Foros del Web » Programando para Internet » PHP »

T_CONSTANT_ENCAPSED_STRING in /home/

Estas en el tema de T_CONSTANT_ENCAPSED_STRING in /home/ en el foro de PHP en Foros del Web. Hola, me arroja este error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/comercio/public_html/cron_jobs/makesitemap.php on line 41 y no se que pasa: Gracias por su ayuda. ...
  #1 (permalink)  
Antiguo 16/09/2008, 17:47
 
Fecha de Ingreso: abril-2006
Mensajes: 12
Antigüedad: 18 años
Puntos: 0
T_CONSTANT_ENCAPSED_STRING in /home/

Hola,

me arroja este error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/comercio/public_html/cron_jobs/makesitemap.php on line 41

y no se que pasa:

Gracias por su ayuda.

djfritzz

<?


define ('IN_ADMIN', 1);

if (!$manual_cron || IN_ADMIN == 1)
{
include_once ('../includes/global.php');
$parent_dir = '../';
}
else
{
$parent_dir = '';
}

ini_set('max_execution_time',0); // No more timeouts
ignore_user_abort(1); // No more timeouts

include_once ($parent_dir . 'includes/class_formchecker.php');
include_once ($parent_dir . 'includes/class_custom_field.php');
include_once ($parent_dir . 'includes/class_user.php');
include_once ($parent_dir . 'includes/class_fees.php');
include_once ($parent_dir . 'includes/class_shop.php');
include_once ($parent_dir . 'includes/class_item.php');
include_once ($parent_dir . 'includes/functions_item.php');
include_once ($parent_dir . 'includes/class_messaging.php');

### Get Configuration Data

$config = $db->get_sql_row("SELECT * FROM probid_sitemap_setts WHERE id='1'");

$post = 0;
$filename = $config['filename'];
$path = $config['path'];

$xmlfile = $config['path']"/home/comercio/public_html/sitemap.xml";

if (is_file($path.$filename) AND ($post==0)) {
unlink($path.$filename);
}

$a = $db->query("SELECT * FROM probid_auctions WHERE active=1 AND approved=1 AND closed=0 AND deleted=0 ORDER BY auction_id DESC");
while ($data = $db->fetch_array($a)) {

$id = $data['auction_id'];
$link = $setts['site_path'];

$storelink = $link."shop.php?user_id=";
$auctionlink = $link."auction_details.php?auction_id=";
$classlink = $link."wanted_details.php?wanted_ad_id=";
$owner = $data['owner_id'];

$OutFile=$path.$filename;

if ($post==0) {
$output="<?xml version='1.0' encoding='UTF-8'?>\r\n<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'>\r\n <url>\r\n <loc>$link</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";
}

if ($post==1) {
$output=" <url>\r\n <loc>$auctionlink$id</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";
}

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$counter = $counter + 1;
$post = 1;
}

if ($post==1) {
$query = $db->query("SELECT * FROM " . DB_PREFIX . "users WHERE shop_nb_items > '0' AND shop_active='1' AND active='1' order by username DESC");
while ($store=mysql_fetch_array($query)) {
$username = $store['user_id'];
$output=" <url>\r\n <loc>$storelink$username</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$acounter = $acounter + 1;
$post = 1;
}
}


if ($post==1) {
$getCats = $db->query("SELECT * FROM probid_categories WHERE hidden=0 AND user_id=0 ORDER BY order_id,name");
while ($data=mysql_fetch_array($getCats)) {
$path = $setts['site_path'];
if ($data['parent_id']>0) {
$catLink=$path."categories.php?parent_id=".$data['category_id'];
} else {
$catLink=$path."categories.php?parent_id=".$data['category_id'];
}
$output=" <url>\r\n <loc>$catLink</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$acounter = $acounter + 1;
$post = 1;
}
}

if ($post==1) {
$auctions = $db->query("SELECT * FROM probid_wanted_ads WHERE active=1 AND closed=0 AND deleted!=1 ORDER BY wanted_ad_id ASC");
while ($data=mysql_fetch_array($auctions)) {

$id = $data['wanted_ad_id'];

$output=" <url>\r\n <loc>$classlink$id</loc>\r\n <priority>0.5</priority>\r\n <changefreq>daily</changefreq>\r\n </url>\r\n";

$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$bcounter = $bcounter + 1;
$post = 1;
}
}


$output = "</urlset>\r\n";
$fp = fopen($OutFile, "a") or die("Couldn't create new file - Check your paths and filename!");
$numBytes = fwrite($fp, $output);
fclose($fp);
$counter = $counter + 1;
$post = 1;

?>
  #2 (permalink)  
Antiguo 16/09/2008, 18:19
Avatar de radarcba  
Fecha de Ingreso: mayo-2005
Ubicación: ureleando
Mensajes: 505
Antigüedad: 19 años
Puntos: 3
Respuesta: ayuda por favor, T_CONSTANT_ENCAPSED_STRING in /home/

Tenes un error en esta línea:

Código PHP:
$xmlfile $config['path']"/home/comercio/public_html/sitemap.xml"
Falta un punto despues de $config['path']
Correcto:

Código PHP:
$xmlfile $config['path']."/home/comercio/public_html/sitemap.xml"
__________________
Maldición va a ser un día hermoso... PR
Tetris, correo & TU IP
  #3 (permalink)  
Antiguo 16/09/2008, 18:33
 
Fecha de Ingreso: abril-2006
Mensajes: 12
Antigüedad: 18 años
Puntos: 0
Respuesta: ayuda por favor, T_CONSTANT_ENCAPSED_STRING in /home/

Funciono muchas gracias.

pero ahora sale

Couldn't create new file - Check your paths and filename!
  #4 (permalink)  
Antiguo 16/09/2008, 18:34
 
Fecha de Ingreso: abril-2006
Mensajes: 12
Antigüedad: 18 años
Puntos: 0
Respuesta: ayuda por favor, T_CONSTANT_ENCAPSED_STRING in /home/

esta bien la ruta del servidor ??

$xmlfile = $config['path']"/home/comercio/public_html/sitemap.xml";
  #5 (permalink)  
Antiguo 16/09/2008, 19:05
Avatar de radarcba  
Fecha de Ingreso: mayo-2005
Ubicación: ureleando
Mensajes: 505
Antigüedad: 19 años
Puntos: 3
Respuesta: ayuda por favor, T_CONSTANT_ENCAPSED_STRING in /home/

Me parece que no, debe ser una ruta valida en tu estructura de directorios
Revisa que la carpeta exista.
Si la ruta es correcta y sigue mostrandote algun error, revisa los permisos de escritura de la carpeta y del archivo (que se puedan escribir)
__________________
Maldición va a ser un día hermoso... PR
Tetris, correo & TU IP
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

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 04:27.