This is a discussion on "Recursive programming in php" within the PHP Forum section. This forum, and the thread "Recursive programming in php are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Recursive programming in php
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Recursive programming in php
I'm very very very new to PHP.
I have a PHP doc. What I cannot do: There is a form inside the php file. When user enteres values into the form I want php to analyze the values and if there is a problem to right next to the form field what the problem is. But instead of it before the values are entered into the form the message comes up. How to make the message to analyze the data after the form is processed. There are many more problems with the document but this is the most disturbing one. Thank you guys. This is the code:
Last edited by karinne; Oct 1st, 2007 at 19:16. Reason: Please use the vBcode [ php ] when inserting PHP code in your post. |
|
|
|
|||
|
Re: Recursive programming in php
My favorite way to validate forms is to actually add a javascript function to validate the form attributes when the submit button is clicked and use javascript to add error messages to the innerHtml of the <td> tags where you want. You would need to give each <td> a unique Id inorder to do it.
If you must do it in PHP use the ISSET() function to check whether a POST variable is set before you print out the error messages. |
|
||||
|
Re: Recursive programming in php
Can you put the code in the php bbc
__________________
The Net is Dying | Fan Rage | We are Battlefield heroes - BFH Forum Vanilla Source - Vanilla Help, and mods
Last Blog Entry: Whats your Niche? (Jun 10th, 2008)
|
|
||||
|
Re: Recursive programming in php
Your PHP is a little wacky (sorry
There is no real procedure as the loop hasn't finished before you start checking things. The script below is yours but I have rewritten it to do as you ask but also work -- it will check each condition and only display error messages if needed after the form is submitted.
Quote:
Hope that helps, cheers.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Recursive programming in php
Or use both. The client-side check increases Usability and the server-side increases safety....
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with Programming | SuseLinux | PHP Forum | 6 | Nov 4th, 2006 14:15 |
| [XSLT]: Recursive Function to Add/Multiply | ThyGizmo | Other Programming Languages | 0 | Oct 9th, 2006 08:15 |
| programming-designs.com | programming-designs | Free Web Site Critique | 5 | Aug 27th, 2006 19:31 |
| ASP/SQL programming help | squashed_Frog | Classic ASP | 3 | May 15th, 2006 03:49 |
| NewBie to Web Programming | ruwanr | Introduce Yourself | 7 | Dec 1st, 2005 20:32 |