facnani Posted December 13, 2011 Report Posted December 13, 2011 Cum fac un fisier php "redirect.php" care sa verifice daca pagina A e ok inainte sa faca redirect. Exemplu: 1 useru' da click pe http://domain.com/Redirect.php?URL=http://site1.com/ 2 redirect.php verifica daca websiteul (http://site1.com/) e ok! 3 daca e ok face redirect la http://site1.com/ 4 daca websiteul http://site1.com/ nu e ok atunci verifica si face sau nu redirect la http://site2.com/ 5 daca nici websiteul http://site2.com/ nu e ok, atunci verifica si face sau nu redirect la http://site3.com/P.S. stiu ca se poate face asa ceva deoarece am avut un asemenea script dar nu il mai gasesc Quote
Moderators Dragos Posted December 13, 2011 Moderators Report Posted December 13, 2011 (edited) <?php$link = $_GET['URL'];$headere = get_headers($link);if (stristr($headere[0], "200"))header("Location: " . $link);elseecho "Site-ul nu merge.";?>De aici te descurci Edited December 13, 2011 by Dragos Quote
facnani Posted December 13, 2011 Author Report Posted December 13, 2011 (edited) sper sa reusesc sa il fac mai departe asa cum vreau eu, oricum mersi mult pentru ajutor. doar ca am dat de o problema care ma depaseste....Warning: get_headers() [function.get-headers]: This function may only be used against URLs am pus si allow_url_fopen on .. si degeaba.... orice idee sau solutie e binevenita .. Edited December 13, 2011 by facnani Quote
Serar Posted December 13, 2011 Report Posted December 13, 2011 sper sa reusesc sa il fac mai departe asa cum vreau eu, oricum mersi mult pentru ajutor. doar ca am dat de o problema care ma depaseste....Warning: get_headers() [function.get-headers]: This function may only be used against URLs am pus si allow_url_fopen on .. si degeaba.... orice idee sau solutie e binevenita ..pune @ in fata functiei get_headers, atat timp cat site-ul e ok va face redirect daca nu va da site-ul nu merge Quote
Xander Posted December 13, 2011 Report Posted December 13, 2011 probabil ai pus url-ul fara http in fata si deasta iti da warning Quote