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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация