Foros del Web » Programando para Internet » PHP »

unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

Estas en el tema de unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' en el foro de PHP en Foros del Web. buenas gente, tengo un problema... Estoy con un archivo php y cuando lo subo me aparece: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ...
  #1 (permalink)  
Antiguo 14/12/2010, 20:29
 
Fecha de Ingreso: diciembre-2010
Mensajes: 180
Antigüedad: 13 años, 4 meses
Puntos: 5
unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

buenas gente, tengo un problema... Estoy con un archivo php y cuando lo subo me aparece:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/ironserc/public_html/upload.php on line 159

Segun dreamweaver la linea 159 es:

Código PHP:
Ver original
  1. echo "<center>Link de descarga:</center><p><center><a href=\"$scripturl/files/$filename""</a><br/>";

Codigo completo:
Código PHP:
Ver original
  1. <?php
  2. //  ___  ____       _  ______ _ _        _   _           _  
  3. //  |  \/  (_)     (_) |  ___(_) |      | | | |         | |  
  4. //  | .  . |_ _ __  _  | |_   _| | ___  | |_| | ___  ___| |_
  5. //  | |\/| | | '_ \| | |  _| | | |/ _ \ |  _  |/ _ \/ __| __|
  6. //  | |  | | | | | | | | |   | | |  __/ | | | | (_) \__ \ |_
  7. //  \_|  |_/_|_| |_|_| \_|   |_|_|\___| \_| |_/\___/|___/\__|
  8. //
  9. // by MiniFileHost.co.nr                  version 1.1
  10. ////////////////////////////////////////////////////////
  11.  
  12. include("./config.php");
  13. include("./header.php");
  14.  
  15. $filename = $_FILES['upfile']['name'];
  16. $filesize = $_FILES['upfile']['size'];
  17. $rand2=rand('1','999999');
  18.  
  19. $m=$shourturl;
  20. if ($m=="true")
  21.   $short= "";
  22. else
  23.   $short= "download.php?file=";
  24.  
  25. $bans=file("./bans.txt");
  26. foreach($bans as $line)
  27. {
  28.   if ($line==$rand2."\n"){
  29. ?> <center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top>
  30. <?
  31.     echo "That file is not allowed to be uploaded.";
  32. ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  33.     include("./footer.php");
  34.     die();
  35.   }
  36.   if ($line==$_SERVER['REMOTE_ADDR']."\n"){
  37. ?><center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top>
  38.    <? echo "You are not allowed to upload files.";
  39. ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  40.     include("./footer.php");
  41.     die();
  42.   }
  43. }
  44.  
  45. $checkfiles=file("./files.txt");
  46. foreach($checkfiles as $line)
  47. {
  48.   $thisline = explode('|', $line);
  49.   if ($thisline[0]==$filecrc){
  50.     $filecrc=rand('10000','1000000000');
  51.   }
  52. }
  53.  
  54. if(isset($allowedtypes)){
  55. $allowed = 0;
  56. foreach($allowedtypes as $ext) {
  57.   if(substr($filename, (0 - (strlen($ext)+1) )) == ".".$ext)
  58.     $allowed = 1;
  59. }
  60. if($allowed==0) {
  61. ?><center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top><?
  62.    echo "That file type is not allowed to be uploaded.";
  63.    ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  64. include("./footer.php");
  65.    die();
  66. }
  67. }
  68.  
  69. if(isset($categorylist)){
  70. $validcat = 0;
  71. foreach($categories as $cat) {
  72.   if($_POST['category']==$cat || $_POST['category'] = ""){ $validcat = 1; }
  73. }
  74. if($validcat==0) {
  75. ?><center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top><?
  76.    echo "Invalid category was chosen..";
  77. ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  78.    include("./footer.php");
  79.    die();
  80. }
  81. $cat = $_POST['category'];
  82. } else { $cat = ""; }
  83.  
  84. if($filesize==0) {
  85. ?><center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top><?
  86. echo "You didn't pick a file to upload.";
  87. ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  88. include("./footer.php");
  89. die();
  90. }
  91.  
  92. $filesize = $filesize / 1048576;
  93.  
  94. if($filesize > $maxfilesize) {
  95. ?><center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top><?
  96. echo "The file you uploaded is too large.";
  97. ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  98. include("./footer.php");
  99. die();
  100. }
  101.  
  102. $userip = $_SERVER['REMOTE_ADDR'];
  103. $time = time();
  104.  
  105. if($filesize > $nolimitsize) {
  106.  
  107. $uploaders = fopen("./uploaders.txt","r+");
  108. flock($uploaders,2);
  109. while (!feof($uploaders)) {
  110. $user[] = chop(fgets($uploaders,65536));
  111. }
  112. fseek($uploaders,0,SEEK_SET);
  113. ftruncate($uploaders,0);
  114. foreach ($user as $line) {
  115. @list($savedip,$savedtime) = explode("|",$line);
  116. if ($savedip == $userip) {
  117. if ($time < $savedtime + ($uploadtimelimit*60)) {
  118. ?><center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top><?
  119. echo "You're trying to upload again too soon!";
  120. ?></center></td></tr></table><p style="margin:3px;text-align:center"><?
  121. include("./footer.php");
  122. die();
  123. }
  124. }
  125. if ($time < $savedtime + ($uploadtimelimit*60)) {
  126.   fputs($uploaders,"$savedip|$savedtime\n");
  127. }
  128. }
  129. fputs($uploaders,"$userip|$time\n");
  130.  
  131. }
  132.  
  133. $passkey = rand(100000, 999999);
  134.  
  135. if($emailoption && isset($_POST['myemail']) && $_POST['myemail']!="") {
  136. $uploadmsg = "Your file (".$filename.") was uploaded.\n Your download link is: ". $scripturl . "$short" . $rand2 . "\n Your delete link is: ". $scripturl . "$short" . $rand2 . "&del=" . $passkey . "\n Thank you for using our service!";
  137. mail($_POST['myemail'],"Your Uploaded File",$uploadmsg,"From: [email protected]\n");
  138. }
  139.  
  140. if($passwordoption && isset($_POST['pprotect'])) {
  141.   $passwerd = md5($_POST['pprotect']);
  142. } else { $passwerd = md5(""); }
  143.  
  144. if($descriptionoption && isset($_POST['descr'])) {
  145.   $description = strip_tags($_POST['descr']);
  146. } else { $description = ""; }
  147.  
  148. $filelist = fopen("./files/".$rand2.".txt","w");
  149. fwrite($filelist, $rand2 ."|". basename($_FILES['upfile']['name']) ."|". $passkey ."|". $userip ."|". $time."|0|".$description."|".$passwerd."|".$cat."|\n");
  150.  
  151. $movefile = "./storage/" . $rand2;
  152. move_uploaded_file($_FILES['upfile']['tmp_name'], $movefile);
  153. ?>
  154. <center><table style="margin-top:20px;width:790px;height:400px;"><tr><td style="border:1px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:20px;text-align:left;" valign=top>
  155.  
  156. <?
  157. include("./ads.php");
  158. echo "<center><b>Tu archivo fue subido!</b></center><br />";
  159. echo "<center>Link de descarga:</center><p><center><a href=\$scripturl/files/$filename""</a><br/>";
  160. echo "<p><center>Link de eliminación </center> <p><center> <a href=\"" . $scripturl . "$filename" . $rand2 . "&del=" . $passkey . "\">". $scripturl . "$short" . $rand2 . "&del=" . $passkey . "</a><br />";
  161. echo "<p><center>Please remember the above links."; ?><p><?
  162. include("./bottomads.php");
  163. ?>
  164.   </td></tr></table></center>
  165. <?
  166.  
  167. include("./footer.php");
  168. ?>
  169. <hr>
  170. <p align="center">If you want, we will send an e-mail to up to three persons, who will be informed   about your upload. This e-mail will only contain your download links. The delete   links will not be mentioned. For privacy reasons, the e-mail addresses will not   be saved.
  171. <form action="http://rs365.rapidshare.com/cgi-bin/sendmail.cgi" method="post" target="_blank">
  172.   <div align="center">
  173.     <table>
  174.       <tr><td><div align="center"><b>Your name (as signer):</b></div></td><td>  <input type="text" name="name" size="32">
  175.       </td></tr>
  176.       <tr><td><b>E-Mail #1:</b></td><td><input type="text" name="email1" size="32"></td></tr>
  177.       <tr><td><b>E-Mail #2:</b></td><td><input type="text" name="email2" size="32"></td></tr>
  178.       <tr><td><b>E-Mail #3:</b></td><td><input type="text" name="email3" size="32"></td></tr>
  179.       </table>
  180.     <input type="submit" value="Send download links to the e-mail addresses above">
  181.   </div>
  182. </form></p>
  183. <hr>
  184. <p align="center">Last but not least you can create a free collector's account now. Your advantages:
  185.  
  186. <table><tr><td><div align="center">
  187.   <ul>
  188.     <li>Collect premium-points for downloads of your files and then convert them to a <b>FREE PREMIUM-ACCOUNT!</b></li>
  189.     <li>Use remote HTTP/FTP-Uploads to do server-to-server transfers.</li>
  190.     <li>Manage your files easily and add files to your collection at anytime.</li>
  191.     <li>Especially for photos, thumbnails are generated for an easy overview of your photos.</li>
  192.     <li>No more need to write down links or waiting until uploads are completed. Your uploads will automatically be added to your collection.</li>
  193.   </ul>
  194. </div></td></tr></table>
  195. </p>
  196. <p align="center">Create your free account now. Its easy! Just enter the details below.<br>Your uploaded file will automatically be added to your new collection.</p>
  197. <p align="center"><b>IMPORTANT:</b> This is NO premium-account, but a collector's account.<br>This means that you will not have any premium-download privileges.</p>
  198. <p><form action="https://ssl.rapidshare.com/cgi-bin/freeaccount.cgi" method="post" target="_blank">
  199.   <div align="center">
  200.     <table>
  201.       <tr><td><b>Username:</b></td><td><input type="text" name="username" size="32"></td></tr>
  202.       <tr><td><b>E-Mail:</b></td><td><input type="text" name="email" size="32"></td></tr>
  203.       <tr><td><b>Password:</b></td><td><input type="password" name="password1" size="16"></td></tr>
  204.       <tr><td><b>Repeat it:</b></td><td><input type="password" name="password2" size="16"></td></tr>
  205.       </table>
  206.     <input type="submit" value="Create collector's account! (SSL-protected)">
  207.   </div>
  208. </form></p></div></div></div>
  209. </div>
  210. <p>
  211.   <!-- wrapper -->
  212. </p>
  213. </body></html>
Ayuda porfavor, estoy hace rato con esto xD

Saludos

Última edición por SonrisaCs; 14/12/2010 a las 21:17
  #2 (permalink)  
Antiguo 14/12/2010, 21:30
 
Fecha de Ingreso: diciembre-2010
Mensajes: 73
Antigüedad: 13 años, 4 meses
Puntos: 2
Respuesta: unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

¿Será el punto y coma?
  #3 (permalink)  
Antiguo 14/12/2010, 21:33
 
Fecha de Ingreso: diciembre-2010
Mensajes: 180
Antigüedad: 13 años, 4 meses
Puntos: 5
Respuesta: unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

Cita:
Iniciado por andresccccc Ver Mensaje
¿Será el punto y coma?
No, ya intente borrarlo y nada xD
  #4 (permalink)  
Antiguo 15/12/2010, 00:57
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

en la linea que indicas no estas escapando correctamente las comillas...

te invito a leer lo siguiente:
http://www.forosdelweb.com/f18/como-...1/#post2414268
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 15/12/2010, 09:12
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Tema movido desde Configuración PHP a PHP
  #6 (permalink)  
Antiguo 15/12/2010, 10:25
 
Fecha de Ingreso: diciembre-2010
Mensajes: 180
Antigüedad: 13 años, 4 meses
Puntos: 5
Respuesta: unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

Cita:
Iniciado por pateketrueke Ver Mensaje
en la linea que indicas no estas escapando correctamente las comillas...

te invito a leer lo siguiente:
[url]http://www.forosdelweb.com/f18/como-usar-las-comillas-bien-588701/#post2414268[/url]
jaja, buenisimoo! ya pude resolverlo, muchas gracias pateketrueke!

Saludos!

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:50.