Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

php version of java : self.location.replace("www.url.com"); ??
Hi,

inside html, before <head>, you can put something like this :

<script type="text/javascript">
self.location.replace(www.url.com/newpage.htm);
</script>

which basically instructs the browser to start loading another page asap
(www.url.com/newpage.htm);
This has some limitations, especially when the user has restricted use of
java etc.

Is there a way to do this in PHP ?
like, if there is a link to link.php, this page then starts loading
www.url.com/newpage.htm instead ?



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 01:55 AM


Re: php version of java : self.location.replace("www.url.com"); ??
Thanks for the java vs javascript correction.

What do you mean before any output ?
Do you mean before any html is echoed or printed ?
I mean, I can still do php internal scripting before I call header() ...
right ?




"Oli Filth" <catch@olifilth.co.uk> wrote in message
news:NtIne.5764$Mi4.987@newsfe2-win.ntli.net...
> Peter Van Hove said the following on 02/06/2005 19:36: 
>
> Please note, there is an *enormous* difference between Java and
> Javascript! They are not related in any way. You are talking about
> Javascript.
> 
>
> If you use:
>
> header("Location: http://example.com/blurgh.htm");
>
> before *any* other script output, then this will redirect the user's
> browser. Note that the URL *must* be absolute, i.e. you cannot simply use
> something like /blurgh.htm.
>
>
> --
> Oli



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 01:56 AM


Re: php version of java : self.location.replace("www.url.com"); ??
It work but one more question,
because in the end the user's browser is responsible for loading the new
page, is this guaranteed to work with all browsers ?
Or so some browsers get stuck at this point ?



Report this thread to moderator Post Follow-up to this message
Old Post
Peter Van Hove
06-03-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:43 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.