Uhh so who's right? Calon or Source?
No use
header("location:http://google.com");
capitals don't go well in coding IMO unless its camelcase. Like fucntion
superCoolFunction
But its personal preference, I'm just fussy and been awkward.
Last edited by Source; 02-01-2009 at 05:29 PM.
Its nothing too complex
You can do anything you want above the header thats not an output to a browser. This means no other headers, echoing things out etc...PHP Code:
$var = "ANYTHING YOU WANT";
header("location{$var}");
Mhmm i believe its LocationI've always used...
But this thread gave me second thoughts so i read the bible...PHP Code:<?php
header ("Location: http://google.com/");
?>
http://uk2.php.net/header
its Location
Correct amondo
(Y) I don't see why you all need to give the guy 50 answers, one is good enough and there both right!
I never indent in browsers, because when I use Tab it leaves the textbox. Already explained from other threadsWelcome to the world of indentation calon, ref strings/variables I always think its better to use "" on strings with more than a single word etc, I may be mis-informed. Location though, does not have a capitol L and looks extremly messy.PHP Code:<?php
echo "Single quotes are normally for 1 word strings";
header( "location:http://blah.com/" );
//the above won't work
header( "location:http://www.ggg.com/" );
echo "Single quotes are normally for 1 word strings";
// won't work as the page is terminated after the headers are sent
// you can however do it this way
if( $variable !== NULL ) {
echo "somethingbing";
} else {
header( "location:http://www.ggg.com/" );
}
?>, I usually indent like this: http://forum.sa-mp.com/index.php?topic=61893.0
We're both right, location:url or Location: url works too. location:url is just a messier way and Source explained it better.Uhh so who's right? Calon or Source?
Last edited by Calon; 09-01-2009 at 09:28 AM.
Want to hide these adverts? Register an account for free!