SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2010
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to send data back by PHP

    When you go into a registering site, the password requires one number and you just put in letters. The website is diverted to the same website with all your data except your password. I would like to do that in PHP.

    By the "POST" method I bring the data into the PHP website. I just do not know how to send the data back with the header pointing back to the same website it originated from. How do you send data from the PHP or Server back to the newly formed website?

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Essentially, you could do it like this:
    PHP Code:
    <?php
    // pseudo code
    if( validation is good ){
    // save the data
    // redirect to the next page
    // exit();

    }

    // otherwise fall through to here and just show the form again
    ?>

    <form action="" method="POST">
    <input type=text name="firstName" value="<?php if( isset($_POST['firstName']) ) echo htmlentities($_POST['firstName']) ?>" />
    <input type="submit">
    </form>


Bookmarks

Posting Permissions

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