Jump to content
xisto Community
Sign in to follow this  
shadowdemon

Codes Dont Work

Recommended Posts

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...

Share this post


Link to post
Share on other sites

OK - I did a quick reworking of the code

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:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ 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 inif ( 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 databaseif ( $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>

Share this post


Link to post
Share on other sites

oh okWell 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 pageOne 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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.