dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Can't retrieve variablesa

  1. #1
    Join Date
    Apr 2011
    Posts
    8

    Can't retrieve variablesa

    Trying to get my parameters passed from a form an a previous page into an action handler. I can see my data with var_dump($_POST) but this code returns all blank.
    <?php
    $DatePosted=$_GET["date1"];
    $Type=$_GET["optType"];
    $Status=$_GET["optStatus"];
    $Name=$_GET["txtName"];
    $Description=$_GET["txtDescription"];
    $Contact=$_GET["txtContact"];
    $Area=$_GET["txtArea"];

    print ($_GET["date1"] . "|<BR>");

    var_dump($_POST)
    ?>

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,634
    One of us is confused. Why do you assign value from $_GET and then var_dump() $_POST?
    "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

  3. #3
    Join Date
    Apr 2011
    Posts
    8
    var_dump() $_POST was just a test to display the post data. The _Get returns null

  4. #4
    Join Date
    Jul 2007
    Location
    Wisconsin
    Posts
    468
    Quote Originally Posted by eforce View Post
    var_dump() $_POST was just a test to display the post data. The _Get returns null
    If the data is in $_POST, it won't be in $_GET.

    just replace all your $DatePosted=$_GET["date1"]; with $DatePosted=$_POST["date1"];

  5. #5
    Join Date
    Apr 2011
    Posts
    8
    Beautiful....that worked. Thank you. This is my 2nd day in PHP and am writing website to read and add to a mysql db.

Thread Information

Users Browsing this Thread

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

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