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
How to create an array of a group of items inside an html form?
What is the importance of php?
Write a hello world program using variable?
How can we define a variable accessible in functions of a php script?
What is the difference between Split and Explode in PHP?
What is the difference between get and post method in php?
Can we embedded directly PHP code into XHTML document? State Whether True or False?
Write down the code for saving an uploaded file in PHP.
Is php session id unique?
What is an object in php?
How can you compare objects in php?
How can you send http header to the client in php?
What are php expressions?
What is crypt () in php?
What is PHP's configuration file called?