Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problems with sessions(am a newbie)

    hello there i have a small problem (hopefully)

    when i use the following code it is all working fine:
    $stuname = 'aaa';
    $stuaddr = 'bbb';


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

    echo $_SESSION['d1'];
    echo $_SESSION['d2'];

    aaa and bbb are echoed....but when i try to get value from two drop down menu to display the selected value like the below...i face problems....

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


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


    echo $_SESSION['d1'];
    echo $_SESSION['d2'];

    the echoed value is not printed out...some one please help...

    thanx in advance
    ahmed
    Last edited by afma_afma; 05-03-2006 at 01:28 AM.

  • #2
    New Coder
    Join Date
    Apr 2006
    Location
    UK
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    $_SESSION['d1'] = $a;
    $_SESSION['d2'] = $b
    Where have $a and $b come from?

  • #3
    New Coder
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry thats a mistake
    ....that is $stuname and $stuaddr

  • #4
    New Coder
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by cdwhalley.com
    PHP Code:
    $_SESSION['d1'] = $a;
    $_SESSION['d2'] = $b
    Where have $a and $b come from?

    sorry thats $stuname and $stuaddr

  • #5
    Regular Coder
    Join Date
    May 2004
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i see you have posted twice on this topic.

    instead of:
    PHP Code:
    echo $_SESSION['d1'];
    echo 
    $_SESSION['d2']; 
    try:
    PHP Code:
        $stuname "{$_SESSION['d1']}";
    $stuaddr "{$_SESSION['d2']}"
    then when you want to echo them:
    PHP Code:
    echo $stuname "<br>"$stuaddr
    Last edited by ClubCosmic; 05-02-2006 at 10:56 PM.

  • #6
    New Coder
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanx for the hint

    hi cosmic,
    thanx for ur suggestions.can u tell me how i can assign a drop down menu value into a session variable.

    thanx in advance..
    ahmed:


    Quote Originally Posted by ClubCosmic
    i see you have posted twice on this topic.

    instead of:
    PHP Code:
    echo $_SESSION['d1'];
    echo 
    $_SESSION['d2']; 
    try:
    PHP Code:
        $stuname "{$_SESSION['d1']}";
    $stuaddr "{$_SESSION['d2']}"
    then when you want to echo them:
    PHP Code:
    echo $stuname "<br>"$stuaddr


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •