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
    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>
        '; }

  2. #2
    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.

  3. #3
    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>
        '; }

  4. #4
    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>';

  5. #5
    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.

  6. #6
    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>';
    
    
    }

  7. #7
    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_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>';
    
    
    }


    Good.

    Code:
    Enter Your Password: <input name = "password" type="text">
    No space needed before and after =

    Code:
    Enter Your Password: <input name="password" type="text">
    This will be better. If you change type="text" to type="password", it will show * when you type a character.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

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
  •