Jump to content

how do I direct a user to a new page after a process is finished


ommedia

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.