winmastergames Posted November 23, 2007 Share Posted November 23, 2007 Hi I have a server redirect script at http://www.winmastergames.com but instead of pressing Click here i want it to automatically do that here is the script INDEX.PHP [THE MAIN SCRIPT] <html> <head> <title>Winmastergames server redirector</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="Winmastergames"> <meta name="description" content="Winmastergames has everthing you can think of we host websites for free we are currently hosting Vidmic Bloodscars and much much more"> <meta name="Author" content="Dean Gardiner"> <meta name="Publisher" content="winmastergames.com"> <meta name="robots" content="index, follow"> <!-- (robot commands: all, none, index, no index, follow, no follow) --> <meta name="revisit-after" content="30 days"> <meta name="distribution" content="global"> <meta name="rating" content="general"> <meta name="content-language" content="english"> <script language="JavaScript" type="text/JavaScript" src="images/myfreetemplates.js"></script> <style type="text/css"> <!-- .basestyle { color: #FFFFFF; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } h1 { font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; } body, td, p, input { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; } .navlinks { font-size: 14px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style1 { color: #FFFFFF; } --> </style> </head> <body style="margin:0; "> <table width=755 height="100%" border=0 align="center" cellpadding=0 cellspacing=0> <tr align="center" valign="middle"> <td height="169" colspan="2"><a href="http://winmastergames.com"><img src="images/toplogo.gif" width="216" height="155" border="0"></a><img src="images/topbanner.gif" width="539" height="155"></td> </tr> <tr> <td width="185" align="center" valign="top" bgcolor="#d80000"><h3><img src="images/sidetop.gif" width="185" height="14"></h3> <table width="132" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="navlinks"><a class="navlinks" href="index.php">:: Home</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="thescript.php">:: T<span class="style1">he Scri</span>pt</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="donate.php">:: D<span class="style1">onate</span></a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="contactus.php">:: C<span class="style1">ontact Us</span></a></td> </tr> <tr> <td class="navlinks"> </td> </tr> </table> <h3> </h3></td> <td width="570" rowspan="2" valign="top" style="padding-left:20px; padding-top:25px; padding-right:40px; padding-bottom:35px; "> <?php function prepWWW($url) { $replace = array("http://" => "", "www." => ""); foreach($replace as $toReplace=>$replaceWith) { $url = str_replace($toReplace, $replaceWith, $url); } $parts = explode("/", $url); $newURL = strip_tags(addslashes($parts[0])); return $newURL; } $site = prepWWW("www2.winmastergames.com"); $check = @fsockopen($site, 80); if($check) { echo "Welcome to Winmastergames Backup Redirect<br> To access winmastergames <a href=\"out1.html\">Click here.</a> <br><br>Note this website is part of winmastergames<br><br><br><br><br><br><br><br>Tech Info:WMGM:ONLINE"; } else { echo "Welcome to Winmastergames Backup Redirect<br> To access winmastergames <a href=\"out2.html\">Click here..</a> <br><br>Note this website is part of winmastergames<br><br><br><br><br><br><br><br>Tech Info:WMGM:OFFLINE"; } ?> <br> <br> <br> This Script is part of Winmastergames it just is for backup to always get 100% Uptime Please click the link to access Winmastergames if you want this script or want to know what it does go to "The script" page Please don't steal this script please purchase it if you want it . We need money to get more web space for WinMasterHosting because we want to keep Webhosting free some please don't Steal to donate money purchase the script or click the "Donate" page<br> <br> <!-- AddMe Bookmark Button BEGIN --> </td> </tr> <tr> <td height="20" valign="bottom" bgcolor="#d80000"><img src="images/sidebottom.gif" width="185" height="20"></td> </tr> <tr> <td height="58" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26"><img src="images/baseleft.gif" width="26" height="51"></td> <td align="center" bgcolor="#ef8406" class="basestyle">© Copyright 2006-2007 Winmastergames.com. All Rights Reserved.<br> Theme Made by <a target="_blank" href="http://www.myfreetemplates.com"> myfreetemplates.com</a><br> <!-- START OF ADDME LINK --> <a href="http://www.addme.com">AddMe - Search Engine Optimization</a> <!-- END OF ADDME LINK --> <td width="26"><img src="images/baseright.gif" width="26" height="51"></td> </tr> </table></td> </tr> </table> </body> </html> OUT1.HTML [First Redirector] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Redirecting..</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="Winmastergames"> <meta name="description" content="Winmastergames has everthing you can think of we host websites for free we are currently hosting Vidmic Bloodscars and much much more"> <meta name="Author" content="Dean Gardiner"> <meta name="Publisher" content="winmastergames.com"> <meta name="robots" content="index, follow"> <!-- (robot commands: all, none, index, no index, follow, no follow) --> <meta name="revisit-after" content="30 days"> <meta name="distribution" content="global"> <meta name="rating" content="general"> <meta name="content-language" content="english"> <meta http-equiv="REFRESH" content="0;url=http://www2.winmastergames.com"> <script language="JavaScript" type="text/JavaScript" src="images/myfreetemplates.js"></script> <style type="text/css"> <!-- .basestyle { color: #FFFFFF; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } h1 { font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; } body, td, p, input { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; } .navlinks { font-size: 14px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style1 { color: #FFFFFF; } --> </style> </head> <body style="margin:0; "> <table width=755 height="100%" border=0 align="center" cellpadding=0 cellspacing=0> <tr align="center" valign="middle"> <td height="169" colspan="2"><a href="http://winmastergames.com"><img src="images/toplogo.gif" width="216" height="155" border="0"></a><img src="images/topbanner.gif" width="539" height="155"></td> </tr> <tr> <td width="185" align="center" valign="top" bgcolor="#d80000"><h3><img src="images/sidetop.gif" width="185" height="14"></h3> <table width="132" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="navlinks"><a class="navlinks" href="index.php">:: Home</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="thescript.php">:: T<span class="style1">he Scri</span>pt</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="donate.php">:: D<span class="style1">onate</span></a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="contactus.php">:: C<span class="style1">ontact Us</span></a></td> </tr> <tr> <td class="navlinks"> </td> </tr> </table> <h3> </h3></td> <td width="570" rowspan="2" valign="top" style="padding-left:20px; padding-top:25px; padding-right:40px; padding-bottom:35px; "> Redirecting..</td> </tr> <tr> <td height="20" valign="bottom" bgcolor="#d80000"><img src="images/sidebottom.gif" width="185" height="20"></td> </tr> <tr> <td height="58" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26"><img src="images/baseleft.gif" width="26" height="51"></td> <td align="center" bgcolor="#ef8406" class="basestyle">© Copyright 2006-2007 Winmastergames.com. All Rights Reserved.<br> Theme Made by <a target="_blank" href="http://www.myfreetemplates.com"> myfreetemplates.com</a></td> <td width="26"><img src="images/baseright.gif" width="26" height="51"></td> </tr> </table></td> </tr> </table> </body> </html> OUT2.HTML [second Redirector] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Redirecting..</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="Winmastergames"> <meta name="description" content="Winmastergames has everthing you can think of we host websites for free we are currently hosting Vidmic Bloodscars and much much more"> <meta name="Author" content="Dean Gardiner"> <meta name="Publisher" content="winmastergames.com"> <meta name="robots" content="index, follow"> <!-- (robot commands: all, none, index, no index, follow, no follow) --> <meta name="revisit-after" content="30 days"> <meta name="distribution" content="global"> <meta name="rating" content="general"> <meta name="content-language" content="english"> <meta http-equiv="REFRESH" content="0;url=http://www2.winmastergames.com:81"> <script language="JavaScript" type="text/JavaScript" src="images/myfreetemplates.js"></script> <style type="text/css"> <!-- .basestyle { color: #FFFFFF; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } h1 { font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; } body, td, p, input { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; } .navlinks { font-size: 14px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style1 { color: #FFFFFF; } --> </style> </head> <body style="margin:0; "> <table width=755 height="100%" border=0 align="center" cellpadding=0 cellspacing=0> <tr align="center" valign="middle"> <td height="169" colspan="2"><a href="http://winmastergames.com"><img src="images/toplogo.gif" width="216" height="155" border="0"></a><img src="images/topbanner.gif" width="539" height="155"></td> </tr> <tr> <td width="185" align="center" valign="top" bgcolor="#d80000"><h3><img src="images/sidetop.gif" width="185" height="14"></h3> <table width="132" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="navlinks"><a class="navlinks" href="index.php">:: Home</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="thescript.php">:: T<span class="style1">he Scri</span>pt</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="donate.php">:: D<span class="style1">onate</span></a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="contactus.php">:: C<span class="style1">ontact Us</span></a></td> </tr> <tr> <td class="navlinks"> </td> </tr> </table> <h3> </h3></td> <td width="570" rowspan="2" valign="top" style="padding-left:20px; padding-top:25px; padding-right:40px; padding-bottom:35px; "> Redirecting..</td> </tr> <tr> <td height="20" valign="bottom" bgcolor="#d80000"><img src="images/sidebottom.gif" width="185" height="20"></td> </tr> <tr> <td height="58" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26"><img src="images/baseleft.gif" width="26" height="51"></td> <td align="center" bgcolor="#ef8406" class="basestyle">© Copyright 2006-2007 Winmastergames.com. All Rights Reserved.<br> Theme Made by <a target="_blank" href="http://www.myfreetemplates.com"> myfreetemplates.com</a></td> <td width="26"><img src="images/baseright.gif" width="26" height="51"></td> </tr> </table></td> </tr> </table> </body> </html> If there is anymore information you need i will be up to 11:00 NZ TIME Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted November 23, 2007 Share Posted November 23, 2007 <?php header("Location: where-ever.php"); ?> Quote Link to comment Share on other sites More sharing options...
winmastergames Posted November 23, 2007 Author Share Posted November 23, 2007 I added that (I THINK) here is the script <html> <head> <title>Winmastergames server redirector</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="Winmastergames"> <meta name="description" content="Winmastergames has everthing you can think of we host websites for free we are currently hosting Vidmic Bloodscars and much much more"> <meta name="Author" content="Dean Gardiner"> <meta name="Publisher" content="winmastergames.com"> <meta name="robots" content="index, follow"> <!-- (robot commands: all, none, index, no index, follow, no follow) --> <meta name="revisit-after" content="30 days"> <meta name="distribution" content="global"> <meta name="rating" content="general"> <meta name="content-language" content="english"> <script language="JavaScript" type="text/JavaScript" src="images/myfreetemplates.js"></script> <style type="text/css"> <!-- .basestyle { color: #FFFFFF; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } h1 { font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; } body, td, p, input { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; } .navlinks { font-size: 14px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style1 { color: #FFFFFF; } --> </style> </head> <body style="margin:0; "> <table width=755 height="100%" border=0 align="center" cellpadding=0 cellspacing=0> <tr align="center" valign="middle"> <td height="169" colspan="2"><a href="http://winmastergames.com"><img src="images/toplogo.gif" width="216" height="155" border="0"></a><img src="images/topbanner.gif" width="539" height="155"></td> </tr> <tr> <td width="185" align="center" valign="top" bgcolor="#d80000"><h3><img src="images/sidetop.gif" width="185" height="14"></h3> <table width="132" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="navlinks"><a class="navlinks" href="index.php">:: Home</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="thescript.php">:: T<span class="style1">he Scri</span>pt</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="donate.php">:: D<span class="style1">onate</span></a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="contactus.php">:: C<span class="style1">ontact Us</span></a></td> </tr> <tr> <td class="navlinks"> </td> </tr> </table> <h3> </h3></td> <td width="570" rowspan="2" valign="top" style="padding-left:20px; padding-top:25px; padding-right:40px; padding-bottom:35px; "> <?php function prepWWW($url) { $replace = array("http://" => "", "www." => ""); foreach($replace as $toReplace=>$replaceWith) { $url = str_replace($toReplace, $replaceWith, $url); } $parts = explode("/", $url); $newURL = strip_tags(addslashes($parts[0])); return $newURL; } $site = prepWWW("www2.winmastergames.com"); $check = @fsockopen($site, 80); if($check) { header("Location: where-ever.php"); } else { header("Location: where-ever.php"); ?> <br> <br> <br> This Script is part of Winmastergames it just is for backup to always get 100% Uptime Please click the link to access Winmastergames if you want this script or want to know what it does go to "The script" page Please don't steal this script please purchase it if you want it . We need money to get more web space for WinMasterHosting because we want to keep Webhosting free some please don't Steal to donate money purchase the script or click the "Donate" page<br> <br> <!-- AddMe Bookmark Button BEGIN --> </td> </tr> <tr> <td height="20" valign="bottom" bgcolor="#d80000"><img src="images/sidebottom.gif" width="185" height="20"></td> </tr> <tr> <td height="58" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26"><img src="images/baseleft.gif" width="26" height="51"></td> <td align="center" bgcolor="#ef8406" class="basestyle">© Copyright 2006-2007 Winmastergames.com. All Rights Reserved.<br> Theme Made by <a target="_blank" href="http://www.myfreetemplates.com"> myfreetemplates.com</a><br> <!-- START OF ADDME LINK --> <a href="http://www.addme.com">AddMe - Search Engine Optimization</a> <!-- END OF ADDME LINK --> <td width="26"><img src="images/baseright.gif" width="26" height="51"></td> </tr> </table></td> </tr> </table> </body> </html> But it comes up with this Parse error: syntax error, unexpected $end in C:\xampp\htdocs\testredirwin\index.php on line 133 Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted November 23, 2007 Share Posted November 23, 2007 yeah - I see the reason why - you left off a bracket <html> <head> <title>Winmastergames server redirector</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="Winmastergames"> <meta name="description" content="Winmastergames has everthing you can think of we host websites for free we are currently hosting Vidmic Bloodscars and much much more"> <meta name="Author" content="Dean Gardiner"> <meta name="Publisher" content="winmastergames.com"> <meta name="robots" content="index, follow"> <!-- (robot commands: all, none, index, no index, follow, no follow) --> <meta name="revisit-after" content="30 days"> <meta name="distribution" content="global"> <meta name="rating" content="general"> <meta name="content-language" content="english"> <script language="JavaScript" type="text/JavaScript" src="images/myfreetemplates.js"></script> <style type="text/css"> <!-- .basestyle { color: #FFFFFF; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } h1 { font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; } body, td, p, input { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; } .navlinks { font-size: 14px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style1 { color: #FFFFFF; } --> </style> </head> <body style="margin:0; "> <table width=755 height="100%" border=0 align="center" cellpadding=0 cellspacing=0> <tr align="center" valign="middle"> <td height="169" colspan="2"><a href="http://winmastergames.com"><img src="images/toplogo.gif" width="216" height="155" border="0"></a><img src="images/topbanner.gif" width="539" height="155"></td> </tr> <tr> <td width="185" align="center" valign="top" bgcolor="#d80000"><h3><img src="images/sidetop.gif" width="185" height="14"></h3> <table width="132" border="0" cellpadding="2" cellspacing="0"> <tr> <td class="navlinks"><a class="navlinks" href="index.php">:: Home</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="thescript.php">:: T<span class="style1">he Scri</span>pt</a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="donate.php">:: D<span class="style1">onate</span></a></td> </tr> <tr> <td class="navlinks"><a class="navlinks" href="contactus.php">:: C<span class="style1">ontact Us</span></a></td> </tr> <tr> <td class="navlinks"> </td> </tr> </table> <h3> </h3></td> <td width="570" rowspan="2" valign="top" style="padding-left:20px; padding-top:25px; padding-right:40px; padding-bottom:35px; "> <?php function prepWWW($url) { $replace = array("http://" => "", "www." => ""); foreach($replace as $toReplace=>$replaceWith) { $url = str_replace($toReplace, $replaceWith, $url); } $parts = explode("/", $url); $newURL = strip_tags(addslashes($parts[0])); return $newURL; } $site = prepWWW("www2.winmastergames.com"); $check = @fsockopen($site, 80); if($check) { header("Location: where-ever.php"); } else { header("Location: where-ever.php"); } ?> <br> <br> <br> This Script is part of Winmastergames it just is for backup to always get 100% Uptime Please click the link to access Winmastergames if you want this script or want to know what it does go to "The script" page Please don't steal this script please purchase it if you want it . We need money to get more web space for WinMasterHosting because we want to keep Webhosting free some please don't Steal to donate money purchase the script or click the "Donate" page<br> <br> <!-- AddMe Bookmark Button BEGIN --> </td> </tr> <tr> <td height="20" valign="bottom" bgcolor="#d80000"><img src="images/sidebottom.gif" width="185" height="20"></td> </tr> <tr> <td height="58" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26"><img src="images/baseleft.gif" width="26" height="51"></td> <td align="center" bgcolor="#ef8406" class="basestyle">© Copyright 2006-2007 Winmastergames.com. All Rights Reserved.<br> Theme Made by <a target="_blank" href="http://www.myfreetemplates.com"> myfreetemplates.com</a><br> <!-- START OF ADDME LINK --> <a href="http://www.addme.com">AddMe - Search Engine Optimization</a> <!-- END OF ADDME LINK --> <td width="26"><img src="images/baseright.gif" width="26" height="51"></td> </tr> </table></td> </tr> </table> </body> </html> now try that and see if it works Quote Link to comment Share on other sites More sharing options...
winmastergames Posted November 23, 2007 Author Share Posted November 23, 2007 Some of it works now but now this comes up??? Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\testredirwin\index.php: in C:\xampp\htdocs\testredirwin\index.php on line 90 Quote Link to comment Share on other sites More sharing options...
BenInBlack Posted November 23, 2007 Share Posted November 23, 2007 to properly redirect you need to do this at the top of your php file add this <? ob_start(); //then when you redirect //you need the 302 ob_clean(); header('HTTP/1.0 302 Found'); header('location: /some.php'); ?> and read up on output buffering Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.