Newbie needs help with very 'simple' script

the mail() function

Moderators: macek, egami, gesf

Post Reply
User avatar
Shiv
php-forum Active User
php-forum Active User
Posts: 262
Joined: Wed Feb 02, 2005 8:06 pm
Location: Ahmedabad (Gujarat), INDIA

Post by Shiv » Fri Mar 11, 2005 9:19 pm

You should write what error you get so one can troubleshoot the problem.
:)

victor123
New php-forum User
New php-forum User
Posts: 192
Joined: Mon Sep 06, 2004 1:23 am
Location: Madrid, Spain

Post by victor123 » Sun Mar 13, 2005 12:20 pm

Hi,

I guess the code there has some parentheses left. Besides, as a way of backtracing the problem, you can echo $variable to see the value. Try echoing all the values that have to be correctly filled to be sure. It happens to me all the time.

Cheers.

User avatar
Shiv
php-forum Active User
php-forum Active User
Posts: 262
Joined: Wed Feb 02, 2005 8:06 pm
Location: Ahmedabad (Gujarat), INDIA

Post by Shiv » Sun Mar 13, 2005 7:50 pm

Have you traced the error or not??? Ok tell if any problem.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Mon Mar 14, 2005 12:56 am

Not a correct usage:

$name; // inneholder navnet på avsender
$email; // inneholder avsenders epost-adresse
$text1; // inneholder avsenders beskjed til deg
$text2; //tekstfelt
$radio1; //jjj
$radio2;
$radio3;
$radio4;
$radio5;
$radio6;
$radio7;
$text3;

Here comes an explanation of the possible error: register_globals = Off in PHP.ini while you are trying to use the script with them being turned on.

PLUS that you give one hell number of arguments to the mail function while it takes max 4. I still cant understand WHY you are doing this and what are you trying to achieve... anyways, i think i will explain it in swedish as well as you might understand it a bit better ;)

Ditt största problem är att du försöker ge massa argumenter till mail() funktionen medan den tar bara 4. Funktionens format är mail($to, $subject, $body, [$headers]).
den sista $headers står i [] eftersom den är inte nödvändigt men i nästan alla fall behöver du änvända den... så det är därför jag säger max 4..

Vad är det exakt som du försöker göra? kanske det kan hjälpa i fallet du läser genom PHP manualen.har du problem så kan du alltid fråga mig och så försöker jag hjälpa dig..

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Post by Alexej Kubarev » Mon Mar 14, 2005 12:59 am

Oh, by the way => I am going to move this topic to php coding => Mail() forum as this is a problem of the mail function.. unless someone disagrees with me: it will stay there :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest