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. Quote Link to comment 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"); Quote Link to comment 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>"); }?> Quote Link to comment 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? 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.