Alright, I'm going to learn this stuff if it kills me....and it just might.
I've gone over this, and over this, to no avail. I don't see what the problem is.
The links are right, the script doesn't seem to have anything wrong...then again, I'm not totally sure I'd recognize a major mess if I saw it.
The scenario:
The form works fine, but when you hit "send" ou get the following error:
Warning: require(/php/scfconfig.php) [function.require]: failed to open stream: No such file or directory in /home/rodstolc/public_html/php/scformproc.php on line 52
Fatal error: require() [function.require]: Failed opening required '/php/scfconfig.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rodstolc/public_html/php/scformproc.php on line 52What I'm not getting is, the files are there, the links are correct, why aren't they being seen?
As for line 52, here is the code, starting at line 52
CODE
<?php
$selfChkStr = $_SERVER['PHP_SELF'];
$serverChkStr = "http://" . $_SERVER['SERVER_NAME'];
if(($chkFormRefNotBlank && !$_SERVER['HTTP_REFERER']) ||
($chkFormRefNotSelf && preg_match("#$selfChkStr$#i", $_SERVER['HTTP_REFERER'])) ||
($chkFormRefOwnServer && $_SERVER['HTTP_REFERER'] &&
!preg_match("#^$serverChkStr#i", $_SERVER['HTTP_REFERER'])))
{
sleep(10);
print("<div align=\"center\"><font color=\"red\">Disallowed HTTP Referer! ("" .
$_SERVER['HTTP_REFERER'] .
"")</font></div>");
print("</body></html>");
exit;
}
if($requireVerify)
print("<div align=\"center\"><font color=\"red\">Cookies must be enabled to use this form.</font></div><p />");
?>
<div align="center"><table width="674" ><tr><td>
<form action="scformproc.php" method="get">
<table align="center">
<tr>
<td align="right" class="style1">
Send To: </td>
<td align="left" class="style1">
<span class="style3">
<?php
// Get a pseudo-random alpha-numeric string (no zeros and O's)
function pseudo_random_string($length) {
$string = "";
while($length--) {
for($indx = rand(49, 90);
($indx > 57 && $indx < 65) || $indx == 79;
$indx = rand(49, 90))
;
$string .= chr($indx);
}
return($string);
}
// Read a line from a config file, stripping comments
// and blank lines
function read_file_line($fp) {
while(($inString = fgets($fp, 2048)) != false) {
$inString = rtrim(preg_replace('/\s*#.*/', '',
$inString));
if(!empty($inString))
break;
}
return $inString;
}
if(!$HTTP_SESSION_VARS['majik_string'])
$HTTP_SESSION_VARS['majik_string'] = pseudo_random_string(5);
// Read the contact list keys and descriptions into hash
if(($fp = fopen($recipientFile, "r")) == false) {
die("Can't open data file '$recipientFile'.\n");
}
while($inString = read_file_line($fp)) {
list($key, $description, $value) =
explode(':', $inString);
$options[$key] = $description;
}
fclose($fp);
// If we've more than one choice: present a menu
if(count($options) > 1) {
// If we were given a single arg, that'll be the
// selected menu item.
if(count($_GET) == 1)
$selected = strtolower(key($_GET));
print("<select name=\"whoto\">\n");
foreach($options as $key => $description) {
print("<option ");
if(strtolower($key) == $selected)
print("selected ");
print("value=\"" . trim($key) . "\">" .
trim($description) . "\n");
}
print("</select>\n");
} else {
// There'll be only one...
foreach($options as $key => $description) {
print("<input type=\"hidden\" name=\"whoto\" value=\"" .
trim($key) . "\">" . trim($description) . "\n");
}
}
// Used by the form processor acknowledgment to create a
// "take me back" link.
if(!empty($_SERVER['HTTP_REFERER'])) {
print("<input type=\"hidden\" name=\"orig_referer\" value=\"" .
$_SERVER['HTTP_REFERER'] . "\">\n");
}
?>
</span></td>
</tr>
<tr>
<td align="right" class="style1">
Your name: </td>
<td align="left" class="style1">
<span class="style3">
<input type="text" name="name" size=30>
</span></td>
</tr>
<tr>
<td align="right" class="style1">
Email address: </td>
<td align="left" class="style1">
<span class="style3">
<input type="text" name="email" size=30>
</span></td>
</tr>
<tr>
<td align="right" class="style1">
Subject: </td>
<td align="left" class="style1">
<span class="style3">
<input type="text" name="subject" size=30>
</span></td>
</tr>
<?php
// Are we requiring CAPTCHA-style "is a human" verification?
if($requireVerify) {
print <<<End_Of_Data
<tr><td> </td></tr>
<tr>
<td colspan="2">
Please enter the verification string on the right into the box on the left.
</td>
</tr>
<tr>
<td align="right">
Verification:
</td>
<td align="left">
<input type="text" name="verify" size=10>
<img src="scfgenimg.php" width="60" height="20" align="top" alt="Verification string image"/>
</td>
</tr></span>
End_Of_Data;
}
?>
</table>
<p class="style1">Please enter your comments below. Click "Submit" when done. <br>
<textarea name="comments" rows=5 cols=70></textarea>
<input type="submit" name="s" value="Submit" />
</p>
<p> </p>
</form>
I know this will be something ridiculously dumb to fix, but I'm a wee bit lost.
Thanks in advance,
GC