PHP code within a URL.
Posted: Thu Feb 08, 2007 6:28 am
Well I'm new to the forum, obviously.
I know a little less than the basics in many computer fields, such as programming, web design, 3d modeling, etc.
However, PHP is something I'd like to learn and actually get into.
Currently I'm trying to write a simple script that will redirect the user to a semi-random URL.
Example:
http://www.mysite.com
would redirect the user to
http://www.1241564.mysite.com/index.php
with '1241564' being the random part of the URL.
I've picked up the code for redirecting the user to a new page from within PHP,
and the code for generating random numbers,
I'm just not quite sure how to put them together.
Thanks for your time.
I know a little less than the basics in many computer fields, such as programming, web design, 3d modeling, etc.
However, PHP is something I'd like to learn and actually get into.
Currently I'm trying to write a simple script that will redirect the user to a semi-random URL.
Example:
http://www.mysite.com
would redirect the user to
http://www.1241564.mysite.com/index.php
with '1241564' being the random part of the URL.
I've picked up the code for redirecting the user to a new page from within PHP,
Code: Select all
<?php
header( 'Location: http://www.mysite.com/index.php' ) ;
?>
Code: Select all
srand(time());
$random = (rand()%9999999);Thanks for your time.