yes, you could do it, here's a rough outline of the need to happens.
in PHP you'll have to connect to your MySQL Database (several ways to do it, I use the oldest way)
If you want you can have this as a seperate file or in the page itself, just depends your style and needs.
Code:
<?php
//Connect to MySQL DB
$LOCATION = "localhost"; //if your connecting to the box the WebServer runs on
$USER = "root" //change this to your settings
$PASSWORD = "password" //ditto
$DBNAME = "ftp" //inital DB you want to connect to, feel free to change
$link = mysql_connect("$LOCATION","$USER","$PASSWORD");
if(!$link){
die('Could not connect: '.mysql_error());
}
mysql_selectdb("$DBNAME");
?>
Then you need something like the following in another - or same PHP page
Code:
<?php
if(!empty($_POST['username'])){
if(strcmp($_POST['password'],$_POST['conPW']) == 0){
//do the adding of the user to the mysql DB... I'll leave that part to you... few extra line :P
} else {
echo "Passwords do not Match";
}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<label>Username: </label><input type="text" name="username" />
<label>Password: </label><input type="password" name="password" />
<label>Confirm PW: </label><input type="password" name="conPW" />
</form>
Bookmarks