odomike 0 Report post Posted October 15, 2004 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... <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://forums.xisto.com/no_longer_exists/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. Share this post Link to post Share on other sites
rowita 0 Report post Posted October 15, 2004 Wher is <FORM> TAG ???Your INPUT TAGs should be in <FORM> TAG : <FORM method="POST" action="<? echo $_SERVER['PHP_SELF']; ?>">[/br] If you want to process in the current file.or <FORM method="POST" action="odowebdesigns.uni.cc/forums/login.php; If you want it on another file like "login.php"You can get the values with: $_POST['name']); Share this post Link to post Share on other sites
rowita 0 Report post Posted October 15, 2004 Here is complete tutorials :http://forums.xisto.com/no_longer_exists/http://www.acecoolco.com/media_tutorialshow.php?id=50http://forums.xisto.com/no_longer_exists/https://www.wired.com/?tw=programming Share this post Link to post Share on other sites
odomike 0 Report post Posted October 15, 2004 Here is complete tutorials : http://forums.xisto.com/no_longer_exists/ http://www.acecoolco.com/media_tutorialshow.php?id=50 http://forums.xisto.com/no_longer_exists/ https://www.wired.com/?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. Share this post Link to post Share on other sites
filipc 0 Report post Posted October 23, 2004 This codee will help...it work. [br]<?php [/br]//You must INCLUDE file config.php , in config.php user and pass[br]@include('config.php');[/br]//Administration Panel[br]session_start(); [br][/br]//Username and pass[/br]$_Username = "$adminusername"; [br]$_Password = "$adminpass"; [br][/br]// If the form was submitted [/br]if ($_POST['Submitted'] == "True") { [br][/br] // If the username and password match up, then continue... [br] if ($_POST['Username'] == $_Username && $_POST['Password'] == $_Password) { [br][/br] // Username and password matched, set them as logged in and set the [/br] // Username to a session variable. [br] $_SESSION['Logged_In'] = "True"; [/br] $_SESSION['Username'] = $_Username; [br] } [/br]} [br][/br]// If they are NOT logged in then show the form to login... [br]if ($_SESSION['Logged_In'] != "True") { [br][/br] echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> [/br] Username: <input type=\"textbox\" name=\"Username\"><br /> [br] Password: <input type=\"textbox\" name=\"Password\"><br /> [/br] <input type=\"hidden\" name=\"Submitted\" value=\"True\"> [br] <br>[/br] <input type=\"Submit\" name=\"Submit\" value=\"Go to admin\"> [br] </form>"; [/br]} [br]else [/br]{ [br] echo "You are logged in as: <b>" . $_SESSION['Username'] . "</b> [/br] <br /><a href=\"" . $_SERVER['PHP_SELF'] . "?mode=logout\">Logout</a><br>"; [br] echo "----------------------------------------------------------------------------------<br>";[/br] //here code of page!![br] echo "<br>";[/br] echo "<br>";[br] echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> [br][/br][/br] [br] <input type=\"hidden\" name=\"Submitted\" value=\"True\"> [br] <br>[/br] <input type=\"Submit\" name=\"Submit\" value=\"Save\"> [br] </form>"; [/br]} [br][/br]// If they want to logout then [/br]if ($_GET['mode'] == "logout") { [br] // Start the session [/br] session_start(); [br][/br] // Put all the session variables into an array [br] $_SESSION = array(); [br][/br] // and finally remove all the session variables [/br] session_destroy(); [br][/br] // Redirect to show results.. [br] echo "<META HTTP-EQUIV=\"refresh\" content=\"1; URL=" . $_SERVER['PHP_SELF'] . "\">"; [br]} [/br]?> [/br] Share this post Link to post Share on other sites
odomike 0 Report post Posted October 27, 2004 This codee will help...it work. [br]<?php [/br]//You must INCLUDE file config.php , in config.php user and pass[br]@include('config.php');[/br]//Administration Panel[br]session_start(); [br][/br]//Username and pass[/br]$_Username = "$adminusername"; [br]$_Password = "$adminpass"; [br][/br]// If the form was submitted [/br]if ($_POST['Submitted'] == "True") { [br][/br] // If the username and password match up, then continue... [br] if ($_POST['Username'] == $_Username && $_POST['Password'] == $_Password) { [br][/br] // Username and password matched, set them as logged in and set the [/br] // Username to a session variable. [br] $_SESSION['Logged_In'] = "True"; [/br] $_SESSION['Username'] = $_Username; [br] } [/br]} [br][/br]// If they are NOT logged in then show the form to login... [br]if ($_SESSION['Logged_In'] != "True") { [br][/br] echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> [/br] Username: <input type=\"textbox\" name=\"Username\"><br /> [br] Password: <input type=\"textbox\" name=\"Password\"><br /> [/br] <input type=\"hidden\" name=\"Submitted\" value=\"True\"> [br] <br>[/br] <input type=\"Submit\" name=\"Submit\" value=\"Go to admin\"> [br] </form>"; [/br]} [br]else [/br]{ [br] echo "You are logged in as: <b>" . $_SESSION['Username'] . "</b> [/br] <br /><a href=\"" . $_SERVER['PHP_SELF'] . "?mode=logout\">Logout</a><br>"; [br] echo "----------------------------------------------------------------------------------<br>";[/br] //here code of page!![br] echo "<br>";[/br] echo "<br>";[br] echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\"> [br][/br][/br] [br] <input type=\"hidden\" name=\"Submitted\" value=\"True\"> [br] <br>[/br] <input type=\"Submit\" name=\"Submit\" value=\"Save\"> [br] </form>"; [/br]} [br][/br]// If they want to logout then [/br]if ($_GET['mode'] == "logout") { [br] // Start the session [/br] session_start(); [br][/br] // Put all the session variables into an array [br] $_SESSION = array(); [br][/br] // and finally remove all the session variables [/br] session_destroy(); [br][/br] // Redirect to show results.. [br] echo "<META HTTP-EQUIV=\"refresh\" content=\"1; URL=" . $_SERVER['PHP_SELF'] . "\">"; [br]} [/br]?> [/br] 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. Share this post Link to post Share on other sites