Warptweet Posted February 11, 2007 Share Posted February 11, 2007 I know this is a very long code, but I will give you the proper lines and area to look at, because most of the code doesn't necessarily have to do with the error. <? /** * Main.php * * This is an example of the main page of a website. Here * users will be able to login. However, like on most sites * the login form doesn't just have to be on the main page, * but re-appear on subsequent pages, depending on whether * the user has logged in or not. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 26, 2004 */ include("include/session.php"); ?> <html> <style> body { scrollbar-face-color:#656565; scrollbar-track-color:#454545; scrollbar-darkshadow-color:#454545; scrollbar-3dlight-color:#202020; scrollbar-shadow-color:#ffdf12; scrollbar-highlight-color:#ffdf12; scrollbar-arrow-color:#ffdf12; } </style> <head> <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Warptweet.com</title> </head> <body background="http://www.warptweet.com/images/warpback.PNG" text="#FFDF12" link="#FFDF12" vlink="#FFFF12" alink="#FFFF00"> <div align="center" style="width: 960; height: 696"> <center> <p> <img border="0" src="http://www.warptweet.com/images/warpbanner.PNG" width="425" height="75"><a href="http://www.warptweet.com"></p> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="762" height="1"> <tr> <td width="760" height="27" bordercolorlight="#454545" bordercolordark="#454545" bgcolor="#454545" valign="top" align="center" colspan="2"> <?php include("http://www.warptweet.com/phpchange/menu.php"); ?></td> </tr> <tr> <td width="760" height="1" bordercolorlight="#454545" bordercolordark="#454545" bgcolor="#454545" valign="top" align="center" colspan="2"> <font size="2">Welcome, Guest!</font></td> </tr> <tr> <td width="156" bordercolorlight="#454545" bordercolordark="#454545" bgcolor="#454545" valign="top" align="center" background="http://www.warptweet.com/images/warpnavi.PNG" bordercolor="#FFFFFF"> <font size="2"> <img border="0" src="http://www.warptweet.com/images/warpnavitop.PNG" width="158" height="4"><br> // 50 Side Navigation</font><p><font size="2"><?php include("http://www.warptweet.com/phpchange/sidebar.php"); ?></font></td> <td width="603" height="640" bordercolorlight="#454545" bordercolordark="#454545" bgcolor="#454545" valign="top" align="left"> <?php function generate_rand($l){ $c= "WARPTEONwarpteonDICYdicy159"; srand((double)microtime()*1000000); for($i=0; $i<$l; $i++) { $rand.= $c[rand()%strlen($c)]; } return $rand; } $uploaddir = "./uploads/flash/"; $maxfilesize = 20971520; //1 megabyte $filename = $_FILES['file']['name']; $filesize = $_FILES['file']['size']; $min_deslenngth = 20; $min_nalenngth = 5; $min_aulenngth = 2; $flashicon = $_POST['flashicon']; $flashdescription = $_POST['flashdescription']; $flashname = $_POST['flashname']; $flashage = 0; $flashcommentary = $_POST['flashcommentary']; $filetmpname = $_FILES['file']['tmp_name']; $valid = array (".swf"); if ($filename) { $error = ""; if ($filesize == 0) { $error .= "The submitted file was invalid.<br />"; } $type = strtolower(strstr($filename, '.')); if (!in_array($type, $valid)) { $error .= "The file you uploaded must be of a Flash(.swf) file extension!<br />"; } if (!$_POST['flashname']){ $error .= "You did not enter the Flash Name!<br />"; } if (!$_POST['flashdescription']){ $error .= "You did not enter a Description!<br />"; } if (!$_POST['flashcommentary']){ $error .= "You did not enter a Commentary!<br />"; } // 100 if (file_exists("http://www.warptweet.com/211612151419/$flashname .php")) { $error .= "The name of this Flash Entry already exists, please rename your Flash!<br />"; } if ($filesize>$maxfilesize) { $error .= "The submitted file was larger than a Megabyte.<br />"; } if(strstr($_POST['flashcommentary'],"<embed")) { $error .= "Your Commentary may not contain Embed Source HTML!<br />"; } if(strstr($_POST['flashdescriptino'],"<embed")) { $error .= "Your Description may not contain Embed Source HTML!<br />"; } if(strstr($_POST['flashdescription'],"<a href")) { $error .= "Your Flash Description may not Contain HTML Links!<br />"; } if(strstr($_POST['flashdescription'],"<")) { $error .= "Your Flash Description may not contain HTML! This may be an error caused by the < symbol in your Flash Description.<br />"; } if(strstr($_POST['flashname'],"<")) { $error .= "Your Flash Name may not contain HTML! This was detected because of a < symbol inside the Flash Name field, please do not include < or > symbols.<br />"; } $randnum = generate_rand(50); $randnum .= $type; $file_exists = true; while ($file_exists) { if (file_exists("$uploaddir$randnum")) { $randnum = generate_rand(50); $randnum .= $type; }else{ //50 $file_exists = false; } } if ($error == "") { if (move_uploaded_file($filetmpname, "$uploaddir$randnum")) { chmod("$uploaddir$randnum", 0644); echo "Your file was successfully uploaded!</br></br><a href=\"http://www.warptweet.com/uploads/pages/$flashname.php\">Click here to see your flash!</a><br />"; if($_POST['flashviolence']=="1"){ $flashviolence = ""; } //60 if($_POST['flashviolence']=="2"){ $flashviolence = "Mild Violence</br>"; $flashage += 3; } if($_POST['flashviolence']=="3"){ $flashviolence = "<b>Excessive Violence</b></br>"; $flashage += 8; } if($_POST['flashviolence']=="4"){ $flashviolence = "<b><i>Extreme Violence</b></i></br>"; $flashage += 13; } if($_POST['flashaudio']=="1"){ $flashaudio = ""; } if($_POST['flashaudio']=="2"){ $flashaudio = "Mild Explicit Audio</br>"; $flashage += 8; } if($_POST['flashaudio']=="3"){ $flashaudio = "<b>Excessive Explicit Audio</b></br>"; $flashage += 13; } if($_POST['flashaudio']=="4"){ $flashaudio = "<b><i>Extremely Explicit Audio</b></i></br>"; $flashage += 18; } // 150 if($_POST['flashtext']=="1"){ $flashtext = ""; } if($_POST['flashtext']=="2"){ $flashtext = "Mild Explicit Text</br>"; $flashage += 8; } if($_POST['flashtext']=="3"){ $flashtext = "<b>Excessive Explicit Text</b></br>"; $flashage += 13; } if($_POST['flashtext']=="4"){ $flashtext = "<b><i>Extremely Explicit Text</b></i></br>"; $flashage += 18; } if($_POST['flashadult']=="1"){ $flashadult = ""; } if($_POST['flashadult']=="2"){ $flashadult = "Mild Adult Themes</br>"; $flashage += 8; } if($_POST['flashadult']=="3"){ //100 $flashadult = "<b>Excessive Adult Themes</b></br>"; $flashage += 13; } if($_POST['flashadult']=="4"){ $flashadult = "<b><i>Extreme Adult Themes</b></i></br>"; $flashage += 18; } if($_POST['flashnudity']=="1"){ $flashnudity = ""; } if($_POST['flashnudity']=="2"){ $flashnudity = "Mild Nudity</br>"; $flashage += 8; } if($_POST['flashnudity']=="3"){ $flashnudity = "<b>Excessive Nudity</b></br>"; $flashage += 13; } if($_POST['flashnudity']=="4"){ $flashnudity = "<b><i>Extreme Nudity</b></i></br>"; $flashage += 18; } if ($flashage < 3){ $flashrecommended = "all audiences."; } if ($flashage > 2){ $flashrecommended = "ages 3 and above."; } if ($flashage > 7){ $flashrecommended = "ages 8 and above."; } if ($flashage > 12){ $flashrecommended = "ages 13 and above."; } if ($flashage > 17){ $flashrecommended = "ages 18 and above."; } $o = fopen("uploads/pages/".$_POST['flashname'].".php", "w"); $stringData = " <? /** * UserInfo.php * * This page is for users to view their account information * with a link added for them to edit the information. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 26, 2004 */ include(\"include/session.php\"); ?> <html> <head> <meta http-equiv=\"Content-Language\" content=\"en-us\"> <meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\"> <meta name=\"ProgId\" content=\"FrontPage.Editor.Document\"> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\"> <title>Warptweet.com</title> </head> <body background=\"http://www.warptweet.com/images/warpback.PNG\" topmargin=\"0\" link=\"#66CCFF\" vlink=\"#66CCFF\" alink=\"#66CCFF\" text=\"#FFFFFF\"> <?php include(\"http://www.warptweet.com/phpchange/header.php\"); ?> </p> <div align=\"center\"> <center> <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"758\" height=\"420\"> <tr> <td width=\"100\" height=\"100\" bgcolor=\"#454545\" valign=\"top\" bordercolorlight=\"#ACACAC\" bordercolordark=\"#111111\" bordercolor=\"#FFFFFF\"> <p align=\"left\"><?php list($width, $height) = getimagesize("".$req_user_info['avatar'].""); if($width < 101 || $height < 101){ echo "<img src="".$req_user_info['avatar']."">"; } else echo "<img border="0" src="".$req_user_info['avatar']."" width="100" height="100">"; ?></p> </td> <td width=\"639\" height=\"420\" bgcolor=\"#454545\" valign=\"top\" align=\"left\" rowspan=\"2\"> "; fwrite($o, $stringData); $stringData = "Flash Name: $flashname </br>"; fwrite($o, $stringData); $stringData = "Description: $flashdescription"; fwrite($o, $stringData); $stringData = "</br></br>"; fwrite($o, $stringData); $stringData = "Commentary:<br> $flashcommentary"; //131 fwrite($o, $stringData); $stringData = "</br></br>"; fwrite($o, $stringData); $stringData = "$flashviolence$flashaudio$flashtext$flashadult$flashnudity<br>"; fwrite($o, $stringData); $stringData = "Recommended for $flashrecommended</br></br>"; fwrite($o, $stringData); if($_POST['flashtypes']=="1"){ $stringData = "<b><FONT SIZE=+3><A HREF=\"javascript:void(0)\" ONCLICK=\"window.open('http://www.warptweet.com/uploads/flash/$randnum','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=$flashwidth,height=$flashheight')\">Watch this Movie!</a></font> <img border=\"0\" src=\"$flashicon\" width=\"75\" height=\"75\">"; fwrite($o, $stringData); } if($_POST['flashtypes']=="2"){ $stringData = "<b><FONT SIZE=+3><A HREF=\"javascript:void(0)\" ONCLICK=\"window.open('http://www.warptweet.com/uploads/flash/$randnum','miniwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=$flashwidth,height=$flashheight')\">Play this Game!</a></font> <img border=\"0\" src=\"$flashicon\" width=\"75\" height=\"75\">"; fwrite($o, $stringData); } $stringData = "</td> </tr> <tr> <td width=\"116\" height=\"261\" bgcolor=\"#454545\" valign=\"top\"> <b><font face=\"Tahoma\" size=\"2\">Author: $session->username</font></td> </tr> </table> </center> </div> </body> </html>"; fwrite($o, $stringData); fclose($o); } else { echo "Your file could not be uploaded."; } }else{ echo $error; } }else{ echo "No file was uploaded"; } ?><body></td> </tr> </table> </center> </div> </body> </html> Okay, pay close attention to LINE 270 Also pay close attention to the lines which have to do with $stringData and writing to files. For some reason, it says "Unexpected "/" on Line 270" You can also test out this yourself at my uploader.. www.warptweet.com/upload.php (Note, you can only upload .swf files) You will notice that after uploading a .swf file it gives that error. Can anyone tell me what seems to be the problem? Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 11, 2007 Share Posted February 11, 2007 "I know this is a very long code, but I will give you the proper lines and area to look at, because most of the code doesn't necessarily have to do with the error" Then don't POST most of the code! Just POST the part that matters, instead of posting it all and telling us to search through it. This line has unescaped quotes: echo "<img border="0" src="".$req_user_info['avatar']."" width="100" height="100">"; Which is line 270? Post a few lines before 270 to a few lines after. Like, 5 lines total. Not all 47593 lines. Quote Link to comment Share on other sites More sharing options...
Warptweet Posted February 11, 2007 Author Share Posted February 11, 2007 Okay. LINE 270 list($width, $height) = getimagesize("".$req_user_info['avatar'].""); GENERAL AREA (All inside the $stringData = " code) $o = fopen("uploads/pages/".$_POST['flashname'].".php", "w"); $stringData = " <? include(\"include/session.php\"); ?> <html> <head> <meta http-equiv=\"Content-Language\" content=\"en-us\"> <meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\"> <meta name=\"ProgId\" content=\"FrontPage.Editor.Document\"> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\"> <title>Warptweet.com</title> </head> <body background=\"http://www.warptweet.com/images/warpback.PNG\" topmargin=\"0\" link=\"#66CCFF\" vlink=\"#66CCFF\" alink=\"#66CCFF\" text=\"#FFFFFF\"> <?php include(\"http://www.warptweet.com/phpchange/header.php\"); ?> </p> <div align=\"center\"> <center> <table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"758\" height=\"420\"> <tr> <td width=\"100\" height=\"100\" bgcolor=\"#454545\" valign=\"top\" bordercolorlight=\"#ACACAC\" bordercolordark=\"#111111\" bordercolor=\"#FFFFFF\"> <p align=\"left\"><?php list($width, $height) = getimagesize("".$req_user_info['avatar'].""); if($width < 101 || $height < 101){ echo "<img src="".$req_user_info['avatar']."">"; } else echo "<img border="0" src="".$req_user_info['avatar']."" width="100" height="100">"; ?></p> </td> <td width=\"639\" height=\"420\" bgcolor=\"#454545\" valign=\"top\" align=\"left\" rowspan=\"2\"> "; Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 11, 2007 Share Posted February 11, 2007 include(\"include/session.php\"); Unexpected \. There is a \ that doesn't belong. Hint: It's not the one inside the string Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 Edit: Actually, both of the \ in that line are wrong Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.