Desperate Again Please HELP PHP

Reply

Join Date: Mar 2006
Posts: 52
Reputation: puddin is an unknown quantity at this point 
Solved Threads: 0
puddin puddin is offline Offline
Junior Poster in Training

Desperate Again Please HELP PHP

 
0
  #1
Mar 30th, 2006
Hello,

Q.

With php I know we can Create a Form and have it POST to read on the next page. Great! NOW can it post to a third page, without using a form again. I just want to carry the users name around, so to say.

Design so my pages are personalized showing the users name whatever page they go to.

You see the username is Posting on page 2 this is what i want...
But! When the user clicks a next 3rd page I cannot get their name to show automatically - I want it to show like it did on page 2, It can't be the user has to enter their username on a form again and again.

P.S - My register_global are off and I have no access to my php.ini file
none of these can be configured, So I need to know how to do it without what register_globals OFF and the php.ini file default at 0 ....


The answer will be much appreciated! A big Thank-you
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: Desperate Again Please HELP PHP

 
0
  #2
Mar 31st, 2006
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 52
Reputation: puddin is an unknown quantity at this point 
Solved Threads: 0
puddin puddin is offline Offline
Junior Poster in Training

Re: Desperate Again Please HELP PHP

 
0
  #3
Mar 31st, 2006
How to use sessions is what I am trying to understand!

I have the username on the 2nd page all is good, I have the username attached to the address
on the 3rd page,Like so,
http://www.puddinpatchdatematch.com/welcomed.php?$username=puddin
But I cannot get it to post on the darn page!

HOW DO I GET IT TO POST ON THE PAGE!!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 52
Reputation: puddin is an unknown quantity at this point 
Solved Threads: 0
puddin puddin is offline Offline
Junior Poster in Training

Re: Desperate Again Please HELP PHP

 
0
  #4
Mar 31st, 2006
I just got it!

echo $_REQUEST['$username'];


I hope this helps someone.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 52
Reputation: puddin is an unknown quantity at this point 
Solved Threads: 0
puddin puddin is offline Offline
Junior Poster in Training

Re: Desperate Again Please HELP PHP

 
0
  #5
Mar 31st, 2006
Sorry here is the complete way to do it!

PART ONE:

On your FORM page add this part to the address:

?$username=<?echo $_POST["username"]?>"> After the .php address

I wanted the username to show up on my next page - $username is my variable

The link has to look like below with the above part added to the FORM address and any other links you want it to work with:

You start by adding it to your FORM address it looks like this:

<form action="welcome.php?$username=<?echo $_POST["username"]?>" method="post">
Username:<input type="text" name="username" value="" size="10">
&nbsp;&nbsp;Email Address:<INPUT TYPE="password" size=10 name="email_address">
&nbsp;<input type="submit" value= "Submit">
&nbsp;<input type="reset" value="Reset">
</form>


Than any other links you add to look like this:
<a href="http://www.your_link_page.php?$username=<?echo $_POST["username"]?>">


PART TWO:

On the page you want it to show up on at the very top of the page have :
<?
session_start();
?>
Check this session_start(); may need t be on both pages.

And last place this on the page you want to display your variable:
<?
echo $_REQUEST['$username'];
?>

It looks really nice and works Great!
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 52
Reputation: puddin is an unknown quantity at this point 
Solved Threads: 0
puddin puddin is offline Offline
Junior Poster in Training

Re: Desperate Again Please HELP PHP

 
0
  #6
Mar 31st, 2006
ABOUT PART TWO...

The PART TWO ABOVE goes on the same page ...


<?
session_start();
?>

Goes at the very top of the page and the other part goes on the same page. Place it where you want it to show on your webpage

<?
echo $_REQUEST['$username'];
?>


It looks very nice but after viewing going to a next page and click try to go back you get an error message ... It won't go back. If you know how to correct this please let me know, Thanks!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC