hello frndz...
i what to knw i their any method to hold the values of form after refreshing the page or gettin back again on same page..!!!
for eg i create a form.. username frstname lastname...after submiting the form if username exits then it go back to registerin form but tht should contain alteast correct value like frstname,lastname..!!!
i hope u understand wht i want to say... waiting for positive reply..!!!
thnx in advance..!![:)]

9 Years
Discussion Span
Last Post by nish123

Store it in a session or cookie.

Session example:


foreach($_POST as $key => $value) {
  $_SESSION['post_vars'][$key] = $value;

Very basic example, by no means complete.

You can then access the values using $_SESSION['post_vars']['field name']

<form action="" method='post' onsubmit='return confirm("Sure?")'>
<input type='text' name='fred' value="<?php if($_POST['fred']) { echo $_POST['fred'];} ?>">
<input type='submit' value='submit'>

another method


Thank you friends..!!

i have done with my work.. i store the values in session after submit..!! its working fine

but is there anyway to hold values of textbox on page refresh..!!! :O

i have list of items and price..

items | price
item1 | texbox (we fill value in it)
item2 | texbox
Add new item button

after clicking on Add new item, a popup window will open and after adding new item, window will close and refresh the parent page....

and this results in showing new item in list but deleting all values which we fill in textbox..!!

i hope you understand what i need..?? :)

waiting for positive reply.. thanks in advance..!! :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.