Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post

    php not reading html code

    I have a heading and a full length sidemenu bar on my HTML page.

    There is a problem with the $usern = filter_input(INPUT_POST, "usern"); it will not register from the html code because the echo does not print. I think it may be due to the <div class = "content" id ="content"> but I need the separate css frames. Could someone show me where I am going wrong?


    Code:
    <div class = "content" id ="content">
            <form name = "myform" action="index.php" method="post">
                <fieldset><left><table><tr><td align = "left"><h2>Username</h2></td></tr>
                <tr><td align = "left"><input type="text" name="usern" value="myuser" size="8"/></td></tr>
                <tr><td align = "left"><h2>Password</h2></td></tr>
                <tr><td align = "left"><input type="text" name="passw" value="mypass" size="8"/></td></tr>
                <tr><td align = "left"><input type = "submit" name = "signin" value="Sign In" /></td></tr>
                <tr><td align="left"><h2>Count</h2></td></tr>
                <tr><td align="left"><input type="text" name="count" value="count#" size="8"/></td></tr></table></left></fieldset>
            </form>
        </div>
    Code:
    <?php
            $usern = filter_input(INPUT_POST, "usern");
            $passw = filter_input(INPUT_POST, "passw");
            $count = filter_input(INPUT_POST, "count");
            echo $usern;
            //php screen is blank.  It does not echo.  It did not reach connection.
            $host = 'localhost';
            $user = 'username1';
            $pass = 'password1';
            $db = 'database1';        
            $link = mysql_connect($host, $user, $pass) or die('Could not connect: ' . mysql_error());
            echo "Connection Made";
            ...    
        ?>
    Last edited by Philosophaie; 02-16-2012 at 10:59 PM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Does the "connection made" message show up?

  • #3
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post
    "Connections Made" is not there. Neither does the error report. My username and password work in other programs.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    What version of PHP are you using?

  • #5
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post
    5.3.8

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Hmm. 5.3.8 is certainly sufficient for filter family functions. Enable your error reporting with:
    PHP Code:
    ini_set('display_errors'1);
    error_reporting(E_ALL); 
    Does that indicate a problem?
    Count itself won't exist since the html for the submit is before the count input.


  •  

    Posting Permissions

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