By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,935 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,935 IT Pros & Developers. It's quick & easy.

header location redirect interfering with script -

P: n/a
A script i'm working on is behaving real strange. It is more or less
the same as dozens of others that work aok.

Info is posted from one script to another, the second script does some
work (nothing too taxing, just checks the input and updates/moves a
couple of files) then redirects to the first script.

Its one of these second scripts I'm having trouble with. As I was
writing it, instead if redirecting to the initial script I would just
echo out the variables etc.. that I was interested in, make sure all
was well and gradually work through it that way. When everything was
doing as expected I just stuck in the header("location: ...") line.

The script redirects ok but doesn't complete the tasks. If I remark
(//) the redirect line out, everything completes successfully. Now, I
know what one or two of you may be thinking, move the redirect line
down to the end of the script, well I can assure it is. Very last
couple of lines, right at bottom.

header("Location: ../home.php?ps=4&sub=6");

As I say I have written about 20 of these scripts with redirects and
no problem.

The site is on a managed server and the version is 4.2.3, I've asked
them to update PHP in the the past but they won't.

--Tea BREAK--

ok, i've just worked out what the matter was. I am about as
intelligent as the doughnut I just ate (not nearly).

The second script that redirected to the first one placed some files
in a folder. When the first script was executed again it deleted the
contents of the same folder, so i was left wondering why the files
hadn't copied over. Friday tomorrow.


Hope it can cheer someones day up (and maybe help some other
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.