If command Help
Posted: Sat Sep 13, 2008 3:49 am
I'm trying to get this if command working. There is a text form that can be entered but doesnt have to be. If it is not entered than a random string will replace it. Similar to the one that http://tinyurl.com might use where u dont have to enter a custom url but u can.
That is the Sniplet
If you need the full code...
Code: Select all
$alex = 'newurl';
if($alex = "") {
$rnd_url = $newurl;
}If you need the full code...
Code: Select all
$alex = 'newurl';
if($alex = "") {
$rnd_url = $newurl;
}
if ($_POST['submit']) {
$rnd_url=chr(rand(97,122)).chr(rand(97,122)).chr(rand(97,122)).chr(rand(97,122)); // Later Add .rand(111,999)
$newurl = $_POST['newurl'];
$oldurl = $_POST['oldurl'];
$title= $_POST['title'];
$urlcloking= $_POST['urlcloking'];
$redirect = "<html><head><title>$title</title></head><body>
<iframe src='$oldurl' height='100%' width='100%' frameborder='0'>
</script></body></html>";
if(file_exists("$newurl/index")) die("Please try again there was an error.");
mkdir("$newurl");
$filename = "$newurl/index";
$filename .= ".php";
$Content = "<META http-equiv='refresh' content='0;URL=$oldurl'>";
$handle = fopen($filename, 'x+');
fwrite($handle, $Content);
fclose($handle);
?>
<br>
</span>
<h2 class="style1"><marquee>Success!</marquee></h2>
<span class="style2">Your new URL is <a href=http://wiurl.com/<?php echo "$newurl"; ?>>http://wiurl.com/<?php echo"$newurl"; ?></a><br />
Copy your URL <input type="text" class="text" id="chi2" size="18" value="http://wiurl.com/<?php echo "$newurl"?>" onclick="this.select();" />
<?php