...

View Full Version : session's in php



afma_afma
05-02-2006, 09:06 PM
hello there,
i am a newbie and i want to know how to handle php session's.i want to know how i can assign a selected drop down menu value to a session variable.

thanx in advance
mansoor ahmed

afma_afma
05-02-2006, 09:54 PM
handling of sessions:
dd1 and dd2 are two drop down boxes

session_start();
$stuname = trim($_POST['dd1']);
$stuaddr = trim($_POST['dd2']);


$_SESSION['d1'] = $stuname
$_SESSION['d2'] = $stuaddr;


i am using the latest php...mysql and apache



thanx ahmed

afma_afma
05-02-2006, 09:55 PM
i followed the above way of coding and sessions is still not working...please some some one help me out...

ahmed

ClubCosmic
05-02-2006, 11:40 PM
when posting code please use the
tags.

i see you are missing a semi-colon.
[PHP]$_SESSION['d1'] = $stuname <--
$_SESSION['d2'] = $stuaddr;

maybe you just missed it in your post.

can you echo the vars $stuname and $stuaddr after you delare them?

what errors (if) any does you code produce?

where are you trying to display these $_SESSION vars? maybe they exist but you are not accessing them correctly.

keep us posted:thumbsup:

afma_afma
05-03-2006, 02:18 AM
when posting code please use the
tags.

i see you are missing a semi-colon.
[PHP]$_SESSION['d1'] = $stuname <--
$_SESSION['d2'] = $stuaddr;

maybe you just missed it in your post.

can you echo the vars $stuname and $stuaddr after you delare them?

what errors (if) any does you code produce?

where are you trying to display these $_SESSION vars? maybe they exist but you are not accessing them correctly.

keep us posted:thumbsup:


hi thanx for giving me ur valuable suggestion,i am trying to access the student name and student address value in some other webpage....and the problem is it is not working.if i try to pass a value directly into the session variable like $_SESSION['d1']='hello'; this working..i am able to get 'hello' in some other page....but if it is a value from dropdown menu then it is not working....

thanx ahmed



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum