Jump to content
xisto Community
odomike

Help With Php Log-in Form my PHP forum log-in form aint working

Recommended Posts

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

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
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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.