The default installation of PHP 4.2.x+ now ships with register_globals set
to OFF in PHP.ini. You have two choices:

1. Change all of your variable references to $_POST['varname'] (or
$_GET['varname']). In your case it looks like you'd need $_GET['id'].

2. Turn register_globals ON in your PHP.ini.

The first option is the recommended way. The "why" is explained in the
configuration notes in php.ini. I'd recommend you take the time to scan the
notes at the top of the php.ini file. Lots of important stuff in there that,
if you're aware of it, will help you handle future issues as well.

Hope this helps.

Rich

-----Original Message-----
From: linton [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 11:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP transfer variable question?????


PHP  transfer variable question?????

My program is ok in apache_1.3.19 and php-4.1.2£¬but when I change over to
php_4.3.2

and apache_1.3.27,I can't get variable¡£
------------------------------------------------------------------------
code:

//newsList.php:

$querystring = "SELECT id,title FROM $nTable ORDER BY id DESC LIMIT 3";
$result = mysql_query($querystring) or die ("can't query£¡£¡£¡");
while ($row = mysql_fetch_row($result))    {
    echo "<a href='news/show.php?id=$row[0]' >$row[1]</a><br>";
}
------------------------------------------------------------------------
code:

//show.php

$querystring = "SELECT  * FROM $nTable WHERE id='$id'";
$result = mysql_query($querystring) or die ("can't query£¡£¡£¡");

echo $querystring;  //test

while ($row = mysql_fetch_row($result))
------------------------------------------------------------------------

echo display£º
SELECT * FROM news_tb WHERE id=''
                               ----??  why is empty???
$id can't receive!

How to resolve it??



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


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

Reply via email to