I lose data when i click on back button

Discussion in 'PHP' started by baris22, Jan 8, 2010.

  1. #1
    Hello,

    I have got a back button:

    
    <INPUT TYPE="BUTTON" VALUE="&lt;&lt; Go Back" 
    ONCLICK="window.history.back()">
    
    PHP:
    when i click it i lose data on 1 field. if i leave this field empty and submit then go back the other fields are fine.

    This is the field causing problem.

    
    
    <input name="demo3" id="demo3" type="text" value="<?=$row['order_collect_time'];?>" size="25" onclick="javascript:NewCal('demo3','ddmmmyyyy',true,24)">
    
    
    PHP:
    What can i do to solve this problem. I can not use sessions.

    thanks
     
    baris22, Jan 8, 2010 IP
  2. xenon2010

    xenon2010 Peon

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    what do you wanna do? I didn't understand the problem here..
     
    xenon2010, Jan 8, 2010 IP
  3. baris22

    baris22 Active Member

    Messages:
    543
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    i have got a form and i have got fields. When i fill the form and click, i go to next page to see the data i filled. If there is something wrong on the data i go back to the first page to change it.

    when i go back i lose all the data i entered. This is happening because of this field

    
    
    <input name="demo3" id="demo3" type="text" value="<?=$row['order_collect_time'];?>" size="25"
     onclick="javascript:NewCal('demo3','ddmmmyyyy',true,24)">
    
    
    PHP:
    if i leave this field empty and come back, all the data remains same.
     
    baris22, Jan 8, 2010 IP
  4. xenon2010

    xenon2010 Peon

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    why dont you just use sessions?
    if you cant use sessions use cookies.
    if you cant use cookies use hidden inputs.
    if you cant use hidden inputs use GET.
     
    xenon2010, Jan 8, 2010 IP