Hi guys, I struggled for few days to find a php code that work's to this form contact. Please if someone know's help me. Thank you!

<form action="index.php#contact" method="post">
<div id="box-message">
</div>
<p class="clearfix">
<input type="text" name="name" value="" placeholder="Name" required="required" />
<input type="email" name="email" value="" placeholder="Email" required="required" />
<input type="text" name="website" value="" placeholder="Website" />
</p>
<p>
<textarea cols="109" rows="9" name="query" placeholder="Your message" required="required"></textarea>
<input type="hidden" name="_token" value="63cec6911de36c0b920850d85316773d" />
<input type="submit" value="Submit" />
</p>
</form>

How are you planning to send this contact through? You want this in database, in a file, through email, what is the output you're expecting?

Also I believe <input type="hidden" /> is still visible in source-code, just so you know.

Member Avatar for diafol

@Aeonix:

The hidden token here is probably CSRF protection - that's the usual way to present it. It has to be sent with the form and you don't want it visible, spoiling the visuals of said form.

I can't see anything wrong with your form. Is the 'action' correct? We don't usually send forms to the index page of our sites. This form should be sent to its own form handler, e.g. 'handlers/send_email.php'

You do not show what happens to the submitted data, so we have absolutely no idea what you're doing. If you don't have any code at all, didn't you search the manual?

http://php.net/manual/en/function.mail.php

http://www.w3schools.com/php/func_mail_mail.asp

http://www.w3schools.com/php/php_forms.asp

http://stackoverflow.com/questions/5335273/how-to-send-an-email-using-php

Just the first 4 results for 'send mail php'

If you can't use Google or Bing - perhaps they're banned in your country? You can search this forum - we have about 10 new threads per month on this very issue.

commented: I see, thanks. +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.