Php contact form

Hi friends, i have a question, How to separate php folder for email contact form, to be in folder called php. Is there any way to link it? Thanks

Yes, why not? Let me know more in detail what you mean.

For example you can create a HTML Form with some required inputs and set the forms action attribute value as link to your PHP file which will handle the form inputs and submit them.

Another option would be JavaScript and an asynchronous webrequest grabbing the forms data and submitting it as POST to the specified PHP link.

But at all, explain me a little bit more about your fittings.

Cheers, eliteCode

1 Like

Thank you for good answer, i have a html theme and i only need php for contact form then i need to put php code when client send email. I need to put php code in specific folder.

Yes it’s no problem.

Create in your HTML Template a FORM Element and set his specified inputs in the form. Example:

    <form method="POST" action="yourfolder/yourfile.php">
<input type="text" name="formName" />
<input type="submit" value="Send" />
</form>

Create the PHP file named yourfile.php in your folder for example yourfolder/yourfile.php and put following code inside:

<?php
$formName = $_POST["formName"];
// do something with the value of formName
?>

Thank you, I will try this :slight_smile: