homepage Welcome to WebmasterWorld Guest from 54.167.238.60
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Parse error: PHP unexpected $end
error message
julival




msg:4643698
 1:43 pm on Feb 9, 2014 (gmt 0)

Parse error: syntax error, unexpected $end in /home/u807470965/public_html/upload/view.php on line 100



<?php
ERROR_REPORTING(0);

require("../init.php");
if(!isloggedin())
{/*
header("location: ../index.php");
*/}
else
{
$user=$_SESSION["user"];
}
$id=(int)$_REQUEST["id"];
if($id<1)
{/*
header('location: index.php');
exit();
*/}
$cquery=mysql_query("SELECT * FROM b_upload WHERE id=$id");
if(mysql_num_rows($cquery)==0)
{
header("location: index.php");
exit();
}
$cinfo=mysql_fetch_array($cquery);
$name=$cinfo["name"];
$id=$cinfo["id"];
$description=$cinfo["description"];
$by=$cinfo["by"];
$date=$cinfo["date"];
$date=date("D, d M Y", $date);
$extension=$cinfo["extension"];
$downloads=$cinfo["downloads"];
$views=$cinfo["views"]+1;
mysql_query("UPDATE b_upload SET views='$views'");
$size=$cinfo["size"];
$size=get_size($size);
$catid=$cinfo["catid"];
$catinfo=mysql_fetch_assoc(mysql_query("SELECT name FROM b_uploadcat WHERE id='$catid'"));
$catname=$catinfo["name"];
echo"<title>$config->title - Viewing $name</title>";
echo"<style type='text/css'>
<!--
.style1 {
color: #FF0000;
font-weight: bold;
}
.style2 {
color: #FFFF00;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
}
.style5 {font-family: Arial, Helvetica, sans-serif; color: #FF0000;}
.style6 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>

<div class='body_width'>";
include"../topnav.php";
echo"<div class='breadcrumb'><a href='../main.php'>Home</a> &raquo; <a href='index.php'>uploads</a> &raquo; $name</div>";
echo"<center>";
include"../ads.php";
fblike();

echo"</center>";
echo"<center>

<div class='public_message'><div class='success'></div></div>

</center>


<div style='margin-top: 5px;' class='grid3'>




</div>";


echo"<div class='grid3 middle'>
<div class='b_head'>File &raquo; $name</div>";
echo"<div class='file-info'>
if(!isloggedin())
{
echo\"<div class='download_button'><a href='download.php?id=$id'><center>Download this App Here</center></a></div><ul>
<li class='first'>
<b><span>Name: $name</li><li><span class='style1'>Description:</span> $description</li><li>Uploaded on: $date</li><li>By: $by</li><li>Category: $catname</li><li>Size: $size</li><li>Extension: $extension</li><li>Total views: $views</li><li>Total Downloads: $downloads</li></ul></span></li></li></ul></div>";
echo"<div class='link_button'><a href='category.php?id=$catid'>Go Back</a></div></div>\";
}
else
{
echo\"<font color=\"red\">Please <a href=\'../index1.php\'> Login </a> or <a href=\'../register.php\'> Register </a> To Enjoy Free And Unlimited Downloads!</font>\";
}
</div>
include\"../footer.php\";
?>

 

coopster




msg:4644301
 7:19 pm on Feb 11, 2014 (gmt 0)

Welcome to WebmasterWorld, julival.

Do you use a code editor? I highly recommend using an editor that has PHP coding syntax highlighting and error checking built-in. It will help you spot these errors quite quickly. In this case, you forgot to close out your echo statement before you begin your "if" logic, right here ...

echo"<div class='file-info'>
if(!isloggedin())
{

penders




msg:4644620
 1:08 am on Feb 13, 2014 (gmt 0)

.... but what's a bit confusing is that the double quotes that follow on subsequent lines are all backslash escaped as if the "if" logic that follows is meant to be part of that echo?! Is this intentional? Or has some code editor escaped these chars?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved