/    Sign up×
Community /Pin to ProfileBookmark

contact/feedback mail forms

hello everyone,

im new here, i want to end up my problem in PHP mail forms, im new in PHP, i used to have an ASP mail forms and was easy to use and i done it well, but i have a project which it needs to be in a PHP format. I already got a PHP script to send mail forms in my contact/feedback form, but the problem is it didnt work. Theres a lot of shared scripts i already used in my site but still it didnt work, the problem again was i dont recieve the mail that i send in the mail i specified in the script. i have this problem a month now.
i have 3 inputs in the form, His/Her Name, Email Address and his/her message.
the recipient email was hidden in the script. then also im having problem in redirection to a THANKS page. ? ?
Can anyone help me solve my problem?

by the way heres the PHP code:contact.php

[CODE]
<?php
global $name;
if($name) {
$name=$_GET[‘name’];
$email=$_GET[’email’];
$subject1=$_GET[‘subject’];
$message=$_GET[‘message’];
$ip=$_SERVER[“REMOTE_ADDR”];
$host = gethostbyaddr($_SERVER[‘REMOTE_ADDR’]);
$host = $ip.”.”.$host;
$mon=date(m);
$day=date(j);
$year=date(y);
$hour=date(g);
$min=date(i);
$sec=date(s);
$hour=$hour-2;
if($hour<=0) { $hour+=12; }
$ts = “$hour:$min:$sec on $mon/$day/$year”;
$to=”[email protected]”;
$subject=”Contact Form:”.” $subject1″;
$body=”
Message from: $name
Subject: $subject1
E-mail: $email
Message: $message

Host: $host
Time: $ts”;

mail($to, $subject, $body);
echo “<script>location.href=”http://mysite.com/thanks.php”</script>”;
}
?>
[/CODE]

and heres the HTML code: contact.php

[CODE]
<html>
<head>
<title>Contact Us</title>
</head>

<body bgcolor=”#ffffff” text=”#666666″>
<font face=”verdana” size=”1″>
<form method=”post” action=”contact.php”>
Your Name:<br>
<input type=”text” name=”name” style=”border: 1px solid #cccccc; background-color: #ffffff;”><br><br>
Your E-mail Address:<br>
<input type=”text” name=”email” style=”border: 1px solid #cccccc; background-color: #ffffff;”><br><br>
Subject:<br>
<input type=”text” name=”subject” style=”border: 1px solid #cccccc; background-color: #ffffff;”><br><br>
Message:<br>
<textarea name=”message” cols=”40″ rows=”10″ style=”border: 1px solid #cccccc; background-color: #ffffff;”></textarea>
<br><br>
<input type=”submit” value=”send” style=”border: 1px solid #cccccc; background-color: #ffffff;”>
</form>
</font>

</body>
</html>
[/CODE]

i used this because this was the one that easy to understand and the flow are simple. i have different code that i use to

upload in the server but it was all the same, it didnt send an email to the email i specified. and the codes are just the

same, some other codes needs referers and i dont know what does suppose to do.

thanks in advance…

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@JayMApr 11.2005 — If you used several scripts and they all didn't work, I assume it is not the code that is not working. Are you on a Windows system? If so, have you modified your php.ini file? PHP will not send unless you have done the proper modifications.
Copy linkTweet thisAlerts:
@ne3ro0authorApr 12.2005 — hi, how can i modify the PHP.ini, yes im using Windows 2000 server. but the site is hosted in a server not in my local server.
Copy linkTweet thisAlerts:
@JayMApr 12.2005 — Take a look at this article [URL=http://builder.com.com/5102-6371-1045471.html]here[/URL]
Copy linkTweet thisAlerts:
@ne3ro0authorApr 12.2005 — JayM, i just read the link you've given, lots of info ive learned about. but the question is i dont run the site in my locahost or local server, because theres still be configured in my local machine to be a dedicated server and i dont know how to do it. I just setup my site using my local machine using my IP address. the site im doing is hosted in a free web hosting server, the tutorial you've given me didnt tell how to configure the php.ini in the hosted server. it only tells how to configure the php.ini in the local machine or rather localhost.
Copy linkTweet thisAlerts:
@ne3ro0authorApr 12.2005 — im still confused, the PHP.ini contains only this code?

<? phpinfo() ?>

did my understanding to the article correct?

ahhhhhhh.. my brain is bursting in to pain.. 'cry cry cry cry'...

my brain is not working that fast. help me understand it. please...
×

Success!

Help @ne3ro0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...