Hi, i have some code like: <?php if($_GET['Domain']){ header("Location: ".$_GET['Domain'].""); } ?> PHP: I'm trying to make a redirect based on the referrer source: (Example: ht*p://myblog.com/index.php?domain=google.com Any ideas for this?
<?php if($_GET['Domain'])){ $d = "http://".$_GET['Domain']; header("Location: $d"); } ?> PHP: However, if the URL actually is ht*p://myblog.com/index.php?domain=google.com, your $_GET['Domain'] needs to be $_GET['domain']
Hi, i need to strap out the domain (domain.com) out of the referer and then redirect to a separate page, like index.php?domain=domain.com <? $referer = SERVER['HTTP_referer']; $domain = $referer; if($_GET['domain'])){ $d = "http://".$_GET['domain']; header("Location: $d"); } ?> PHP: ??
If you dont have the referer already, you would want something more like this: <?php $ref = $_SERVER['HTTP_REFERER']; header("Location: $ref"); } ?> PHP:
Yes thanks, but not the full referer URL.. instead i wan't to redirect to myblog.com/domain=domain.com
Depending on what you plan to do with the project, this can be really simple or kinda difficult. What is the purpose of redirecting them to index.php?domain=domain.com ??