GetDotted Domains

Viewing Thread:
"Help (PHP)"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 23/03/02 at 16:24
Regular
Posts: 787
On my new site, I've decided to have a feedback option where users can send me suggestions on how I could improve my site or give me ideas on new wallpaper themes. Thing is, I'm new to PHP and have made my own mail script. I just uploaded it to find it doesn't work.

Here is the script :-

function sendmail()
{
global $mail_to, $mail_from_name, $mail_from_email; $mail_body;

$mail_parts["mail_to"] = $mail_to;
$mail_parts["mail_from_name"] = $mail_from_name;
$mail_parts["mail_from_email"] = $mail_from_email;
$mail_parts["mail_body"] = $mail_body;

$mail_to = [email protected]

if(my_mail($mail_parts))
user_message("Successfully sent an e-mail title '$mail_subject'.");

else error_message("An unknown error occurred while attempting to send an e-mail title '$mail_subject'.");
}
function my_mail($mail_parts)
{
$mail_from = $mail_parts["mail_from_name"];
$mail_body = $mail_parts["mail_body"];

if(empty($mail_to)) error_message("Empty to field!");
if(empty($mail_body)) error_message("No message!");

$mail_to = str_replace("; ", ",", $mail_to);

$mail_headers = '';

$mail_subject = stripsplashes($mail_subject);
$mail_body = stripslashes($mail_body);

return mail ($mail_body);
}
?>

This is the page where users can send the feedback:-

http://wallpapers.mega.net.kg/feedback/

Any suggestions would be helpful, cheers.

By the way, I know the site looks complete crap on Netscape, I'm in the middle of sorting that :).
Sat 23/03/02 at 16:54
Regular
"No Surprises Please"
Posts: 2,192
So what do I replace the

$mail_parts["mail_to"] = $mail_to;
$mail_parts["mail_from_name"] = $mail_from_name;
$mail_parts["mail_from_email"] = $mail_from_email;
$mail_parts["mail_body"] = $mail_body;

with

mail($mail_to, "Feed Back Form Results", "
FROM: $mail_from_name ($mail_from_email)
$mail_body"
", "FROM:$mail_from_email");

or do I need to put his above/below the mail parts?

This is all a little bit confusing for me.
Sat 23/03/02 at 16:48
Regular
"It goes so quickly"
Posts: 4,083
Well, you have not put in the actual mail(); function, which is what will send you the data.

$mail_to = [email protected]

mail($mail_to, "Feed Back Form Results", "
FROM: $mail_from_name ($mail_from_email)
$mail_body"
", "FROM:$mail_from_email");

Is the simplest way, though the validation isn't included in that.
Sat 23/03/02 at 16:45
Regular
"No Surprises Please"
Posts: 2,192
OK, thanks a lot.

Check out the free mySQL host thread I made, I know you were looking for one :).
Sat 23/03/02 at 16:42
Regular
"It goes so quickly"
Posts: 4,083
Firstly, put $mail_to = [email protected] above the $mail_part bits

.. I'm looking it it now though, and I'll let you know about the rest.
Sat 23/03/02 at 16:24
Regular
"No Surprises Please"
Posts: 2,192
On my new site, I've decided to have a feedback option where users can send me suggestions on how I could improve my site or give me ideas on new wallpaper themes. Thing is, I'm new to PHP and have made my own mail script. I just uploaded it to find it doesn't work.

Here is the script :-

function sendmail()
{
global $mail_to, $mail_from_name, $mail_from_email; $mail_body;

$mail_parts["mail_to"] = $mail_to;
$mail_parts["mail_from_name"] = $mail_from_name;
$mail_parts["mail_from_email"] = $mail_from_email;
$mail_parts["mail_body"] = $mail_body;

$mail_to = [email protected]

if(my_mail($mail_parts))
user_message("Successfully sent an e-mail title '$mail_subject'.");

else error_message("An unknown error occurred while attempting to send an e-mail title '$mail_subject'.");
}
function my_mail($mail_parts)
{
$mail_from = $mail_parts["mail_from_name"];
$mail_body = $mail_parts["mail_body"];

if(empty($mail_to)) error_message("Empty to field!");
if(empty($mail_body)) error_message("No message!");

$mail_to = str_replace("; ", ",", $mail_to);

$mail_headers = '';

$mail_subject = stripsplashes($mail_subject);
$mail_body = stripslashes($mail_body);

return mail ($mail_body);
}
?>

This is the page where users can send the feedback:-

http://wallpapers.mega.net.kg/feedback/

Any suggestions would be helpful, cheers.

By the way, I know the site looks complete crap on Netscape, I'm in the middle of sorting that :).

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Continue this excellent work...
Brilliant! As usual the careful and intuitive production that Freeola puts into everything it sets out to do, I am delighted.
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.