if($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset($_REQUEST['getfile']) && count($_SESSION['binary']) > 0) {
$str = $fileclass->genfile($_SESSION['binary']);
$newfile = "/files/myfile.nnn";
$fh = fopen($newfile, 'w') or die("Can't open file");
fwrite($fh, $str);
fclose($fh);
exit;
}
}
Need some help
Moderator: General Moderators
Need some help
What I'm trying to do is after the file is created in the following script, I want to open another page and pass it a few variables. I don't know how to do that.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
You are either going to have to set session vars and use them in both pages, set cookies and use them in the second page or pass them in the query string and use $_GET. On a side note I would recommend staying away from the $_REQUEST global. If you know it is a POST var, use $_POST. If it is a query string var, use $_GET.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Code: Select all
echo '<a href="/somepage.php?var1=' . $var1 . '&var2=' . $var2 . '">Click this link to go to the next page</a>';