FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » pass variable in php construct
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: pass variable in php construct [message #172176 is a reply to message #172174] Thu, 03 February 2011 06:36 Go to previous messageGo to previous message
Curtis Dyer is currently offline  Curtis Dyer
Messages: 34
Registered: January 2011
Karma:
Member
Joe <juliani(dot)moon(at)gmail(dot)com> wrote:

> I have these simple lines in my php script:
>
> <?php
> if (!empty($_GET[req])) {

You need quotes around ``req''.

> print "<h2>$_GET[req]</h2>";

Here, too.

As Jerry suggests, make sure your error reporting is enabled and
you have "display_errors" on in php.ini on your development
environment.

> ?>
> <h3>"$_GET[req]"</h3>

This is simply output, and never parsed.

See: <http://php.net/manual/en/language.basic-syntax.phpmode.php>

> <?php
> } else {
> ...
> }
> ?>
>
> I wonder why the $_GET[req] value shows up within the php code
> block (print to <h2> tags), but not showing up in the html block
> (between <h3> tags)?

You might consider starting at the beginning to get a better feel
for PHP:

<http://php.net/manual/en/tutorial.php>

> Is it suppose so or I missed something? (I
> tried to pass it to a local defined variable but still cannot be
> used in 'html' block).

It seems to me, you just need a bit more time to get acclimated to
PHP.

> Thanks in advance,
> joe

HTH

--
Curtis Dyer
<?$x='<?$x=%c%s%c;printf($x,39,$x,39);?>';printf($x,39,$x,39);?>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help with my website
Next Topic: validating / converting time for insertion into mysql DB??
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 01:21:00 GMT 2024

Total time taken to generate the page: 0.04426 seconds