Here is a url with the problem that i was describing
http://xiot.darktech.org

I fiddled and I found what the problem.

Header('Location: $calling)    ----  the first char in $calling can not be a
/
I was setting $calling with $_SERVER['PHP_SELF'] which adds the / in front
of the path.
I changed it to "." . $_SERVER['PHP_SELF'] and it worked

take a look at the url to see what was going on.

Here is the code that im using

--index.php
print_r($_POST);
...
echo "<form action='poll.php' method='POST'>";
    echo "<input name='poll_id' type='hidden' value='1>\n";
    echo "<input name='calling' type='hidden' value=' " .
$_SERVER['PHP_SELF'] . " '>\n";
    echo "<input name='poll_choice' type='radio' value=1>Choice 1";
    echo "<input name='poll_choice' type='radio' value=2>Choice 2";
    echo "<input name='poll_choice' type='radio' value=3>Choice 3";

    echo "<input type='submit' value='submit'>";
echo "</form>";


--poll.php
$poll_id = $_POST['poll_id'];
$poll_choice = $_POST['poll_choice'];
$calling = $_POST['calling'];

if (isset($poll_id)) {
    unset($_POST);
    castVote($poll_id, $poll_choice);
    Header("Location: $calling");
    exit();
}


Chris

"Jason Giangrande" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Chris Thomas wrote:
> > I am not sure if this was designed like this, or if its just something
im
> > doing wrong.
> >
> > Im posting some data to a processing page, where i handle it then use
> > Header('Location: other.php') to direct me to another page.
> >
> > The problem that im running into is that the posted data is available in
> > other.php.
> > I would like to get it so that in other.php $_POST  should be an empty
array
> >
> > Any suggestions??
> >
> > Chris
> >
>
> If the processing page and other.php page are two separate pages I don't
> see how you could be getting the same $_POST data that the processing
> page is receiving.  You aren't passing any data from your processing
> page to hidden form inputs (or something) on that page before you call
> header() are you?  Perhaps if you gave an example of your code I might
> have a better idea of what is going on.  You could also try using
> unset($_POST) in other.php to make sure $_POST is empty for that page.
>
> -- 
> Jason Giangrande <[EMAIL PROTECTED]>
> http://www.giangrande.org
> http://www.dogsiview.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to