www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help with php and html

  1. #1
    Join Date
    Jun 2014
    Posts
    6

    Help with php and html

    Unfortunately I don't have the code with me right now, but what whatever you can do to answer will be greatly appreciated. So I have a form in which I have the user input some information, on this site I have submit button, which takes you to another site with the information already input, you know like a confirmation page, and so for this I'm using session variables for storing the input of the user in the different fields. So I'm adding a button on the confirmation page that says "go back to edit" but when you go back the input is gone, if you could help me on how to do that I would appreciate it very much, if you could maybe show me a little example that would be great. And one more thing, is the input validation, how on top of this could you validate , for example if you leave something empty , to not let you submit

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,611
    If the data is in $_SESSION, then you can do something like this:
    PHP Code:
    <input type="text" name="field_1" value="<?php
    if(!empty($_SESSION['field_1']) {
        echo 
    htmlspecialchars($_SESSION['field_1']);
    }
    ?>" />
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles