SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: URL Redirection???
-
May 2, 2001, 07:57 #1
- Join Date
- Sep 2000
- Location
- Lahore, Pakistan
- Posts
- 567
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
In ASP, it works like this:
<%
Response.Redirect "/someurl/"
%>
In PHP, i tried this:
<?php
header("Location: /someurl/");
?>
The problem is that in PHP, the URL in browser's address bar never changes but the page does. Any solution???TinyPlanet.org
Discuss and Debate World Events, Politics and Religion.
Interact and Share your Views with People around the Globe.
-
May 2, 2001, 09:34 #2
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try adding the full http:// address of the location not just a relative filename
Please don't PM me with questions.
Use the forums, that is what they are here for.
-
May 2, 2001, 13:06 #3
I don't see that problem at all.
Are you using the PHP file in a frame or something?
My URL changes with either a relative or full URL.
-t
-
May 2, 2001, 18:17 #4
- Join Date
- Sep 2000
- Location
- Lahore, Pakistan
- Posts
- 567
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I am testing my site on Windows (Apache, PHP, MySQL). The relative URL just doesn't seem to work.
Okay I'll explain a bit more:
1. I created a template in Dreamweaver.
2. Each page is created from that template.
3. On the top of each page this statement is placed:
PHP Code:<?php ob_start(); ?>
4. Whenever I have to redirect on any page. I use this:
PHP Code:ob_end_clean();
header("Location: /url/");
exit;
6. This method always works in ASP.TinyPlanet.org
Discuss and Debate World Events, Politics and Religion.
Interact and Share your Views with People around the Globe.
-
May 2, 2001, 18:20 #5
- Join Date
- Sep 2000
- Location
- Lahore, Pakistan
- Posts
- 567
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes, to add something. I DO NOT want to use complete URLs with http://.
TinyPlanet.org
Discuss and Debate World Events, Politics and Religion.
Interact and Share your Views with People around the Globe.
-
May 4, 2001, 00:28 #6
Then use javascript redirect, not sure if this is correct I am not very good in JS
Something like:
<script language="javascript">
window.top.location="/myfile.php";
</script>
Edit: There is also option to use Meta refresh tag:
<meta http-equiv="refresh" content="2;URL=/myfile.php">
2 is number of seconds, you can replace that with 0 or any bigger number.
Good luck!Last edited by moshe_be; May 4, 2001 at 00:30.
-
May 4, 2001, 04:50 #7
- Join Date
- Sep 2000
- Location
- Lahore, Pakistan
- Posts
- 567
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No, I dont want to do it this way. Thanks anyway. I think I'll have to use complete URLs (including http).
TinyPlanet.org
Discuss and Debate World Events, Politics and Religion.
Interact and Share your Views with People around the Globe.
-
May 4, 2001, 14:01 #8
- Join Date
- Apr 2000
- Posts
- 1,483
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Or it might just be a problem with the Windows implementation of PHP that could be solved by uploading to your host - try uploading it and see if that helps.
Bookmarks