Welcome Guest, Not a member yet? Register   Sign In
How can i do a redirect pre-systme hook ?
#3

[eluser]bhenbe[/eluser]
Thanks !

You must also check if $row doesn't return false. Without this check, exit will stop the controller calls.

Code:
$query = sprintf("SELECT `redirect` FROM `direct_access` WHERE `url` LIKE '%s'", mysql_real_escape_string($url));
  $result = mysql_query($query);
  
  if (!$result)
      return;
      
    $row = mysql_fetch_assoc($result);
    
    if (!$row)
     return;

  Header('Location: '.$row['redirect']);

  exit;



Messages In This Thread
How can i do a redirect pre-systme hook ? - by El Forum - 02-18-2012, 06:35 AM
How can i do a redirect pre-systme hook ? - by El Forum - 02-18-2012, 06:49 AM
How can i do a redirect pre-systme hook ? - by El Forum - 02-18-2012, 07:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB