Actually, they are.  You are assuming the PHP directive 
register_globals = on when using $phrase from the form 
below.  register_globals = on is what creates $phrase.

As of PHP 4.2.0 the default value for register_globals 
has become off.  Regardless, there are other options:

Try either:

  // Worked since PHP 3 (forever)
  print $HTTP_GET_VARS['phrase'];

  // Worked since PHP 4.1.0
  print $_GET['phrase'];
  print $_REQUEST['phrase'];

  // Worked since PHP 4.1.0 too
  // See docs for details (see also extract())
  import_request_variables('gpc', 'r_');
  print $r_phrase;

Those are some options.  See also:

  http://www.php.net/manual/en/language.variables.predefined.php

Regards,
Philip Olson


On Fri, 7 Jun 2002, Beeman wrote:

> I just read the release notes and do not believe they are referring to my
> dilemma.
> 
> Here is the code I am using. Just a basic form
> 
> <<Form.php>>
> <body>
> <form action="form_act.php" method="get" enctype="multipart/form-data">
>   <p>Phrase: 
>     <input name="phrase" type="text" id="phrase" >
>   </p>
>   <input name="Submit" type="submit" value="Submit">
> </form>
> 
> </body>
> 
> <<Form_act.php>>
> <? 
> if ($phrase){ echo "Phrase-- $phrase";}
> Else{ echo "No Variables";}
> ?>
> 
> 
> On 6/7/02 9:08 PM, "Stuart Dallas" <[EMAIL PROTECTED]> wrote:
> 
> > On Saturday, June 8, 2002 at 1:56:35 AM, you wrote:
> > 
> >> I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running
> >> Apache 1.3.2. I have verified that php is running and apache is running.
> >> When I access a page locally http://127.0.0.1/simple_form.php, fill in the
> >> only text box and submit the form to form_act.php. The variable doesn't
> >> exist (as far as PHP is concerned. I have tested for its existance using an
> >> IF ELSE). This happens with POST as well as GET, but when using GET I can
> >> obviously see the variable name and value in the URL. Do I need to change
> >> the default config for apache?? Or PHP? Can anyone please help before I go
> >> completely crazy.
> > 
> > Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you are
> > trying to use the latter, I suggest you read the release note for the software
> > you just installed: http://www.php.net/release_4_2_1.php (specifically the
> > 'External Variables' section).
> 
> 
> -- 
> 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

Reply via email to