rincewind456 wrote:print '<pre>';
print_r($_POST); // or $_GET etc
print '<pre>';'
at the head of your processing script.
You should then see what, if any data is being sent from the form to the processing script.
Alright, once I put that in I get: Parse error: syntax error, unexpected T_STRING .. line 17...
Line 17 is the start of the $name=$_POST['name']; series of lines. 😕 If I try to take out any $ lines, or all of them, it tells me 'unexpected $end'.
Somedays I just hate (not knowing) PHP.. :glare:
Since I know I'm doing something wrong (Or, all of it wrong), I'll post the code that I'm happily using.
form:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Welcome to PIP Virtual Airlines</title>
</head>
<body>
<table border="0" width="100%" id="table1">
<tr>
<td><?php
include 'header.inc';?></td>
</tr>
</table>
<form method="post" action="processing.php">
<input type="hidden" name="pilot_id" value="NULL">
<input type="hidden" name="status" value="P5">
<p align="center">Welcome to PIP Virtual Airlines. Before we begin your
application, have you had a chance to look over our manual? If not, you'd
better do that!</p>
<div align="center">
<table border="0" width="67%" id="table2" bordercolorlight="#000000" bordercolordark="#000000" style="border-collapse: collapse">
<tr>
<td align="left">
<p align="center">Let's start with the basics: </td>
</tr>
<tr>
<td align="left">
<p align="center"> </td>
</tr>
<tr>
<td align="left">What's your name?
<!--webbot bot="Validation" b-value-required="TRUE" -->
<input type="text" name="name" size="34"></td>
</tr>
<tr>
<td align="left">And how about your email address?
<!--webbot bot="Validation" b-value-required="TRUE" -->
<input type="text" name="email" size="34" value="EX: Bob@Network.com"></td>
</tr>
<tr>
<td>
<p align="left">This is important: Are you <b>at least</b> 13 years of
age? <input type="radio" value="y" checked name="age"> I sure am!
<input type="radio" name="age" value="n"> I am not. </td>
</tr>
<tr>
<td>
<p align="left"><font face="Arial">What version of Microsoft Flight
Simulator are you using?
<!--webbot bot="Validation" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
<select size="1" name="version">
<option selected>Choose..</option>
<option>2002</option>
<option>2004 (FS9)</option>
<option>FSX</option>
<option>X-Plane</option>
<option>Fly! / Fly II!</option>
<option>Other / Not Listed / I just don't know!</option>
</select></font></td>
</tr>
<tr>
<td>
<p align="center"><font face="Arial">Have you read the PIP Pilot
Information and Regulation Handbook, and swear to abide by it?<br>
<!--webbot bot="Validation" s-display-name="You MUST agree to the terms and conditions." b-value-required="TRUE" --><input type="radio" value="y" name="abide"> Yes, I do.
<input type="radio" value="n" name="abide" checked> No, I do not.</font></td>
</tr>
<tr>
<td><font face="Arial">If you're picked, which Hub System would you like
to enroll in?
<!--webbot bot="Validation" b-value-required="TRUE" b-disallow-first-item="TRUE" --> <select size="1" name="hub">
<option selected>Choose..</option>
<option>Asia/Pacific</option>
<option>North America</option>
<option>Europe</option>
</select></font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<p align="center">Now, about you.. Tell us something about yourself! I
know you've got a lot to share, but limit yourself to 500 characters
including spaces.<br>
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="600" --><textarea rows="2" name="about" cols="49">EG: I have three cats and play golf.
</textarea></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<p align="center"><input type="reset" value="Cancel IFR" name="B2">
<input type="submit" value="Clear for takeoff" name="B1"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
process:
<?
$DBhost = "host";
$DBuser = "user";
$DBpass = "pass";
$DBName = "name";
$table = "table";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$name=$_POST['name'];
$email=$_POST['email'];
$age=$_POST['age'];
$version=$_POST['version'];
$hub=$_POST['hub'];
$flown=$_POST['flown'];
$about=$_POST['about'];
$status=$_POST['status'];
$sqlquery = "INSERT INTO $table VALUES('$id','$name','$email','$age','$version','$hub','$flown','$about','$status')";
$results = mysql_query(mysql_query);
mysql_close();
print "<html><body><center>";
print "Hey, $name ! Thanks for applying.<br>";
print " We will be contacting you at $email , so keep your eyes open! Thanks again for applying with us. Good luck!";
print "</body></html>";
?>
Going from the example I posted before, everything is the same. The only thing to change are the added style/amount of form fields processed.
If I add the
print '<pre>';
print_r($_POST); // or $_GET etc
print '<pre>';'
code, I get the parse error. :queasy: