[PHP] Passing Values between Pages : $_SESSION / $_GET

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default RE: [PHP] Passing Values between Pages : $_SESSION / $_GET

    [snip]
    My question here is " How do I get the name of the company that was
    passed to this script as a $_GET Parameter. I cannot use the $company
    because it is out of scope.
    [/snip]

    How about $_GET['company'] ? Or am I missing something?

    Have a pleasant day.
    Jay Blanchard Guest

  2. Similar Questions and Discussions

    1. #39223 [NEW]: $_Session and $_Get get confused
      From: dgk at visskiss dot org Operating system: Fedora PHP version: 5.1.6 PHP Bug Type: Session related Bug description: ...
    2. #39011 [NEW]: foreach($_GET as $key => &$value) causes later bugs passing $_GET as a paramete
      From: php_bug dot email at email dot digiways dot com Operating system: Windows XP PHP version: 5.1.6 PHP Bug Type: Arrays...
    3. register_globals, effects on $_GET and $_SESSION
      I read php manual many times but I can't figure out register_globals works. I m using Php 4.3.2 and register_globals on. It seems to have different...
    4. Passing Values between Pages : $_SESSION / $_GET
      Hello All, I am using php and mysql in my application which allows users to search/query a database. The database is cast and has about 32 rows...
    5. Passing Values Between Web Forms Pages
      I am porting an old client/server application to asp.net. I used to retrieve data into local tables (Paradox table-files on the client's disk) and...
  3. #2

    Default Re: [PHP] Passing Values between Pages : $_SESSION / $_GET

    Thank you Jay for responding.


    Let me clarify again. The $_GET Parameter was used to to transfer the
    name from the results page (with the tables etc) to a
    full-profile_1.php page. On the full_profile_1.php page the user is
    displayed a form with all the details about the company. On the same
    page there is a form where changes can be made to values of the fields.
    I am trying to pass the company name in this form as a POST Parameter.
    However the Update part of the full_profile.php page is not able to get
    this value.

    The main point to remember is that full_profile_1.php does 2 things :
    1.) Display all the fields of the company as a form which is editable
    2.) Now if the user were to make changes in the values that were
    returned in the form above , the changes should be updated in the
    record. Now my problem is trying to transfer the name of the
    company from the 'form' to the update query.


    The way the logic on the full_profile_1.php is designed is as
    follows:

    if ($submit)
    {
    // This is after the user has been displayed all the fields of
    the record and he has made some changes and wanst to Update them
    // The Problem is how do I get the same name of the company in
    this loop. I have tried to pass the name as another $_POST Variable
    from the Form in the else part below, but when I try to access
    it over here. nothing comes.
    $temp1 = $_POST['temp'];\0\0 // RETURNS EMPTY
    :(
    }


    else{

    // here we get the name of the company as a $_GET Parameter from the
    previous page
    // display all the records of the selected company as a editable Form
    <form name="form1" method="POST"
    action="full_profile_1.php?temp=$row['company']">\0\0

    }




    Thanks again, and have a great weekend !

    --Pushpinder


    On Friday, August 8, 2003, at 04:20 PM, Jay Blanchard wrote:
    > [snip]
    > My question here is " How do I get the name of the company that was
    > passed to this script as a $_GET Parameter. I cannot use the $company
    > because it is out of scope.
    > [/snip]
    >
    > How about $_GET['company'] ? Or am I missing something?
    >
    > Have a pleasant day.
    >
    Pushpinder Singh Garcha Guest

  4. #3

    Default RE: [PHP] Passing Values between Pages : $_SESSION / $_GET

    [snip]
    Let me clarify again. The $_GET Parameter was used to to transfer the
    name from the results page (with the tables etc) to a
    full-profile_1.php page. On the full_profile_1.php page the user is
    displayed a form with all the details about the company. On the same
    page there is a form where changes can be made to values of the fields.
    I am trying to pass the company name in this form as a POST Parameter.
    However the Update part of the full_profile.php page is not able to get
    this value.
    [/snip]

    Clearer now.

    Place the value in a hidden form field that can be passed along with the
    POST
    Jay Blanchard Guest

  5. #4

    Default Re: [PHP] Passing Values between Pages : $_SESSION / $_GET

    Hello Jay ,


    I am attaching snippet of the Form Code that displays the results of
    the first query


    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <? echo "Hello ::: ".$company."<br>"; ?>
    <body bgcolor="aaaaaa" leftmargin="14" topmargin="10">
    <form name="form1" method="POST"
    action="full_profile_1.php?temp=$company">
    <table width="780" border="1" align="center" cellpadding="2"
    cellspacing="2">
    <tr>
    <td width="778" height="1007"> <table width="775" height="1151"
    cellpadding="1" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
    <tr bgcolor="#3300CC">
    <td height="29" colspan="2"> <div align="center"><font
    color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica,
    sans-serif"><strong>Complete
    Candidate Profile<br>
    <br>
    </strong></font>
    <table width="770" height="27">
    <tr>
    <td width="385"><font color="#FFFFFF" size="1"
    face="Verdana, Arial, Helvetica, sans-serif"><? echo
    $_SESSION['validuser']; ?></font></td>
    <td width="385"><div align="right"><font
    color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica,
    sans-serif"><strong><a
    href="logout.php">Logout</a></strong></font></div></td>
    </tr>
    </table>
    <font color="#FFFFFF" size="2" face="Verdana, Arial,
    Helvetica, sans-serif"><strong><br>
    </strong></font></div></td>
    </tr>
    <tr>
    <td width="149" height="28" bgcolor="99ccff"><strong><font
    color="#666666" size="1" face="Verdana, Arial, Helvetica,
    sans-serif">Company
    Name</font></strong></td>
    <td width="614" bgcolor="#E7E7E7"><font size="2"
    color="#552233" face="Verdana, Arial, Helvetica, sans-serif"><strong><?
    echo "$company"; ?></strong>
    <input name="company" type="hidden" id="company3"
    size="40" value= <? echo "$company"; ?> >
    </font></td>
    </tr>
    <tr> \0\0


    // END OF SNIPPET


    However when I try to access it in the if($submit) part as
    $_POST['temp'] I get nothing !!!

    Thanks in advance,

    --Pushpinder



    On Friday, August 8, 2003, at 04:57 PM, Jay Blanchard wrote:
    > [snip]
    > Let me clarify again. The $_GET Parameter was used to to transfer the
    > name from the results page (with the tables etc) to a
    > full-profile_1.php page. On the full_profile_1.php page the user is
    > displayed a form with all the details about the company. On the same
    > page there is a form where changes can be made to values of the fields.
    > I am trying to pass the company name in this form as a POST Parameter.
    > However the Update part of the full_profile.php page is not able to get
    > this value.
    > [/snip]
    >
    > Clearer now.
    >
    > Place the value in a hidden form field that can be passed along with
    > the
    > POST
    >
    Pushpinder Singh Garcha Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139