开发者

Does <?php echo $PHP_SELF?> No Work In PHP 5.x?

I know that with PHP 4.1 they introduced the concept of super globals, which I do not entirely understand, but I had the following code working with PHP 4.3.x (or something close to that), and recently updated to PHP 5.2.4, and now the info doesn't seem to want to get posted to my database. It just returns me to the same page I was trying to submit from.

if ($submit) {
mysql_select_db("ibmclub",$db);
$sql = "INSERT INTO april_floral (image) VALUES ('$image')";
$result = mysql_query($sql);
header("location:confirm.php")开发者_Go百科;
} else {
<form method="post" action="<?php echo $PHP_SELF?>">
<form guts>
<?php
}
?>

You get the gist. Having problems escaping the brackets to get the code to show up.

So, is there s


It's moved to $_SERVER['PHP_SELF']. register_globals is deprecated and will be completely removed in a future version of PHP. You'd better update your code to not rely on it.


it could be that your register_globals setting was turned off with the upgrade you did. The correct way to use it is <?php $_SERVER['PHP_SELF'] ?>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