Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.