RE: PHP transfer variable question?????

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

 



Sorry, bass-ackwards. 4.2.x+ ships with register_globals set to ON, not OFF.
So you'd have to change the setting to register_globals=OFF  for your
existing code to work.

Sorry for any confusion.

Rich

-----Original Message-----
From: Rich Hutchins [mailto:rhutchin@rochester.rr.com]
Sent: Saturday, June 14, 2003 8:53 AM
To: linton; php-db@lists.php.net
Subject: RE:  PHP transfer variable question?????


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:lj979@hotmail.com]
Sent: Friday, June 13, 2003 11:32 PM
To: php-db@lists.php.net
Subject:  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


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