Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables

Status
Not open for further replies.

sim133

Technical User
Sep 14, 2004
85
US
Hi I have a problem passing form variables to php page. The form first validates the variables using javascript but where it called Action="register.php", it doesn't pass the values of the variables.
Here is the first lines of codes for the form site and php.site
<?php
include("header.php");
include("leftNavBar.php");
?>

<form action="register.php" method="POST" name="rgForm" onsubmit="return regcheck();">

php site


<?php
include("header.php");
include("leftNavBar.php");
if(isset($submit))
{

$dbcn = @mysql_connect("localhost","----","-----");
if(!$dbcn)
{
echo "<p>Error creating database connection: ". mysql_error() ."</p>";
exit;
}

 
To retrieve varibles POSTed from a form, you need to get them from the superglobal array $_POST. In your case:
Code:
if (isset($_POST['submit']))

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top