Page 2 of 2

Posted: Tue Nov 25, 2003 9:07 am
by Mactek
I copy and pasted the code and i am also getting a parse error on line 9.

Posted: Tue Nov 25, 2003 3:55 pm
by OuchMedia
The parse error is gone but now there are new errors...they are as follows:

Warning: fopen("/quotes.txt","a") - Permission denied in /home/sites/site46/web/New/submit.php on line 21

Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site46/web/New/submit.php on line 23

Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site46/web/New/submit.php on line 24

here is the script exactly as it appears:


<html>
<head>
<title>Untitled Document</title>
</head>
<body>

Code: Select all

<?php 

//Define your variables here 
$date = $_POST['name']; 
$name = $_POST['title']; 
$company = $_POST['company']; 
$address = $_POST['address']; 
$location = $_POST['location']; 
$zipcode = $_POST['zipcode'];
$phone = $_POST['phone']; 
$email = $_POST['email']; 
$description = $_POST['description']; 
//The above define your variables sent from your "form.php" file 

$fp = fopen("$/quotes.txt", "a"); 
$outputstring = "$date.\n\r\r. Name .$name.\n\r\r Title $title.\n\r\r Company $company.\n\r\r Address $address.\n\r\r City, State $location.\n\r\r Phone $phone.\n\r\r Phone $phone.\n\r\r Email $email.\n\r\r Text $description.\n\r\r"; 
fwrite($fp, $outputstring); 
fclose($fp); 
?>
<h1>ouch media</h1>
<h2>form results</h2>

Code: Select all

<? 
echo "<p>form processed."; 
?>

</body>
</html>

Thanks for the help thus far.

*****here is some info from the "support" section of my host for my server:

What paths do I need to know in order to configure my cgi scripts?

The path to date: /usr/bin/date
The path to perl: /usr/bin/perl
The path to sendmail: /usr/sbin/sendmail
The path to your site: /home/sites/www.yourdomain.com/web

Posted: Tue Nov 25, 2003 4:24 pm
by DuFF
The error has to do with this line:

Code: Select all

$fp = fopen("$/quotes.txt", "a");
Where do you want quotes.txt to be? If it is supposed to be in the same folder as this script you should change that line to:

Code: Select all

$fp = fopen("quotes.txt", "a");

Posted: Wed Nov 26, 2003 2:27 am
by twigletmac
Topic continued:
viewtopic.php?t=14977

Mac