adding a login onto a different page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

that url appears to be a login error. In which case you should read all the above posts for help :D
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

Well i added that and tried on the main login page and it takes me to the members.php but when i add all the codes to the index33.php page it only comes up as index.33.php?username=username&password=userpassword
so is there any other way to over seek that little problem?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

wait so its coming up as index.33.php? like with the period after index and between 33? if so try changing the name of index33 to somtin like indexB or somtin maybe. if not post some code of index33.php or somtin
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

no that was a typo its index33.php
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

then post index33.php's code
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

here is index33.php codes

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title> HG </title>
<link rel="stylesheet" href="emx_nav_right.css" type="text/css">
<script type="text/javascript">
<!--
var time = 3000;
var numofitems = 7;

//menu constructor
function menu(allitems,thisitem,startstate)&#123; 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
	this.numberofmenuitems = 7;
	this.caller = document.getElementById(callname);
	this.thediv = document.getElementById(divname);
	this.thediv.style.visibility = startstate;
&#125;
				 
//menu methods
function ehandler(event,theobj)&#123;
  for (var i=1; i<= theobj.numberofmenuitems; i++)&#123;
	  var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
	&#125;
	theobj.thediv.style.visibility="visible";
&#125;
				
function closesubnav(event)&#123;
  if ((event.clientY <48)||(event.clientY > 107))&#123;
    for (var i=1; i<= numofitems; i++)&#123;
      var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		&#125;  
	&#125;
&#125;
// -->
</script>
</head>
<body onmousemove="closesubnav(event);"> 
<div class="skipLinks">skip to: <a href="#content">page content</a> | <a href="pageNav">links on this page</a> | <a href="#globalNav">site navigation</a> | <a href="#siteInfo">footer (site information)</a> </div>
<div id="masthead"> 
  <h1 id="siteName">Haunted Graveyard </h1> 
  </div> 
<br>
<br>
<br>
  <div id="globalNav"> 
    <img alt="" src="gblnav_left.gif" height="32" width="4" id="gnl"> <img alt="" src="glbnav_right.gif" height="32" width="4" id="gnr">
<FORM METHOD="" ACTION=""><TABLE BORDER=0 WIDTH=98% BORDER=0 CELLPADDING=2 CELLSPACING=2 ALIGN=CENTER BGCOLOR="000000"><td bgcolor="000000" height="8">
<marquee><font color="00FF00">Welcome to Haunted Graveyard</font></marquee>
   </div>
    <!--end globalLinks--> 

  <div id="subglobal1" class="subglobalNav"> 

  </div> 
</div> 
<!-- end masthead --> 
<div id="pagecell1"> 
  <!--pagecell1--> 
  <img alt="" src="tl_curve_white.gif" height="6" width="6" id="tl"> <img alt="" src="tr_curve_white.gif" height="6" width="6" id="tr"> 
  <div id="pageName"> 
    <h2>Home</h2> 
    <img alt="small logo" src="Haunted.gif" height="59" width="66"/> 
  </div> 
  <div id="pageNav"> 
    <div id="sectionLinks"> 
    </div> 
    <div class="relatedLinks"> 
      <h3><u>Link's</u></h3> 
      <a href="http://www.massinfluence.net">Massinfluence</a> <a href="http://www.msn.com">MSN</a> <a href="http://www.yahoo.com">Yahoo</a> <a href="http://www.gmail.com">Gmail</a> <a href="http://www.w3school.com">w3school</a>
<a href="">VQ Rulez</a>
    </div> 
    <div class="relatedLinks"> 
      <h3><u>Other Game's</u></h3> 
<a href="http://www.netdragons.com">VQ+</a> <a href="http://www.vq-2.com/">VQ2</a> <a href="http://www.battleon.com">AQ</a> <a href="http://www.runescape.com">Runescape</a> <a href="http://www.nukezone.nu">Nuke Zone</a> 
    </div>
    <div class="relatedLinks"> 
      <h3><u>Hosting Site's</u></h3> 
<a href="http://www.southsidedesigns.net"><b>Southsidedesigns</b></a>
<a href="http://www.hostultra.com">Host Ultra</a>
<a href="http://www.brinkster.com">Brinkster</a> 
<a href="http://www.brownhost.com/">Brownhost</a>
    </div>
    <div class="relatedLinks"> 
      <h3><u>Contact's</u></h3> 
