Forum Moderators: phranque
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName mysite.com
ServerAlias *.mysite.com
DocumentRoot /home/mysite/public_html
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/mysite/>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
AddHandler cgi-script .cgi
Require all granted
</Directory>
<Directory /home/mysite/public_html>
Options Indexes ExecCGI
</Directory>
[<Directory "/home/mysite/public_html/contact" >
php_admin_value register_globals On
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/mysite.error.log
#CustomLog /home/mysite/logs/access.log combined
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/mysite.access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Require all denied
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost> [Tue Jan 07 02:39:33.133498 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: REMOTE_ADDR in /home/mysite/public_html/contact/phpreview_view.php on line 3, referer: http://mysite.com/contact/contact.html
[Tue Jan 07 02:39:33.133543 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: UserName in /home/mysite/public_html/contact/phpreview_view.php on line 61, referer: http://mysite.com/contact/contact.html
[Tue Jan 07 02:39:33.133556 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: UserEmail in /home/mysite/public_html/contact/phpreview_view.php on line 65, referer: http://mysite.com/contact/contact.html
[Tue Jan 07 02:39:33.133567 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: UserPhone in /home/mysite/public_html/contact/phpreview_view.php on line 70, referer: http://mysite.com/contact/contact.html
[Tue Jan 07 02:39:33.133578 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: UserCountry in /home/mysite/public_html/contact/phpreview_view.php on line 74, referer: http://mysite.com/contact/contact.html
[Tue Jan 07 02:39:33.133596 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: UserRefer in /home/mysite/public_html/contact/phpreview_view.php on line 79, referer: http://mysite.com/contact/contact.html
[Tue Jan 07 02:39:33.133607 2020] [:error] [pid 24542] [client x.x.x.x:38876] PHP Notice: Undefined variable: UserComments in /home/mysite/public_html/contact/phpreview_view.php on line 84, referer: http://mysite.com/contact/contact.html
<?
$ip = $REMOTE_ADDR
?>
<html>
<head>
<title>mysite.com - Review Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') {
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<style type="text/css">
<!--
-->
</style>
<link rel="stylesheet" href="http://mysite.com/contact/formstyle.css" type="text/css">
</head>
<body bgcolor="#8FABBE" text="#0033CC" leftmargin="0" topmargin="10" marginwidth="0" marginheight="10" link="#FF6600" vlink="#FF6600" alink="#FFCC00">
<table width="600" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#336699">
<tr align="left" valign="middle">
<td bgcolor="#336699"> <font color="#FFFFFF" face=arial><b><font size="5">Review your submission</font></b></font></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF">
<form name="page1" method="post" action="http://mysite.com/contact/phpreview_mail.php" onSubmit="MM_validateForm('UserName','','R','UserEmail','','R');return document.MM_returnValue">
<table width="100%" border="0" cellpadding="4" align="center" cellspacing="5">
<tr align="left" valign="top">
<td colspan="2">This is a preview of the information that will be sent. If you have used your real e-mail address you will receive a confirmation message.<br><b>Please check and edit your message if required.</b></td>
</tr>
<tr bgcolor="#ffE9E9">
<td valign="middle" align="right" width="34%" class="framz"><b><font size="2">Name:</font></b></td>
<td valign="middle" align="left" width="66%" class="framz"><?php echo $UserName ?></td>
</tr>
<tr bgcolor="#ffE9E9">
<td valign="middle" align="right" width="34%" class="framz"><b><font size="2">E-mail:</b></td>
<td valign="middle" align="left" width="66%" class="framz"><?php echo $UserEmail ?>
</td>
</tr>
<tr bgcolor="#ffE9E9">
<td valign="middle" align="right" width="34%" class="framz"><b><font size="2">Phone:</font></b></td>
<td valign="middle" align="left" width="66%" class="framz"><?php echo $UserPhone ?></td>
</tr>
<tr bgcolor="#ffE9E9">
<td valign="middle" align="right" width="34%" class="framz"><b><font size="2">Country:</font></b></td>
<td valign="middle" align="left" width="66%" class="framz"><?php echo $UserCountry ?></td>
</tr>
<tr bgcolor="#ffE9E9">
<td valign="middle" align="right" width="34%" class="framz"><b><font size="2">How
you found us:</font></b></td>
<td valign="middle" align="left" width="66%" class="framz"><?php echo $UserRefer ?></td>
</tr>
<tr bgcolor="#ffE9E9">
<td valign="top" align="right" width="34%" class="framz"><b><font size="2">Your
message:</b></td>
<td valign="middle" align="left" width="66%" class="framz"><?php echo $UserComments ?>
</td>
</tr>
<tr>
<td valign="middle" align="left" width="34%">
<input type="hidden" name="UserName" value="<?php echo $UserName ?>">
<input type="hidden" name="UserEmail" value="<?php echo $UserEmail ?>">
<input type="hidden" name="UserPhone" value="<?php echo $UserPhone ?>">
<input type="hidden" name="UserCountry" value="<?php echo $UserCountry ?>">
<input type="hidden" name="UserRefer" value="<?php echo $UserRefer ?>">
<input type="hidden" name="UserComments" value="<?php echo $UserComments ?>">
</td>
<td valign="middle" align="left" width="66%" bgcolor="#ffE9E9" class="framz">
<input type="submit" name="Back" value="<Edit" class="buttns" onClick="MM_goToURL('parent','javascript:history.back(1)');return document.MM_returnValue">
<input type="submit" name="Submit" value="Submit>" class="buttns">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
AddHandler application/x-httpd-php5 .html .htm (where the "php5" art depends on the version of php that is in use. ... and PhP 5.6.40