parse error in submit.php on line 10
Moderator: General Moderators
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>
<h1>ouch media</h1>
<h2>form results</h2>
</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
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);
?><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
The error has to do with this line:
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");Code: Select all
$fp = fopen("quotes.txt", "a");- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK