Hello all. So I am trying to write a simple script that will let me put forwarding on a godaddy domain for example forward-this-domain1 dot com to redirect-to-here dot com. The php file can sit on the redirect-to-here dot com server and in godaddy i want to forward to say redirect-to-here dot com/ redirection/ index.php? domain=forward-this-domain1 dot com. I want this whole process to be logged.
Hello World! My first program. (Ps not HW)
6
Hello all. So I am trying to write a simple script that will let me put forwarding on a godaddy domain for example forward-this-domain1 dot com to redirect-to-here dot com.
The php file can sit on the redirect-to-here dot com server and in godaddy i want to forward to say redirect-to-here dot com/ redirection/ index.php? domain=forward-this-domain1 dot com. I want this whole process to be logged.
So here is my first script written mostly by me ever.
And this is my output to "redirections dot html"
How do I make "Array" say the domain variable instead? The host refer does seem to work though when its called from an actual web page, but not when forwarded through a domain on godaddy.
Hope I make sense. And I hope I didnt fudge the code so bad lol. I thought it was going pretty well until it didnt do what I really wanted it to lol.
Ps. didnt mean to obscure the links so much but the forum thought I was trying to spam it. I dont know if any domain other than the network tool is active or owned.
The php file can sit on the redirect-to-here dot com server and in godaddy i want to forward to say redirect-to-here dot com/ redirection/ index.php? domain=forward-this-domain1 dot com. I want this whole process to be logged.
So here is my first script written mostly by me ever.
PHP Code:
<?php
//variables
$logfile = 'redirections.html';
$redir_url = 'http: redirect-to-here dot com';
$IP = $_SERVER['REMOTE_ADDR'];
$refer = $_SERVER[''];
$domain = array("forward-this-domain1 dot com" => "forward-this2 dot com");
//set logfile output
$logdetails= date("F j, Y, g:i a") . ': ' . '<a href=http: network-tools dot com/default.asp?prog=whois&host='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>' . ' from domain ' . $domain . ' and referrer ' . $refer;
//set var to open logfile
$fp = fopen($logfile, "a");
//main script
fwrite($fp, $logdetails);
fwrite($fp, "<br />");
fclose($fp);
header('Location:' . $redir_url);
exit();
?> Code:
January 5, 2010, 3:09 pm: xx.xxx.xx.xxx from domain Array and referrer January 5, 2010, 3:09 pm: xx.xxx.xx.xxx from domain Array and referrer ##Referral directory if called from a director with no index##
Hope I make sense. And I hope I didnt fudge the code so bad lol. I thought it was going pretty well until it didnt do what I really wanted it to lol.
Ps. didnt mean to obscure the links so much but the forum thought I was trying to spam it. I dont know if any domain other than the network tool is active or owned.
- rctelles
- HomeBizNizz
- chaos69
- [1] reply
- saschakimmel
- [1] reply
- patrick.giblin Banned
Next Topics on Trending Feed
-
6