I have a form, with some input elements (name, phone, address) like this:
<form method="get" action="<!-- PHP --> echo htmlspecialchars($_SERVER['PHP_SELF']); <!-- ENDPHP -->" accept-charset="utf-8">
<label>Nombre:</label>
<input name="nombre" id="nombre" type="text" placeholder="Tu nombre">
<label>Teléfono:</label>
<input name="phone" id="tel" type="text" placeholder="666777666">
<label>Dirección:</label>
<input name="address" id="direc" type="text" placeholder="Mi Casa">
<fieldset>
<input value="Enviar" type="submit">
</fieldset>
</form>
After that form, there is a large php code to "post" the obtained data in phpbb (using submit_post()
) and formatting the body and title post.
Then when click on submit I want to validate form data (verifying that the phone is a number, for example) and, if all is ok, continue with the php script to post.
I have searched a bit, and found that is needed action="<!-- PHP --> echo htmlspecialchars($_SERVER['PHP_SELF']); <!-- ENDPHP -->"
but when click on submit, page only reloads, without running the php code just below the form.
PD: this will be a html file to be used as template for phpbb3 so instead of <?php ... ?>
is needed to use <!-- PHP --> .... <!-- ENDPHP -->
Any help or code is appreciated