Re: [PHP] redirection to another page function

2001-04-23 Thread James Holloway

One thing that doesn't seem to have been considered is the use of the
refresh meta tag.  Whilst it depends on whether or not the browser is
archaic (and let's face it, most people nowadays seem to be running at least
version 4 of either IE or Netscape), it's something that can't be turned off
(at least to my knowledge, I could be wrong) and workarounds can be supplied
for instances when the browser doesn't accept the tag.  This doesn't hinder
programming too much, as you don't have to worry about sending output after
headers, nor whether or not the browser has javascript enabled.

Personally, I prefer to use the header() function, and it's ages since I've
used this meta tag, though it's worth keeping in mind that old techniques
can still be useful ;)

META HTTP-EQUIV=Refresh CONTENT=1;url=page.php

James.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Jason Murray

 Is there any PHP native function to redirect to another page or URL?

No, because you can only redirect a browser to another page using the 
appropriate HTTP command (it is a header) or JavaScript.

 I would like that once the user clicks on home.php4 and a few 
 verifications are done, he/she would be redirected to home.html.

You can issue a HTTP redirection command to the web browser by using 
PHP's Header() function. You'll want to use this kind of code:

?
   Header("Location:
http://this.is.the.destination.com/directory/file.php");
?

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Christian Dechery

At 11:22 23/4/2001 +1000, Jason Murray wrote:
  Is there any PHP native function to redirect to another page or URL?

No, because you can only redirect a browser to another page using the
appropriate HTTP command (it is a header) or JavaScript.

  I would like that once the user clicks on home.php4 and a few
  verifications are done, he/she would be redirected to home.html.

You can issue a HTTP redirection command to the web browser by using
PHP's Header() function. You'll want to use this kind of code:

?
Header("Location:
http://this.is.the.destination.com/directory/file.php");
?

I never had any trouble using header() to redirect, but wouldn't something 
like this work even better (without worring about previous outputs)??

function redirect($dest)
{
 ?
 script language="JavaScript"
 parent.location.href='?=$dest?';
 /script
 ?
}

it would work wouldn't it?


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Christian Dechery

At 11:56 23/4/2001 +1000, you wrote:
  I never had any trouble using header() to redirect, but
  wouldn't something like this work even better (without
  worring about previous outputs)??
 
  function redirect($dest)
  {
   ?
   script language="JavaScript"
   parent.location.href='?=$dest?';
   /script
   ?
  }
 
  it would work wouldn't it?

In Netscape:

  Menu  Edit  Preferences  Advanced 
[ ] Enable Javascript
 ^
 Not ticked

Oops. I just broke that redirection. :)

Yeah... I know that... but, c'mon... a browser that doesn't support 
Javascript can't surf trough at least 30% of all websites... it's the 
absolute minority. Netscape itself is a minority.


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Jason Murray

 Yeah... I know that... but, c'mon... a browser that doesn't support 
 Javascript can't surf trough at least 30% of all websites... it's the 
 absolute minority. Netscape itself is a minority.

That's not the point. You should be writing the code such that you 
shouldn't need to make this kind of argument, at least for a simple
HTTP-related issue anyway. JavaScript syntax / functionality perhaps,
HTTP commands no.

Why do with JavaScript what you can do without?

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Chris Aitken

At 11:15 PM 22/04/2001, Christian Dechery wrote:

Yeah... I know that... but, c'mon... a browser that doesn't support 
Javascript can't surf trough at least 30% of all websites... it's the 
absolute minority. Netscape itself is a minority.

While its true Netscape is a minority, and browsers not allowing Javascript 
are an even bigger minority (Bigger Minority. Military Intelligence 
Microsoft Works ?), I think Jasons point was more to show that its best to 
use an option which will work on all environments if possible. Sure, the 
Javascript system will work, but the header() function works better.

Surely its better to write your code trying not to exclude any user if at 
all possible.



Chris




--
   Chris Aitken - Webmaster/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
 

   Unix -- because a computer's a terrible thing to waste!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Christian Dechery

