EdwardJ Posted December 2, 2008 Share Posted December 2, 2008 With the following code: <?php // contiene funciones basicas del sistema // para evitar inyecciones SQL function mysql_prep($value) { $magic_quotes_active = get_macic_quotes_gpc(); $new_enough_php = function_exists("mysql_real_escape_string"); if($new_enough_php) { if ($magic_quotes_active) { $value = stripslashes($value); } $value = mysql_real_escape_string($value); } else { if (!magic_quotes_active) { $value = addslashes($value); } } return $value; } // para redirigir a otra pagina function redirect_to($location = NULL) { if($location != NULL) { header ("Location: {$header}"); exit; } } // para confirmar query function confirm_query($result_set) { if(!$result_set) { die("Hubo un error en el query: " . mysql_error()) } } ?> I get "Parse error: syntax error, unexpected '}' in C:\wamp\www\vanvien\includes\functions.php on line 31" As much as I tried I could not find an error with my syntx. Please help! Link to comment https://forums.phpfreaks.com/topic/135204-solved-cant-find-the-error-please-help/ Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 Try indenting your code next time, but the error is here die("Hubo un error en el query: " . mysql_error()) should be die("Hubo un error en el query: " . mysql_error()); Link to comment https://forums.phpfreaks.com/topic/135204-solved-cant-find-the-error-please-help/#findComment-704175 Share on other sites More sharing options...
revraz Posted December 2, 2008 Share Posted December 2, 2008 Code seemed well indented. Link to comment https://forums.phpfreaks.com/topic/135204-solved-cant-find-the-error-please-help/#findComment-704183 Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 It is easier to read doing <?php function easier() { $easy = "This is easier to read than"; return $easy; } easier(); function harder(){ $harder = "Harder"; if($harder == "Harder"){ return $harder; } else{return false;} } ?> Link to comment https://forums.phpfreaks.com/topic/135204-solved-cant-find-the-error-please-help/#findComment-704191 Share on other sites More sharing options...
EdwardJ Posted December 2, 2008 Author Share Posted December 2, 2008 got it thanks Link to comment https://forums.phpfreaks.com/topic/135204-solved-cant-find-the-error-please-help/#findComment-704219 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.