Jump to content

Recommended Posts

on this test pag: http://www.webauthorsgroup.com/index2.html, I created an "include" file (for the php form script), but if you just click on (or forgot a field) the submit button, it doesn't produce the error above the form, but rather it produces a seperate page with the form and error(s).

 

How can I correct this so that the error messages are echoed on the same page?

Link to comment
https://forums.phpfreaks.com/topic/271160-form-validation-error/
Share on other sites

Is there any chance to see any PHP code?

 

Set your form action to index2.php. At the top of that page(above the doctype declaration, you can process the code there).

 

if(isset($_POST['name'])){
include("process_form.php");
}

 

Regards,

 

AoTB.

Edited by AoTBuNgLe

Is there any chance to see any PHP code?

 

Set your form action to index2.php. At the top of that page(above the doctype declaration, you can process the code there).

 

if(isset($_POST['name'])){
include("process_form.php");
}

 

Regards,

 

AoTB.

 

The URL is of an html file so unless they have it configured to parse php, they would need an ajax call. And then all the errors would be displayed at the top of the page instead of where they want

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.