How do I stop my e-mail subscription?
variables not behaving as expected
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > PHP web-programming > variables not behaving as expected 19 August 2002 21:02:59

  Top users: 
  Recent blog posts: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

variables not behaving as expected

Robert McPeak 19 August 2002 20:58:38
 We've recently upgraded to PHP version 4.2.2 running on SuSE 7.2 with
the 2.4.4 kernel and I'm seeing variables behave in a way I didn't
expect. With the prior configuration http post variables were freely
available on the receiving page, but now, for some reason, they aren't.

This code:

foreach ($_POST as $key => $post)
{
echo "$key = $post<Br>";
$key = $post;
}
echo "<hr>";
echo "do = $do";

renders this result:

do = addart
display_date = date
art_time = time
art_url = url
art_link = link
src_link = link
src_url = url
-------------------­--------------------­--------------------­--------------------­-
do =


Why is the $do variable null outside of the for loop? Shouldn't it
equal "addart?" Shouldn't it be available anywhere on the page? With
the previous configuration the http post variables were available
anywhere on the page. Is this a php configuration issue?

Thanks!





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


Add comment
Joseph W. Goff 19 August 2002 21:02:59 permanent link ]
 You don't actually have a variable named $do at this point.
You can either have php set this variable automatically by turning on
register globals in the php.ini file or you can extract the variable or do
something like this:
foreach ($_POST as $key => $post)
{
echo "$key = $post<Br>";
$$key = $post;
}

----- Original Message -----
From: "ROBERT MCPEAK" <RMCPEAK@jhuccp.org­>
To: <php-general@lists.­php.net>
Sent: Monday, August 19, 2002 12:58 PM
Subject: [PHP] variables not behaving as expected

We've recently upgraded to PHP version 4.2.2 running on SuSE 7.2 with> the 2.4.4 kernel and I'm seeing variables behave in a way I didn't> expect. With the prior configuration http post variables were freely> available on the receiving page, but now, for some reason, they aren't.>
This code:>
foreach ($_POST as $key => $post)> {> echo "$key = $post<Br>";> $key = $post;> }> echo "<hr>";> echo "do = $do";>
renders this result:>
do = addart> display_date = date> art_time = time> art_url = url> art_link = link> src_link = link> src_url = url> -------------------­--------------------­--------------------­---------------
------> do =>
Why is the $do variable null outside of the for loop? Shouldn't it> equal "addart?" Shouldn't it be available anywhere on the page? With> the previous configuration the http post variables were available> anywhere on the page. Is this a php configuration issue?>
Thanks!>
--> PHP General Mailing List (http://www.php.net­/)> To unsubscribe, visit: http://www.php.net/­unsub.php>


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


Add comment
Met 19 August 2002 21:07:04 permanent link ]
 Read this.

http://www.php.net/­release_4_2_0.php

~ Matthew

-----Original Message-----
From: ROBERT MCPEAK [mailto:RMCPEAK@jhuccp.org]
Sent: Monday, August 19, 2002 1:59 PM
To: php-general@lists.p­hp.net
Subject: [PHP] variables not behaving as expected


We've recently upgraded to PHP version 4.2.2 running on SuSE 7.2 with
the 2.4.4 kernel and I'm seeing variables behave in a way I didn't
expect. With the prior configuration http post variables were freely
available on the receiving page, but now, for some reason, they aren't.

This code:

foreach ($_POST as $key => $post)
{
echo "$key = $post<Br>";
$key = $post;
}
echo "<hr>";
echo "do = $do";

renders this result:

do = addart
display_date = date
art_time = time
art_url = url
art_link = link
src_link = link
src_url = url
-------------------­--------------------­--------------------­-------------
--------
do =


Why is the $do variable null outside of the for loop? Shouldn't it
equal "addart?" Shouldn't it be available anywhere on the page? With
the previous configuration the http post variables were available
anywhere on the page. Is this a php configuration issue?

Thanks!





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


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


Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > PHP web-programming > variables not behaving as expected 19 August 2002 21:02:59

see also:
[JBoss JIRA] Resolved: (JBPM-31) bpel…
ridiculous quesion about console.....
INFORMATION_SCHEMA views and identity…
pass tests:
How objective you are
see also:
Share an Easy Way to Convert DVD and…
DBI installation problem
lHello...

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .