Jump to content

retrieving a variable


fallenangel1983

Recommended Posts

yes, if you create a form in that other page to post the information to the current page like:

 

 

<form id="formid" name="formname" method="post" action="filename.php">

<input name="textinput" type="text">

<input type="submit" name="submit" value="submit" />

 

then in filename.php you would put"

 

$var=$_POST['textinput']

 

so whatever they typed into the textbox on the first page and hit submit would then get stored into $var in filename.php. or instead of a text box you could have a drop down list or radio button or whatever.

Link to comment
https://forums.phpfreaks.com/topic/98666-retrieving-a-variable/#findComment-504962
Share on other sites

does $_GET retrieve a variable set in another html page?

 

I think im understanding what you are trying to do,

 

if you create a form that the user fills out on page1, then the form method is GET and it goes to page2.php.

 

at the top of page2.php put the $_GET string i put earlier...

 

this will only work if you are using a form, either for the user to input data or as hidden so they are already passed....

Link to comment
https://forums.phpfreaks.com/topic/98666-retrieving-a-variable/#findComment-504963
Share on other sites

Right ok sorry for being too vague didnt mean to annoy.

 

in another html page i am using the afore mentioned form and input box to send that variable to a specific page.

 

however this will only send that variable to that specific page.

 

i wish to access that variable now on a completly different page for use with php validation.

 

I cannot use session varibles and this way of doing it.....

 

<form name='blah' method='post' action='page.php'>

<input name='blah' type='blah' value='blah'></form>

 

will only send it to page.php

 

I need the variable on page2.php and so i am assuming a fucntion would be needed.

 

thanks for the input guys sorry for inconvienience

Link to comment
https://forums.phpfreaks.com/topic/98666-retrieving-a-variable/#findComment-504966
Share on other sites

Right ok sorry for being too vague didnt mean to annoy.

 

in another html page i am using the afore mentioned form and input box to send that variable to a specific page.

 

however this will only send that variable to that specific page.

 

i wish to access that variable now on a completly different page for use with php validation.

 

I cannot use session varibles and this way of doing it.....

 

<form name='blah' method='post' action='page.php'>

<input name='blah' type='blah' value='blah'></form>

 

will only send it to page.php

 

I need the variable on page2.php and so i am assuming a fucntion would be needed.

 

thanks for the input guys sorry for inconvienience

 

 

if not session variables then store it into a SQL database and retrieve it on the other page....

Link to comment
https://forums.phpfreaks.com/topic/98666-retrieving-a-variable/#findComment-504970
Share on other sites

It is already inside a table but it is a specific row of that table that the user selects from a list.

 

what im trying to get is a record form a table. from a user stated ID.

 

the table name is events and i need to retrieve the specific eventID that the user requests on a form submitted a few pages ago.

 

i stated that session variables would not work. however i only know one way of doing them.

Link to comment
https://forums.phpfreaks.com/topic/98666-retrieving-a-variable/#findComment-504974
Share on other sites

It is already inside a table but it is a specific row of that table that the user selects from a list.

 

what im trying to get is a record form a table. from a user stated ID.

 

the table name is events and i need to retrieve the specific eventID that the user requests on a form submitted a few pages ago.

 

i stated that session variables would not work. however i only know one way of doing them.

 

store the user's selection in new table on the first page. on the current page query the selection from the new table and put it in a variable, then query the original table where eventID='$variable'.

Link to comment
https://forums.phpfreaks.com/topic/98666-retrieving-a-variable/#findComment-504979
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.