6 Replies - 373 Views - Last Post: 26 January 2013 - 11:14 PM Rate Topic: -----

#1 pororo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 05-May 12

how to use get variable from page 1 for page 3

Posted 26 January 2013 - 07:33 PM

Hi, I have 3 pages.
How do I use get method for page 3?
For page 2, I can get the variable from page 1 but how do I do the same for page 3?
I need to have get the same variable from page 2 to page 3?
Thanks in advance. Pls help me asap .
Is This A Good Question/Topic? 0
  • +

Replies To: how to use get variable from page 1 for page 3

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10825
  • View blog
  • Posts: 40,363
  • Joined: 27-December 08

Re: how to use get variable from page 1 for page 3

Posted 26 January 2013 - 07:45 PM

You will need to use Sessions.
Was This Post Helpful? 0
  • +
  • -

#3 pororo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 05-May 12

Re: how to use get variable from page 1 for page 3

Posted 26 January 2013 - 08:11 PM

I am sorry. I am new to this forum. I do not know that I had click PM to you.
I am not submitting any forms. If I am not submitting any form do I still use session??
I am doing a website. I just wanna do get the variable. Thank for helping.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10825
  • View blog
  • Posts: 40,363
  • Joined: 27-December 08

Re: how to use get variable from page 1 for page 3

Posted 26 January 2013 - 08:15 PM

Quote

I am sorry. I am new to this forum. I do not know that I had click PM to you.

You didn't PM me. You must be referring to my signature, where I ask people not to PM me with coding help questions. :)

Sessions don't require forms, so you're good there. This is definitely what you want to use.
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3838
  • View blog
  • Posts: 13,603
  • Joined: 12-December 12

Re: how to use get variable from page 1 for page 3

Posted 26 January 2013 - 08:26 PM

Is it necessary to use sessions.. If it is a simple, insignificant, value then it can be passed as a url parameter via a link:

<a href="page3.html?somevar=42">Page 3</a>

or via a Javascript re-direct.

PHP can construct the link:
<a href="page3.html?somevar=<?php echo $somevar; ?>">Page 3</a>

This post has been edited by andrewsw: 26 January 2013 - 08:29 PM

Was This Post Helpful? 1
  • +
  • -

#6 pororo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 05-May 12

Re: how to use get variable from page 1 for page 3

Posted 26 January 2013 - 10:33 PM

View Postmacosxnerd101, on 26 January 2013 - 08:15 PM, said:

Quote

I am sorry. I am new to this forum. I do not know that I had click PM to you.

You didn't PM me. You must be referring to my signature, where I ask people not to PM me with coding help questions. :)/>

Sessions don't require forms, so you're good there. This is definitely what you want to use.


Can you give a example on how can I use session? Thanks
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10825
  • View blog
  • Posts: 40,363
  • Joined: 27-December 08

Re: how to use get variable from page 1 for page 3

Posted 26 January 2013 - 11:14 PM

Check the tutorial I linked you to.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1