Jump to content

[SOLVED] Form variables to Session variables


xProteuSx

Recommended Posts

I am writing a small script that consists of two pages:  page one displays a bunch of values from a DB (ie. First Name, Last Name, Phone Number).  On this page you will find a form that follows this format:

 

<input type="text" name="edit_firstname" size="20" maxlength="35" value='Bob'>

<input type="text" name="edit_lastname" size="20" maxlength="35" value='Smith'>

<input type="text" name="edit_phone" size="20" maxlength="35" value='5552222'>

 

So when you see the page there will already be a 'default' value in each line (which is information extracted from a DB).  This works perfectly and has been tested thoroughly.

 

On the second page I have the following code:

 

$editfirstname = $_POST['edit_firstname'];

$editlastname = $_POST['edit_lastname'];

$editphone = $_POST['edit_phone'];

 

What I am trying to do is this:  the default value for edit_firstname from the form is 'Bob' by default, but the user can change this in the input field on the first page.  This value, whether changed or unchanged, should then be stored as edit_firstname and by calling up the function $_POST[''] on the second page I want to transfer the value to the variable $editfirstname.  However, it seems that $_POST['edit_firstname'] and the other fields do not return a value at all, hence $editfirstname = '' or $editfirstname = 'NULL'.  I have never tried to do things this way before.  I have spent too many hours trying to figure this out on my own.

 

Help!?!?!  TIA.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.