I have a form, with some input elements (name, phone, address) like this:
[code]
<label>Nombre:</label>
Teléfono:
Dirección:
<fieldset>
<input value="Enviar" type="submit">
</fieldset>
</form>[/code]
Then in a separate file (called application.php) I have a script that in other things, gives formatting to the submit form, and then , it submits the code into phpbb3 using submit_post()
function.
Eveything goes ok, y fill the inputs, click on submit, and then it redirects to application.php?.. and posts the aplication into the correct forum and with the formatting.
Now, I want to check the info before submitting (phone only numbers, name without them…) and, if every input is ok, run the code (preferably i want the script code into the same file as the form, but if is better to have it in another file, there is no problem, but I dont know how to do it)
I have searched a bit, found that to validate a form and 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. (i have tried to copy the content of application.php into the form file)
PD: this will be a html file to be used as template for phpbb3 so instead of <?php ... ?> is needed to use …
Any one knows hoy validate and run the script (that uses the information given into the form)
thanks