Page 1 of 1

PHP window shuts down immediately

PostPosted: 19. March 2006 05:58
by Emanuele
Hi all and welcome to my first post :)

I'm trying to make an online survey and wouldn't want to use a simple mail-to form in HTML, so I tried using PHP. I am using web space from my university, and the webmaster was telling me that I had to convert my file to CGI script by entering some kind of command on the first line of the .php file. I was trying but I can't even open the .php file; some window does open but then it shuts down immediately.

I don't know what to do!! Any ideas?


PostPosted: 19. March 2006 06:36
by tjthedj
same problem awile back and then a few days later my computer had a harddrive failure so i never got a chance to try and fix the problem.

PostPosted: 23. March 2006 10:56
by WorldDrknss
Not sure if this would help you a bit, but here is a code that you would use in a action in a form.

Code: Select all
$username = $_POST['username'];
$useraddr = $_POST['useraddr'];
$comments = $_POST['comments'];

$to = "admin@localhost";
$re = "Survey";
$msg = $comments;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html";
$headers .= " charset=iso-8859-1\r\n";
$headers .= "From: $useraddr \r\n";
$headers .= "Cc: another@localhost \r\n";
mail( $to, $re, $msg, $headers );