Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Tutorial, lol


    Nubcake
     Share

    Recommended Posts

    <?

    $rand = rand(1,2);

    echo "It is tutorial, lol. The lucky number is: ";

    if ($rand = 1){

    echo "1, lol";

    }else{

    echo "Two!";

    }

    ?>

    Link to comment
    Share on other sites

    • 7 months later...

    also irgendwie check ich das nicht

     

    sieht so aus wie Php aber ist irgendwie nicht ein tutorial sondern ein Codeschnipsel würd ich mal sagen

    Link to comment
    Share on other sites

    • 1 month later...

    Ich hab Ahnung von php wenn ihr das ausgebt kommt nix raus da fehlt die hälfte im Script...

    Link to comment
    Share on other sites

    • 2 months later...

    das script soll ne zahl (1 oder 2) ausgeben....

     

    funzt aber net

    Link to comment
    Share on other sites

    <?php

    This simply start our php script so the webserver knows we are using php now.

     

    $rand

    Thats an simple variable we can declare strings or numbers to.

     

    rand(1,2)

    With this function we generate an random number between 1 and 2 and assign it to the $rand variable.

     

    if($rand == "1")

    We check if the generated number is 1

     

    echo "Wow an 1\n";

    If it is we print the string "Wow an 1". "\n" stands for newline.

     

    else if($rand == "2")

    Or if the generated number is 2

     

    echo "Wow an 2\n";

    We print the string "Wow an 2".

     

    ?>

    We close our php script so webserver knows php script ends here.

     

    Complete Source:

    <?php	 //our php script starts here :)			 
    $rand = rand(1,2);   // we setup the variable $rand and use the function rand to generate a randomnumber between 1 and 2.
    if($rand == "1") echo "Wow an 1\n";  // we check if the variable is 1 and if it is 1 we print it
    else if($rand == "2") echo "Wow an 2\n"; // if it is 2 we print it 
    ?>//we close our php script

     

    So this is what a tutorial should looks like xD

    thats all an simple php script O.o

    Edited by silex
    Link to comment
    Share on other sites

    • 6 months later...

    Thanks silex O.o

     

    That guy is just posting script snippets in hope of making it look like a tutorial xD

     

    BTW he says:

     

    if $rand = 1

     

    that means:

     

    if variable $rand is set to 1, then

     

    it needs to be:

     

    if($rand == 1)

     

    So it always is 1 with his method >.>

    Edited by Mastermind Joe™
    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...