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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
larajoseph
Forum Newbie
Posts: 2
Joined: Sun Jan 22, 2006 8:47 am

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

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
larajoseph
Forum Newbie
Posts: 2
Joined: Sun Jan 22, 2006 8:47 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

document.location.href is the url. You could split it to pull out the query string..
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

location.search will give you the query string :)
Post Reply