You are here: Re: undefined var in php « PHP SQL « IT news, forums, messages
Re: undefined var in php

Posted by Kimmo Laine on 12/05/05 20:06

"Arthur Knopper" <arthurknopper@wanadoo.nl> kirjoitti
viestissδ:43947fea$0$37555$dbd43001@news.wanadoo.nl...
> Hello,
>
> I installed easyphp, everything seems to be working ok.
> now i entered this script:
>
>
> <html>
>
> <form>
> Please type your name here:<br>
> <input type=text name="username"><br><br>
> <input type=submit value="Submit data">
> </form>
>
> <br><br>
> You typed:
>
> <?
> echo ($username);
> ?>
>
> <html>
>
> and i am getting this error:
>
> Notice: Undefined variable: username
>
> what am i doing wrong?


Not a day goes by without someone asking this same thing. For Pete's sake,
where do you people find these crappy example codes? This has been a known
issue for such long time now... Okay, simply: replace $username with
$_GET['username'] and read php.net/register_globals to learn why.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <antaatulla.sikanautaa@gmail.com.NOSPAM.invalid>

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация