Posted by Squet34785 on 11/06/06 20:35
Hello,
A script in an existing website I'm looking after has suddenly stopped
working. There is a PHP file which containts this code:
include ( 'library.php' );
showRecord ( $_POST );
Inside library.php the function looks like this:
function showRecord ( $post ){
//get vars
$table_name = $post [ 'table_name' ];
....
Which was working fine until the other day. Now $table_name comes back
blank, as does everything in $post. No one has changed the server config as
far as I know. I temporarily fixed the problem by changing the function call
to use the old style $HTTP_POST_VARS, but other scripts on the site failing
in the same way and I'd rather find out why rather keep patching scripts.
Does anyone know why this might have started happening?
P.S. I created a test script which looks like this:
<form action="<?=$PHP_SELF?>" method="POST">
<input type="text" name="username" value="Rob"> <input type="submit"
value="Say Hello">
</form>
<?php
if ($_POST["username"]){
sayHello($_POST);
}
function sayHello($post){
echo("<p>Hello " . $post["username"] . "</p>");
}
?>
Which seems to work fine, so I have no idea what's going on!
[Back to original message]
|