| | www.mysite.trap17.com/join im testing this page as a join but none of my codes work can someone help me |
|
|
There are a ton of things wrong with that code =)
Give me 10 minutes and I will upload a reworked version of it that should at least help you to get started. I see that you did sort of take my advice on my post in the last topic that you made. Hang in there a couple minutes... It should now work - assuming you have the actual databases set up. You need to have made a table with the name "Member" and it has to have columns named "loginName", "createDate", and "password" This is a very basic code for a page that is going to let users sign up on your site tho and i recommend (once again) that you follow an example from an actual script. You need to ask for the password twice and then compare them to make sure that the person put the password that they intended to have (with no typo's kind of deal) I would also do something with the email. You ask them for the email and then dont do anything with it. I would also recommend that you indent stuff like I did. Otherwise it is hard to see the structure of the code. In your code there were misplaced table tags and stuff that were hard to see unless you indent the code as you do. And without any further adue here is the code: CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Login</title> </head> <body> <?php //// MAKE sure that the feilds have been entered in if ( isset($_POST['loginName']) ) { $loginName = $_POST['loginName']; } else { $message = "<br /> YOU NEED TO ENTER A LOGINNAME<br />"; }; if ( isset($_POST['password']) ) { $password = $_POST['password']; } else { $message = "<br /> YOU NEED TO ENTER A PASSWORD<br />"; }; if ( isset($_POST['email']) ) { $email = $_POST['email']; } else { $message = "<br /> YOU NEED TO ENTER AN EMAIL<br />"; }; /// IF all the feilds were given values THEN insert thier information into the database if ( $email && $password && $loginName ) { /// Initialize and run the MYSQL query to insert teh stuff into the database $sql = mysql_query( "INSERT INTO Member (loginName, createdate, password) values ('$loginName', NOW() ,'$password')" ) or die (mysql_error()); } else { echo "$message"; } ?> <font face='arial' size=2><b>All fields marked with a * are required:</b></font><br> <form name="form1" method="post" action="/join.php"> <table border=1 bordercolor='#000000'> <tr> <td> <table width='50%' border=0> <tr> <td bgcolor='#C0C0C0'>UserName<font color='#ff0000'>*</font>:<input type="text" name="loginName"></td> </tr> <tr> <td bgcolor='#CCCCCC'>Email<font color='#ff0000'>*</font>:<input type="text" name="email"></td> </tr> <tr> <td bgcolor='#C0C0C0'>Password:<input type="text" name="password"><br /></td> </tr> </table> </td> </tr> </table> <input type="submit" value="submit" name="submit"> </form> </body> </html>
one of those codes was a form thing i made iwith the form maker thingy so it would send that info to me then i put the stuff in manually then the other was just a test of some codes
oh ok
Well that code that I posted there for you should do all that you want it too. Then all you need to do is fix it up a little more with whatever else you want and you have a really simple registration page One thing i forgot to add is a "Congrats Your now a member of the coolest website!" type message that lets people know that they successfully registered on your site.
ok and one thing i put the code on my site and when i filled the info out to test it it said no such database and i looked in the code and didnt see anything about database only about table
Similar Topics
Keywords : codes Looking for codes, work
|
|
![]() Codes Dont Work |
| ADD REPLY / Got an Opinion! | Remove these ADs! | RAPID SEARCH! | Free Web Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|