/    Sign up×
Community /Pin to ProfileBookmark

Hello all, I am a new member here, and I got a problem , please help me.

[B]I get this error message:[/B]

Warning: Unexpected character in input: ” (ASCII=92) state=1 in /hsphere/local/home/linato/instantad.org/funciones.php on line 126 Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /hsphere/local/home/linato/instantad.org/funciones.php on line 126

[B]This is how my php file (funciones.php) looks like:[/B]

<?php

function limitatexto( $texto, $limite )
{
if( strlen($texto)>$limite )
{
$texto = substr( $texto,0,$limite );
}
return $texto;

}

function mostrarTemplate($tema, $variables)
{
//var_dump($variables);
extract($variables);
eval(“?>”.$tema.”<?”);
}

function parsearTags($mensaje)
{
$mensaje = str_replace(“[citar]”, “<blockquote><hr width=’100%’ size=’2′>”, $mensaje);
$mensaje = str_replace(“[/citar]”, “<hr width=’100%’ size=’2′></blockquote>”, $mensaje);
return $mensaje;
}

// funcion para validar email
function ValidaMail($pMail) {
if (ereg(“^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*@+([_a-zA-Z0-9-]+.)*[a-zA-Z0-9-]{2,200}.[a-zA-Z]{2,6}$”, $pMail ) ) {
return true;
} else {
echo “Ingresa un mail valido”; exit();
}
}

// minimo de carateres
function minimo($contenido) {

if (strlen($contenido) < 3) {

echo “less then 3 characters.”; exit();

} else {

// echo “todo bien…”;
return $contenido;
}

}

function minimopass($contenido) {

if (strlen($contenido) < 6) {

echo “Password must be at least 6 characters.”; exit();

} else {

// echo “todo bien…”;
return $contenido;
}

}

// funcion para sanitizar variables
function limpiar($mensaje)
{
$mensaje = htmlentities(stripslashes(trim($mensaje)));
$mensaje = str_replace(“‘”,” “,$mensaje);
$mensaje = str_replace(“;”,” “,$mensaje);
$mensaje = str_replace(“$”,” “,$mensaje);
return $mensaje;
}

function shout($nombre_usuario){
if (ereg(“^[a-zA-Z0-9_]{3,20}$”, $nombre_usuario)) {
// echo “The field names user is correct<br>”;
return $nombre_usuario;
} else {

echo “The field names user is not valid since it contains characters nonallowed<br>”;

exit();
}
}

// universal cleaner function

function uc($mensaje)
{

if (ereg(“^[a-zA-Z0-9_]{3,33}$”, $mensaje)) {
// echo “The field message is correct<br>”;
$mensaje = htmlentities(stripslashes(strtolower(trim($mensaje))));
$mensaje = str_replace(“‘”,” “,$mensaje);
$mensaje = str_replace(“;”,” “,$mensaje);
$mensaje = str_replace(“$”,” “,$mensaje);
return $mensaje;
} else {
echo “the field message is not valid since it contains characters nonallowed<br>”;
exit();
}

}

//funcion para añadir smylies

function caretos($texto,$ruta)
{
$i=”<img src=../%22$ruta/%22;
$i_=”” >”;
$texto=str_replace(“?”,$i.”icon_smile.gif”.$i_
,$texto);
$texto=str_replace(“?”,$i.”icon_biggrin.gif”.$i_,$texto);
$texto=str_replace(“^^“,$i.”icon_cheesygrin.gif”.$i_
,$texto);

$texto=str_replace(“xD”,$i.”icon_lol.gif”.$i_,$texto);
$texto=str_replace(“XD”,$i.”icon_lol.gif”.$i_,$texto);

$texto=str_replace(“:|”,$i.”icon_neutral.gif”.$i_,$texto);
$texto=str_replace(“:(“,$i.”icon_sad.gif”.$i_,$texto);
$texto=str_replace(“:&#039(“,$i.”icon_cry.gif”.$i_,$texto);
$texto=str_replace(“:O”,$i.”icon_surprised.gif”.$i_,$texto);
$texto=str_replace(“B)”,$i.”icon_cool.gif”.$i_,$texto);
$texto=str_replace(“8|”,$i.”icon_rolleyes.gif”.$i_,$texto);
$texto=str_replace(“O_O”,$i.”icon_eek.gif”.$i_,$texto);
$texto=str_replace(“:P”,$i.”icon_razz.gif”.$i_,$texto);
$texto=str_replace(“:?”,$i.”icon_confused.gif”.$i_,$texto);
$texto=str_replace(“^:@”,$i.”icon_evil.gif”.$i_,$texto);
$texto=str_replace(“^_-“,$i.”icon_frown.gif”.$i_,$texto);
$texto=str_replace(“!(“,$i.”icon_mad.gif”.$i_,$texto);
$texto=str_replace(“^)”,$i.”icon_twisted.gif”.$i_,$texto);
$texto=str_replace(“;)”,$i.”icon_wink.gif”.$i_,$texto);
$texto=str_replace(“:B”,$i.”drool.gif”.$i_,$texto);
return $texto;

}

// ip real
function getRealIP()
{

if( $_SERVER[‘HTTP_X_FORWARDED_FOR’] != ” )
{
$client_ip =
( !empty($_
SERVER[‘REMOTE_ADDR’]) ) ?
$_SERVER[‘REMOTE_ADDR’]
:
( ( !empty($_
ENV[‘REMOTE_ADDR’]) ) ?
$_ENV[‘REMOTE_ADDR’]
:
“unknown” );

// los proxys van añadiendo al final de esta cabecera
// las direcciones ip que van “ocultando”. Para localizar la ip real
// del usuario se comienza a mirar por el principio hasta encontrar
// una dirección ip que no sea del rango privado. En caso de no
// encontrarse ninguna se toma como valor el REMOTE_ADDR

$entries = split(‘[, ]’, $_SERVER[‘HTTP_X_FORWARDED_FOR’]);

reset($entries);
while (list(, $entry) = each($entries))
{
$entry = trim($entry);
if ( preg_match(“/^([0-9]+.[0-9]+.[0-9]+.[0-9]+)/”, $entry, $ip_list) )
{
// [url]http://www.faqs.org/rfcs/rfc1918.html[/url]
$private_ip = array(
‘/^0./’,
‘/^127.0.0.1/’,
‘/^192.168..*/’,
‘/^172.((1[6-9])|(2[0-9])|(3[0-1]))..*/’,
‘/^10..*/’);

$found_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);

if ($client_ip != $found_ip)
{
$client_ip = $found_ip;
break;
}
}
}

}
else
{
$client_ip =
( !empty($_SERVER[‘REMOTE_ADDR’]) ) ?
$_
SERVER[‘REMOTE_ADDR’]
:
( ( !empty($_ENV[‘REMOTE_ADDR’]) ) ?
$_
ENV[‘REMOTE_ADDR’]
:
“unknown” );
}

return $client_ip;

}

?>

I hope you guys can help me, it is really urgent.
Thanks ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@knowjJan 06.2008 — please put the code in [php ] tags also it would help alot if you commented line 126 for us and tabbed your code
Copy linkTweet thisAlerts:
@NogDogJan 06.2008 — No closing quote on that line:
[code=php]
$i="<img src=../%22$ruta/%22;
[/code]
×

Success!

Help @Koliton spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...