At 12:22 23/4/2001 +1000, Chris Aitken wrote:
At 11:15 PM 22/04/2001, Christian Dechery wrote:

Yeah... I know that... but, c'mon... a browser that doesn't support 
Javascript can't surf trough at least 30% of all websites... it's the 
absolute minority. Netscape itself is a minority.

While its true Netscape is a minority, and browsers not allowing 
Javascript are an even bigger minority (Bigger Minority. Military 
Intelligence Microsoft Works ?), I think Jasons point was more to show 
that its best to use an option which will work on all environments if 
possible. Sure, the Javascript system will work, but the header() function 
works better.

Surely its better to write your code trying not to exclude any user if at 
all possible.

Yeah... I know what you and Jason mean.

I justed pointed out that it could work nicely... and I just tought of 
that... I user header("location: ... ") on all my scripts and struggle to 
put them before any output (that's not easy)...
I work on a e-commerce website (coding in ASP, but what can I do?) with 
lots of JavaScript calls that in some cases are the heart of the operation, 
and we never had any trouble or complaints with it.

I know that, the best way is to get your script running anywhere regardless 
of what browser or OS people use, but is important too to use as much of 
the technology as you can. Like HTML capable clients... in a recent pass, 
that was a nightmare cuz half the people used the most outdated email 
clients, but nowadays, almost every spam or corporate email I get, is HTML, 
people who don't have HTML capable clients, hurry to get them. I won't even 
get started with "noframesYour browser isn't frames capable/noframes", 
hehe. Javascipt is almost a standard and it is a great help in many cases 
where server-side simply won't do the job. I don't know... I'm just 
thinking here... maybe its all BS! :)

. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Jason Murray

 I work on a e-commerce website (coding in ASP, but what can I 
 do?) with lots of JavaScript calls that in some cases are the heart 
 of the operation, and we never had any trouble or complaints with it.

I want your job. 

We have people complain every time we set a cookie. Imagine the
fuss we'd have if we required JavaScript for something. :)

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"What'll Scorpy use wormhole technology for?"
'Faster pizza delivery.'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Christian Dechery

At 12:42 23/4/2001 +1000, you wrote:
  I work on a e-commerce website (coding in ASP, but what can I
  do?) with lots of JavaScript calls that in some cases are the heart
  of the operation, and we never had any trouble or complaints with it.

I want your job.

I don't think u do. :) ASP sux. Win2K sux even worse, I was just working at 
home in huge PHP script that ended up haning the entire system because I 
remotely restarted WIN2K and crappy-old-IIS didn't get back. Can u imagine 
my ears tomorrow? :)) hehehehe


We have people complain every time we set a cookie. Imagine the
fuss we'd have if we required JavaScript for something. :)




. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] redirection to another page function

2001-04-22 Thread Christian Dechery

At 12:48 23/4/2001 +1000, Chris Aitken wrote:
At 11:40 PM 22/04/2001, you wrote:

I justed pointed out that it could work nicely... and I just tought of 
that... I user header("location: ... ") on all my scripts and struggle to 
put them before any output (that's not easy)...
I work on a e-commerce website (coding in ASP, but what can I do?) with 
lots of JavaScript calls that in some cases are the heart of the 
operation, and we never had any trouble or complaints with it.

While I do utilise some javascript niceties in some of my work, I usually 
only do it either when a) its an internal sytsem here at work and I know 
everyone has the same system/software/setup or b) where its only an 
enhancement and it wont affect the usability of the system if its not 
there. Ill always try and use PHP and server side solutions before 
resorting to client side solutions

that's a better way to think about it...

Altough... I still think that URL redirection should be something easier to 
do... as it is something very usefull and very basic, if u think in the 
concepts of WWW and surfing... going from one page to another is almost a 
primitive... u know where I'm getting at?


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] redirection to another page function

2001-04-22 Thread Adam

use the javascript function, but also use as backup plan such as a link at
the bottom or even code at the top like this:
///

if (conditionals == true) {
header(location:home.html);
}

//

that way it will get through for most all browsers if not all browsers



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]