Hey, I have a php file located at http://example.com/connect.php how can i make it shows different content when some one views http://example.com/connect.php?ip=205-251-138-58 they see <html> <head> <title></title> <meta http-equiv="REFRESH" content="5;url=http://205-251-138-58.clmproxy.com/connect.php <body> <center> <h2>You Are Now Being Connected To <a href="http://205-251-138-58.clmproxy.com/connect.php">http://205-251-138-58.clmproxy.com/connect.php</a></h2> <img src="http://img51.imageshack.us/img51/7712/loadinganimation.gif" /> If your not redirected please click <a href="http://205-251-138-58.clmproxy.com/connect.php">Here</a></a> </center> </body> </html> HTML: and if they visit http://example.com/connect.php it redirects them it http://example.com/
I will assume the data is set as a GET request not as POST , let me know if it works as ive not tested if theres a error it should be something simple <?php if ($_GET['ip'] <> "205-251-138-58" && !isset($_GET['ip'])) { //Error occured so goto index.php print "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'> <html> <head> <title>ERROR</title> <meta http-equiv='REFRESH' content='0;url=http://www.yoursite.com'></HEAD> <BODY> Error occured , redirecting to home..... </BODY> </HTML>"; } else { print "<html> <head> <title></title> <meta http-equiv='REFRESH' content='5;url=http://205-251-138-58.clmproxy.com/connect.php <body> <center> <h2>You Are Now Being Connected To <a href='http://205-251-138-58.clmproxy.com/connect.php'>http://205-251-138-58.clmproxy.com/connect.php</a></h2> <img src='http://img51.imageshack.us/img51/7712/loadinganimation.gif' /> If your not redirected please click <a href='http://205-251-138-58.clmproxy.com/connect.php'>Here</a></a> </center> </body> </html>"; } ?> Code (markup):
I get a Parse error: syntax error, unexpected '{' in /home/myihacki/clmproxy.com/public_html/connect.php on line 1 Code (markup):
Must be on your side, I just uploaded it to my own domain and tested it and it worked , copy paste that enite code into a brand new .php file unedited , it will work p.s the error says there was a unexpected "{" on line 1 but line 1 of my code does not have a "{"
<?php if (@$_GET['ip'] == "205-251-138-58") { ?> <html> <head> <title></title> <meta http-equiv="REFRESH" content="5;url=http://205-251-138-58.clmproxy.com/connect.php <body> <center> <h2>You Are Now Being Connected To <a href="http://205-251-138-58.clmproxy.com/connect.php">http://205-251-138-58.clmproxy.com/connect.php</a></h2> <img src="http://img51.imageshack.us/img51/7712/loadinganimation.gif" /> If your not redirected please click <a href="http://205-251-138-58.clmproxy.com/connect.php">Here</a></a> </center> </body> </html> <?php } else { header("Location: http://example.com/"); } ?> PHP: