Hey I want when i click the submit button it runs a php script that then loads it to a local database where I can then use the entered data as a way for someone to login into the site but everytime i click the submit, it downloads the whole php file. The form is in html and in the same folder as the php file. my html code is:
<form action="register.php" method="post">
<table border="0" width="225" align="center">
<tr>
<td width="219" bgcolor="#999999">
<p align="center"><font color="white"><span style="font-size:12pt;"><b>Registration</b></span></font></p>
</td>
</tr>
<tr>
<td width="219">
<table border="0" width="282" align="center">
<tr>
<td width="116"><span style="font-size:10pt;">Name:</span></td>
<td width="156"><input name="name" type="text" id="name" maxlength="100"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Email:</span></td>
<td width="156"><input name="email" type="text" id="email" maxlength="100"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Username:</span></td>
<td width="156"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td width="116"><span style="font-size:10pt;">Password:</span></td>
<td width="156"><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td width="116"> </td>
<td width="156">
<p align="right"><input name="Submit" type="submit" onclick="MM_validateForm('name','','R','email','','RisEmail','username','','R','password','','R');return document.MM_returnValue" value="Send"></p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="219" bgcolor="#999999"> </td>
</tr>
</table>
</form>
KBL
0
Newbie Poster
Recommended Answers
Jump to PostMaybe because you don't need to include onclick="MM_validateForm(...)" on your Submit button anymore.
Since you used POST as your form method, on your register.php script you can get all the values of your form by doing:
$name = $_POST;
$email = $_POST;
$username = $_POST;
$password = $_POST;
Jump to PostSomething tells me you haven't got a localhost server set up. Have you got apache (or IIS) and php installed and fired up?
If so, try the following. OK, stripped to bare bones:
<form action="register.php" method="post"> Name: <input name="name" type="text" id="name" maxlength="100" /> Email: <input name="email" …
All 7 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.