Ik zie niks?

Status
Niet open voor verdere reacties.

NeedForSpeed

Gebruiker
Lid geworden
17 jan 2008
Berichten
245
Hallo,

als ik dit script upload zie ik hem niet . maar wel bijv in dreamweaver.
Het is een login script: dat hij moet showe de rest showt hij behalve de login.. script..
PHP:
<html>
<head>
<title>RestyleGunZ donator shop</title>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<script type="text/javascript">
EW_ROOT_PATH = ""; // configure root path
ew_cartAction = 0; // Load cart
</script>
<script type="text/javascript" src="Spry_1_6_1_022408/includes_minified/SpryData.js"></script>
<script type="text/javascript" src="ewcartconfig.js"></script>
<script type="text/javascript" src="ewcart32.js"></script>
<link href="Spry_1_6_1_022408/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<link href="RG.css" rel="stylesheet" type="text/css" />
<meta name="generator" content="PayPal Shop Maker v3.2.0.2" />
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<!-- Logo and top banner background color -->
	<tr class="ewTopRow">
		<td><img src="images/paypalshopmkrhdr.png" border="0" /></td>
	</tr>
</table>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" class="ewMain">	
<tr>
	<!-- Begin Menu Column -->
	<td width="20%" height="100%" valign="top" class="ewLeftColumn">		
<script type="text/javascript" src="Spry_1_6_1_022408/includes_minified/SpryMenuBar.js"></script>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">		
			<tr><td style="white-space: nowrap"><span class="paypalshopmaker">
<!-- Begin Main Menu -->
<ul id="RootMenu" class="MenuBarVertical">
<li><a href="Home.php">Home</a>
</li>
<li><a href="Login.php">Login</a>
</li>
<li><a href="Register.php">Register</a>
</li>
<li><a href="Main.php">Main</a>
</li>
<li><a href="Admin.php">Admin</a>
</li>
<li><a href="Logout.php">Logout</a>
</li>
<li><a href="http://www.forum.restylegamerz.net">Forum</a>
</li>
<li><a href="Contact_Us.php">Contact Us</a>
</li>
</ul>
<!-- End Main Menu -->
				<script type="text/javascript">				
				var oMenuRoot = new Spry.Widget.MenuBar("RootMenu", {imgRight: EW_MENUBAR_RIGHTHOVER_IMAGE}); // Main menu 
				</script>
			</span></td></tr>
		</table>	
		<br />
		<table width="100%" border="0" cellspacing="0" cellpadding="0">		
			<tr><td style="white-space: nowrap">	
			<span class="paypalshopmaker"><b>Browse</b></span>
			</td></tr>		
		</table>	
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr><td style="white-space: nowrap"><span class="paypalshopmaker">
				<script type="text/javascript">
				var EW_NO_PRODUCT = "No product in this category.";
				</script>
<!-- Begin Categories -->
<ul id="RootCat" class="MenuBarVertical">
<li><a href="Weapons_1.php">Weapons</a>
</li>
<li><a href="Armor2Fset27s_1.php">Armor/sets</a>
</li>
<li><a href="Event_1.php">Event</a>
</li>
<li><a href="Meds2Fnades_1.php">Meds/nades</a>
</li>
<li><a href="Special_1.php">Special</a>
</li>
</ul>
<!-- End Categories -->
				<script type="text/javascript">
				var oCatRoot = new Spry.Widget.MenuBar("RootCat", {imgRight: EW_MENUBAR_RIGHTHOVER_IMAGE}); // Category menu				
				</script>
			</span></td></tr>
		</table>
	</td>
	<!-- End Menu Column -->
	<!-- Begin Content column -->
	<td valign="top" class="ewMidColumn">	
<table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td>
<!-- menu template customizable area start -->
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr><td><div class="paypalshopmaker">
<?
/**
 * Checks whether or not the given username is in the
 * database, if so it checks if the given password is
 * the same password in the database for that user.
 * If the user doesn't exist or if the passwords don't
 * match up, it returns an error code (1 or 2). 
 * On success it returns 0.
 */
function confirmUser($username, $password){
   global $conn;
   /* Add slashes if necessary (for query) */
   if(!get_magic_quotes_gpc()) {
    $username = addslashes($username);
   }
   /* Verify that user is in database */
   $q = "select password from users where username = '$username'";
   $result = mysql_query($q,$conn);
   if(!$result || (mysql_numrows($result) < 1)){
      return 1; //Indicates username failure
   }
   /* Retrieve password from result, strip slashes */
   $dbarray = mysql_fetch_array($result);
   $dbarray['password']  = stripslashes($dbarray['password']);
   $password = stripslashes($password);
   /* Validate that password is correct */
   if($password == $dbarray['password']){
      return 0; //Success! Username and password confirmed
   }
   else{
      return 2; //Indicates password failure
   }
}
/**
 * checkLogin - Checks if the user has already previously
 * logged in, and a session with the user has already been
 * established. Also checks to see if user has been remembered.
 * If so, the database is queried to make sure of the user's 
 * authenticity. Returns true if the user has logged in.
 */
function checkLogin(){
   /* Check if user has been remembered */
   if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){
      $_SESSION['username'] = $_COOKIE['cookname'];
      $_SESSION['password'] = $_COOKIE['cookpass'];
   }
   /* Username and password have been set */
   if(isset($_SESSION['username']) && isset($_SESSION['password'])){
      /* Confirm that username and password are valid */
      if(confirmUser($_SESSION['username'], $_SESSION['password']) != 0){
         /* Variables are incorrect, user not logged in */
         unset($_SESSION['username']);
         unset($_SESSION['password']);
         return false;
      }
      return true;
   }
   /* User not logged in */
   else{
      return false;
   }
}
/**
 * Determines whether or not to display the login
 * form or to show the user that he is logged in
 * based on if the session variables are set.
 */
