i have designed a registration form in html
(registration.html) and to insert user details in database
i have designed a submit form in php
(submit_registration.php) but when i click on submit button
in registration.html it opens a dialogue box which asks for
open or save php(submit_registration.php) even though i
have already installed apache HTTP server and php version 5
on my computer and i am using mysql as backend.
plz suggest me what should i do????
Answer Posted / pohit
<html>
<table width="300" border="2" align="center"
cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="loginform" method="post" action="insert.php">
<td>
<table width="100%" border="1" cellpadding="3"
cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td><strong>Member Login </strong></td>
</tr>
<tr>
<td align="center"><strong>FirstName</strong></td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="FirstName" type="text"
id="FirstName" /></td>
</tr>
<tr>
<tr>
<td align="center"><strong>LastName</strong></td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="LastName" type="text"
id="LastName" /></td>
</tr>
<td align="center"><strong>Email</strong></td>
<td align="center"><strong>:</strong></td>
<td align="center"><input name="Email" type="text"
id="Email" /></td>
</tr>
<tr>
<td align="center"><strong>Password</strong></td>
<td align="center"><strong>:</strong></td>
<td align="center"><input type="Password" name="Password"
id="Password" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit"
value="Submit" /></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</html>
<?php
include("includes/config.php");
$FirstName=$_POST['FirstName'];
$LastName=$_POST['LastName'];
$Email=$_POST['Email'];
$Password=$_POST['Password'];
if(isset($_REQUEST['Submit']))
{
$sql="INSERT INTO myvalues (FirstName, LastName, Email,
Password ) VALUES
('$FirstName', '$LastName', '$Email', '$Password')";
$result=mysql_query($sql);
if($result)
{
echo "Successful";
echo "<BR>";
echo "<a href='insert.php'>Back to main page</a>";
}
else {
echo "ERROR";
}
}
?>
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the uses of implode() function?
Tell me how can we change the maximum size of the files to be uploaded?
What is move_uploaded_file in php?
What are global variables in php?
What is regular expression in php?
What are php data types?
What is the purpose of the '.myd' file extension? What do thes file contain?
Why php is better?
How do I install php?
What is php dependency injection?
Do you know when sessions ends?
Is it more secure to use cookies to transfer session ids?
What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?
Explain me the difference between include and require?
What is an anti csrf token?