Page 1 of 1

redirect

Posted: Sun Nov 14, 2004 1:23 pm
by alliance
Hello,

I'm trying to redirect the browser after executing a task

I need the redirect to be as follow:

1. header... location $URL1 (open in a new window)
2. header... location $URL2 (open in current window)

with the $URL2 I don't have any problem, but the first to be opened in a new window give me some work.. Can anyone help ?

I may also use anyohter function if any is more suitable for this task.

Thanks

Samuel

Posted: Sun Nov 14, 2004 1:52 pm
by patrikG
have you considered looking in the PHP Manual? Or using the search function of this forum?

Posted: Sun Nov 14, 2004 2:43 pm
by alliance
yes, php.net no info about header into a new window and searches more than only this forum

Posted: Sun Nov 14, 2004 3:42 pm
by Ambush Commander
Since your handling browser elements, you may need to use JavaScript for this one. Can't help you here.

Posted: Mon Nov 15, 2004 2:54 am
by patrikG
use Javascripts

Code: Select all

document.myForm.target="_blank";
Note that a form can only be submitted once. You can pass the form-values to other functions via $_POST, $_GET or $_REQUEST.

Posted: Wed Nov 17, 2004 1:44 pm
by alliance
Thanks PatrikG,

As I can't return a form, destination URL may reject it here is what I used, hope this may help other too.

To open the $URL1 in a new window

Code: Select all

window.open('<?echo $URL1?>);
And to refresh the base window with $URL2, i use a meta tag refresh, as when testing with header function, I get an error message, header already sent (in the new window !)

A bit difficult but it's work.