I have tried desperatly to find a solution but cant. Would there be some php setting or something else that is preventing this from working on the VPS.
The script is below:
Code: Select all
<?php include ("ipban.php"); ?>
<?php
session_start();
$ip = $REMOTE_ADDR;
$recipient="myemail@myemail.com";
$subject="A email form for a survey has been submited";
$msg="E-Mail Address: $email IP: $ip OptIn: $opt";
$email = $_POST["email"];
if(array_key_exists($ip,$iplook)){
print 'IP BANNED';
}
if((!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email))
&& (! array_key_exists($ip,$iplook))
&& (! isset($_SESSION['email'])))
{
print "<center>
Please enter a valid e-mail address to continue: <p>
<form action=\"$SERVER[self_php]\" method=\"post\">
Email: <input name=\"email\" type=\"test\" size=\"20\" maxlength=\"100\"><p>
checkbox<input type=\"checkbox\" name=\"opt\" CHECKED>
<p> </p>
<b></b><p></p><input name=\"Submit\" type=\"submit\" value=\"Submit\"><p> </p></center>";
}
if((ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email))
&& (! array_key_exists($ip,$iplook))
&& (! isset($_SESSION['email']))){
if(mail($recipient, $subject, $msg)){
$_SESSION['email'][] = array('email' => $email);
$email=null;}}
if(isset($_SESSION['email'])){
$site = file_get_contents('http://www.google.com');
print "$site";
}
?>Code: Select all
<?php
$iplook['68.239.139.166'] = '68.239.139.166';
?>Thanks so much
ppc