coupe-r Posted April 2, 2010 Share Posted April 2, 2010 No, just add this. if(isset($_POST['Submit'])) { $id = $_POST['id']; $password = $_POST['password']; echo $id .' '. $password; } Thats all. Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035747 Share on other sites More sharing options...
yeakyau Posted April 2, 2010 Author Share Posted April 2, 2010 the results is dispaly password ->12345 no display IC: 850905075287 Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035749 Share on other sites More sharing options...
coupe-r Posted April 2, 2010 Share Posted April 2, 2010 <?php if(isset($_POST['Submit'])) { $ic = $_POST['ic']; $password = $_POST['password']; echo $ic .'<br />'. $password; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <p>IC <input type="text" name="ic" id="ic" /> </p> <p>Password <input type="text" name="password" id="password" /> </p> <p> <input type="submit" name="Submit" id="Submit" value="Login" /> </p> </form> </body> </html> This is a basic form, which I just tested. Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035752 Share on other sites More sharing options...
yeakyau Posted April 2, 2010 Author Share Posted April 2, 2010 ok let me try Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035753 Share on other sites More sharing options...
yeakyau Posted April 2, 2010 Author Share Posted April 2, 2010 halo sir i got the answer td width="294"><input name"ic" type="text" id="ic"></td> i didn't put input anme="ic" however after i put still the same using the command to echo out. than i change the ic to userid. now it's work thank you very much~ by the wait u mean what kind of seassion should i put in everpages . Tq Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035762 Share on other sites More sharing options...
coupe-r Posted April 2, 2010 Share Posted April 2, 2010 Well, on a successful login, give that user a session variable. Then, on every page, check the session. if(!isset($_SESSION['id'])) { take them back to the login page } Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035764 Share on other sites More sharing options...
yeakyau Posted April 2, 2010 Author Share Posted April 2, 2010 oic~ is there anyways to pull out users information into the pages once they login will diplsay the detail. Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035769 Share on other sites More sharing options...
coupe-r Posted April 2, 2010 Share Posted April 2, 2010 Yes, do it right when they log in. instead of just pulling their username and password, pull everything and assign it to session vars. Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035771 Share on other sites More sharing options...
yeakyau Posted April 2, 2010 Author Share Posted April 2, 2010 helo sir u still there? i got one more problem <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <!-- #BeginTemplate "../master.dwt" --> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <!-- #BeginEditable "doctitle" --> <title></title> <!-- #EndEditable --> <link href="../styles/style1.css" media="screen" rel="stylesheet" title="CSS" type="text/css" /> </head> <body> <!-- Begin Container --> <div id="container"> <!-- Begin Masthead --> <div id="masthead"> <h1>WELCOME TO IICP ALUMNI WEB PORTAL~</h1> <h3>BY: IICP MEMBERS</h3> </div> <!-- End Masthead --> <!-- Begin Navigation --> <div id="navigation"> <ul> <li><a href="../../index.php">Home</a></li> <li><a href="http://www.alumni-inti.co.cc/register.php">Register</a></li> <li><a href="http://www.alumni-inti.co.cc/news.php">News/Notice Board</a></li> <li><a href="http://www.alumni-inti.co.cc/jobseeker.php">JobSeeker</a></li> <li><a href="../photo_gallery/default.html">Photo Gallery</a></li> <li><a href="../information_links/default.html">Links</a></li> <li><a href="../faq/default.html">Forum</a></li> <li><a href="http://www.alumni-inti.co.cc/contact.php">Contact</a></li> </ul> </div> <!-- End Navigation --> <!-- Begin Content --> <div id="content"> <!-- #BeginEditable "content" --> <?php include("config.php"); $result= mysql_query("SELECT*FROM news ORDER BY newsid DESC",$connect); //lets make a loop and get all news from the database while($myrow = mysql_fetch_assoc(results)) { echo "<b>Title:"; echo $myrow['title']; echo "</b><br><On: <i>"; echo $myrow['dtime']; echo "</li><hr align=left width=160>"; echo $myrow['text1']; echo "<br><a href=\"read_more.php?newsid=$myrow[newsid]\">Read More...</a> } <title>News</title> <h2>News</h2> <p>INTI'S OPEN DAY</p> <p>World-Class Higher Education As one of the pioneers in the Malaysian higher education sector, the INTI Education Group has carved a niche based on its quality programmes, global alliances, commitment to excellence and uncompromising academic standards. Every INTI student has benefited from the Group's expansion and commitment to globalisation and today, there are some 55,000 alumni from Malaysia and 50 other countries across the globe, all proudly waving the INTI flag. </p> <table width="400" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><strong>Comment Book </strong></td> </tr> </table> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form id="form1" name="form1" method="post" action="addguestbook.php"> <td> <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td width="117">Name</td> <td width="14">:</td> <td width="357"><input name="name" type="text" id="name" size="40" /></td> </tr> <tr> <td>Email</td> <td>:</td> <td><input name="email" type="text" id="email" size="40" /></td> </tr> <tr> <td valign="top">Comment</td> <td valign="top">:</td> <td><textarea name="comment" cols="40" rows="3" id="comment"></textarea></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Submit" /> <input type="reset" name="Submit2" value="Reset" /></td> </tr> </table> </td> </form> </tr> </table> <table width="400" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><strong><a href="commentbook.php">Comment BOOK</a> </strong></td> </tr> </table> <h3>Notice BOard</h3> <ul> <li><span class="style_bold">Malacca TripS~ Pls Contact: Doblue A Phone:0125555235</span><br /> <span class="style_italic">Visit INTEL FactorY~</span><br /> </li> <li><span class="style_bold">Beach Party</span><br /> <span class="style_italic">LOCATE AT Batu Ferringi</span><br /> </li> <li><span class="style_bold">Last years Event.. INTI NITE~</span><br /> <span class="style_italic">INternational NITE~</span><br /> C\</li> </ul> ?> <!-- #EndEditable "content" --></div> <!-- End Content --> <!-- Begin Footer --> <div id="footer"> <p><a href="../../index.php">Home</a> | <a href="http://www.alumni-inti.co.cc/register.php">Register</a> | <a href="http://www.alumni-inti.co.cc.news.php">News/Notice Board</a> | <a href="http://www.alumni-inti.co.cc/jobseeker.php"> JobSeeker</a> | <a href="../photo_gallery/default.html">Photo Gallery</a> | <a href="../information_links/default.html">Links</a> | <a href="/default.html">FAQ</a> | <a href="../contact/default.html">Contact</a></p> </div> <!-- End Footer --></div> <!-- End Container --> </body> <!-- #EndTemplate --> </html> after i adding a php code inside this web , it getting errors >.< if remove no erros may i knw why Quote Link to comment https://forums.phpfreaks.com/topic/197323-cant-login-got-problem-with-the-code-help/page/2/#findComment-1035778 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.