473,320 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Contact Form

My server does support php, but I cannot get contact form to work.
Could use some help to see if any error in php code and appreciate
help in advance! Jason

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;

if (!isset($_REQUEST['email'])) {
header( "Location: index.htm" );
}
elseif (empty($name) || empty($email) || empty($subject) ||
empty($message)) {
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<link href="css/jace2.css" rel="stylesheet" type="text/css" />
</head>

<body>
<p class="topic">Unable to send your message!</p>
<p>One or more fields are empty and ALL fields in contact form are
required to be filled to be able to send your message </p>
<p> Click your browser's &quot;back&quot; button to return to the
contact form and fill all fields.</p>
</body>
</html>

<?
}
else {
mail("sc*******@jace41.com", $subject,
$message, "From: $name<$email>" );
header( "Location: contactsent.html" );
}
?>
Jul 17 '05 #1
3 3344
sc*******@jace41.com (Jason) wrote in
news:ed**************************@posting.google.c om:
My server does support php, but I cannot get contact form to work.
Could use some help to see if any error in php code and appreciate
help in advance! Jason


"Doesn't work" isn't a helpful description when you're asking someone to
help you debug your code. You need to state in very specific terms both
what you *want* to happen and what actually *is* happening.

That said, the first thing that pops into my mind is that what does/doesn't
get put into $_REQUEST is a matter of how PHP is configured, and therefore
it's usually better to work directly with $_GET and/or $_POST.
Jul 17 '05 #2
Eric Bohlman <eb******@earthlink.net> wrote in message news:<Xn*******************************@130.133.1. 4>...
sc*******@jace41.com (Jason) wrote in
news:ed**************************@posting.google.c om:
My server does support php, but I cannot get contact form to work.
Could use some help to see if any error in php code and appreciate
help in advance! Jason


"Doesn't work" isn't a helpful description when you're asking someone to
help you debug your code. You need to state in very specific terms both
what you *want* to happen and what actually *is* happening.

That said, the first thing that pops into my mind is that what does/doesn't
get put into $_REQUEST is a matter of how PHP is configured, and therefore
it's usually better to work directly with $_GET and/or $_POST.

My bad, was a sleepy head while typed my previous message and supposed
to give the details, instead of "doesn't work".

Okay let me try to explain: I already created three pages: index.htm
(contact form), sentform.php (check and validate whether fields are
filled and if validated it will redirect to contactsent.htm and email
message), and contactsent.htm (thank you).

As for php script, I got it from

http://www.thesitewizard.com/archive/phptutorial2.shtml

"if and elseif" codes function as validation to check if any field is
missing before proceed to next php code. If all fields aren't filled,
then this page will stop at this point. If all are filled then it
will proceed to next php instruction.

Once pass "if and elseif" codes, then "else" will submit email and
redirect to thank you page.

Okay, here's problem: I tested pages by filled all fields and
submitted, but it stopped at second page (sentform.php) and won't send
email and redirect to thank you page.

I'm not a php freak and I am assume it's "REQUEST" function's a
problem or entire php need to be recode. Hopefully I explained
clearly.

Jason
Jul 17 '05 #3
Eric Bohlman <eb******@earthlink.net> wrote in message news:<Xn*******************************@130.133.1. 4>...
sc*******@jace41.com (Jason) wrote in
news:ed**************************@posting.google.c om:
My server does support php, but I cannot get contact form to work.
Could use some help to see if any error in php code and appreciate
help in advance! Jason


"Doesn't work" isn't a helpful description when you're asking someone to
help you debug your code. You need to state in very specific terms both
what you *want* to happen and what actually *is* happening.

That said, the first thing that pops into my mind is that what does/doesn't
get put into $_REQUEST is a matter of how PHP is configured, and therefore
it's usually better to work directly with $_GET and/or $_POST.

My bad, was a sleepy head while type my previous message and forget to
explain the full details.

Okay, let's see where to start: I already created three pages:
index.htm (contact form), sentform.php (validate to see if all fields
are filled before proceed submit email and redict to thankyou page),
and contactsent.htm (thank you page).

I got php scripts from:

http://www.thesitewizard.com/archive/phptutorial2.shtml

"if and elseif" codes function as validation to see if all fields are
filled before proceed to next php instruction (else). If form fails,
then this page will act as error page to instruct to return back to
contact form and make sure all fields are filled.

"else" code will process the email and redirect page to
contactsent.htm (thank you) if form passed the "if and else" script.

But the problem's: I have tested them by fill all fields and succeed
jump to contactsent.php, but for some reason, sentform.php won't
process the email and redirect to thankyou page. It's my guess that
the "REQUEST"'s problem, but I'm not a php freak since I'm starting to
learning php. Hopefully I explain clearly...

Jason
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jason | last post by:
I'm struggling with this email code and I'm not php freak since I'm starting to learn php stuff. Could use some help... It seems that I get too many parse errors all over and cannot figure went...
1
by: rjbonn | last post by:
I'm setting up a contact list for a musician, who is about to release her first CD. She would like a contact list that can track the people she meets, who will be in various categories -- fans,...
0
by: Robert J. Bonn | last post by:
I am setting up a contact list for a musician, who is about to release her first CD. She would like a contact list that can track all the people she meets, who will be in various categories --...
3
by: John | last post by:
What is the easiest way to make the contact form show on the front page. Meaning on want to keep the front html page and when someone clicks on the contact us link the front page remains the same,...
0
by: kammaldeep | last post by:
hi, i m newbie 2 PHP & to b frank ... will alwaz be ... i dont think i will go into much details with PHP as my work doesnot include workin with PHP bt i have a forum .. and i want to make a...
4
by: thanos | last post by:
Hello, I'm relatively new to PHP so I found this free contact us script on the net that i was going to use for my Contact Us php page. Its works pretty good except for error handling. I was...
5
by: NYXX | last post by:
Here is my Html Code and my Contact.php This is My code in my html <td height="345" valign="top"> <form style="margin:0; padding:0; " action="contact.php" method="get" id="form"> <table...
12
by: colt28 | last post by:
Ok so I found an ajax contact form script but i can't get the b****** to work. I made a bunch of alterations to it and it didn't work so i replaced everything with the original and it still didn't...
8
by: chromis | last post by:
Hi, I'm writing a contacts section for a cms on a website, I've decided to write the section in OO code. So far I have my Contacts object and a page structure I would use for a procedural site. ...
4
by: tokcy | last post by:
HI every one, i am using tooltip on click of link and i want like when that tooltip open then background window would be blure(). can anyone help me...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.