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! Quote Link to comment 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()); Quote Link to comment Share on other sites More sharing options...
revraz Posted December 2, 2008 Share Posted December 2, 2008 Code seemed well indented. Quote Link to comment 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;} } ?> Quote Link to comment Share on other sites More sharing options...
EdwardJ Posted December 2, 2008 Author Share Posted December 2, 2008 got it thanks 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.