potential permissions problem
Posted: Wed Aug 18, 2004 4:17 pm
Hi,
I'm using PHP for the first time and I've run into a problem.
I want to create a form on my website to collect email addresses for a mailing list. I have successfully created the form using the following html code:
<form method="post" action="formprocess.php">
E-mail Address: <input type="text" name="email"><p>
<input type="submit" name="submit" value="Submit">
</form>
I also have a file called formprocess.php with the following code:
<?php
$to = "myemail@mysite.com";
$subject = "Someone's email address from web form";
$email = $_POST['email'];
$message = "Person's email address: $email\n";
$headers = "From: $email";
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
include("success.html");
} else {
include("fail.html");
};
?>
Lastly, I have created the success.html and fail.html pages. These two files and the file with the form and the formprocess.php file all sit in the same directory.
I'm able to get the web form for the email address and the "Submit" button to appear, but I can't seem to get the php script to run. When I press "Submit", the browser returns a blank page.
You can see this result at http://www.goler.com/yorz
Also, I tried action="formprocess.php" and action="/yorz/formprocess.php" in hopes that maybe the submit wasn't finding the php file. That change didn't help. I called my hosting company (fatcow.com) and they assure me that php is installed on their boxes. The tech support person thought I might have a problem with my "permissions". I'm unfamiliar what with what sort of permission issues I may be running into.
I would greatly appreciate it if anyone has any suggestions about what might be causing this problem and how I could fix it.
Thank you!
--g
I'm using PHP for the first time and I've run into a problem.
I want to create a form on my website to collect email addresses for a mailing list. I have successfully created the form using the following html code:
<form method="post" action="formprocess.php">
E-mail Address: <input type="text" name="email"><p>
<input type="submit" name="submit" value="Submit">
</form>
I also have a file called formprocess.php with the following code:
<?php
$to = "myemail@mysite.com";
$subject = "Someone's email address from web form";
$email = $_POST['email'];
$message = "Person's email address: $email\n";
$headers = "From: $email";
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
include("success.html");
} else {
include("fail.html");
};
?>
Lastly, I have created the success.html and fail.html pages. These two files and the file with the form and the formprocess.php file all sit in the same directory.
I'm able to get the web form for the email address and the "Submit" button to appear, but I can't seem to get the php script to run. When I press "Submit", the browser returns a blank page.
You can see this result at http://www.goler.com/yorz
Also, I tried action="formprocess.php" and action="/yorz/formprocess.php" in hopes that maybe the submit wasn't finding the php file. That change didn't help. I called my hosting company (fatcow.com) and they assure me that php is installed on their boxes. The tech support person thought I might have a problem with my "permissions". I'm unfamiliar what with what sort of permission issues I may be running into.
I would greatly appreciate it if anyone has any suggestions about what might be causing this problem and how I could fix it.
Thank you!
--g