Form Error Styling Attempt

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Form Error Styling Attempt

Post by obi_wasabi »

Code: Select all

if(strlen($fm_firstname)>0){
                $fm_firstname=stripslashes($fm_firstname);
        }else{//If no name was entered.
                $fm_firstname=NULL;
        include('./index.php');
                echo '<label for="fm_firstname" class="error">First name:</label>';
        }
The label element is echoed to the recalled index page, but, appears at the beginning of the html, I was hoping the echoed element would overwrite the current. What is my misunderstanding, and how is it corrected?


http://ckimedia.com/php_version/index.php
This is a clean version. The site is a one page, the user will be scrolled to the individual sections, via a dom script, hope this helps.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm going to guess the index.php file creates some variables or something and the output is done afterward in the script?
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post by obi_wasabi »

feyd wrote:I'm going to guess the index.php file creates some variables or something and the output is done afterward in the script?
Simply plain xhtml/css.
I getting the feeling the index page and form have to be generated by php?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If you want to be able to change the contents of it, yes, in some fashion.
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post by obi_wasabi »

feyd wrote:If you want to be able to change the contents of it, yes, in some fashion.
Hi,

Thanks, I'll break the form down into a php include, and carry on from there. I'll be in touch.
Post Reply