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 #172175 is a reply to message #172174] Thu, 03 February 2011 05:04 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 2/2/2011 11:27 PM, Joe wrote:
> I have these simple lines in my php script:
>
> <?php
> if (!empty($_GET[req])) {
> print "<h2>$_GET[req]</h2>";
> ?>
> <h3>"$_GET[req]"</h3>
> <?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)? 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).
>
> Thanks in advance,
> joe

First thing is to turn on all errors and notices on your development
system (you DO have a development system, don't you?)

This will give you an E_NOTICE on the line

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


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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: Fri Sep 20 11:52:20 GMT 2024

Total time taken to generate the page: 0.04562 seconds