ommedia Posted December 30, 2006 Share Posted December 30, 2006 without using a form, button, or anything to click, how do I send a user to another page.in coldfusion I would simply say <cflocation url = "whatever.cfm">for the life of me, I can't find a similar tag in PHP. generally, all my form results post to itself, but in this case I want to take the user to another page after processing, given a specific scenario. Link to comment https://forums.phpfreaks.com/topic/32328-how-do-i-direct-a-user-to-a-new-page-after-a-process-is-finished/ Share on other sites More sharing options...
dbo Posted December 30, 2006 Share Posted December 30, 2006 header("Location: http://www.google.com");or header("Location: index.php"); Link to comment https://forums.phpfreaks.com/topic/32328-how-do-i-direct-a-user-to-a-new-page-after-a-process-is-finished/#findComment-150121 Share on other sites More sharing options...
ommedia Posted December 30, 2006 Author Share Posted December 30, 2006 Yea, well, I was looking at that command and it seems to me....or at least how I read about it, that it's for redirecting before any header information is read or passed. Meaning, very first thing. My situation may be deep into some code.this is what I am using now, but this seems like a cheap way of doing it:So I tried it and it didn't like the header tag at all that deep in the code. Other ideas??<?php ...if ($testfail){echo("<script>window.location.href = 'secondary_application.php'; </script>"); }?> Link to comment https://forums.phpfreaks.com/topic/32328-how-do-i-direct-a-user-to-a-new-page-after-a-process-is-finished/#findComment-150122 Share on other sites More sharing options...
dbo Posted December 30, 2006 Share Posted December 30, 2006 That is correct you can't call it after header information is sent, would hae to use javascript which is sort of iffy.Can you describe the process stuff that you're running and how and where you are wanting to do the redirect? Is there another way to approach it? Link to comment https://forums.phpfreaks.com/topic/32328-how-do-i-direct-a-user-to-a-new-page-after-a-process-is-finished/#findComment-150123 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.