kael.shipman Posted July 20, 2007 Share Posted July 20, 2007 I've been looking for this for a while. I have a site that uses post variables for navigating the "processors" section. For example, index.php?p=1 runs the appropriate page. If I post something to index.php?p=1 where $_POST['process'] = 1 and $_POST['action'] = 'chng_name', it knows by the first post variable to include the Processors file, then it knows by the second variable what it needs to do with the rest of the post data. It processes the appropriate data and continues to load the same page again. However, I've run into a few times where it would be nice to be able to keep a page running on an array that the user submits without having to have the user resubmit stuff every time. I know that's confusing, but here's another example: <?php $files = $_POST['files']; //$files is an array submitted by the user telling the parser which files to parse $file = current($files); if ($file) { //Parse the file. This takes a long time, so if I loop it, sometimes PHP times out before it gets to the end of the array. //Instead of looping through the array, just remove the first element and repost it array_shift($files); post_redirect($_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'],array('process'=>1,'action'=>$_POST['action'],'files'=>$files)); //The above is a made up function that posts the array in the second argument to the script in the first. This is what I need to find. } //output rest of the page ?> Essentially, it should be like using header('Location: newPage.php'), but with post variables included. Oh, and for the record, I'm not looking for a way to solve this problem; that part is easy with a different approach. I'm looking to see if there's any way to solve it in this particular manner. Thanks! Quote Link to comment Share on other sites More sharing options...
samtay Posted July 20, 2007 Share Posted July 20, 2007 Hey Have a look in to cURL() Samuel Quote Link to comment Share on other sites More sharing options...
samtay Posted July 20, 2007 Share Posted July 20, 2007 http://www.php.net/curl There some information. Quote Link to comment Share on other sites More sharing options...
kael.shipman Posted July 20, 2007 Author Share Posted July 20, 2007 Hm. I admit, from my brief overview, that looks like a little bit more than what I'm after. I don't doubt that I could do it that way, but it seems there should be a more elegant solution than calling up a whole new library simply to pass post data along. Maybe not, though. I understand that the application I'm after isn't exactly standard, and therefore I guess I shouldn't expect a standard solution. Thanks for the suggestion, and if there are any other suggestions out there, send them my way! -kael Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.