Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 40

Thread: Day 7 - Talk To Server - Become PHP Expert in 30 days

  1. #11
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    http://php.flashwebhost.com/sherly/welcome.php

    Code:
    <?php
    
    echo '<h1>Hi, ' .  $_GET['Neenalaisa'] . '! Welcome to our school.</h1>';

  2. #12
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by sherlyk View Post
    http://php.flashwebhost.com/sherly/welcome.php

    Code:
    <?php
    
    echo '<h1>Hi, ' .  $_GET['Neenalaisa'] . '! Welcome to our school.</h1>';

    Why posted this alone ? What happened to HTML page that is part of example ?
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  3. #13
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by stefin View Post
    http://php.flashwebhost.com/stefin/facebook_signin.php

    Code:
    <?php
    
    if (isset($_GET['signin'])) {
    
    echo 'THANK YOU FOR JOINING FACEBOOK';
    
    }
    
    else {
    
    echo '
    
    <html>
    <body>
    
    <h1>Welcome To Facebook</h1>
    
    <h2>Its Free And Always Will Be</h2>
      
    <form action="welcome.php" method="GET">
    
    Enter First Name : <input name="first name" type="text">
    
    </form>
    
    ';}
    
    {
    
    echo '
    
    <form action="welcome.php" method="GET">
    
    Enter Last Name : <input name="last name" type="text">
    
    
    
    </form>
    
    ';}
    
    {
    
    echo '
    
    <form action="welcome.php" method="GET">
    
    Enter Your Email : <input name="email" type="text">
    
    
    </form>
    
    ';}
    
    {
    
    echo '
    
    
    <form action="welcome.php" method="GET">
    
    Re-Enter Your Email : <input name="re-enter email" type="text">
    
    
    
    </form>
    
    ';}
    
    {
    
    echo '
    
    <form action="welcome.php" method="GET">
    
    Enter Your Password : <input name="password" type="text">
    
    
    
    </form>
    
    ';}
    
    {
    
    echo '
    
    <form action="welcome.php" method="GET">
    
    Enter Your Birthday : <input name="birthday" type="text">
    
    <h2><button type="SIGN UP"> SIGN UP </button></h2>
    
    </form>
    
    </body>
    </html>
    
    ';}

    Very nice try, thinking out of the box.

    When you need to use more than one input form, you don't need to repeat

    Code:
    <form
    part multiple times. Only ONE FORM is needed. Here is updated code.

    PHP Code:
    <?php

    if (isset($_GET['submit'])) {
        echo 
    '<h1>THANK YOU FOR JOINING DRAGON CITY.</h1>';
        echo 
    '<br>';
        echo 
    '<p>You submitted following data, please take a print out and keep it safe.</p>';
        echo 
    '<pre>';
        
    print_r($_GET);
        echo 
    '</pre>';
    } else {

        echo 
    '
        <html>
        <body>

        <h1>Welcome To Dragon City.</h1>

        <p>Its Free And Always Will Be</p>

        <form action="" method="GET">

        Enter First Name : <input name="first name" type="text"><br>
        Enter Last Name : <input name="last name" type="text"><br>
        Enter Your Email : <input name="email" type="text"><br>
        Re-Enter Your Email : <input name="re-enter email" type="text"><br>
        Enter Your Password : <input name="password" type="text"><br>
        <button type="submit" name="submit">Play Now!</button>

        </form>

        </body>
        </html>
        '
    ;
    }
    NOTE: button type need to be submit.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  4. #14
    Join Date
    Nov 2004
    Location
    India
    Posts
    65

    Default

    http://php.flashwebhost.com/stefin/facebook_signup.php

    Code:
     <?php
    
    
    if (isset($_GET['submit'])) {
        echo '<h1>THANK YOU FOR JOINING Facebook.</h1>';
        echo '<br>';
        echo '<pre>';
        print_r($_GET);
        echo '</pre>';
    } 
    else {
        echo '
        <html>
        <body>
    
        <h1>Welcome To Facebook.</h1>
    
        <p>Its Free And Always Will Be</p>
    
        <form action="" method="GET
    
        Enter First Name : <input name="first name" type="text"><br>
        Enter Last Name : <input name="last name" type="text"><br>
        Enter Your Email : <input name="email" type="text"><br>
        Re-Enter Your Email : <input name="re-enter email" type="text"><br>
        Enter Your Password : <input name="password" type="text"><br>
        <button type="submit" name="submit"> Submit!</button>
    
        </form>
        </body>
        </html>
        '; }

  5. #15
    Join Date
    Feb 2005
    Location
    India
    Posts
    11,004

    Default PHP GET with Bootstrap Form

    An attempt with bootstrap forms and php GET method

    http://php.flashwebhost.com/melbin/d...dent_data.html

    HTML Code:
    <!DOCTYPE html>
    <html>
      <head>
        <title>STUDENT DATA</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="css/bootstrap.css" />
        <script type="text/javascript" href="js/bootstrap.js"></script>
      </head>
    
      <body>
      <div class="container">
        <div class="row">
          <div class="span6 offset3">
            <h2 style="text-align:center;">Student Data</h2>
          </div>
      </div>
      <hr>
        <div class="row">
          <div class="span6 offset3">
            
            <form class="form-horizontal" method="GET" action="print_progress_report.php">
              <div class="control-group">
                <label class="control-label" for="studentname">STUDENT NAME</label>
                  <div class="controls">
                    <input type="text" id="studentname" name="studentname" placeholder="Enter Student Name">
                  </div>
              </div>
    
              <div class="control-group">
                <label class="control-label" for="std" name="std">STD</label>
                  <div class="controls">
                    <select name="std">
                    <option>SELECT STD</option>
                    <option>STD V</option>
                    <option>STD VI</option>
                    <option>STD VII</option>        
                    <option>STD VIII</option>        
                    <option>STD IX</option>        
                    <option>STD X</option>        
                    </select>
                  </div>
              </div>
    
              <div class="control-group">
                <label class="control-label" for="std">BATCH</label>
                  <div class="controls">
                    <select name="division">
                    <option>SELECT BATCH</option>
                    <option>A</option>
                    <option>B</option>
                    <option>C</option>        
                    <option>D</option>        
                    </select>
                  </div>
              </div>
    
              <div class="control-group">
                  <label class="control-label" for="language1">FIRST LANGUAGE</label>
                  <div class="controls">
                    <input type="text" name="language1" placeholder="Enter Mark between 0 and 100">
                  </div>
              </div>
    
              <div class="control-group">
                  <label class="control-label" for="language2">SECOND LANGUAGE</label>
                  <div class="controls">
                    <input type="text" name="language2" placeholder="Enter Mark between 0 and 100">
                  </div>
              </div>
    
              <div class="control-group">
                  <label class="control-label" for="physics">PHYSICS</label>
                  <div class="controls">
                    <input type="text" name="physics" placeholder="Enter Mark between 0 and 100">
                  </div>
              </div>
    
              <div class="control-group">
                  <label class="control-label" for="chemistry">CHEMISTRY</label>
                  <div class="controls">
                    <input type="text" name="chemistry" placeholder="Enter Mark between 0 and 100">
                  </div>
              </div>
    
              <div class="control-group">              
                  <label class="control-label" for="biology">BIOLOGY</label>
                  <div class="controls">
                    <input type="text" name="biology" placeholder="Enter Mark between 0 and 100">
                  </div>
              </div>
    
              <div class="control-group">              
                  <label class="control-label" for="maths">MATHEMATICS</label>
                  <div class="controls">
                    <input type="text" name="maths" placeholder="Enter Mark between 0 and 100">
                  </div>
              </div>
              
              <div class="form-actions">
                <button type="submit" class="btn btn-primary">Print Progress Report</button>
                <button type="reset" class="btn">Reset All</button>
              </div>
            </form>
          </div><!-- span6 -->
    </div><!-- .row -->
    </body>
    </html>  
    http://php.flashwebhost.com/melbin/d...ess_report.php

    PHP Code:
    <?php

        
    if (isset($_GET['studentname'])) {
            
    $studentname=$_GET['studentname'];
        } else {
        echo 
    'NO NAME';
        } 

        if (isset(
    $_GET['std'])) {
            
    $std=$_GET['std'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['division'])) {
            
    $division=$_GET['division'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['language1'])) {
            
    $language1=$_GET['language1'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['language2'])) {
            
    $language2=$_GET['language2'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['physics'])) {
            
    $physics=$_GET['physics'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['chemistry'])) {
            
    $chemistry=$_GET['chemistry'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['biology'])) {
            
    $biology=$_GET['biology'];
        } else {
        echo 
    'No Data Found';
        } 

        if (isset(
    $_GET['maths'])) {
            
    $maths=$_GET['maths'];
        } else {
        echo 
    'No Data Found';
        }

    $gtotal=$language1+$language2+$physics+$chemistry+$biology+$maths;

    echo 
    '<hr>';
    echo 
    '<b>' strtoupper($studentname) . ' ' $std ' ' $division '</b> <br>';
    echo 
    'FIRST LANGUAGE : ' $language1 '<br>';
    echo 
    'SECOND LANGUAGE : ' $language2 '<br>';
    echo 
    'PHYSICS : ' $physics '<br>';
    echo 
    'CHEMISTRY : ' $chemistry '<br>';
    echo 
    'BIOLOGY : ' $biology '<br>';
    echo 
    'MATHS : ' $maths '<br>';
    echo 
    '<hr>';
    echo 
    '<b> GRAND TOTAL : ' $gtotal '<b><br>';
    echo 
    '<hr>';
    echo 
    '<hr>';
    Last edited by melbin; 05-17-2014 at 07:55 AM. Reason: spelling mistake
    VIDEO WORLD : LATEST HOLLYWOOD || BOLLYWOOD || SOUTH INDIAN VIDEOS || TRAILERS

  6. #16
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    @melbin, good script. Try to make simple scripts, so others can learn few things from it. I am sure sibi can make a better bootstrap page, but that only confuse others, some will even stop learning :)
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  7. #17
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by stefin View Post
    http://php.flashwebhost.com/stefin/facebook_signup.php

    Code:
     <?php
    
    
    if (isset($_GET['submit'])) {
        echo '<h1>THANK YOU FOR JOINING Facebook.</h1>';
        echo '<br>';
        echo '<pre>';
        print_r($_GET);
        echo '</pre>';
    } 
    else {
        echo '
        <html>
        <body>
    
        <h1>Welcome To Facebook.</h1>
    
        <p>Its Free And Always Will Be</p>
    
        <form action="" method="GET
    
        Enter First Name : <input name="first name" type="text"><br>
        Enter Last Name : <input name="last name" type="text"><br>
        Enter Your Email : <input name="email" type="text"><br>
        Re-Enter Your Email : <input name="re-enter email" type="text"><br>
        Enter Your Password : <input name="password" type="text"><br>
        <button type="submit" name="submit"> Submit!</button>
    
        </form>
        </body>
        </html>
        '; }

    Good work on updating facebook signup script.

    Edit:

    Just found a mistake

    Code:
    <form action="" method="GET
    This should be

    Code:
    <form action="" method="GET">
    Anyway browsers are intelligent to auto correct such errors, script works as expected.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  8. #18
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    http://php.flashwebhost.com/sherly/school_website.php

    Code:
    <?php
    
    if (isset($_GET['neenalaisa'])) {
        echo '<h1>Hi, ' . $_GET['neenalaisa'] . '! Welcome to our school web site.</h1>';
    } else {
    
    echo '
    <html>
    <body>
    
    <h1>Welcome to our school web site.</h1>
    
    <p>Please enter you name below and click that button to see our school web site.</p>
    
    <form method="GET" action="school_website.php">
    
         Enter Your Name: <input name="neenalaisa" type="text">
        <button type="submit">Enter School Web Site</button>
    </form>
    
    </body>
    </html>';
    
    }

  9. #19
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    DAY 7 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/day_7_ex_2.html

    Code:
    <html>
    <body>
    
    
    <h1>Welcome to Online Booking Center</h1>
    
    
    <p>Please enter your email id below to book your show.</p>
    
    
    <form method="GET" action="http://www.catchmyseat.com">
        Enter Your Email ID: <input name="email" type="text">
        <button type="submit">Book Now</button>
    </form>
    
    
    </body>
    </html>
    http://php.flashwebhost.com/tom/day_7_ex_2.php

    Code:
    <?php
    
    
    echo '<h1>Hello, ' . $_GET['email'] . ' Wecome to Online Booking Center</h1>';

  10. #20
    Join Date
    Feb 2007
    Posts
    26,214

    Default

    DAY 7 PHP PROGRAMMING

    http://php.flashwebhost.com/tom/day_7_ex_3.php

    Code:
    <?php
    
    
    if (isset($GET['email'])) {
    
    
    echo 'Hello, ' . $_GET['email'] . ' Welcome to Online Booking Center';
    } else {
    
    
    echo'
    
    
    
    
    <html>
    <body>
    
    
    <h1>Welcome to Online Booking Center</h1>
    
    
    <p>Please enter your email id below to book your show.</p>
    
    
    <form method="GET" action="day_7_ex_2.php">
        Enter Your Email ID: <input name="email" type="text">
        <button type="submit">Book Now</button>
    </form>
    
    
    </body>
    </html>';
    
    
    }

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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