[Lvlug] Any PHP help please
Michael S. Dunsavage
mikesd at ptd.net
Wed Jul 2 23:29:40 EDT 2008
On Wed, 2008-07-02 at 23:23 -0400, linc wrote:
> Michael S. Dunsavage wrote:
> > I'm trying to use urlencode() and I can't seem to get it to read in
> > another script.
> >
> > URL ENCODE SCRIPT:
> >
> > echo "<BR><BR>";
> > print "Your first name is: <b>$FirstName</b>.<BR><BR>\n";
> > print "Your last name is: <b>$LastName</b>.<BR><br>\n";
> > print "Your E-mail is: <b>$Email.</b><BR><br>\n";
> > print "Your Comments are: <b>$Comments</b><br><BR>\n";
> >
> > $FullName=urlencode($FullName);
> >
> > print ("<P>Click <A HREF=\"welcome.php?Name=$FullName\"> here</A> to see
> > your personalized greeting!\n");
> > ?>
> >
> >
> > NEXT SCRIPT:
> >
> > <HTML>
> > <HEAD>
> > <TITLE>Welcome!</TITLE>
> > <BODY>
> > <?php
> >
> >
> > print $FullName;
> > print ("<B><CENTER>Hello, $FullName.</CENTER></B>\n");
> > ?>
> > </BODY>
> > </HTML>
> >
> >
> > All I'm getting is: Hello, .
>
> You have to reset or pass the variable from one script to the next
> unless the variables are global. Something like so:
> script1.php-----------------------------------
> $name="john smith";
> $fullname=urlencode($name);
> print("click <a href='script2.php?name=$fullname'>HERE</a> to run second
> script");
> ------------------------------------------
>
> script2.php-------------------------------------
> $fullname=urldecode($_GET['name']);
> print("Your name is $fullname");
> ------------------------------------------------
> _______________________________________________
> Lvlug mailing list
> Lvlug at thelinuxlink.net
> https://www.thelinuxlink.net/mailman/listinfo/lvlug
>
I was beginning to wonder if urldecode was involved, I just couldn't
find any good answers on Google or php's mailing lists. Thanks.
--
Michael S. Dunsavage
More information about the Lvlug
mailing list