Jump to content

[SOLVED] cant find the error please help


EdwardJ

Recommended Posts

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

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;}
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.