Jump to content

login page not working


silverglade

Recommended Posts

hi, i have a login page and its not logging me in even though i put a password and email in the database already. here is the error message i get , any help greatly appreciated. thanks. derek

 

 

Notice: Undefined index: hack in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php on line 23

 

You do not exist on the system

 

 

here is the code im using for thet page

 

<?php
include("connect1.php");



ini_set('display_errors', 1);
  error_reporting(E_ALL);   // GREAT SNIPPET FOR DEBUGGING OUTPUTS ERRORS TO SCREEN */

session_start(); // this is the session declaration , one per page.
/// data is set up in the mysql lite table , rows are 
// record_id, int, 11, not null checked, default, null
//username, varchar, 20, default null
// password, varchar, 20 default, null
//Name, varchar, 20 default null
////////////////////////////////////////
////////////////////////////////////////
// a while loop is used to loop through and display output, like a table info, etc.dynamic rows.
$u = $_POST['email'];
$p = $_POST['password'];



$hack = $_GET['hack']; /// we got the hack variable from other page with GET




// if logoff is set, destroy the session, or unset it.
if(isset($_GET['logoff'])){

    
unset($_SESSION['userid']);

//session_destroy();

$message = "You have been logged off"; // notice here that he used the same variable as before but just changed value


     

		}


if($hack){    

   $message = "Naughty Naughty!  "; // COOL

    }


// escape username and password for use in SQL//person said on board "looks fine" like this
//to prevent sql injections
$u = mysql_real_escape_string($u);
$p = mysql_real_escape_string($p);



// if fields username and password have contents, then...
if($u && $p){

 $p = md5($p);

$query = mysql_query("SELECT * FROM members_videos WHERE Email = '$u' AND (Password = '$p' )");

if(!mysql_num_rows($query))
{
$message = "You do not exist on the system";
}
else
{
$result = mysql_fetch_array($query); //creates array called result,//notice we dont need a while loop here.
                                          //if its found a user it will create a populated array, if find nothing, it creates a blank array.
                                        //the mysql_fetch_array automatically gives us our keys for us.
// if username is set, go on...username is a key for $result, and a field in the table.

	$message = "You have been logged in";
	// session is an array, a php defined word, becomes like a variable.which can be accessed on any page.
	// 'userid'here is like a variable. we are going to assign to $_SESSION whatever the $result array contains which is 'username' in this case.

	$_SESSION['userid'] = $result['Email'];

	header("Location:videos.php"); // this will redirect them to the application.php page. and exit the script here.
	exit;
}



}





/////////BAN USER CODE/////////////


/*//this is the file that connect to sql
$s=$_SERVER["REMOTE_ADDR"];
//draws IP address of visitor
$ipbancheck="SELECT * from banip where IP='$s'";
$ipbancheck2=mysql_query($ipbancheck);
if (!$ipbancheck2) {
die("query error in $ipbancheck<br.".mysql_error());
}
if (mysql_num_rows($ipbancheck2) > 0)
{
header("Location:http://www.derekvanderven.com/hacker.html");
}
else
{
//put content you want unbanned users to see here
}*/
?>
<!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" />
<!--[if lt IE 7]>
<link href="iefixes4.css" rel="stylesheet" type="text/css" /> <![endif]--> 
<!-- LIGHTBOX CODE-->
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<!-- END LIGHTBOX CODE-->



<title>OLDMASTERCOPIES.COM</title>
<style type="text/css">
<!--
.style1 {font-size: x-large}
.style2 {font-size: large}
#login {
width: 214px;
background-color: #000000;
/*border: 2px solid #C7A83D;*/
margin-top: 20px;
margin-right: auto;
margin-bottom: -10px;
margin-left: auto;
height: 30px;
}
#login_snake {
width: 260px;
background-image: url(snake_skinS.jpg);
background-repeat: no-repeat;
border: 2px solid #000000;
height: 210px;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
padding-top: 0px;
padding-bottom: 0px;
padding-right: auto;
padding-left: auto;
}
.style4 {color: #C28D29}
.style5 {
color: #00CC33;
font-weight: bold;
}
.style6 {	color: #B39551;
font-size: large;
}

p {
padding-left: 20px;
padding-right:20px;
}
-->
</style>
</head>

<body>
<div align="center">
  <p> </p>
  <p>WELCOME TO </p>
  <p><span class="style1">OLDMASTERCOPIES.COM</span></p>
  <p>The Best Place On The Internet You Will Learn To Draw and Paint Like the Old Masters </p>
  <p> </p>
  <p><strong>current project:</strong></p>
  <p><br />  
    <span class="style2">DRAWING LIKE THE OLD MASTERS</span><br />
    (<strong>Old Master Technique Instructional Videos</strong>)</p>
  <p>Drawing like the Old Masters such as Rembrandt, Da Vinci, Michelangelo, and others seems to be a mystery today, lost in the closed down atelier's of the painters of the past. Only now are they brought back to life as I go through the exact lessons you need to master these forgotten and wonderful techniques to make spectacular drawings that would look as if they were masterpieces done in the 1600's. I will be including more and more video tutorials in this compilation, so be sure to look back often for updated videos.<br />
    <br />
  The first 7 lessons in this series, deal with line drawing in pen. I will soon cover charcoal, and go on to make videos on painting landscape copies in acrylic, and copying Master paintings.</p>
  <p>The following drawings are in the lessons to help you learn the drawing techniques of the old masters.<br />
    <br />
  I spend about 1 hour explaining the drawing techniques of the Old Masters. The time seems short, but I explain a TON of ideas and give great demonstrations and explanations, so that by the time you are finished with the videos you will have an excellent understanding and ability to draw like the masters practicing the methods I discuss along with the images.</p>
  <p><strong>I discuss:</strong></p>
  <p><strong>Line, shape, perspective, tone, planes, proportion, anatomy, rendering versus modeling, lighting, positioning in space, contraposto, abstract tonal shapes, tricks of seeing correctly, and other things.</strong></p>
  <table border="1">
    <tr>
      <td><a target="_blank" href="line_shape_basics.jpg" rel="lightbox[placecard]">
      <img src="line_shape_basics_t.jpg"   
  			 width="150"
  			height="150" border="1"/>  </a></td>
      <td><a target="_blank" href="tone_basics.jpg" rel="lightbox[placecard]">
      <img src="tone_basics_t.jpg"   
  			 width="150"
  			height="150" border="1"/>  </a></td>
      <td><a target="_blank" href="planes.jpg" rel="lightbox[placecard]">
      <img src="planes_t.jpg"   
  			 width="150"
  			height="150" border="1"/>  </a></td>
      <td><a target="_blank" href="skull_drawings.jpg" rel="lightbox[placecard]">
      <img src="skull_drawings_t.jpg"   
  			 width="150"
  			height="150" border="1"/>  </a></td>
    </tr>
  </table>
  <p> </p>
  <table border="1">
    <tr>
     <td><a target="_blank" href="back_man_done.jpg" rel="lightbox[placecard]">
      <img src="back_man_done_t.jpg"   
  			 width="150"
  			height="150" border="1"/>  </a></td>
      <td><a target="_blank" href="screaming_man_final.jpg" rel="lightbox[placecard]">
      <img src="screaming_man_final_t.jpg"   
  			 width="150"
  			height="150" border="1"/>  </a></td>
    </tr>
  </table>
  <p class="style5">INSTANT ACCESS TO THE ONLINE VIDEOS<p align="left"><strong><u>When you buy the videos you get access to all of the information I described, and forever, that is, a one time payment, and you have access to the "Drawing Like The Old Masters" videos forever.</u></strong><span class="style6"><strong><br />
    </strong> </span>I accept all major credit cards and Paypal account payments.</strong><br />
  Once you click the "Buy Now" button below , it takes you to Paypal Checkout to make a payment of only $19.95 (no tax). If you don't have a paypal account, click on the "dont have a paypal account? continue" link there to use your debit/credit card. After payment, You will receive 2 emails in your Inbox. One will be a link to choose your password and go the Login page of the "OLD MASTER VIDEOS" page, and the other will be a receipt of your purchase from Paypal. Please, no refunds, people could buy the pages, learn all of the techniques, then ask me for a refund. You will love the pages. Thanks. Derek</p>
  <p align="left"> </p>
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YYA2TY3QHDLXN">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</p>
  <p align="center">If there are any problems after payment<strong>,</strong> you can email me at any time at <a href="mailto:[email protected]">[email protected]</a>.<br />
  </p>
  <p align="center"> <br />
  </p>
  <div id="login_snake">
  
<div id="login"> 
<div align="center"><table border="0">  
    <tr>
      <td bgcolor=#000000 width="203"><div align="center"><span class="style4"><span class="style4"><strong>Login to the Video pages</strong></span><span class="style63"><br />
        <a name="login" id="login">.</a></span></div></td>
    </tr>
  </table></div></div><!-- end login snake-->
  
    <div id="table_center">
<form id="form1" name="form1" method="post" action="">
   <table style=" margin-bottom: 0px;"   width="212" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#000000">
     <tr bordercolor="#D59640">
       <td width="24" bgcolor=#000000> </td>
       <td width="150"><table width="150" border="0" align="center">
         <tr>
           <td bgcolor=#000000 width="144" bordercolor="0"><label for="email"> <span class="style4 style50"><strong>Your Email </strong></span></label>
               <input type="text" name="email" id="email" /></td>
         </tr>
         <tr>
           <td bordercolor="0"><label for="password"> <span class="style4 style50"><strong>Password </strong></span></label>
               <input type="password" name="password" id="password" /></td>
         </tr>
         <tr>
                 
           <td height="44" bordercolor="0"><input type="submit" name="submit2" id="mysubmit" value="Enter"  /></td>
         </tr>
         <tr>
           <td></td>
         </tr>
       </table></td>
       <td width="24"> </td>
     </tr>
   </table>
</form>
</div> 

<!--end tablecenter--></div> <!--end login div-->
    <div id="message"><?php echo ($message); ?> </div>
    <div align="center">
      <p>Forgot your password? <a href="passrecovery8.php">click here</a>.</p>
      <p> </p>
      <p>Copyright Derek Van Derven 2009 All rights reserved. All videos are copyrighted and may not be reproduced or used in any way without my permission. thank you. Derek</p>
    </div> 
</div>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/198157-login-page-not-working/
Share on other sites

here are some more errors i get

 

Notice: Undefined index: email in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php on line 19

 

Notice: Undefined index: password in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php on line 20

 

Notice: Undefined index: hack in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php on line 24

when i type in my user and email now, it brings me to a new page with the following errors

 

Notice: Undefined index: hack in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php on line 24

 

Warning: Cannot modify header information - headers already sent by (output started at /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php:24) in /hermes/bosweb/web173/b1739/sl.brendansite1/public_html/OLDMASTERCOPIES/index.php on line 83

The Warning: Cannot modify header information error is being caused by the previous Notice error. Solve the notice by using

 

Change

$hack = $_GET['hack']; /// we got the hack variable from other page with GET

to:

$hack = isset($_GET['hack']) ? $_GET['hack'] : false;

 

change

if($hack)

[/code]

That's not what's causing the notice, the notice is thrown because there is no 'hack' set in the querystring.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.