|
|
|
|
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED]
Posts: 1,093 Joined: 3-August 04 From: Nigeria Member No.: 569 |
Post
#1
Oct 15 2004, 12:46 AM
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. |
![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 90 Joined: 27-September 04 From: this f**king world Member No.: 1,293 |
Post
#2
Oct 15 2004, 07:41 AM
Wher is <FORM> TAG ??? Your INPUT TAGs should be in <FORM> TAG : CODE <FORM method="POST" action="<? echo $_SERVER['PHP_SELF']; ?>">[/br] If you want to process in the current file. or[br] CODE <FORM method="POST" action="http://www.odowebdesigns.uni.cc/forums/login.php">[/br] [br]If you want it on another file like "login.php"You can get the values with: CODE $_POST['name']);
|
![]() ![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 90 Joined: 27-September 04 From: this f**king world Member No.: 1,293 |
Post
#3
Oct 15 2004, 07:49 AM
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED]
Posts: 1,093 Joined: 3-August 04 From: Nigeria Member No.: 569 |
Post
#4
Oct 15 2004, 11:30 PM
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. |
![]() ![]() ![]() ![]() ![]() Group: Members
Posts: 75 Joined: 20-October 04 Member No.: 1,847 |
Post
#5
Oct 23 2004, 05:03 AM
This codee will help...it work. CODE [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]
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED]
Posts: 1,093 Joined: 3-August 04 From: Nigeria Member No.: 569 |
Post
#6
Oct 27 2004, 02:29 AM
QUOTE (filipc @ Oct 23 2004, 05:03 AM) This codee will help...it work. CODE [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. |
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
6 | LuciferStar | 11,475 | 7th November 2004 - 12:40 PM Last post by: eldeo |
|||
![]() |
6 | wild20 | 1,432 | 8th June 2006 - 10:04 PM Last post by: wild20 |
|||
![]() |
7 | cragllo | 5,559 | 14th December 2004 - 01:51 AM Last post by: khmerneed |
|||
![]() |
0 | thablkpanda | 4,947 | 7th December 2004 - 01:25 AM Last post by: thablkpanda |
|||
![]() |
2 | s243a | 3,568 | 8th December 2004 - 03:24 AM Last post by: thablkpanda |
|||
![]() |
2 | FaLgoR | 4,122 | 4th January 2005 - 06:30 PM Last post by: FaLgoR |
|||
![]() |
1 | kkrizka | 1,405 | 21st September 2007 - 07:21 PM Last post by: delivi |
|||
![]() |
12 | Neutrality | 5,793 | 31st August 2006 - 10:49 AM Last post by: goldrain |
|||
![]() |
0 | RGPHNX | 3,878 | 27th February 2005 - 08:38 PM Last post by: RGPHNX |
|||
![]() |
0 | nancmu | 3,509 | 4th March 2005 - 03:04 PM Last post by: nancmu |
|||
![]() |
3 | Benz1435 | 6,279 | 27th June 2005 - 09:35 PM Last post by: snlildude87 |
|||
![]() |
0 | OpaQue | 2,256 | 15th March 2005 - 05:51 AM Last post by: OpaQue |
|||
![]() |
3 | JewelzyGrl | 979 | 4th June 2006 - 05:08 AM Last post by: JewelzyGrl |
|||
![]() |
5 | Amezis | 2,651 | 22nd March 2005 - 08:36 AM Last post by: Amezis |
|||
![]() |
0 | kvarnerexpress | 2,044 | 20th March 2005 - 11:16 PM Last post by: kvarnerexpress |
|||
|
Open Discussion | Time is now: 22nd November 2009 - 05:07 AM |
Web Hosting Powered by ComputingHost.com.