close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

WA Form Validation in PHP with forms in according and problems with link and validation - Please help

Thread began 12/29/2013 12:15 am by Venkatesh | Last modified 1/01/2014 12:42 pm by Jason Byrnes | 1925 views | 5 replies |

Venkatesh

WA Form Validation in PHP with forms in according and problems with link and validation - Please help

Hi, I am trying to create a registration login system in my website for my clinic. I have used a template based on PHP to create my website. I know nothing about PHP. Essentially, I have used webassist to create a login for with server side validation as a first step. I have utilized different css styles to manually style the form that WA generates. While the form on it's own works fine without being included in any page, I am having trouble when I integrate it into the page where I want it to work. The links in my webpage are referenced by PHP for e.g. menu link as follows to the login page - <li class="submenu<?php echo ($_GET["page"]=="professionals" ? " class='selected'" : ""); ?>"><a href="#" title="FOR PROFESSIONALS">FOR PROFESSIONALS</a><ul class="wide"><li><a href="?page=practitioners#practitioner-login" title="Professional Login">Login</a></li>. The login form is on a page that has accordion panels that hide the forms and I usually call the login form using the link as ?page=practitioners#practitioner-login where the PHP page is practitioners.php and the DIV ID for the form is practitioner-login. When I integrate the login form, I have been getting errors with the validation which is not working and I think the problem lies in how the PHP redirection have been referenced. I have used ?page=practitioners in <form action> and the validation does not work. I am not sure how to reference the action page or links to it in the various validation fields. I moved the form to a separate page (renamed just as login) without accordions and referenced the form action as ?page=login and it partially works. It temporarily loads something in the background saying 'There was a problem' but this is quickly replaced by the page with fields mostly validated including email, password and CAPTCHA but not the second security question which is not validating despite correct answers. The same form without the PHP require once for header or footer and called simply from the browser as localhost/?page=login (renamed as login with just the form and scripts)worked fine. Unfortunately I have messed up the file with multiple rewrites and it is not working anymore. Why am I getting the footer stuff in the progress bar wrapper as seen in the other pic.

Please help me integrate this into my existing page so that I can then work on inserting it into database and user registration forms etc. I have attched screenshots (4 files in sequence of the file login.php that loads the form and which partially works with a background temporary error)and the PHP files (including header and footer files) zipped version of my whole website for your review.

Please help

Attached Files
website_zipped.rar
working-login-form.rar
Sign in to reply to this post

Jason ByrnesWebAssist

Use Framework Builder Plugins to add the login form page to the main page.

see the Framework builder getting started guide for details:
http://www.webassist.com/tutorials/Getting-Started-with-Framework-Builder

Sign in to reply to this post

Venkatesh

Thanks Jason,
So, do I create a registration and login system in separate PHP files and include that as a plugin using the framework ? Do these pages need styling or will they inherit the styles from the page where they are called? I hadn't used Plugins before but happy to venture into it. As long as it serves my requirement.

Perhaps similar to calling the menu system in my webpages by just using the <require once> PHP code...
I will give this a try and get back to you if there are any issues.

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, the login pages will be created in separate files, then added to the site pages using Framework builder.

You will need to add styling to the forms.

plugins are similar to use require once, but better.

with require once, all the code on the page being added is placed at the require once line.

using plugins, the system looks at the page and finds the code chunks in various parts of the document and places them in the correct places on the page it is being included.

this means that code on the plugin page that is outside the doctype is added to the main page outside the doctype, code that is in the head section is added in the head section. code in the body is added to the body, etc.

Sign in to reply to this post

Venkatesh

Hi Jason,
I tried using the Framework Builder. I am still running into problems.
My main page includes the header and footer that are called in via a PHP include on the main index page as:
<?php
error_reporting(E_ALL & ~E_NOTICE);
require_once('header.php');
require_once(basename(($_GET['page']!='' ? $_GET['page'] : 'home') . '.php'));
require_once('footer.php');
?>

I have attached my Menu file to this post.

I even changed the form post action to "<?php echo htmlentities($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlentities($_SERVER["QUERY_STRING"]):""; ?>" as suggested elsewhere.

The server side validation works since it happens before form posting.

However once I submit the form with intentional errors in captch/security code, it doesn't submit but goes to http://localhost/index.php?page=practitioners

Where am I going wrong?

Please help.

Is it to do with the way my PHP Links are structured. I have made no progress in a week and I would really appreciate your help. Could you please look at my relevant zipped website files and see what is causing the error?

I used a static plugin and don't know if a dynamic plugin would have made a difference. I could not figure out how to use the dynamic plugin in terms of what variables to call.

When I point over the register button it shows http://localhost/index.php?page=practitioners (is this why it is not processing the form)

Please let me know since I don't know PHP coding but if given the right instructions I Can read up about it and set things right.

Attached Files
website.rar
Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...