Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: PHP Help

  1. #11
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    Uhh so who's right? Calon or Source?
    Vouches
    [x][x]

  2. #12
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Fazon View Post
    Uhh so who's right? Calon or Source?
    Omgosh just use header("Location: url");

    Jesus christ.

  3. #13
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    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.


    www.fragme.co = a project.

  4. #14
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    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.
    Haha i use capital L

  5. #15
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    I'm not talking about capitalization, I'm talking about specifying a var before header output
    Vouches
    [x][x]

  6. #16
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Its nothing too complex

    PHP Code:

    $var 
    "ANYTHING YOU WANT";

    header("location{$var}"); 
    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...


    www.fragme.co = a project.

  7. #17
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    Its nothing too complex

    PHP Code:

    $var 
    "ANYTHING YOU WANT";

    header("location{$var}"); 
    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...
    More processing power with the var surely?

  8. #18
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    No use

    header("location:http://google.com");
    Mhmm i believe its Location I've always used...
    PHP Code:
    <?php

    header 
    ("Location: http://google.com/"); 
    ?>
    But this thread gave me second thoughts so i read the bible...

    http://uk2.php.net/header

    its Location

    Quote Originally Posted by Jackboy View Post
    Haha i use capital L
    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!


  9. #19
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    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/" );
    }

    ?>
    Welcome 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.
    I never indent in browsers, because when I use Tab it leaves the textbox. Already explained from other threads , I usually indent like this: http://forum.sa-mp.com/index.php?topic=61893.0

    Uhh so who's right? Calon or Source?
    We're both right, location:url or Location: url works too. location:url is just a messier way and Source explained it better.
    Last edited by Calon; 09-01-2009 at 09:28 AM.

  10. #20
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    Okay I get it already

    Someone close this.
    Vouches
    [x][x]

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •