Results 1 to 10 of 40

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by image View Post
    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>';

    I think many don't understand the concept. Why we have two files. In above example

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

    Is the PHP file. We need visitors enter their name, so that PHP script know name of visitor and show a personalized page with visitor name.

    The solution here with toms script is to use following URL

    Code:
    http://php.flashwebhost.com/tom/[email protected]
    Now you see

    Hello, [email protected] Wecome to Online Booking Center
    Now can we get our visitors to enter email ? Will visitors know how to get GET method or what is GET method ?

    This is where we need an HTML form page, where we ask user what is his email. Like

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

    In toms code

    Code:
    <form method="GET" action="http://www.catchmyseat.com">
    Action need to be set to our PHP file, that is

    Code:
    <form method="GET" action="day_7_ex_2.php">
    Hope everyone will try to understand this concept, ask others or discuss here if you don't understand, someone will be able to explain it better than me, or i can try again
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  2. #2
    Join Date
    Sep 2003
    Location
    india
    Posts
    11,527

    Default

    http://php.flashwebhost.com/annie/login.php

    Code:
     <?php
    
    if (isset($_GET['login'])) {
        echo '<h1> Login Successful!!</h1>';
        echo '<br>';
        echo '<pre>';
        print_r($_GET);
        echo '</pre>';
    } 
    else {
        echo '
    <html>
        <body>
    
        <h1>Customer Login</h1>
        <p>All the Power. Even more convenience</p>
       <form method="GET" action="login.php">
        Enter Username : <input name="username" type="text"><br>
        Enter Password : <input name="password" type="text"><br>
         <button type="submit" name="login"> LOG IN!</button>
        </form>
        </body>
        </html>
        '; }

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

    Default


    http://php.flashwebhost.com/melbin/php_get_ex_1.php


    PHP Code:
    <?php
      
    if( $_GET["name"] || $_GET["age"] )
      {
         echo 
    "Welcome "strtoupper($_GET['name']) . "<br />";
         echo 
    "You are <b>"$_GET['age']. "</b> years old.";
         exit();
      }
    ?>

    <html>
    <body>
      <br>
      <form action="<?php $_PHP_SELF ?>" method="GET">
      Name: <input type="text" name="name" /><br>
      Age: <input type="text" name="age" /><br>
      <input type="submit" />
      </form>
    </body>
    </html>
    VIDEO WORLD : LATEST HOLLYWOOD || BOLLYWOOD || SOUTH INDIAN VIDEOS || TRAILERS

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
  •