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>&nbsp;</td>
<td>&nbsp;</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


Please Help Members By Posting Answers For Below Questions

What are the uses of implode() function?

571


Tell me how can we change the maximum size of the files to be uploaded?

550


What is move_uploaded_file in php?

553


What are global variables in php?

502


What is regular expression in php?

537






What are php data types?

519


What is the purpose of the '.myd' file extension? What do thes file contain?

542


Why php is better?

539


How do I install php?

598


What is php dependency injection?

526


Do you know when sessions ends?

556


Is it more secure to use cookies to transfer session ids?

537


What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?

626


Explain me the difference between include and require?

519


What is an anti csrf token?

506