- Impact
- 4
ok, i have a very small error in this code. i know where the error is because if i remove that bit it works fine. I think the problem is one ' } ' or ' { ' is in the wrong place or needed some where.
the error im geting is :
all the code:
error part:
any help guys?
thanks
-ed
the error im geting is :
Parse error: parse error, unexpected T_ELSE in C:\apache2triad\htdocs\topsites\silk\admin\index.php on line 131
all the code:
PHP:
<HTML>
<HEAD>
<TITLE>Admin Area</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #646464;
}
.style1 {
font-size: 36px;
font-weight: bold;
}
.header {
font-size: 36px;
font-weight: bold;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</HEAD>
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('images/nav_roll_10.jpg','images/nav_roll_12.jpg','images/nav_roll_13.jpg','images/nav_roll_14.jpg')">
<div align="center">
<table width="200" border="0">
<tr>
<th scope="col">
<!-- ImageReady Slices (odd.psd - Slices: 01, 03, 04, 05, 06, 07, 08, 09, 16, 18, 19) -->
<TABLE WIDTH=519 BORDER=0 align="left" CELLPADDING=0 CELLSPACING=0>
<TR>
<TD COLSPAN=4> <IMG SRC="images/left_01.jpg" WIDTH=519 HEIGHT=10 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=10 ALT=""></TD>
</TR>
<TR>
<TD> <IMG SRC="images/left_03.jpg" WIDTH=69 HEIGHT=31 ALT=""></TD>
<TD> <IMG SRC="images/left_04.jpg" WIDTH=36 HEIGHT=31 ALT=""></TD>
<TD> <img src="images/odd_05.jpg" width="401" height="31"></TD>
<TD> <IMG SRC="images/left_06.jpg" WIDTH=13 HEIGHT=31 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=31 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2 background="images/left_07.jpg"> </TD>
<TD COLSPAN=2 ROWSPAN=2 valign="top" background="images/left_08.jpg"><div align="center" class="header"> <?PHP if(!isset($title)){ echo"DASHBOARD";}else{ echo $title; } ?></div>
<p align="center"><?php if ($title == "CONFIG"){
if($_POST['submit']){
if(empty($_POST['name'])){
$name = FALSE;
$message .="<p> you forgot to enter the sites name</p>";
} else {
$n = $_POST['name'];
}
if(empty($_POST['URL'])){
$UR = FALSE;
$message .="<p> you forgot to enter the sites URL (web address)</p>";
} else {
$UR = $_POST['URL'];
}
if(empty($_POST['email'])){
$em = FALSE;
$message .="<p> you forgot to enter your email address</p>";
} else {
$em = $_POST['email'];
}
if(empty($_POST['slogan'])){
$sl = FALSE;
$message .="<p> you forgot to enter the sites slogan / tag-line</p>";
} else {
$sl = $_POST['slogan'];
}
if(empty($_POST['subject'])){
$su = FALSE;
$message .="<p> you forgot to enter the sites subject</p>";
} else {
$su = $_POST['subject'];
}
if(empty($_POST['description'])){
$de = FALSE;
$message .="<p> you forgot to enter the sites description</p>";
} else {
$de = $_POST['description'];
}
if(empty($_POST['keywords'])){
$ke = FALSE;
$message .="<p> you forgot to enter the sites keywords</p>";
} else {
$ke = $_POST['keywords'];
}
if(empty($_POST['title'])){
$ti = FALSE;
$message .="<p> you forgot to enter the sites title</p>";
} else {
$ti = $_POST['title'];
}
}
if($n && $UR && $em && $sl && $su && $de && $ke && $ti){
$query = "INSERT INTO (site_name, site_url, site_slogan, site_subject, meta_keywords, meta_description, meta_short_description, site_email) VALUES ('$n', '$UR', '$sl', '$su', '$ke', '$de', '$title')";
$result = @mysql_query($query);
if($result){echo"<p>Updated Config!</p>";}else{ echo"<p>The config could not be updated</p><p>" . mysql_error() . "</p>";
}else{ echo $message; }
}else{
echo"<style type='text/css'>
<!--
.style1 {font-size: 12px}
.style6 {
font-size: 14px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style8 {font-family: Georgia, 'Times New Roman', Times, serif}
.style11 {font-size: 14px}
.style13 {
font-size: 14px;
font-family: Georgia, 'Times New Roman', Times, serif;
font-weight: bold;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
.style15 {font-size: 9px}
-->
</style>
<div align='center'>
<form name='form1' method='post' action=''>
<table width='409' border='0' cellpadding='5' cellspacing='5'>
<tr bgcolor='#CCCCCC'>
<th bgcolor='#ECE9D8' scope='row'><em><strong><a href='#' title='note: move your mouse over any text in the White Background to show a message'>item <br>
<span class='style15'>(roll over text)</span></a></strong></em></th>
<td bgcolor='#CCCCCC'><em><strong>input</strong></em></td>
<td bgcolor='#999999'><em><strong>examples</strong></em></td>
</tr>
<tr bgcolor='#CCCCCC'>
<th width='87' bgcolor='#ECE9D8' scope='row'><div align='center' class='style6 style8'><a href='#' title='your sites name'>site name</a> </div></th>
<td width='144' bgcolor='#CCCCCC'><input name='name' type='text' id='name'></td>
<td width='140' bgcolor='#999999'><span class='style1'>games for you </span></td>
</tr>
<tr>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style11 style8'><a href='#' title='Your sites URL'><strong>site url</strong></a></div></th>
<td bgcolor='#CCCCCC'><input name='url' type='text' id='url' value='http://'></td>
<td bgcolor='#999999'><span class='style1'>http://www.games4you.com/</span></td>
</tr>
<tr bgcolor='#CCCCCC'>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style13'><a href='#'title='Youe email address'>site email </a></div></th>
<td bgcolor='#CCCCCC'><input name='email' type='text' id='email'></td>
<td bgcolor='#999999'><span class='style1'>[email protected]</span></td>
</tr>
<tr>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style13'><a href='#'title='Your sites slogan / tag-line'>site slogan</a></div></th>
<td bgcolor='#CCCCCC'><input name='slogan' type='text' id='slogan'></td>
<td bgcolor='#999999'><span class='style1'>The worlds best gaming sites brought to you! </span></td>
</tr>
<tr bgcolor='#CCCCCC'>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style13'><a href='#'title='The subject of your topsites site'>site subject</a></div></th>
<td bgcolor='#CCCCCC'><input name='subject' type='text' id='subject'></td>
<td bgcolor='#999999'><span class='style1'>online gaming</span></td>
</tr>
<tr>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style13'><a href='#'title='a description of your site '>site description </a></div></th>
<td bgcolor='#CCCCCC'><textarea name='description' cols='15' id='description'></textarea></td>
<td bgcolor='#999999'><span class='style1'>games4you has the top 10 online gaming sites on the net listed! Come and see whos the best gaming site! </span></td>
</tr>
<tr bgcolor='#CCCCCC'>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style13'><a href='#'title='keywords for your site '>site keywords </a></div></th>
<td bgcolor='#CCCCCC'><input name='keywords' type='text' id='keywords' value=''></td>
<td bgcolor='#999999'><span class='style1'>gaming,online gaming,top 10 game sites </span></td>
</tr>
<tr>
<th bgcolor='#ECE9D8' scope='row'><div align='center' class='style13'><a href='#'title='a summary of your site '>site title</a></div></th>
<td bgcolor='#CCCCCC'><input name='title' type='text' id='title'></td>
<td bgcolor='#999999'><span class='style1'>A topsite site with the 10 best gaming sites listed</span></td>
</tr>
<tr bgcolor='#CCCCCC'>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield9'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
<tr>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield10'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
<tr>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield11'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
<tr>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield12'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
<tr>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield13'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
<tr>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield14'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
<tr>
<td bgcolor='#ECE9D8' scope='row'><div align='center'><span class='style11'></span></div></td>
<td bgcolor='#CCCCCC'><input type='text' name='textfield15'></td>
<td bgcolor='#999999'><span class='style1'></span></td>
</tr>
</table>
<p>
<input type='submit' name='Submit' value='Submit'>
</p>
</form>
</div>
"; }?>
</p>
</TD>
<TD background="images/left_09.jpg"> </TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=388 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2 valign="bottom" background="images/left_09.jpg"> <img src="images/left_16.jpg" alt="" width=13 height=51 align="absbottom"></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=14 ALT=""></TD>
</TR>
<TR>
<TD> <IMG SRC="images/left_18.jpg" WIDTH=69 HEIGHT=37 ALT=""></TD>
<TD COLSPAN=2> <IMG SRC="images/left_19.jpg" WIDTH=437 HEIGHT=37 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=37 ALT=""></TD>
</TR>
</TABLE>
<!-- ImageReady Slices (odd.psd - Slices: 02, 03, 04, 05, 06, 07, 08, 09) -->
<TABLE WIDTH=121 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD COLSPAN=2> <IMG SRC="images/index_02.jpg" WIDTH=121 HEIGHT=56 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=56 ALT=""></TD>
</TR>
<TR>
<TD> <a href="index.php?title=DASHBOARD" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('dash','','images/nav_roll_10.jpg',1)"><img src="images/index_03.jpg" alt="dashboard" name="dash" width="73" height="118" border="0"></a></TD>
<TD ROWSPAN=4> <IMG SRC="images/index_04.jpg" WIDTH=48 HEIGHT=362 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=118 ALT=""></TD>
</TR>
<TR>
<TD> <a href="index.php?title=CONFIG" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('config','','images/nav_roll_12.jpg',1)"><img src="images/index_05.jpg" alt="config" name="config" width="73" height="89" border="0"></a></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=89 ALT=""></TD>
</TR>
<TR>
<TD> <a href="index.php?title=TOPSITES" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('topsites','','images/nav_roll_13.jpg',1)"><img src="images/index_06.jpg" alt="topsites" name="topsites" width="73" height="102" border="0"></a></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=102 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2> <a href="index.php?title=HELP" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('help','','images/nav_roll_14.jpg',1)"><img src="images/index_07.jpg" alt="help" name="help" width="73" height="64" border="0"></a></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=53 ALT=""></TD>
</TR>
<TR>
<TD ROWSPAN=2> <IMG SRC="images/index_08.jpg" WIDTH=48 HEIGHT=62 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=11 ALT=""></TD>
</TR>
<TR>
<TD> <IMG SRC="images/index_09.jpg" WIDTH=73 HEIGHT=51 ALT=""></TD>
<TD> <IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=51 ALT=""></TD>
</TR>
</TABLE>
<!-- End ImageReady Slices -->
<!-- End ImageReady Slices --></th>
</tr>
</table>
</div>
</BODY>
</HTML>
error part:
PHP:
if($_POST['submit']){
if(empty($_POST['name'])){
$name = FALSE;
$message .="<p> you forgot to enter the sites name</p>";
} else {
$n = $_POST['name'];
}
if(empty($_POST['URL'])){
$UR = FALSE;
$message .="<p> you forgot to enter the sites URL (web address)</p>";
} else {
$UR = $_POST['URL'];
}
if(empty($_POST['email'])){
$em = FALSE;
$message .="<p> you forgot to enter your email address</p>";
} else {
$em = $_POST['email'];
}
if(empty($_POST['slogan'])){
$sl = FALSE;
$message .="<p> you forgot to enter the sites slogan / tag-line</p>";
} else {
$sl = $_POST['slogan'];
}
if(empty($_POST['subject'])){
$su = FALSE;
$message .="<p> you forgot to enter the sites subject</p>";
} else {
$su = $_POST['subject'];
}
if(empty($_POST['description'])){
$de = FALSE;
$message .="<p> you forgot to enter the sites description</p>";
} else {
$de = $_POST['description'];
}
if(empty($_POST['keywords'])){
$ke = FALSE;
$message .="<p> you forgot to enter the sites keywords</p>";
} else {
$ke = $_POST['keywords'];
}
if(empty($_POST['title'])){
$ti = FALSE;
$message .="<p> you forgot to enter the sites title</p>";
} else {
$ti = $_POST['title'];
}
}
if($n && $UR && $em && $sl && $su && $de && $ke && $ti){
$query = "INSERT INTO (site_name, site_url, site_slogan, site_subject, meta_keywords, meta_description, meta_short_description, site_email) VALUES ('$n', '$UR', '$sl', '$su', '$ke', '$de', '$title')";
$result = @mysql_query($query);
if($result){echo"<p>Updated Config!</p>";}else{ echo"<p>The config could not be updated</p><p>" . mysql_error() . "</p>";
}else{ echo $message; }
}else{
any help guys?
thanks
-ed







