Jump to content

LiamProductions

Members
  • Posts

    496
  • Joined

  • Last visited

    Never

Posts posted by LiamProductions

  1. I've redone it now...

     

    Name.php

     

    <html>
    <head>
    <title>My PHP Program!</title>
    </head>
    <body>
    <center>
    <?php
    
    if (empty($userName)){
      print <<<HERE
      <form>
      Please enter your name: <br >
      <input type = "text"
             name = "userName"><br><br />
      <input type = "submit" >
      </form>
    HERE;
    
    } else {
      print "<h3>Hi there, $userName!</h3>";
    } //end
    
    if ($userName == Liam){
      print "<h1>Your amazing!</h1>";
    
    } // end if
    
    if ($userName == Andy){
      print "<h1>The name andy is ok!</h1>";
    
    } // end if
    
    if ($userName == Jack){
      print "<h1>Jack thank you for using this</h1>";
    
    
    } // end if
    
    if ($userName == Gav){
      print "<h1>Nice Name. <br /></h1><br />$gavImg";
    
    } // end if
    
    
    ?>
    
    </center>
    <br />
    <br />
    
                        
    <br>
    
    </form>
    </body>
    </html>
    

  2. Thorpe, I tried your code. But even when i put Liam, Andy or Jack in, it still comes up with You've got a nice name... I want to stop that when using one of the 3 names but if you don't it will come up...

  3. Hey.

     

    I need PHP help.

     

    Heres the code:

    <html>
    <head>
    <title>Hi User</title>
    </head>
    <body>
    <h1>Little Story maker</h1>
    
    
    <?
    
      print "<h3>$userName was walking down the street when someone asked him if he wanted to $hobbie he accepted the invite.</h3>";
    
    if ($userName == Liam){
      print "<h1>Your amazing!</h1>";
    
    } // end if
    
    if ($userName == Andy){
      print "<h1>The name andy is ok!</h1>";
    
    } // end if
    
    if ($userName == Jack){
      print "<h1>OMG! YOUR NAME IS JACK! I KNOW SOMEONE CALLED JACK</h1>";
    
    
    } // end if
    
    
    ?>
    
    
    
    </body>
    </html>
    

     

    If your name is'nt any of the 3 how can i make it say

     

    "You've got a nice name" 

     

    ? Thanks

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.