jorgemark
06-11-2008, 03:27 PM
Hi, I'm a student working on a project, but I'm not a computer science student so I don't know exactly what I'm doing. I'm using Xampp as my PHP server (on a PC) and there's a good chance that might be the problem, only I don't know what it is. I'm only using Xampp for development so I'm not even sure this problem would carry over when the page is finally "published". I've spent a lot of frustrating time on this so anyone with any kind of answer (or direction to point me in) would help a lot!
My main problem is that the POST variables from the HTML side are not being posted to the php document. I've looked through some of the previous posts on this forum and for them changing the $_POST to $_REQUEST in the PHP form solved the problem, unfortunately it didn't for me. I'm not doing much more than PHP, so the problem must be somewhere in here, or with the Xampp server. It's either something very simple that I've overlooked (this is my first PHP project) or it's something else I am not at all familiar with. There are about 71 variables being posted, and they all match up with the HTML form, if that matters.
Here's what it looks like on the HTML side.
<FORM ACTION="pc2.php" method=post>
<p><h1>F E C</h1><br></p>
<p><b>Paname:</b> <input type="text" name="paname" size="25"> <br>
<b>M Number:</b> <input type="text" name="mnumber" size="10" maxlength="10"> <br>
<b>Exdate:</b> <input type="text" name="exdate" size="8" maxlength="8"> </p>
Here's what it looks like where it defines the variables in pc2.php:
<body style="font-family: Arial">
<h1><br>
F E C</h1>
<p> </p>
<?php
$paname = $_POST['paname'];
$mnumber = $_POST['mnumber'];
$exdate = $_POST['exdate'];
Here's where it tries to display those variables, in the same pc2.php:
echo "<p><b>Paname:</b> " . echo $paname . echo "<br>
<b>M Number:</b> " . $mnumber . echo "<br>
<b>Exdate:</b> " . $exdate . echo "<br></p>"
I've also tried it like this:
<p><b>Patient name:</b> <?php print $paname ?><br>
<b>M Number:</b> <?php print $mnumber ?><br>
<b>Exdate:</b> <?php print $exdate ?><br></p>
I know something is wrong, but what? How far am I off the path?
My main problem is that the POST variables from the HTML side are not being posted to the php document. I've looked through some of the previous posts on this forum and for them changing the $_POST to $_REQUEST in the PHP form solved the problem, unfortunately it didn't for me. I'm not doing much more than PHP, so the problem must be somewhere in here, or with the Xampp server. It's either something very simple that I've overlooked (this is my first PHP project) or it's something else I am not at all familiar with. There are about 71 variables being posted, and they all match up with the HTML form, if that matters.
Here's what it looks like on the HTML side.
<FORM ACTION="pc2.php" method=post>
<p><h1>F E C</h1><br></p>
<p><b>Paname:</b> <input type="text" name="paname" size="25"> <br>
<b>M Number:</b> <input type="text" name="mnumber" size="10" maxlength="10"> <br>
<b>Exdate:</b> <input type="text" name="exdate" size="8" maxlength="8"> </p>
Here's what it looks like where it defines the variables in pc2.php:
<body style="font-family: Arial">
<h1><br>
F E C</h1>
<p> </p>
<?php
$paname = $_POST['paname'];
$mnumber = $_POST['mnumber'];
$exdate = $_POST['exdate'];
Here's where it tries to display those variables, in the same pc2.php:
echo "<p><b>Paname:</b> " . echo $paname . echo "<br>
<b>M Number:</b> " . $mnumber . echo "<br>
<b>Exdate:</b> " . $exdate . echo "<br></p>"
I've also tried it like this:
<p><b>Patient name:</b> <?php print $paname ?><br>
<b>M Number:</b> <?php print $mnumber ?><br>
<b>Exdate:</b> <?php print $exdate ?><br></p>
I know something is wrong, but what? How far am I off the path?