xProteuSx Posted December 1, 2007 Share Posted December 1, 2007 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. Quote Link to comment Share on other sites More sharing options...
noidtluom Posted December 1, 2007 Share Posted December 1, 2007 Make sure on your first page, the one with all the input fields, has this form value: <form method="post"> Pretty self explanatory why you need it there Quote Link to comment Share on other sites More sharing options...
marcus Posted December 1, 2007 Share Posted December 1, 2007 Um, he was just showing us the layout of what he has. Quote Link to comment Share on other sites More sharing options...
BenInBlack Posted December 1, 2007 Share Posted December 1, 2007 noidtluom is correct. because xProteuSx i correct, but since it is returning empty then he must have is <form method set to method="get" one way of working with values post'd or get'd ;-) is to use the $_REQUEST because this collects both. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.