|
|
|
|
![]() ![]() |
Oct 15 2004, 12:46 AM
Post
#1
|
|
|
Core2Q-QX6800 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 1,093 Joined: 3-August 04 From: Nigeria Member No.: 569 |
Ok .... I have this log-in form on my HomePage. It was designed with PHP scripting, but it aint working. It simply doesnt respond to your log-in command.
Can someone please help me with the exact code to make it work? Here is the code for the log-in form... QUOTE <TD align=middle colSpan=2 style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"> <font face="System" size="2">Forum Log-in</font></TD></TR> <TR> <TD align=right width="45%" style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"><SPAN class=gen><font face="Tahoma" size="2" color="#000000"> Username:</font></SPAN></TD> <TD style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"> <INPUT maxLength=40 size=20 name=username style="text-indent: 2px; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; font-family: Arial, Helvetica, sans-serif; color: #1a2640; border-color: #ffffff"> </TD></TR> <TR> <TD align=right style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"><SPAN class=gen> <font size="2" face="Tahoma" color="#000000">Password:</font></SPAN></TD> <TD style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"> <INPUT type=password maxLength=32 size=20 name=password style="text-indent: 2px; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; font-family: Arial, Helvetica, sans-serif; color: #1a2640; border-color: #ffffff"> </TD></TR> <TR align=middle> <TD colSpan=2 style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF"><SPAN class=gen> <font color="#000000" size="2" face="Tahoma">Auto-Log me on each visit:</font><font color="#000000"> <INPUT type=checkbox name=autologin value="ON" style="text-indent: 2px; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; font-family: Arial, Helvetica, sans-serif; border-color: #ffffff"></font></SPAN></TD></TR> <TR align=middle> <TD colSpan=2 style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"> <INPUT class=mainoption type=submit value="Log in" name=login style="font-family: Tahoma; font-size: 10pt"></TD></TR> <TR align=middle> <TD colSpan=2 style="font-family: Arial, Helvetica, sans-serif" bgcolor="#CCCCCC"><SPAN class=gensmall><A class=gensmall href="http://www.odowebdesigns.uni.cc/forums/profile.php?mode=sendpassword"> <font color="#003C5E" face="Tahoma"><u>I forgot my password</u></font></A></SPAN></TD> If there is a way you can help me make that work, I will be most grateful to you. Or alternatively, if you know about any other php log-in scripting that can log-in into a forum and how to make that work, I will gladly accept it. Thanks in advance. I am anxiously waiting for your replies. |
|
|
|
Oct 15 2004, 07:41 AM
Post
#2
|
|
|
Unknown Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 90 Joined: 27-September 04 From: this f**king world Member No.: 1,293 |
Wher is <FORM> TAG ???
Your INPUT TAGs should be in <FORM> TAG : CODE <FORM method="POST" action="<? echo $_SERVER['PHP_SELF']; ?>"> If you want to process in the current file. or CODE <FORM method="POST" action="http://www.odowebdesigns.uni.cc/forums/login.php"> If you want it on another file like "login.php" You can get the values with: CODE $_POST['name']);
|
|
|
|
Oct 15 2004, 07:49 AM
Post
#3
|
|
|
Unknown Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 90 Joined: 27-September 04 From: this f**king world Member No.: 1,293 |
|
|
|
|
Oct 15 2004, 11:30 PM
Post
#4
|
|
|
Core2Q-QX6800 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 1,093 Joined: 3-August 04 From: Nigeria Member No.: 569 |
QUOTE(rowita @ Oct 15 2004, 07:49 AM) Here is complete tutorials : http://clan-forge.net/viewtut.php?tutid=52 http://www.acecoolco.com/media_tutorialshow.php?id=50 http://www.devdreams.com/phptutorials_securelogin.php http://webmonkey.wired.com/webmonkey/00/05...?tw=programming Thanks for the links rowita. I will try and see whether i can do every other thing myself. If i get stuck, i will holla back in this thread. Thanks once again. |
|
|
|
Oct 23 2004, 05:03 AM
Post
#5
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 75 Joined: 20-October 04 Member No.: 1,847 |
This codee will help...it work.
CODE <?php //You must INCLUDE file config.php , in config.php user and pass @include('config.php'); //Administration Panel session_start(); //Username and pass $_Username = "$adminusername"; $_Password = "$adminpass"; // If the form was submitted if ($_POST['Submitted'] == "True") { // If the username and password match up, then continue... if ($_POST['Username'] == $_Username && $_POST['Password'] == $_Password) { // Username and password matched, set them as logged in and set the // Username to a session variable. $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_Username; } } // If they are NOT logged in then show the form to login... if ($_SESSION['Logged_In'] != "True") { echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> Username: <input type=\"textbox\" name=\"Username\"><br /> Password: <input type=\"textbox\" name=\"Password\"><br /> <input type=\"hidden\" name=\"Submitted\" value=\"True\"> <br> <input type=\"Submit\" name=\"Submit\" value=\"Go to admin\"> </form>"; } else { echo "You are logged in as: <b>" . $_SESSION['Username'] . "</b> <br /><a href=\"" . $_SERVER['PHP_SELF'] . "?mode=logout\">Logout</a><br>"; echo "----------------------------------------------------------------------------------<br>"; //here code of page!! echo "<br>"; echo "<br>"; echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> <input type=\"hidden\" name=\"Submitted\" value=\"True\"> <br> <input type=\"Submit\" name=\"Submit\" value=\"Save\"> </form>"; } // If they want to logout then if ($_GET['mode'] == "logout") { // Start the session session_start(); // Put all the session variables into an array $_SESSION = array(); // and finally remove all the session variables session_destroy(); // Redirect to show results.. echo "<META HTTP-EQUIV=\"refresh\" content=\"1; URL=" . $_SERVER['PHP_SELF'] . "\">"; } ?> |
|
|
|
Oct 27 2004, 02:29 AM
Post
#6
|
|
|
Core2Q-QX6800 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 1,093 Joined: 3-August 04 From: Nigeria Member No.: 569 |
QUOTE(filipc @ Oct 23 2004, 05:03 AM) This codee will help...it work. CODE <?php //You must INCLUDE file config.php , in config.php user and pass @include('config.php'); //Administration Panel session_start(); //Username and pass $_Username = "$adminusername"; $_Password = "$adminpass"; // If the form was submitted if ($_POST['Submitted'] == "True") { // If the username and password match up, then continue... if ($_POST['Username'] == $_Username && $_POST['Password'] == $_Password) { // Username and password matched, set them as logged in and set the // Username to a session variable. $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_Username; } } // If they are NOT logged in then show the form to login... if ($_SESSION['Logged_In'] != "True") { echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> Username: <input type=\"textbox\" name=\"Username\"><br /> Password: <input type=\"textbox\" name=\"Password\"><br /> <input type=\"hidden\" name=\"Submitted\" value=\"True\"> <br> <input type=\"Submit\" name=\"Submit\" value=\"Go to admin\"> </form>"; } else { echo "You are logged in as: <b>" . $_SESSION['Username'] . "</b> <br /><a href=\"" . $_SERVER['PHP_SELF'] . "?mode=logout\">Logout</a><br>"; echo "----------------------------------------------------------------------------------<br>"; //here code of page!! echo "<br>"; echo "<br>"; echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> <input type=\"hidden\" name=\"Submitted\" value=\"True\"> <br> <input type=\"Submit\" name=\"Submit\" value=\"Save\"> </form>"; } // If they want to logout then if ($_GET['mode'] == "logout") { // Start the session session_start(); // Put all the session variables into an array $_SESSION = array(); // and finally remove all the session variables session_destroy(); // Redirect to show results.. echo "<META HTTP-EQUIV=\"refresh\" content=\"1; URL=" . $_SERVER['PHP_SELF'] . "\">"; } ?> Now, i dont reallly know what to do with that code filipc. I dont really know how to make that work. Does anyone have a pre-scripted php log-in form? please help me with it. I will be most grateful to you. Thanks in advance. |
|
|
|
![]() ![]() |
Similar Topics