Welcome to Dream.In.Code
Become a PHP Expert!

Join 136,908 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,776 people online right now. Registration is fast and FREE... Join Now!




post form values?

 
Reply to this topicStart new topic

post form values?

samn84
9 Mar, 2008 - 12:18 AM
Post #1

New D.I.C Head
*

Joined: 21 Feb, 2008
Posts: 41

i have made an update form.upon selection of a particular contact his/her details appear in the fields of the update form where the user can edit the details.the code goes as follows

CODE

<input name="desigantion" type="text" value="<?echo $desig; ?>">
<input name="company" type="text" value="<?echo $comp; ?>"


where $desig and $comp contains the previously stored values
in db.now these values already appear in the form fields when user see's the form.now the user can update values.

on button click the updated details are posted to another page where there is an update query to update the details of that contact in the database

the question is that the values are send by post method and i dont understand that if a i write the following in the next page:

CODE

$des=$_POST['designation'];
$cmp=$_POST['company'];


will it give me the updated values or the old ones?becz i have to update the table based on these values!!!!

*edit* code.gif
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Post Form Values?
9 Mar, 2008 - 12:20 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
If the user changes the value in either of those controls the new value will be posted. If they don't, the only values will be posted. Whatever values are in the form elements when the form is submitted is what is posted.
User is online!Profile CardPM
+Quote Post

samn84
RE: Post Form Values?
9 Mar, 2008 - 12:24 AM
Post #3

New D.I.C Head
*

Joined: 21 Feb, 2008
Posts: 41

i understand but i have given the values tag for the text field which shows the variable value....will that variable be updated accordingly as to what the user types in that field.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Post Form Values?
9 Mar, 2008 - 01:22 AM
Post #4

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,495



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(samn84 @ 9 Mar, 2008 - 01:24 AM) *

i understand but i have given the values tag for the text field which shows the variable value....will that variable be updated accordingly as to what the user types in that field.

They will only be updated once the server can retrieve the values.

It is important to remember which side that the processing takes place. All PHP functionality executes on the server, & all JavaScript executes on the clients web browser. In order to update the PHP code with any changes, you must reprocess the data.
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 09:53PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month