pro_php thread: while on the subject...
Originally I'd had it as action="search.php?url=bl-01-etc" method="get". I
must have been in a bit of a daze when I got rid of the url= part. In my
last few attempts I did change it to action="search.php" action="post".
Surprisingly (to me at least) the PHP interpreter didn't seem to care either
way - maybe it was just read as unset.
Sorry about your migraine!
Mark
>Damn, too bad I didn't pick up that earlier. Yeah, use POST for your
method
>type. Also, for your action string, why do you have "search.php?";
>shouldn't it be just "search.php"?
>P.S. thanks for the problem ... I am officially getting a migraine
headache.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Mark Howe" <markh@p...>
To: "professional php" <pro_php@p...>
Sent: Friday, February 15, 2002 9:29 AM
Subject: [pro_php] Re: while on the subject...
> First of all, thanks for scratching your heads over my problem, I had
> definitely come to the end of my list of things to try. I still haven't
> solved it, but I think I'm nearer to understanding what is causing me
> difficulties. I used the print_r($HTTP_GET_VARS);
> and realised that despite my line specifying GET
> <form enctype="multipart/form-data" action="search.php?" method="get">
> <input type="hidden" name="url" value="bl-13-02-02" />
>
> url was being POSTed
>
> On top of that I decided that the name url could easily be being used for
> something else (I'm sure I've seen it when I've used phpinfo();). So I
> changed my html a bit and sent the form data to a separate script:
> <form enctype="multipart/form-data" action="separatescript.php"
> method="post">
> <input type="hidden" name="addr" value="bl-13-02-02" />
>
> print_r($HTTP_POST_VARS);
>
> Bingo. addr is printed on the screen. However, I put the same line in my
> original script and I get my double result thing again. On the screen I
see
> Array (
> [addr] => bl-13-02-02
> )
> In 'View Page Source' I see
> Array (
> )
> The only difference between the two scripts is that on my original script
> the
> print_r($HTTP_POST_VARS); comes after
> session_start();
> session_register("valid_username");
>
> I decided that there must be something different about the way PHP
processes
> a script if you use sessions - the two-pass thing again.So, I changed my
> script to use session_register("addr") and the equivalent for the other
few
> hidden form variables. Wouldn't you just know it? No warnings logged in
> php_errors and the display on the screen matches what is listed when I
click
> 'View Page Source'.
>
> The problem now is that when the form is re-sent with different values,
the
> old session registered values are the ones processed. So I try using
> session_unregister($addr); at the end of the script. No difference, the
> script still uses the old values. I can't use session_unset(); because I
> need the valid_username variable to be available every time. I tried using
> the plain old unset($addr), but that took me back to square one: warnings
> and dual outputs.
>
> My final attempt was to re-assign the appropriate session variables to the
> current POST_VARS values. Again, dual output. So, maybe the best I can
hope
> for is my original workaround of flushing the first output. The people
users
> of this application don't even have N6. Future users might though. Anyway,
> it's now Friday afternoon for me here in the UK, maybe I'll think about it
> again on Monday. Have a nice weekend.
>
> Mark