Jump to content

[SOLVED] whats wrong?


ronnie88

Recommended Posts

all i get is query failed. Yes database is correct

 


<?php
session_start();
include 'database.php';
$key = $_POST['key'];
$usa = $_POST['name'];
if(!strstr($_SERVER['HTTP_REFERER'],"greatdiscountedgames.com/site_flash/admin.php")) {
          echo "ERROR: YOU CANNOT ACCESS THIS FILE MANUALLY";
}
else {
$query  = "UPDATE info SET key = '$key' WHERE username = '$usa'";
mysql_query($query) or die('Error, query failed');
header('Location: http://www.greatdiscountedgames.com/admin.php');
}
?>

 

 

 

and the form

 

<?php
if($_SESSION['username'] == ronnie) {
?><form action="reginsert.php" method="post">"
<br><tr><td>Name:</td><td><input type="text" name="name" maxlength="25"></td>
<tr><td>Registration Code:</td><td><input type="text" name="key" maxlength="25"></td><br>
<td><input name="add" type="submit" id="add" value="Set Registration Key"></td>
<form></tr>
<?
}
else{
  echo "YOU ARE NOT AN ADMIN!";
}
?>

Link to comment
Share on other sites

thanks but now i am having another problem.... I submit the form and i get this:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/great/public_html/admin.php on line 77

 

entire code:

<?php
session_start();
include("database.php");
if($_SESSION['username']) {
$query  = "SELECT * FROM info WHERE username='{$_SESSION['username']}'";
$result = mysql_query($query);
$row = mysql_fetch_row($result);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GreatDiscountedGames Admin Page</title>
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="style.css" type="text/css" rel="stylesheet">




<body id="page1">
<table style="width:766px" align="center">
    <tr>
        <td><?
if ((isset($_SESSION['username'])) && ($_SESSION['username'] != "")) { 
echo "· Welcome <b>$_SESSION[username]</b>, you are logged in. <a href=\"logout.php\">Logout</a>";
}
else {
echo "<b><a href='index.php'>Login</a> | <a href='register2.php'>Register</a></b>";
}
?>
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24"
			   width="766" height="433">
		<param name="movie" value="flash/header_v8.swf?button=1"> 
		<param name="quality" value="high">
		<param name="menu" value="false">
		<!--[if !IE]> <-->
		<object data="flash/header_v8.swf?button=1"
				width="766" height="433" type="application/x-shockwave-flash">
		 <param name="quality" value="high">
		 <param name="menu" value="false">
		 <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
		 FAIL (the browser should render some flash content, not this).
		</object>
		<!--> <![endif]-->
	   </object>
	</td>
    </tr>
<tr>
        <td style="height:375px">
		<table>
			<tr>
				<td>
					<table style="height:207px">
						<tr>
							<td style="width:36px"></td>
							<td class="col1">
								<br style="line-height:6px">
								<img src="images/t1_1.gif" alt="">NEWS<br>
								<br style="line-height:16px">
								<ul>
									<li> <a href="#"><span>2008-08-03 /</span> GREATDISCOUNTEDGAMES IS OPEN!</a></li>
									<li> <a href="http://www.sup-clan.com"><span>2008-08-03 /</span> CLIENT .:SUP:. Completed</a></li>
								</ul>
								<div class="right"><a href="#"><img src="images/view_archive.gif" alt="" border="0"></a></div>
							</td>
						  <td class="col2" >
								<br style="line-height:6px">
								<img src="images/t1_2.gif" alt=""><br>


					      <br style="line-height:19px">
<?
include("admin2.php");
?>
							<td style="width:30px"></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="border"></td>
			</tr>
			<tr>
				<td class="block">
					<table>
						<tr>
							<td style="height:28px"></td>

						</tr>
						<tr>
							<td>

								<table style="height:101px">
									<tr>
										<td class="newsletter">
										  <div>
												<img src="images/t1_3.gif" alt=""><br>
												<br style="line-height:7px">
<?
include("login2.php");
?>
						<br>								  
										  </div>
										</td>
										<td style="width:36px"></td>
										<td style="width:383px">
											<img src="images/t1_4.gif" alt=""><br>
											<br style="line-height:18px">
											<img src="images/lapka.gif" alt="" align="left" style="margin-top:3px">
											<div style="margin-left:22px">
											<strong>Quote by .:SUP:.</strong> I ask Ronnie aka Vital to make a multiplayer map for my clan called SUP <a href="http://www.SUP-Clan.com">Link</a>, he had it completed within 8 hours! Fast easy and reliable.<img src="images/lapka1.gif" style="vertical-align:middle" alt="">	
<br><br><br><strong>ScreenShots</strong><br><br>
<a href="images/cell1.jpg"><img src="images/cell1.jpg"  width="200" height="85"></a>	<br>
<a href="images/cell2.jpg"><img src="images/cell2.jpg"  width="200" height="85"></a>							</div>

										</td>
										<td style="width:30px"></td>
									</tr>
								</table>
							</form>
							</td>
						</tr>
						<tr>
							<td class="col3">
								<div class="right">
									<a href="#"><img src="images/learn_more.gif" alt="" border="0"></a> 
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="border"></td>
			</tr>
		</table>
	</td>
    </tr>
<tr>
        <td class="footer"><img src="images/imagination.gif" alt=""><img src="images/line.gif" alt=""><a href="admin.php">Admin Login</a></td>
    </tr>
</table>
</body>
</html>




 

the admin2.php

<?php
if($_SESSION['username'] == ronnie) {
?>
<form action="reginsert.php" method="post">"
<br><tr><td>Name:</td><td><input type="text" name="name" maxlength="25"></td>
<tr><td>Registration Code:</td><td><input type="text" name="key" maxlength="25"></td><br>
<td><input name="add" type="submit" id="add" value="Set Registration Key"></td>
<form></tr>
<?
}
else{
  echo "YOU ARE NOT AN ADMIN!";
}
?>

 

the reginsert.php

 

<?php
session_start();
include 'database.php';
$regis = $_POST['regis'];
$usa = $_POST['name'];
if(!strstr($_SERVER['HTTP_REFERER'],"greatdiscountedgames.com/site_flash/admin.php")) {
          echo "ERROR: YOU CANNOT ACCESS THIS FILE MANUALLY";
}
else {
$query  = "UPDATE info SET regis = '$regis' WHERE username = '$usa'";
mysql_query($query) or die(mysql_error());
header('Location: http://www.greatdiscountedgames.com/admin.php');
}
?>

 

line 77 of admin.php

include("admin2.php");

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.