SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Threaded View

  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    header location not working?

    My first post! Need a little help on a very simple script.
    PHP Code:
    <?php

    $host 
    "yada";
    $user "blah";
    $database "blahblah";

    $id mysql_connect($host,$user);
    mysql_select_db($database$id);

    //while (list ($key, $val) = each ($HTTP_POST_VARS)) {
    //    echo "<br>$key: $val";
    //}

    $title=$HTTP_POST_VARS["title"];
    $startDate=$HTTP_POST_VARS["startDate"];
    $endDate=$HTTP_POST_VARS["endDate"];
    $description=$HTTP_POST_VARS["description"];
    $address=$HTTP_POST_VARS["address"];
    $city=$HTTP_POST_VARS["city"];
    $state=$HTTP_POST_VARS["state"];
    $zip=$HTTP_POST_VARS["zip"];
    $phone=$HTTP_POST_VARS["phone"];
    $email=$HTTP_POST_VARS["email"];
    $web=$HTTP_POST_VARS["web"];

    $sql "INSERT INTO calender(ID,title,startDate,endDate,description,address,city,state,zip,phone,email,web) VALUES('','$title','$startDate','$endDate','$description','$address','$city','$state','$zip','$phone','$email','$web')";
    $result mysql_query($sql);


    Header("Location: view.php");

    ?>
    The above code does NOT forward to view.php after everything else is finished. Doesn't return an error - doesn't do anything. Just stays on the current (blank) page.

    Also, is there a better way to assign values to each of my post vars?
    If I don't declare them like this:
    $web=$HTTP_POST_VARS["web"];
    then I can't refer to them by name. Example, I can't use the variable $web unless I declare it as above -- even though it was passed as a post var with the name of web already?

    Hmmm...

    Thanks everyone

    EDIT: I'm using "Small HTTP Server" and PHP 4 on windows 98, if that helps.
    Last edited by phpGrasshopper; May 9, 2002 at 13:24.


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
  •