Re: Newbie needs some help.
| From: | @ Edwin | Date: | Mon, 21 Oct 2002 09:31:24 +0000 |
| Subject: | Re: Newbie needs some help. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120711@lists.php.net to get a copy of this message | ||
The answer is already here...
In case you missed it, try
echo $_GET['name'];
instead of
echo $name;
- E
PS
Similar/related topics have been discussed many times. Please read the
archives...
"Arlene Balagot" <abalagot@bar.gov.ph> wrote in message
news:20021021090405.59059.qmail@pb1.pair.com...
>
> Hello! Please help me. im running php4.2.3 on windows 2000 iis ver 5 and
it
> has some problems
>
> on defining variables. i tried to run them on apache server on my hosting
> account on the intrnet
>
> and nothings wrong with it. they use the same version of php.
>
> these are the simple codes:
>
> <html>
> <head>
> </head>
> <body>
> <form method="get" action="name.php">
> What is your name?
> <input type="text" name="name">
> <input type="Submit" value="Go">
> </form>
> </body>
> </html>
>
> passed on to:
>
> <html>
> <head>
> </head>
> <body>
> My name is:
> <?
> echo $name;
> ?>
> </body>
> </html>
>
> result:
>
> My name is:
> Notice: Undefined variable: name in D:\arlene\phpsample\name.php on line 7
> "Adrian Slusarczyk" <aslusarczyk@web.de> wrote in message
> news:20021018114528.91582.qmail@pb1.pair.com...
> > Could you provide us with some code?
> >
> > My first guess would be that the example in the book accesses the
> variables
> > (from the form) with something like $myvariable in the PHP script. But
it
> > newer PHP versions, this is turned off by default.
> > Try to identify the variables sent by the form and find them in the PHP
> > script. Then, replace $myvar by $_GET['myvar'] (if the HTML form uses
> > method=get) or by $_POST['myvar'] (if the HTML form uses method=post).
> >
> > But again - some code would be useful, this is just a guess :)
> >
> >
> >
> > "Bo" <bacardi_bo@hotmail.com> schrieb im Newsbeitrag
> > news:20021017112530.36093.qmail@pb1.pair.com...
> > > I'm trying to make a simple calculate sheet for learning purposes. It
> > > concists of 2 files, one html and one php.
> > >
> > > The html uses a form with text-inputs and a submit button, and also a
> > > method="post" . When the submit button is pressed the variables of the
> > > text-inputs must be sent to the php file on wich the calculations are
> > done.
> > > But for some reason the php script doesn't receive the variables.
> > >
> > > I got the script from a learning book, and typed it over literally.
It's
> > not
> > > a problem because i forgot a ; or something. Can it have anything to
do
> > with
> > > settings in my IIS (i dont know if i am talking nonsense now =) )
> > >
> > > thx for your help
> > >
> > > greetz
> > >
> > >
> >
> >
>
>