Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP error styling with css
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Dobby" data-source="post: 261972" data-attributes="member: 1559"><p>Okay i have a working login register etc but when an error is displayed i want to to have some css styling to it but it wont for some reason.</p><p></p><p>I have been working on it for ages but i have no idea. could someone help.</p><p></p><p>The PHP</p><p>[PHP]function output_errors($errors) {</p><p> $output = array();</p><p> foreach($errors as $error) {</p><p> $output[] = '<li>'. $error .'</li>';</p><p> }</p><p> return '<div class="validation">' . implode('', $output) . '</div>';</p><p>}</p><p>?>[/PHP]</p><p></p><p>The CSS</p><p>[CODE]</p><p>}</p><p>.info {</p><p>color: #00529B;</p><p>background-color: #BDE5F8;</p><p>background-image: url('info.png');</p><p>}</p><p>.success {</p><p>color: #4F8A10;</p><p>background-color: #DFF2BF;</p><p>background-image:url('success.png');</p><p>}</p><p>.warning {</p><p>color: #9F6000;</p><p>background-color: #FEEFB3;</p><p>background-image: url('warning.png');</p><p>}</p><p>.error {</p><p>color: #D8000C;</p><p>background-color: #FFBABA;</p><p>background-image: url('error.png');</p><p>}</p><p>.validation {</p><p>color: #D63301;</p><p>background-color: #FFCCBA;</p><p>background-image: url('validation.png');</p><p>}</p><p>[/CODE]</p><p></p><p>It will work correctly by adding the <div> and <li> into the code but for some reason it just won't show up. Any ideas?</p><p>The css is linked correct as the rest of the website shows up perfect.</p></blockquote><p></p>
[QUOTE="Dobby, post: 261972, member: 1559"] Okay i have a working login register etc but when an error is displayed i want to to have some css styling to it but it wont for some reason. I have been working on it for ages but i have no idea. could someone help. The PHP [PHP]function output_errors($errors) { $output = array(); foreach($errors as $error) { $output[] = '<li>'. $error .'</li>'; } return '<div class="validation">' . implode('', $output) . '</div>'; } ?>[/PHP] The CSS [CODE] } .info { color: #00529B; background-color: #BDE5F8; background-image: url('info.png'); } .success { color: #4F8A10; background-color: #DFF2BF; background-image:url('success.png'); } .warning { color: #9F6000; background-color: #FEEFB3; background-image: url('warning.png'); } .error { color: #D8000C; background-color: #FFBABA; background-image: url('error.png'); } .validation { color: #D63301; background-color: #FFCCBA; background-image: url('validation.png'); } [/CODE] It will work correctly by adding the <div> and <li> into the code but for some reason it just won't show up. Any ideas? The css is linked correct as the rest of the website shows up perfect. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP error styling with css
Top