Hi all,
I have built a form that works well on my development machine. However when I transferred it to the production machine rather than submitting it seems to reset itself.
Thinking maybe this had something to do with configuration I copied my php.ini to the production machine but still had the same results.
Can someone point me in the right direction to getting this fixed? My code, up to the point where I connect to the database follows:
<html><head><title>Information request form</title></head>
<body>
<?php
$windows = $_POST['windows'];
$storage = $_POST['storage'];
#the html form
$form = "<form action=\"$PHP_SELF\" method=\"post\">";
$form.= "Fields with * are required <br /><br />";
$form.= "*First Name:     <input type=\"text\" name=\"first_name\" ";
$form.= "size=\"10\" value=\"$first_name\">";
$form.= " *Last Name:     <input type=\"text\" name=\"last_name\" ";
$form.= "size=\"15\" value=\"$last_name\"> <br /><br />";
$form.= "*Address: <input type=\"text\" name=\"address\" ";
$form.= "size=\"50\" value=\"$address\"> <br /><br />";
$form.= "*City:     <input type=\"text\" name=\"city\" ";
$form.= "size=\"50\" value=\"$city\">, ";
$form.= "*State: <input type=\"text\" name=\"state\" ";
$form.= "size=\"2\" value=\"$state\"> ";
$form.= "*Zip: <input type=\"text\" name=\"zip\" ";
$form.= "size=\"12\" value=\"$zip\"><br /><br />";
$form.= "*Telephone: <input type=\"text\" name=\"telephone\" ";
$form.= "size=\"12\" value=\"$telephone\"><br /><br />";
$form.= "email: <input type=\"text\" name=\"email\" ";
$form.= "size=\"50\" value=\"$email\"><br /><br />";
$form.= "At least one of the following must be checked...<br /><br />";
$form.= "I would like information on window coverings: <input type=\"checkbox\" name=\"windows\" ";
$form.= "value=\"\"><br /><br />";
$form.= "I would like information on storage solutions for my closets, garage, etc: <input type=\"checkbox\" ";
$form.= "name=\"storage\" value=\"\"><br /><br />";
$form.= "<input type=\"submit\" name=\"submit\" value=\"submit\"> ";
$form.= "</form>";
#display the form on page load
if (!$submit) {$msg = $form;}
else
#redisplay the form if it is incomplete
if (!$first_name and !$last_name and !$address and !$city and $state and !$zip and !$telephone)
{
$msg = "<font color=blue><b>Please fill out the required fields marked with *.</b></font><br /><br />";
$msg.= $form;
} else
if (!isset($_POST['windows']) && (!isset($_POST['storage'])))
{
$msg = "<b>Please check one of the windows and/or closets boxes.</b><br /><br />";
$msg.= $form;
} else
#add the information to the database table
#connect to mysql
{ $conn = mysql_connect("localhost:/var/lib/mysql/mysql2.sock", "secret", "integrity")
or die ("could not connect to mysql");
You can see the live form here.
Thanks for your help.
John