Enquiry form

Hello I need an enquiry form for my site. Does anyone know a php code I can use for a email submission form.

Thanks in advance everyone
 
You should probably tick the "Disable smilies in text" box on your post, otherwise that's rather grumpy-looking code. :rolleyes:
 
Just use the
code.gif
code button to wrap your code in
Code:
 tags, makes it easier for people to view the code in a scroller then, and also takes out the smilies like Jim mentioned :)
 
maybe I'm missing something here but your html is saying form.php and the script is under Form-processor.php so the html is not going to access the php script as far as I can tell as they need to be the same :).
 
Hay let me know if Levi's solution fixes it if not I'll have a look.
But I wrote that PHP contact form, if you are having issues can you let me know what exactly so I can remove them for other users?

Just so I can improve the form/documentation.

The feedback would be great.

Cheers.
Jaz
 
Hello, All,

Jazajay I wasnt aware you wrote the code, it isnt the same as the one you have published on the forum though just to be clear. Regarding the php.form and form-processor I thought the same think. However when I changed them so they match when its live when you hit the submit form nothing happens. The script obviously should take the user back to the homepage but nothing happens. So as a result I assumed that the name of form wasnt the route cause and it was something else.

Any more offers. Thanks all
 
Hi, do you have this uploaded anywhere to view?
& your script name will definitely need to the same, and point to the correct location as a start :up:
 
Okay can I just ask why you don't use mine?
Mine doesn't use a table, is accessible to people with disabilities yours is not, doesn't use tables so cuts down on bloat and would let the user know something has happened, sending them to the home page would cause utter confusion, as in okay so has it been sent or did I make a mistake. Also that form will not send them back to the home page.

If for some unknown reason really want to do that after we fix it let me know but i would highly advise against it.

Its not a php form just so we are clear it would be a (X)HTML form using PHP to get it to work, big difference.

Also they are right you need to point it to form-processor.php not form.php

Also not sure exactly what is going on in the form processor.php code as it is but TBH not sure where you got this from but that's not how those 2 pieces of code are meant to interact, hence why you are having issues, kinda missed out a stage in assembly.

Your setting the $success variable for no apparent reason, also you are commenting out a constant which is all ready set, tad weird and you can safely take that out, it will also just display a blank page to the user if you connect them so i suggest you don't.

Where I can imagine this is from is 2 different pieces of code which is meant to go on the same page.

So if for some strange reason you want it to work like that bare in mind it needs seriously beefing up as you are currently not cleaning any data that will get sent to your email passed your spam filters, IE JavaScript, images or just plain annoying spam, which will lead to security problems for you.

So here we go.
We don't change where the form is submitting it to, but instead bring in both files into the same page, hence why you have form.php and not form-processor.php in the action attribute.

So write this above and around the table:
<?php include("Form-processor.php");
if($success==true){?>
?>

<h1 style="color:green">Thank you your email has been sent</h1>
<p>A member of our team will get round to reading your email and we all ways aim to respond within 24 working hours.</p>
<p>Thank you for taking the time to contact us</p>

<p><i>Company name</i></p>
<?php }else{

if(isset($_POST) && $success=="false"){?>
<h1>An error has occurred</h1>
<p>
We are sorry but an error has occurred trying to send your message as our server is experiencing difficulties at the moment.
</p>
<p>
Please phone us or try submitting your message again at a later time.
</p>
<p>
We apologise for any inconvenience this has caused you.
</p>
<?php }?>
<!----place you table/contact form in here-----!>
<?php }?>

Now I haven't tested your code at all so if you get an error let me know however try to get mine to work, mine screens the code, yours does not, mine is accessible to people with disabilities your would be a nightmare.

Any issues with either the above or GETTING MINE TO WORK, let me know and I'll talk you through both. :)
 
Right you need to re-edit your posts and put the file name, in bold, above each section otherwise I, and others, have no idea which page is which.

Once you have done that submit another post saying done, or whatever, so I get an email and I'll help you out then. :)
 
Or mine?
3rd link from the top in my sig, any issues you run into with it let me know and I'll help you out with it. :)
 
Back
Top