Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-23-2004, 11:35 PM php redirection
samson's Avatar
Registered User

Posts: 107
Location: Victoria, BC
Trades: 0
I got code that needs a page to get redirected. Its a self submitting form. Is there any way to redirect without using header, since after the form is processed, headers will already have been sent

thx.
samson is offline
Reply With Quote
View Public Profile Visit samson's homepage!
 
 
Register now for full access!
Old 08-23-2004, 11:43 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
If you don't want to send a header, then you'll have to use Javascript and/or meta-refresh. Best to use both incase someone doesn't support one or the other.

HTML Code:
<html>
<head>
    <meta http-equiv="refresh" content="4;http://www.newpage.com/">
    <script language="javascript">
        setTimeout("window.location='http://www.newpage.com/'", 4000);
    </script>
</head>
<body>
<div style="text-align:center; font: bold 12pt Arial, sans-seirf;">Redirecting...</div>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 08-24-2004, 03:53 AM
johanesw's Avatar
Extreme Talker

Posts: 174
Location: If I told you that, I'm afraid I'd have to kill you!
Trades: 0
or if you have to use php code, just echo it:

PHP Code:
<?php
if($something == "whatever"){
     
    echo 
'<script language="javascript">
                  document.location = \'bahbahbah\';
            </script>
            <meta http-equiv="refresh" content="0;url=bahbahbah">
            '
;
}

else{
 
//do something
}
?>
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Last edited by johanesw; 08-24-2004 at 03:56 AM..
johanesw is offline
Reply With Quote
View Public Profile Visit johanesw's homepage!
 
Old 08-24-2004, 04:42 AM Hi read it
we4tech's Avatar
Junior Talker

Posts: 2
Trades: 0
U java script is better to redirect a page instread of PHP header

but u should keep mind

HTML Code:
<script>
document.location=""; //is not good way
//use
location="ur page";
</script>

I have tested in all platform that this document.location has some problem
but use only location it works fine

thank

Hasan
http://we4tech.com
we4tech is offline
Reply With Quote
View Public Profile
 
Old 08-24-2004, 04:57 PM
samson's Avatar
Registered User

Posts: 107
Location: Victoria, BC
Trades: 0
thanks guys
samson is offline
Reply With Quote
View Public Profile Visit samson's homepage!
 
Old 08-24-2004, 05:02 PM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
tsk. document.location wouldn't be a good way - you need window.location.href
Tsk! I say again...
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Reply     « Reply to php redirection
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16778 seconds with 12 queries