Page 1 of 1

how to pass values to other pages..not gettin it :(

Posted: Sun Jan 22, 2006 8:54 am
by larajoseph
hawleyjr | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


 
hello!
I an a newbie in php. i am transfering value from one of my page to another(Mailign page) thru query 

string and the values gets dislayed in an input control.

Then the user enters other required values on this  mailing page and then clicks submit which sends a 

mail. I am not able to get the query string value being passed in my mail, only this query string 

value goes blank in the mail though it is displayed properly in the input box when i come into this 

page.

i tried various options say:

Code: Select all

if(isset($_GET['curcategory'])) //if 1
{
	$cat = @$_GET['curcategory'];
}
Here, "curcategory" is the query string variable name passed from the prev page.

Code: Select all

<input name="selcategory" type="text" disabled class="box" id="selcategory" size="32" value="<?php 

echo $cat; ?>">

i also tried these below given opions to get the value and then send it thru MAIL function:
//$current = $_GET['selcategory'];
//$current = $_REQUEST['selcategory'];
//$current = $HTTP_GET_VARS['selcategory'];
//$current = $_SESSION['selcategory'];
Kindly let me know whow to send this $cat thru mail using MAIL()function. I am sure i am making a big

mistake sumwhere, please guide.


hawleyjr | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sun Jan 22, 2006 9:13 am
by feyd
disabled input fields are not transmitted in a submission. You can use the read-only flag instead, or store the actual submittable version in a hidden field. Alternately, you could store them in a session variable if you don't want any tampering with that information.

Posted: Sun Jan 22, 2006 12:58 pm
by larajoseph
thanks feyd

is there any way to get the value from the query string, store that in a variable and when submit is clicked to send the mail..then send this value in the mail...
I tried to do it but i m not sure why it didnt work out. If u know then please send me the code for this.

Lara

Posted: Sun Jan 22, 2006 9:22 pm
by feyd
document.location.href is the url. You could split it to pull out the query string..

Posted: Mon Jan 23, 2006 6:04 am
by Jenk
location.search will give you the query string :)