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">
<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" />
<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" />

Recommended Answers

All 2 Replies

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


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?





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, learning, and sharing knowledge.