
Oct 17th, 2007, 11:37
|
 |
Lead Administrator
|
|
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,299
Thanks: 1
Thanked 6 Times in 6 Posts
|
|
|
[SOLVED] not processing or just taking too long
i am having problems with processing my login script
its taking ages, or its just not working - one of the two
below are all references to the login script
username = test
password = test
thanks
http://www.fmat.co.uk/index.php
check. php
- PHP: Select all
<?php include 'config.php';?> <?php session_start(); if($_SERVER['REQUEST_METHOD'] == "POST") { mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname) or die( "Unable to connect to database"); $result = mysql_query("SELECT * FROM members WHERE username='" . $_POST['username'] . "' AND password=md5('" . $_POST['password'] . "')"); if(mysql_num_rows($result) > 0) { $_SESSION['is_logged_in'] = 1; } } if(!isset($_SESSION['is_logged_in'])) { header("location:index.php"); } else { header("location:authenticated.php"); } ?>
login_success. php
- PHP: Select all
<? session_start(); if(!session_is_registered(myusername)){ header("location:index.php"); } ?> <html> <body> Login Successful </body> </html>
authenticated. php
- PHP: Select all
<?php session_start(); session_destroy(); header("location:authenticated.php"); ?>
index. php
- PHP: Select all
<!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> <style type="text/css"> <!-- #header { width:800px; float: right; margin-right:5em; border:double; border-color:#999999; } #container { width:799px; float: right; margin-right:5em; border:double; border-color:#999999; background-image:url(images/Circleswallpaper_1680.jpg); } #rcontainer { width:239px; float: right; margin-right:1em; margin-top:1em; } #mainc { width:500px; float: left; margin-left:1em; margin-top:1em; margin-bottom:1em; background-color:#ffffef; padding:3px 3px 3px 10px; border:double; border-color:#999999; } #main { width:480px; float: left; margin-left:1em; margin-top:1em; margin-bottom:1em; background-color:#ffffef; border-color:#999999; } #plug1 { width:219px; float: right; margin-right:1em; margin-bottom:1em; background-color:#FFFFFF; padding:3px 3px 3px 1px; border:double; border-color:#999999; } #plug2 { width:212px; float: right; margin-right:1em; background-color:#FFFFFF; padding:3px 3px 3px 10px; border:double; border-color:#999999; } #footer { width:790px; float: right; margin-right:5em; border:double; border-color:#999999; background-color:#B9D1B1; } #menu { width:800px; float: right; margin-right:5em; margin-top:0em; border:thin; border-color:#999999; } #navlist { margin: 0; padding: 2px 0 20px 10px; } #navlist ul, #navlist li { margin: 0; padding: 0; display: inline; list-style-type: none; } #navlist a:link, #navlist a:visited { float: left; line-height: 14px; font-weight: bold; margin: 0 10px 4px 10px; text-decoration: none; color: #999; } #navlist a:link#current, #navlist a:visited#current, #navlist a:hover { border-bottom: 4px solid #000; padding-bottom: 2px; background: transparent; color: #000; } #navlist a:hover { color: #000; } body { background-image: url(images/Lime_1600.jpg); } .style1 {font-family: Georgia, "Times New Roman", Times, serif; color: #666666; } --> </style> </head> <body> <div id="header"><img src="http://www.webforumz.com/images/free-header-image-tree.jpg" alt="logo" width="800" height="200" /></div> <div id="menu"><div id="navcontainer"> <ul id="navlist"> <li id="active"><a href="#" id="current">Item one</a></li> <li><a href="#">Item two</a></li> <li><a href="#">Item three</a></li> <li><a href="#">Item four</a></li> <li><a href="#">Item five</a></li> </ul> </div></div> <div id="container"> <div id="rcontainer"> <div id="plug1"><span class="style1"> </span><span class="style1"></span><span class="style1"><table width="221" border="0"> <tr> <form name="form1" method="post" action="check.php"> <td width="215"><div align="center"><strong>Admin Login</strong> </div> <table width="205" border="0"> <tr> <td width="64">Username:</td> <td width="144"><input name="username" type="text" name="username" size="15"></td> </tr> <tr> <td>Password:</td> <td><input name="password" type="password" name="password" size="15"></td> </tr> <tr> <td> </td> <td> <div align="right"> <input type="submit" id="submit" value="Submit"> </div> </td> </tr> </table></td> </form> </tr> </table></span></div> <div id="plug2"> <p><span class="style1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ligula lorem, consequat eget, tristique nec, auctor quis, purus. Vivamus ut sem. Fusce aliquam nunc vitae purus. Aenean viverra malesuada libero. Fusce ac quam. Donec neque. Nunc venenatis enim nec quam. Cras faucibus, justo vel accumsan aliquam, tellus dui fringilla quam, in condimentum augue lorem non tellus. Pellentesque id arcu non sem placerat iaculis. Curabitur posuere, pede vitae lacinia accumsan, enim nibh elementum orci, ut volutpat</span></p> </div> </div> <div id="mainc"> <div class="style1" id="main"> <?php include 'main.php';?> </div> </div> <div id="footer"> <p> </p> <p> </p> </div> </div> </body> </html>
blogform. php
- PHP: Select all
<?php session_start(); if (!isset($_SESSION['is_logged_in'])) { header("Location:index.php"); die(); } ?> <script language="javascript" type="text/javascript" src="../blog/jscripts/tiny_mce/tiny_mce.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas" }); </script> <?php include 'config.php';?> <?php $d = date("dS F Y");?> <?php include("form.php"); ?> <style type="text/css"> <!-- body { background-color: #FFFFCC; } --> </style> <div align="center"> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> <p><input name="title" type="text" value="TITLE" size="100"> </p> <table width="600" height="39" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="270"><input name="date" type="text" value="<?php echo($d); ?> "45"></td> <td width="58"> </td> <td width="136"> <label></label> <div align="center"><strong>SUBJECT:</strong></div></td> <td width="136"><select name="subject" size="1" id="subject"> <option>choose...</option> <option>website design tips</option> </select></td> </tr> </table> <p> <?php include ("created.php");?> </p> <label></label> <p> <textarea name="blog_mes" cols="100" rows="15">BLOG MESSAGE</textarea> </p> <table width="632" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="494"> </td> <td width="138"><div align="right"> <input type="submit" name="submit" value="SUBMIT BLOG"> </div></td> </tr> </table> </form> </div> </body> </html>
Last Blog Entry: Basic Advice for newbies (Feb 1st, 2008)
|