Connecting Tech Pros Worldwide Help | Site Map

header location redirect interfering with script -

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 01:36 AM
jock
Guest
 
Posts: n/a
Default header location redirect interfering with script -

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");
exit;
?>

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
unfortunate).

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.