I have to write my own "add a user form" because the author asumes we all know how. Well I have created one that in throry should work but does not work in implementation. I have two parts to my "add a user" form. The first is an HTML page that uses the post method to get my information to a PHP page that inserts the info into the database. When I try this I get an error on the PHP page: Parse error: parse error, unexpected $ in /home/content/s/a/t/user/html/adduseraction.php on line 14
Here is the PHP processing page (keep in mind I took out the server address, username and password to show it to you):
Code:
<?PHP
// Check if the information has been filled in
if($psEmail == '' || $psPassword == '') {
// No login information
echo "blank entrys";
} else {
// Authenticate user
$hDB = mysql_connect('server', 'username', 'password');
mysql_select_db('database');
// Insert a row of information into the table
mysql_query("INSERT INTO tblUsers
(iUser, sEmail, sPassword, sGUID, sData) VALUES(Null, '$psEmail', password('$psPassword'), Null, Null) ")
or die(mysql_error());
?>
There is no closing "}" to match the "} else {" opening one.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
...wow...there are some days I feel like an idiot. Anyway that solved that problem but the processing PHP insists that the feilds are blank. Any ideas?
If we assume that register_globals are off (which is not a bad assumption as php.net recommends that new code should not be written using them and they will disappear in future versions of PHP), then you need to setup your variables in the processing page like this -
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Thank you so much for helping me. I have a lot of tweaking to do with this (Logouts, time expiration, security levels, etc) and I have a feeling I may be asking for help again some time.