<a href="mailto:smackie.@hauntedgraveyard.southsidedesigns.net">Elder Smackie</a>
<a href="mailto:aoth@hauntedgraveyard.southsidedesigns.net">Elder AOTH</a>
<a href="mailto:ryuu@hauntedgraveyard.southsidedesigns.net">Elder Ryuu</a> 
<a href="mailto:help@hauntedgraveyard.southsidedesigns.net">Help</a>
<a href="mailto:elder@hauntedgraveyard.southsidedesigns.net">Elders</a>
<a href="mailto:support@hauntedgraveyard.southsidedesigns.net">Support</a> 
   </div>  
    <div id="advert"> 
    </div> 
  </div>
  <br> 
  <div id="content"> 
    <div class="feature"> 
      <img src="Haunted.gif" alt="" width="250" height="200"> 
      <h3>Welcome To Haunted Graveyard</h3> 
      <p>
      First off <b>The Elders of HG</b> would like to welcome everyone and 
      Thank everyone that helped make <b>HG</b> happen..
      <b>The Elders</b> are working on getting alot more games to put on here for
      everyone. If you have a game you would like to see on the <b>HG</b> site
      please<br><br>
      Contact the <b>Elders</b> and they will find a way for you to send us the
      game... If you have a Link you would like to add to the Link's list please
      send them to <a href="mailto:elder@hauntedgraveyard.southsidedesigns.net">Elder Email</a>
      </p> 
    </div> 
    <div class="story"> 
      <h3></h3> 
      <p>
<center>
<img src="3dheadstone.gif" alt="" width="185" height="102"> 
</center>
      </p> 
    </div> 
    <div class="story"> 
      <table width="100%" cellpadding="0" cellspacing="0" summary=""> 
        <tr valign="top"> 
          <td class="storyLeft"> <p> 
            <b><u>News Today</u></b><br><br>
<marquee align="right" bgcolor="000000" behaviour="slide" direction="up" height="150" width="200" 
scrolldelay="100" scrollamount="1" height="100">
<font face="Microsoft Sans Serif"><font size="3"><font color="00FF00">
News for today is well We got a new template and working on some games like always.. lol... If you would like to become a HG Staff please signup on the Staff Signup page... We are only needing a few people if you didnt get picked wait until next time.. 
<br>
<u>-Spot's needed help-</u><br>
New's Reporter<br>
PHP and MySQL Helper<br>
Forum Posting and Mods.<br>
----------------------------<br>
That is it for now thank you<br>
<br>
Elder Smackie
</font></marquee>
</p></td>
          <td> <p> 
            <b><u>Game List</b></u><br><br>
            Legend of the Green Dragon<br>
            Promisance<br>
            And Haunted Graveyard when it is up<br>
          
            </p></td> 
        </tr> 
        <tr valign="top"> 
          <td class="storyLeft"> <p> 
          <b><u>About the Login</u></b><br><br>
Alright If you are signing up please please make the password easy so that you can remember it.. Because right now we do not have a forgot password script up yet but if you do want a password the <b>Elders</b> will probably give you a new password but you must email the <b>Elders</b> to find out.. <br>
<br>
Thank you<br>
<b><b>Elder Smackie</b>
            </p></td> 
          <td> <p> 
<?php
ob_start();
// dBase file
include "http://www.hauntedgraveyard.southsidedesigns.net/smackie/123%20step/dbConfig.php";

if ($_GET&#1111;"op"] == "login")
                &#123;
	if (!$_POST&#1111;"username"] || !$_POST&#1111;"password"])
		&#123;
		die("Please go back and Supply a username and password.");
		&#125;

	// Create query
	$q = "SELECT * FROM `dbUsers` "
		."WHERE `username`='".$_POST&#1111;"username"]."' "
		."AND `password`=PASSWORD('".$_POST&#1111;"password"]."') "
		."LIMIT 1";
	// Run query
	$r = mysql_query($q);

	if ( $obj = @mysql_fetch_object($r) )
	&#123;
		// Login O.K., create session variables
		$_SESSION&#1111;"valid_id"] = $obj->id;
		$_SESSION&#1111;"valid_user"] = $_POST&#1111;"username"];
		$_SESSION&#1111;"valid_time"] = time();

	// Redirect to member page
	Header("Location: http://www.hauntedgraveyard.southsidedesigns.net/smackie/members.php");
                 	&#125;
	else
		&#123;
		// Login not successful
		die("Sorry, could not log you in. Wrong login information.");
		&#125;
	                &#125;
                else
		&#123;
		echo "<form action="?op=login" method="POST">";
		echo "Username: <input name="username" size="15"><br />";
		echo "Password: <input type="password" name="password" size="15"><br />";
		echo "<input type="submit" value="Login">";
		echo "</form>";
		&#125;

?>
            </p></td> 
        </tr> 
        <tr valign="top"> 
          <td class="storyLeft"> <p> 

            </p></td> 
          <td> <p> 
            </p></td> 
        </tr> 
      </table> 
    </div> 
  </div> 
  <!--end content --> 
  <div id="siteInfo"> 
&copy;2003
    Deke McCoy
  </div> 
</div> 
<!--end pagecell1--> 
<br> 
<script type="text/javascript">
    <!--
      var menuitem1 = new menu(7,1,"hidden");
			var menuitem2 = new menu(7,2,"hidden");
			var menuitem3 = new menu(7,3,"hidden");
			var menuitem4 = new menu(7,4,"hidden");
			var menuitem5 = new menu(7,5,"hidden");
			var menuitem6 = new menu(7,6,"hidden");
			var menuitem7 = new menu(7,7,"hidden");
    // -->
    </script> 
</body>
</html>
Post Reply