can anyone tell me whats wrong with this script , I don't get errors Or anything it won't process a form right, test it & you'll see what i mean
signup.php script <? require ("config.php"); if ($allow == "no") { echo "<html> <head> <title>$sitename -- Register -- disabled</title> </head> <body> <form method=\"POST\" action=\"?action=process_signup\"> <font face=\"Tahoma\" size=\"2\">Sorry sign up has been disabled at this present time we apologize for any inconvenience caused. </font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else if ($allow == "yes") if (!$action) { echo "<html> <head> <title>$sitename -- Register</title> </head> <body> <form method=\"POST\" action=\"?action=process_signup\"> <font face=\"Tahoma\" size=\"2\">Please fill in All the fields to sign up for an account with $sitename<br> Username:<br> </font> <input type=\"text\" name=\"name\" size=\"20\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\"><font face=\"Tahoma\" size=\"2\"><br> Email Address:<br> </font> <input type=\"text\" name=\"email\" size=\"20\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\"><font face=\"Tahoma\" size=\"2\"><br> Password:<br> </font> <input type=\"password\" name=\"password\" size=\"20\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\"><font face=\"Tahoma\" size=\"2\"><br> Repeat Password: <br> </font> <input type=\"password\" name=\"password1\" size=\"20\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1\"><font face=\"Tahoma\" size=\"2\"><br> Profile (html allowed)<br> <textarea rows=\"2\" name=\"profile\" cols=\"20\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF\"></textarea><br> </font> <input type=\"submit\" value=\"Submit\" name=\"B1\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF\"><input type=\"reset\" value=\"Reset\" name=\"B2\" style=\"font-family: Tahoma; font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF\"></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } if ($action=="process_signup") { if (!$name) { echo "<html> <head> <title>$sitename -- Register -- Error </title> </head> <body> <font face=\"Tahoma\" size=\"2\">we cannot find Your name in the form</font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else if (file_exists("data$name.txt")) { echo "<html> <head> <title>$sitename -- Register -- Error</title> </head> <body> <font face=\"Tahoma\" size=\"2\">Sorry but the username $name is in use</font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else if (!$email) { echo "<html> <head> <title>$sitename -- Register -- Error</title> </head> <body> <font face=\"Tahoma\" size=\"2\">Unable to detect your email address we need this so we can process your submission & check your details.</font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else if (!$password) { echo "<html> <head> <title>$sitename -- Register -- Error</title> </head> <body> <font face=\"Tahoma\" size=\"2\">Password cannot be blank</font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else if (!$password = $password1) { echo "<html> <head> <title>$sitename -- Register -- Error</title> </head> <body> <font face=\"Tahoma\" size=\"2\">Your Passwords do not match, Please check them & try again.</font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else if (!$profile) { echo "<html> <head> <title>$sitename -- Register -- Error</title> </head> <body> <font face=\"Tahoma\" size=\"2\">Please enter a Profile</font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } else ( $data = "$name<br>\n$email\n<br>\n$password\n<br>$profile\n<br>"); $fp = fopen("data/$name.txt",'w'); $fw = fwrite($fp,$data); fclose($fp); $data1 = "$name\n"; $fp = fopen("data/userdat.txt",'a'); $fw = fwrite($fp,$data1); fclose($fp); mail ($email, $subject, $mailmsg); echo "<html> <head> <title>$sitename -- Register -- Complete</title> </head> <body> <font face=\"Tahoma\" size=\"2\">Thank you $name. <br> we have sent your details to $email </font></p> </form> <p><font face=\"Tahoma\" size=\"2\"><br> </font></p> <p> </p> </body> </html>"; } ?> config.php <? $sitename = "Yoursite.Org"; // Your Site $allow = "yes"; // allow members sign up $loginurl = "http://www.Yoursite.org/members/login.php"; $subject = "Register Information"; $mailmsg = "Welcome $name, Thank you for signing up to $sitename below are your details. Username: $name Password: $password Login here $loginurl Thank you $sitename Staff "; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php