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
    Feb 2005
    Location
    India
    Posts
    11,004

    Default

    Quote Originally Posted by Austinwhite View Post
    http://php.flashwebhost.com/austin/day7.php

    I need help with this code!!!
    mine not working properly
    There is s a spelling mistake in the following line.

    HTML Code:
    Enter you name : <input n="name" type="text"> // input tag is 'name', not 'n'
    Change it to

    HTML Code:
    Enter you name : <input name="name" type="text">
    See the corrected script below.

    PHP Code:
    <?php
        
    if (isset ($_GET['name']) ) {
            echo 
    'i got the name';
            echo 
    'Hi ' $_GET['name'] . ' Whats up buddy!';
    }

    else {

        echo
    '
        <html>
        <body>
        <p> welcome to my website! </P>'
    ;

        echo 
    'Whats you name?';

        echo 
    '<form method="GET" action="day7.php">
         Enter you name : <input name="name" type="text">
         <button type="submit">Go</botton>
         </form>
        </body>
        </html>'
    ;
    }
    Last edited by melbin; 05-19-2014 at 09:23 AM. Reason: spelling mistake
    VIDEO WORLD : LATEST HOLLYWOOD || BOLLYWOOD || SOUTH INDIAN VIDEOS || TRAILERS

  2. #2
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    Why? .....is not working

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

    Code:
    <?php
    
    if (isset($_GET['submit'])) {
        echo '<h1>Blog Login Success!!</h1>';
        echo '<br>';
        echo '<pre>';
        print_r($_GET);
        echo '</pre>';
    } 
    else {
        echo '
    <html>
        <body>
    
        <h1>Visit Our Blog</h1>
        <p>Marriage Counseling -  Advice and Tip</p>
       <form method="GET" action="blogloginsubmit.php">
        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>
        Enter Your Password : <input name="password" type="text"><br>
         <button type="submit" name="login"> submit!</button>
        </form>
        </body>
        </html>
        '; }

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

    Default

    Quote Originally Posted by sherlyk View Post
    Why? .....is not working

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

    Code:
    <?php
    
    if (isset($_GET['submit'])) {
        echo '<h1>Blog Login Success!!</h1>';
        echo '<br>';
        echo '<pre>';
        print_r($_GET);
        echo '</pre>';
    } 
    else {
        echo '
    <html>
        <body>
    
        <h1>Visit Our Blog</h1>
        <p>Marriage Counseling -  Advice and Tip</p>
       <form method="GET" action="blogloginsubmit.php">
        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>
        Enter Your Password : <input name="password" type="text"><br>
         <button type="submit" name="login"> submit!</button>
        </form>
        </body>
        </html>
        '; }
    We are checking is a something with name "submit" is passed to PHP script.

    None of our input element have name "submit", to fix.

    find

    Code:
    <button type="submit" name="login"> submit!</button>
    Replace with

    Code:
    <button type="submit" name="submit">Some Nice Button Text Here</button>
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  4. #4
    Join Date
    Nov 2009
    Posts
    76,596

    Default

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

    Code:
    <?php
    
    if (isset($_GET['submit'])) {
        echo '<h1>Blog Login Success!!</h1>';
        echo '<br>';
        echo '<pre>';
        print_r($_GET);
        echo '</pre>';
    } 
    else {
        echo '
    <html>
        <body>
    
        <h1>Visit Our Blog</h1>
        <p>Marriage Counseling -  Advice and Tip</p>
       <form method="GET" action="blogloginsubmit.php">
        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>
        Enter Your Password : <input name="password" type="text"><br>
         <button type="submit" name="submit"> submit!</button>
        </form>
        </body>
        </html>
        '; }

  5. #5
    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 you name below and click that button to see Online Booking Center.</p>
    
    
    <form method="GET" action="day_7_ex_2.php">
    
    
    Enter Your Name: <input name= "full_name" type="text">
    
    
    <button type="Submit">Enter Your Name</button>
    
    
    </form>
    
    
    </body>
    </html>
    http://php.flashwebhost.com/tom/day_7_ex_2.php

    Code:
    <?php
    
    
    echo '<h1>Hello '. $_GET['full_name'] . ' ! Welcome to Online Booking Center </h1>';

  6. #6
    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 you name below and click that button to see Online Booking Center.</p>
    
    
    <form method="GET" action="day_7_ex_2.php">
    
    
    Enter Your Name: <input name= "full_name" type="text">
    
    
    <button type="Submit">Enter Your Name</button>
    
    
    </form>
    
    
    </body>
    </html>
    http://php.flashwebhost.com/tom/day_7_ex_2.php

    Code:
    <?php
    
    
    echo '<h1>Hello '. $_GET['full_name'] . ' ! Welcome to Online Booking Center </h1>';

    Good, working properly.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  7. #7
    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 '<h1>Hello ' . $_GET['email'] . '! Welcome to Webmail</h1>' ;
    
    
    echo '<pre>';
    
    
    print_r($_GET);
    
    
    echo '</pre>';
    
    
    } else {
    
    
    echo'
    
    
    <html>
    
    
    <body>
    
    
    <h1>Welcome to Webmail</h1>
    
    
    <p>Please enter your email id and password below</p>
    
    
    <form method="GET" action = "day_7_ex_3.php">
    
    
    Enter Your Email: <input name = "email" type="text"><br>
    
    
    Enter Your Password: <input name = "password" type="text">
    
    
    <button type="Submit">Enter</button>
    
    
    </form>
    
    
    </body>
    </html>';
    
    
    }

  8. #8
    Join Date
    May 2014
    Posts
    21

    Default

    Ohh... i thought name too is a variable.
    like the name was a temp variable for input and then it is stored to another variable.

    Got the mistake. thx
    Last edited by Austinwhite; 05-19-2014 at 10:16 AM.

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
  •