Problem with passing variables in PHP
| From: | Mazin Albahkali | Date: | Fri, 14 Mar 2003 16:07:44 +0000 |
| Subject: | Problem with passing variables in PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26380@lists.php.net to get a copy of this message | ||
I'm a beginner in PHP and Database connections
I'm accessing a MS Access database using PHP. Everything is working fine. I
get the data through an ODBC query and show it on an HTML format form so
that I can modify the data and re-post it. I tried to pass the values to a
second php file that has the updating query but no luck. My PHP didn't
accept passing variables at all. I'm using PHP 4.3.1 on IIS 5.1 server, I
even tried Apatche2 with no luck.
Is there a way to run an update query using data from a form in the same
page without the need for passing it to another page?, and what is wrong
with my server not allowing me to pass variables, is there a parameter in
the server I should set on?
Here is a test example for passing a variable that failed:
File 1: Test Passing a variable
<?PHP
echo "<html>\n";
echo "<body>\n";
echo "<form name=\"Update\" method=\"post\"
ACTION=\"update.php\">\n";
echo "<p align=\"right\"><INPUT type=\"text\"
NAME=\"sname\"
VALUE=\"$sname\" SIZE=30></td>\n";
echo "<P><INPUT TYPE=\"submit\" NAME=\"submit\"
VALUE=\"Send\"></p>\n";
echo "</FORM>\n";
echo "</body>\n";
echo "</html>\n";
?>
****************************************************
File 2: update.php
<?php
echo "<html>\n";
echo "<body>\n";
if (isset($sname)) {
print($sname);
} else {
print ("No data yet\n");
}
echo "</body>\n";
echo "</html>\n";
?>