Error: SQL query failed: ' . mysql_error ()); } else { $sum = mysql_num_rows($q); if($sum) { header ('' . 'Location: ' . $sendto_url); } else { foreach($myURLs as $url) { if(strpos($sendto_url, $url) !== false) { header ('' . 'Location: ' . $sendto_url); } } exit ('Error: Link not exists: ' . $sendto_url); } } } else { exit ('Error: SQL query failed: ' . mysql_error ()); } } else { if (constant ('TRADE_SCRIPT')) { $sendto_url = str_replace ('[URL]', urlencode ($gal_url), constant ('TRADE_SCRIPT')); $sendto_url = str_replace ('[URL_DECODE]', urldecode ($gal_url), $sendto_url); $sendto_url = str_replace ('[AUX1]', $_GET['aux1'], $sendto_url); $sendto_url = str_replace ('[AUX2]', $_GET['aux2'], $sendto_url); $sendto_url = str_replace ('[AUX3]', $_GET['aux3'], $sendto_url); } else { $sendto_url = $gal_url; } header ('' . 'Location: ' . $sendto_url); } } else { exit ('Error: SQL database selection failed: ' . mysql_error ()); } mysql_close ($db_id); } else { exit ('Error: SQL connection failed: ' . mysql_error ()); } } else { exit ('Error: Gallery URL or ID are missing.'); } ?>