html - php submit returning source code? -


i having issue after pressing submit, taken page source code rather getting logged in expected.

can tell me issue great, i'm confused want working local page in stages of development new world of coding trying learn.

source of index.html:

<?php  session_start(); echo 'connected successfully'; mysql_close($link);  if ($_post['username']) {  $dbusername = "james"; $dbpassword = ""; $uid = "1111";  $username = strip_tags($_post["username"]); $paswd = strip_tags ($_post["password"]);  if (username == $dbusername && $paswd == $dbpassword){     $_session['username'] = $username;     $_session['id'] = $uid;      header("location: index.html");  } else {     echo "username , password not registered"; } }   ?> <!doctype html> <html lang="en"> <head> <title>rank landlord</title> <meta charset="utf-8" />  <link rel="stylesheet" href="style.css" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">  </head>  <body class="body">  <header class="mainheader">     <div id="wrapper">     <br /> <form id="form" action="index.php" method="post" enctype="multipart/form-     data"> username: <input type="text" name="username" />  password: <input type="password" name="password" />  <input type="submit" value="login" name="submit" /><br /><br /> </form> </div>     <nav><ul>         <li class="active"><a href="#">home</a></li>         <li><a href="xxx.html">xxx</a></li>         <li><a href="xxxx.html">xxxx</a></li>         <li><a href="xxxxxxx.html">xxxxxxt</a></li>         <li><a href="registration.html">registration</a></li>         <li><a href="detailed.html">xx</a></li>     </ul></nav> </header>  <div class="maincontent">     <div class="content">                <article class="topcontent">                     <header>                     <h2><a href="#" rel="bookmark" title="permalink   post title">who we?</a></h2>                 </header>                  <footer>                     <p class="xxxxxxxxx xxxxxxxxxxx</p>                 </footer>                  <content>                             <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>                            <p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>                 </content>              </article>              <article class="bottomcontent">                  <header>                     <h2><a href="#" rel="bookmark" title="permalink           post title">registration</a></h2>                 </header>                      <footer>                         <p class="post-info">register free user using social media</p>                 </footer>                  <content>                     <p>social media logos go here, links</p>                 </content>              </article>          </div>              <aside class="top-sidebar">                 <article>                 <h2>quick search</h2>                 <p></p>                 <div id="bottomcontent">      <form class="searchform cf">  <input type="text" placeholder="find landlord rank!">  <button type="submit">search</button>   <p> </p>  </form>  </div>                 </article>             </aside>              <aside class="middle-sidebar">                 <article>                 <h2>area search</h2>                 <p>                 <form class="searchform cf">   <input type="text" placeholder="postcode..."></p>                 <p>                      <form class="searchform cf">   <input type="text" placeholder="city..."></p>                 <p>                  <form class="searchform cf">   <input type="text" placeholder="county..."></p>                 <p><form action="">                 <select name="within...">                 <option value="01">0-1 miles</option>                 <option value="25">2-5 miles</option>                 <option value="5-10">5-10 miles</option>                 <option value="10plus">10+ miles</option>    </select>                  <p>  <button type="submit">search</button> </p>                 </article>              </aside>                   </form></p>     </div>      <footer class="mainfooter">       </footer>      </body>  </html> 

change filename index.html index.php otherwise won't parsed , executed php.

also ensure executing file webserver php installed.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -