Jump to content

[SOLVED] why can't call the information from the field called authorised


madspof

Recommended Posts

I have this login script which i want to only let authorised people sign in i have the database bit all setup and i no how to put the If function in but the thing is that when i try to call the authorised part from the database i get resource id#4

in the script i have not put the if statment in because i cannot get the script the call the authorised part form the database anyone know why i keep getting resourceid#4

here is it live www.deskfun.co.nr/halo 3 clan/

<?php
$message = "";
include "connect.php";
$username = $_POST["user"];
$password = $_POST["pass"];
      if (!$username) {
          header("Location: statuscheck.php?check=4"); exit;
      }
      if (!$password) {
          header("Location: statuscheck.php?check=4"); exit;
      }
$password = MD5($password);
           $issuchusername = mysql_query("SELECT * FROM members WHERE Gamertag = '$username'");
      $usernamelogin = mysql_num_rows($issuchusername);
      $auth1 = mysql_query("SELECT * FROM members WHERE Gamertag = '$username'");
      

	  if ($usernamelogin == 1) {

		  $issuchpassword = mysql_query("SELECT * FROM members WHERE Gamertag = '$username' AND Password = '$password'");
		  $passwordlogin = mysql_num_rows($issuchpassword);

	  
		  if ($passwordlogin == 1) {

			  $time = time();
			  $cookie_data = $username.'-'.$password;
			  if(setcookie ("cookie_info",$cookie_data, $time+1800)==TRUE) {
			  }
			  else {
				  $message .= "You computer does not support cookies. <BR> To view other pages after logged in you need to have cookies enabled.<BR>";
			  }

		  }
		  else {
			  $message .= "your password/username is incorrect";
			  exit;
		  }
	  }
	  else {
		  $message .= "your password/username is incorrect";
		  exit;
	  }
  
?>
<html>
<head>
<meta name="Microsoft Theme 2.00" content="Slate 011">
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="index_files/filelist.xml">
<link rel=Edit-Time-Data href="index_files/editdata.mso">

<title>Xxxxx Clan</title>

<style>
<!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1593833729 1073750107 16 0 415 0;}
@font-face
{font-family:Halo;
panose-1:0 0 0 0 0 0 0 0 0 0;
mso-font-charset:0;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:-2147483645 0 0 0 1 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Verdana;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";
color:white;}
h1
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:1;
font-size:16.0pt;
font-family:Verdana;
mso-bidi-font-family:Arial;
color:white;
mso-font-kerning:16.0pt;
font-weight:bold;}
h2
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:14.0pt;
font-family:Verdana;
mso-bidi-font-family:Arial;
color:white;
font-weight:normal;}
h3
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
font-size:13.0pt;
font-family:Verdana;
mso-bidi-font-family:Arial;
color:white;
font-weight:normal;}
h4
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:4;
font-size:14.0pt;
font-family:Verdana;
color:white;
font-weight:normal;}
h5
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
mso-outline-level:5;
font-size:13.0pt;
font-family:Verdana;
color:white;
font-weight:normal;}
h6
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
mso-pagination:widow-orphan;
mso-outline-level:6;
font-size:11.0pt;
font-family:Verdana;
color:white;
font-weight:normal;}
a:link, span.MsoHyperlink
{color:#B6B04D;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:#707849;
text-decoration:underline;
text-underline:single;}
p
{font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.style1, li.style1, div.style1
{mso-style-name:style1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:black;}
p.style2, li.style2, div.style2
{mso-style-name:style2;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:white;}
span.style11
{mso-style-name:style11;
color:black;}
span.style21
{mso-style-name:style21;
color:white;}
@page Section1
{size:612.0pt 792.0pt;
margin:0cm 90.0pt 72.0pt 90.0pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
.style1 {color: #FFFFFF}
.style3 {font-size: 24pt}
-->
</style>

</head>

<body bgcolor=white background="index_files/image001.gif" lang=EN-US
link="#B6B04D" vlink="#707849" style='tab-interval:36.0pt'>


<div class=Section1>

<p class=MsoNormal style='margin-right:-54.0pt'><span lang=EN-GB
style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p>

<div align=center>

<table class=MsoTableTheme border=1 cellspacing=0 cellpadding=0
style='margin-left:.65pt;border-collapse:collapse;border:none;mso-border-alt:
solid #989898 .25pt;mso-yfti-tbllook:480;mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-border-insideh:.75pt solid #989898;mso-border-insidev:.75pt solid #989898'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:141.0pt;background-image:url("index_files/header_short.jpg");'>
  <td colspan=2 valign=top style='width:680.0pt;border:solid #989898 1.0pt;
  mso-border-alt:solid #989898 .25pt;mso-border-bottom-alt:solid #989898 .75pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:141.0pt'>
  <p class=MsoNormal align=center style='margin-top:0cm;margin-right:-9.75pt;
  margin-bottom:0cm;margin-left:-4.45pt;margin-bottom:.0001pt;text-align:center;
  text-indent:-9.0pt'><![if !vml]><![endif]><span lang=EN-GB style='mso-ansi-language:
  EN-GB'><![if !vml]><![endif]><o:p></o:p></span></p>
  <p class=MsoNormal align=center style='margin-top:0cm;margin-right:-9.75pt;
  margin-bottom:0cm;margin-left:-4.45pt;margin-bottom:.0001pt;text-align:center;
  text-indent:-9.0pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p>
  <p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Times New Roman";
  color:windowtext;mso-ansi-language:EN-GB'><o:p> </o:p></span></p>
  <p class=MsoNormal align=center style='text-align:center'><strong><span
  lang=EN-GB style='font-size:10.0pt;color:windowtext;mso-ansi-language:EN-GB'>XXXXXX</span></strong><span
  lang=EN-GB style='font-size:10.0pt;font-family:"Times New Roman";color:windowtext'>
  </span><strong><span style='font-family:Verdana'><o:p></o:p></span></strong></p>
  <p align=center style='text-align:center'><o:p> </o:p></p>
  <p align=center style='text-align:center'><span lang=EN-GB style='font-size:
  10.0pt;mso-ansi-language:EN-GB'><o:p> </o:p></span></p>
  <p align=center style='text-align:center'><strong><span lang=EN-GB
  style='font-size:10.0pt;mso-ansi-language:EN-GB'>Here to Finish the fight </span></strong><span
  lang=EN-GB style='font-size:10.0pt;mso-ansi-language:EN-GB'><o:p></o:p></span></p>
  </td>
</tr>
<tr bgcolor="#FFFFFF" style='mso-yfti-irow:1;height:14.5pt'>
  <td colspan=2 valign=top style='width:680.0pt;border:solid #989898 1.0pt;
  border-top:none;mso-border-top-alt:solid #989898 .75pt;mso-border-top-alt:
  .75pt;mso-border-left-alt:.25pt;mso-border-bottom-alt:.75pt;mso-border-right-alt:
  .25pt;mso-border-color-alt:#989898;mso-border-style-alt:solid;background:
  #000000;padding:0cm 5.4pt 0cm 5.4pt;height:14.5pt'>
  <p class=MsoNormal align=right style='text-align:right'><b style='mso-bidi-font-weight:
  normal'><span lang=EN-GB style='mso-ansi-language:EN-GB'><a href="index.html"><span
  style='color:white'>Menu</span></a>   <a href="members.php"><span
  style='color:white'>Members</span></a>   <a href="video's.php"><span
  style='color:white'>Video’s</span></a>    <a href="pictures.php"><span style='color:white'>Pictures</span></a><span
  class=style21>     </span></span></b>                         <a href="login.html" class="style1">Login</a>            <a href="video's.php"><span
  class=style21><o:p> </o:p></span></p>
  </td>
</tr>
<tr style='mso-yfti-irow:2;height:467.7pt'>
  <td width=747 valign=top style='width:549.75pt;border:solid #989898 1.0pt;
  border-top:none;mso-border-top-alt:solid #989898 .75pt;mso-border-alt:solid #989898 .75pt;
  mso-border-left-alt:solid #989898 .25pt;padding:0cm 5.4pt 0cm 5.4pt;
  height:467.7pt' background="index_files/bk2.jpg">
  <p class=MsoNormal style='margin-right:-9.1pt;text-indent:-4.75pt'><![if !vml]><![endif]><span lang=EN-GB style='mso-ansi-language:
  EN-GB'><!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75"
   style='width:562.5pt;height:466.5pt'>
   <v:imagedata src="index_files/image003.jpg" o:title="halo-3"/>
  </v:shape><![endif]--><![if !vml]><![endif]><o:p></o:p></span></p>
  <p><span class="style3"><span class="MsoNormal"><span lang=EN-GB style='mso-ansi-language:
  EN-GB'>
    <?php	
//message
echo $message;
echo $auth1;

  ?>
  </span></span></span><span
  style='font-size:10.0pt'><o:p><span class="MsoNormal">
  </span></o:p></span></p>
  </td>
  <td width=202 valign=top style='width:120.9pt;border-top:none;border-left:
  none;border-bottom:solid #989898 1.0pt;border-right:solid #989898 1.0pt;
  mso-border-top-alt:solid #989898 .75pt;mso-border-left-alt:solid #989898 .75pt;
  mso-border-alt:solid #989898 .75pt;mso-border-right-alt:solid #989898 .25pt;
  padding:0cm 5.4pt 0cm 5.4pt;height:467.7pt'>
  <p class=MsoNormal align=center style='margin-left:-14.4pt;text-align:center;
  text-indent:9.15pt'><u><span lang=EN-GB style='mso-ansi-language:EN-GB'>Clan
  Pictures<o:p></o:p></span></u></p>
  <p class=MsoNormal style='margin-top:0cm;margin-right:-5.4pt;margin-bottom:
  0cm;margin-left:-6.75pt;margin-bottom:.0001pt'><span lang=EN-GB
  style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p>
  <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p>
  <p class=MsoNormal style='margin-left:-14.4pt;text-indent:9.15pt'><u><span
  lang=EN-GB style='mso-ansi-language:EN-GB'><o:p><span style='text-decoration:
   none'> </span></o:p></span></u></p>
  </td>
</tr>
<tr style='mso-yfti-irow:3;mso-yfti-lastrow:yes'>
  <td colspan=2 valign=top style='width:680.0pt;border:solid #989898 1.0pt;
  border-top:none;mso-border-top-alt:solid #989898 .75pt;mso-border-alt:solid #989898 .25pt;
  mso-border-top-alt:solid #989898 .75pt;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal><span lang=EN-GB style='font-size:9.0pt;mso-ansi-language:
  EN-GB'>About us - Contact us - Copyright 2007<o:p></o:p></span></p>
  </td>
</tr>
</table>

</div>

<p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p>

</div>

</body>

</html>

Link to comment
Share on other sites

$auth1 will return 'resource id #4' because mysql_query only returns a result resource number which links to the returned record set. You will have to use mysql_fetch_assoc in order to get the data out of the record set.

 

Also why on earth are you using Word for creating a  web page? Extremely bad idea! Puts in crap loads of invalid markup.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.