Jump to content

[SOLVED] Headers stuff


AV1611

Recommended Posts

I have a form that when submitted goes to a processor that does this:

 

<?php
header('Content-type: application/vnd.ms-word');
header('Content-Disposition: filename=file.doc');
echo "This is a variable: ".$_POST['blah']."\n";
//etc...
?>

 

The form submits and the file is downloaded no problem.

 

How can I make it so the page also forwards to a new page.

 

If I add

header('Location: newfile.php');

 

It forwards but no file is downloaded.

 

Help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/90056-solved-headers-stuff/
Share on other sites

Providing the readfile function doesn't do an exclusive lock on the file (which it shouldn't because it's doing a read operation) then you will be fine. 2 clients can read the same file at the same time. Files only usually get locked (on linux) when they're being written two or explicitly made to.

Link to comment
https://forums.phpfreaks.com/topic/90056-solved-headers-stuff/#findComment-461740
Share on other sites

Sorry,

 

What I meant was:

 

If I have to take the form, write the variables to the file, then download the file and forward to another page, and two folks do that at the same time, how do I make sure that the file was not changed with the other persons variables?  or am I being too careful?

Link to comment
https://forums.phpfreaks.com/topic/90056-solved-headers-stuff/#findComment-461788
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.