problem to php code

SierraAR

Community Advocate
Community Support
Messages
827
Reaction score
17
Points
18
Hello,

Try renaming contact.html to contact.php first and foremost. If it's still not working, can you post the entirety of the code (Making sure you remove any database connection information such as passwords)

P.S.: Moved to the programming section
 

gamermax

New Member
Messages
1
Reaction score
0
Points
0
Another thing you could do is send it as GET

and you would have

Code:
if (all filters passed) {
mail($contact_email,$_GET['subject'],$whateveryouwantinthemessage,'From: contactformsubmitted@website.com');
}

you would add all necessary filters separated with && or ||
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
First, if there is a PHP script problem, it's on mail.php, not on contact.html. Giving a link does us no good, since we can't see the PHP source code (the server processes it, and we should get either a generic error page--or a custom error page if things are well-coded--if we try to open the file directly from the browser). You need to post the relevant code here.

Second, it's very likely that your PHP script tries to set the From header of the contact email to the email address value the user enters on the contact form. That's not allowed here; you can only set the From header value to an existing address belonging to your hosting account. Mail with any other value in the From header will be silently discarded by an outgoing spam filter. (That's to prevent spamming and spoofing/phishing.) If you insist on emailing yourself from the contact form (which is the wrong way to do things altogether, but there's a large cargo cult built around the practice), then you can use the ReplyTo header instead to hold the user email address.

Third, your contact form shouldn't work at all. You are using XHTML -- or at least your DOCTYPE claims that you are -- so there is a strict order for tags. In schematic form, the pertinent part of your page reads:

HTML:
<div id="Layer2">
<form action="mail.php" method="post">
</div><!-- this is where Layer2 ends -->
</form>

If the form starts inside a DIV, it has to end inside the same DIV. By rights, the browser should crap out and render an "invalid document" page because the XHTML is not well-formed, but a lot of the web would break if browsers were as strict as they once were. A browser could choose to end the form immediately after the name field, leaving all of the other fields and the submit and reset buttons out in the cold. If you're testing with a browser that does that, then your submit and reset buttons won't do anything.

And what's with all of the paragraphs with nothing but non-breaking spaces in them?
 

bakul

New Member
Messages
12
Reaction score
0
Points
0
Thank for suggestion, but when I had contact.php set up than it is download. where is the problem.
 

cybrax

Community Advocate
Community Support
Messages
764
Reaction score
27
Points
0
Did you read my post at all?
Think calm thoughts my Canadian friend, breathe deeply and the urge will pass.

Bakul, we need to see what the file mail.php contains to help you.
 

bakul

New Member
Messages
12
Reaction score
0
Points
0
Think calm thoughts my Canadian friend, breathe deeply and the urge will pass.

Bakul, we need to see what the file mail.php contains to help you.



Thanks every body. I have solve this problem it was hosting problem. My new hosting is www.ovidesign.tk
My new problem is new posting please help me
 
Top