function displayLogin(){
   global $logged_in;
   if($logged_in){
      echo "<h1>Logged In!</h1>";
      echo "Welcome <b>$_SESSION[username]</b>, you are logged in. <a href=\"logout.php\">Logout</a>";
   }
   else{
?>
<h1>Login</h1>
<form action="" method="post">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30"></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30"></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember">
<font size="2">Remember me next time</td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="sublogin" value="Login"></td></tr>
<tr><td colspan="2" align="left"><a href="register.php">Join</a></td></tr>
</table>
</form>
<?
   }
}
/**
 * Checks to see if the user has submitted his
 * username and password through the login form,
 * if so, checks authenticity in database and
 * creates session.
 */
if(isset($_POST['sublogin'])){
   /* Check that all fields were typed in */
   if(!$_POST['user'] || !$_POST['pass']){
      die('You didn\'t fill in a required field.');
   }
   /* Spruce up username, check length */
   $_POST['user'] = trim($_POST['user']);
   if(strlen($_POST['user']) > 30){
      die("Sorry, the username is longer than 30 characters, please shorten it.");
   }
   /* Checks that username is in database and password is correct */
   $md5pass = md5($_POST['pass']);
   $result = confirmUser($_POST['user'], $md5pass);
   /* Check error codes */
   if($result == 1){
      die('That username doesn\'t exist in our database.');
   }
   else if($result == 2){
      die('Incorrect password, please try again.');
   }
   /* Username and password correct, register session variables */
   $_POST['user'] = stripslashes($_POST['user']);
   $_SESSION['username'] = $_POST['user'];
   $_SESSION['password'] = $md5pass;
   /**
    * This is the cool part: the user has requested that we remember that
    * he's logged in, so we set two cookies. One to hold his username,
    * and one to hold his md5 encrypted password. We set them both to
    * expire in 100 days. Now, next time he comes to our site, we will
    * log him in automatically.
    */
   if(isset($_POST['remember'])){
      setcookie("cookname", $_SESSION['username'], time()+60*60*24*100, "/");
      setcookie("cookpass", $_SESSION['password'], time()+60*60*24*100, "/");
   }
   /* Quick self-redirect to avoid resending data on refresh */
   echo "<meta http-equiv=\"Refresh\" content=\"0;url=$HTTP_SERVER_VARS[PHP_SELF]\">";
   return;
}
/* Sets the value of the logged_in variable, which can be used in your code */
$logged_in = checkLogin();
?>
</div></td></tr>
</table>
</td></tr></table>
<!-- menu template customizable area end -->
		<p>&nbsp;</p>
	</td>
	<!-- End Content column -->
	<!-- Begin Cart column -->
	<td width="20%" valign="top" class="ewRightColumn">			
	<p><b><div class="paypalshopmaker">Shopping Cart</div></b></p>
	<!-- Note: DO NOT CHANGE THE IDs! -->
	<div id="ewCartView0" spry:region="dsShopCartItems dsShopCartSummary" class="SpryHiddenRegion">
		<div spry:if="{dsShopCartItems::ds_RowCount} > 0">
		<form name="simple" action="checkout.php">
		<table class="ewTable0">
			<tbody>
				<tr spry:repeat="dsShopCartItems">
					<td>{itemname}<br /><span style="white-space: nowrap">{price}</span>&nbsp;&nbsp;Qty&nbsp;{quantity1}&nbsp;{remove}
					</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td style="white-space: nowrap"><b>Total</b>&nbsp;{dsShopCartSummary::total}</td>
				</tr>
			</tfoot>
		</table>
		<input type="image" src="images/ppcheckout.gif" alt="Checkout" border="0">
		</form>
		</div>
		<div class="ewMessage" spry:if="{dsShopCartItems::ds_RowCount} == 0">No items</div>
	</div>
	</td>
	<!-- End Cart column -->
</tr>
</table>
<!-- Footor -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">	
	<tr class="ewFooterRow">
		<td>&nbsp;<!-- Note: Only licensed users are allowed to remove or change the following copyright statement. -->
			<font class="ewFooterText">&copy;2008 e.World Technology Ltd. All rights reserved.</font>
			<!-- Place other links, for example, disclaimer, here -->
		</td>
	</tr>
</table>
<script type="text/javascript">
CartView();
</script>
</body>
</html>


Dus weet iemand waarom hij hem niet laat zien als ik hem upload?

LINK:

http://restylegamerz.net/shop/Login.php
 
Laatst bewerkt door een moderator:
Ik zou in ieder geval error_reporting en display_errors aanzetten.
 
Als ik me niet vergis is het een hele simpele reden:
Code:
function displayLogin(){
   global $logged_in;
   if($logged_in){
      echo "<h1>Logged In!</h1>";
      echo "Welcome <b>$_SESSION[username]</b>, you are logged in. <a href=\"logout.php\">Logout</a>";
   }
   else{
En dan heb ik het over het stukje
Code:
function displayLogin()
Je roept deze functie niet aan, op deze pagina.
als je onderaan, of waar je de login ook maar wilt hebben gewoon
Code:
displayLogin();
zet.. Zou het moeten werken, voor de rest zie ik niet iets raars op t eerste oog.

Succes!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan