Jump to content

Basic Question: Problem Uploading php Files To My Server


php_me

Recommended Posts

I have limited knowledge concerning these things, so if this question sounds retarded to you...well, it probably is :-) I'll try to include as much information as possible.  Ok here it is.

 

I have two domains on the same shared hosting account.  Both are wordpress installed.  I had a friend write two php codes for me.  One php code is a php redirect for domain 1, which sends them to domain 2.  Domain 2 has a php "random" script.  This random script, on domain 2, then directs them to one of 4 websites.

 

My problem lies in uploading the files to the server.  I located the public_html folder, which had a "wordpress" index.php page.  I uploaded the php redirect into that file.  I then logged in through FTP, to my 2nd domain.  The second domain did not have its own seperate public_html folder.  It didn't have an index.php file either.  I'm assuming the reason is because its shared hosting and that domain 1 is sharing the same public_html folder as domain 2.

 

Here's the code.  This is the random redirect script.

 

<?php
//random redirect script

//destination links to your meta refresh redirects
$destlink1 = "http://www.redirecttothisdomain.com/offer1.php";
$destlink2 = "http://www.redirectstothisdomain.com/offer2.php";
$destlink3 = "http://www.redirectstothisdomain.com/offer3.php";
$destlink4 = "http://www.redirectstothisdomain.com/offer4.php";

$randNum = rand(1 , 4);
if ($randNum == 1){
    header("Location: $destlink1");
} elseif ($randNum == 2){
    header("Location: $destlink2");
} elseif ($randNum == 3){
    header("Location: $destlink3");
} else {
    header("Location: $destlink4");
}
exit();
?>

 

I then make 4 different php files named "offer1.php", "offer2.php", etc.  Which has this code.

 

<?php
//$id=$_GET[id];
$destination = "http://www.websitehere.com";

echo "<html><head><meta http-equiv=\"refresh\" content=\"0;url=$destination\"/><title>Click</title></head><body><br><a href=\"$destination\">Continue</a></body></html>";
?>

 

I'm hoping someone can help me load these files into the correct place on my server.

 

Please help gentlemen! (and ladies)

What hosting company are you using... I use hostmonster and i have multiple domains and what ever is the main website (probably the one you put in when you signed up for the service) is in the public_html. now inside the public html you will probably have a folder named whatever domain #2 is named and inside that folder is where you would put all the files you want for domain #2.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.