![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Programmer
Join Date: Jul 2005
Posts: 73
Rep Power: 4
![]() |
cannot get form input...
For some reason, either the form input is not working, or it is not emailing correctly.
here is the html: <!-- /************************* * * * Created with RapidPHP * * version 6.1.0.54 * * * * * *************************/ --> <form action="register.php" method="POST"> <table border="0" cellspacing="2" cellpadding="4" width="100%"> <tr><td width="20%" bgcolor="#AAAAAA">Desired username:</td><td bgcolor="#AAAAAA"> <input type="text" name="user" width="98%" maxlength="30" /></td></tr> <tr><td width="20%" bgcolor="#AAAAAA">Desired password:</td><td bgcolor="#AAAAAA"> <input type="password" name="pass" width="98%" maxlength="30" /></td></tr> <tr><td width="20%" bgcolor="#AAAAAA">Password (again):</td><td bgcolor="#AAAAAA"> <input type="password" name="pass_conf" width="98%" maxlength="30" /></td></tr> <tr><td width="20%" bgcolor="#AAAAAA">First Name:</td><td bgcolor="#AAAAAA"> <input type="text" name="fname" width="98%" maxlength="30" /></td></tr> <tr><td width="20%" bgcolor="#AAAAAA">Last Name:</td><td bgcolor="#AAAAAA"> <input type="text" name="lname" width="98%" maxlength="30" /></td></tr> <tr><td width="20%" bgcolor="#AAAAAA">E-Mail address:</td><td bgcolor="#AAAAAA"> <input type="text" name="email" width="98%" maxlength="30" /> <font size="-1">(You will need to enter a valid e-mail address to continue.)</font></td></tr> <tr><td width="20%" bgcolor="#AAAAAA">Age:</td><td bgcolor="#AAAAAA"> <input type="text" name="age" width="98%" maxlength="30" /> <font size="-1">(For legal reasons we cannot offer service to users under the age of 13.)</td></tr> <tr><td width="20%" bgcolor="#AAAAAA" rowspan="2">Address:</td><td bgcolor="#AAAAAA" rowspan="2"> <input type="text" name="adddress1" width="98%" maxlength="30" /><br /> <input type="text" name="address2" width="98%" maxlength="30" /></td></tr> <tr><td></td></tr> <tr><td colspan="2" align="center"><input type="submit" value="Submit" /></td></tr> </table> </form> and register.php: [php]<?php /************************* * * * Created with RapidPHP * * version 6.1.0.54 * * * * * *************************/ unset($user, $pass, $pass_conf, $fname, $lname, $email, $address1, $address2); $user = $_POST['user']; $pass = $_POST['pass']; $pass_conf = $_POST['pass_conf']; $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $address1 = $_POST['address1']; $address2 = $_POST['address2']; $address = $_POST['address1'] . "\n" . $_POST['address2']; $email_from = "noreply@xxxxxxxxxxxxxxxxx.com"; $email_to = "xxxxxxxxxx@xxxxx.com"; $email_msg = "noreply@xxxxxxxxxxxxxxxxx.com\n----------\nDo not respond to this email. Any response sent will not be recieved.\n\nYour message is as follows\n-------------------------\n\n"; $email_subj = "Undaground Hosting: user registration"; If ( $user = "" ||$pass = "" || $pass_conf = "" || $fname = "" || $lname = "" || $email = "" || $address1 = "" || $address2 = "" ) { Die ("One or more fields were not filled out. Please click <script language=\"javascript\" type=\"text/javascript\">document.write('<a href=\"javascript:history.go(-1)\">here</a>');</script><noscript>your browser's back button</noscript> to fill out the empty fields."); } If ( $pass != $pass_conf ) { Die ("Your password and your confirmation password did not match. Please click <script language=\"javascript\" type=\"text/javascript\">document.write('<a href=\"javascript:history.go(-1)\">here</a>');</script><noscript>your browser's back button</noscript> to correct these passwords, then try again."); } $email_msg .= "A new user account has been requested. The user sent the following information about the account:\n"; $email_msg .= "\nUsername:\n".$user."\n"; $email_msg .= "\nPassword:\n".$pass."\n"; $email_msg .= "\nFull Name:\n".$lname.", ".$fname."\n"; $email_msg .= "\nEmail address:\n".$email."\n"; $email_msg .= "\nPostal Address:\n".$address."\n"; mail ($email_to, $email_subj, $email_msg, "From: ".$email_from); ?> [/php] and here is the email I recieved: Quote:
thanks! |
|
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If ( $user = "" ||$pass = "" || $pass_conf = "" || $fname = "" || $lname = "" || $email = "" || $address1 = "" || $address2 = "" )
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jul 2005
Posts: 73
Rep Power: 4
![]() |
oops
that was a bit stupid...sorry, my php has gotten a little rusty... thanks man! |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Jul 2005
Posts: 73
Rep Power: 4
![]() |
wait...now it's telling me that some fileds were not filled out, but I am positive that I filled out everything...
|
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Effective debugging requires information. If you don't have a debugger, sprinkle 'echo' or 'print_r' statements through the code to make sure variables are being stuffed with the values you expect. A print_r ($_POST) will tell you if the stuff is arriving. Echoing the values inside the string of "" tests (where the DIE is) will also tell you something. Sometimes you will need to view the source as well as the rendered page.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|