Re: Showing up variables in URL !

From: Date: Wed, 19 Sep 2001 04:32:24 +0000
Subject: Re: Showing up variables in URL !
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67788@lists.php.net to get a copy of this message
Try this: <? if( $greetings ){ echo $greetings; } else { header( "Location: index.php?greetings=Hello" ); } ?> Alex ----- Original Message ----- From: "Arcadius A." <ahouans@sh.cvut.cz> To: <php-general@lists.php.net> Sent: Wednesday, September 19, 2001 6:14 AM Subject: [PHP] Showing up variables in URL ! > Hello ! > We all know how to pass value to variable using an URL. > So, how can I do the inverse ? > I mean , showing the value of a variable in the URL? > > for instance my page "index.php" is : > > <? > $greetings="Hello" ; > echo $greetings ; > ?> > > So, how to make PHP so that when I load my page in the browser(typing > "index.php" in the adress bar) , it will print not only "hello" on the > page,but also show "index.php?greetings=hello" as URL .... , So , I > basically want PHP to dynamically append "?greetings=<?=$greetings?>" to > the URL I've typed........ > > How to do this ? > I hope I've made myself understood ... :o) > > Thanks... > > Arcad. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#67788) next »