Asday Posted July 10, 2007 Share Posted July 10, 2007 I want the script to direct a browser directly to a page after a certain event. Case: I want to delete a file with get, then go to the page without the get request, so as not to delete a file that isn't there. Possible? EDIT: Yes, I do need to use get. Link to comment https://forums.phpfreaks.com/topic/59240-solved-instant-redirection/ Share on other sites More sharing options...
trecool999 Posted July 10, 2007 Share Posted July 10, 2007 I'm not sure I get what you're saying. Link to comment https://forums.phpfreaks.com/topic/59240-solved-instant-redirection/#findComment-294243 Share on other sites More sharing options...
Asday Posted July 10, 2007 Author Share Posted July 10, 2007 I'm not sure I get what you're saying. I use get to delete a file. The file is deleted. The get request stays in the URL bar. Upon refresh, it tries to delete the file again, but the file isn't there. How do I set the URL? Link to comment https://forums.phpfreaks.com/topic/59240-solved-instant-redirection/#findComment-294245 Share on other sites More sharing options...
Yesideez Posted July 10, 2007 Share Posted July 10, 2007 I thihnk this is what you mean: <?php if ($_POST['deletefile']) { //delete file here header("Location: ".$_SERVER['PHP_SELF']); exit; } ?> Once the file is deleted the page refreshes itself removing the "del" part from the URL. Link to comment https://forums.phpfreaks.com/topic/59240-solved-instant-redirection/#findComment-294265 Share on other sites More sharing options...
Asday Posted July 10, 2007 Author Share Posted July 10, 2007 I thihnk this is what you mean: <?php if ($_POST['deletefile']) { //delete file here header("Location: ".$_SERVER['PHP_SELF']); exit; } ?> Once the file is deleted the page refreshes itself removing the "del" part from the URL. That was what I needed, thanks. Link to comment https://forums.phpfreaks.com/topic/59240-solved-instant-redirection/#findComment-294332 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.