944,044 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1491
  • PHP RSS
Mar 30th, 2006
0

Desperate Again Please HELP PHP

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
puddin is offline Offline
52 posts
since Mar 2006
Mar 31st, 2006
0

Re: Desperate Again Please HELP PHP

Reputation Points: 17
Solved Threads: 14
Posting Whiz
DanceInstructor is offline Offline
355 posts
since Feb 2005
Mar 31st, 2006
0

Re: Desperate Again Please HELP PHP

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!!!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
puddin is offline Offline
52 posts
since Mar 2006
Mar 31st, 2006
0

Re: Desperate Again Please HELP PHP

I just got it!

echo $_REQUEST['$username'];


I hope this helps someone.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
puddin is offline Offline
52 posts
since Mar 2006
Mar 31st, 2006
0

Re: Desperate Again Please HELP PHP

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!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
puddin is offline Offline
52 posts
since Mar 2006
Mar 31st, 2006
0

Re: Desperate Again Please HELP PHP

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!
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
puddin is offline Offline
52 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: PhP scripting help
Next Thread in PHP Forum Timeline: phpBB database incompatibility (php-nuke)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC