Problem with passing variables in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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";

?>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux