| | |
My Form wont show up
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Nov 2009
Posts: 10
Reputation:
Solved Threads: 0
I am writing a PHP registration form but when i view my page i cannot see the form, any ideas all my code is below.
i have noticed that if i remove the
my form is displayed but none of my error messages are
register.php
header.html
footer.html
i have noticed that if i remove the
PHP Syntax (Toggle Plain Text)
print '<h1> Please Register To Continue </h1>'; print '<style type="text/" media="screen> .error { color: red; } </style>';
register.php
PHP Syntax (Toggle Plain Text)
<?php define('TITLE', 'Register'); include('header.html'); print '<h1> Please Register To Continue </h1>'; print '<style type="text/" media="screen> .error { color: red; } </style>'; if ( isset($_post['submitted']) ) { $problem = FALSE; if (empty($_POST['fname'])) { $problem = TRUE; print '<p class="error">Please Enter Your First Name!</p>'; } if (empty($_POST['lname'])) { $problem = TRUE; print '<p class="error">Please Enter Your Last Name!</p>'; } if (empty($_POST['email'])) { $problem = TRUE; print '<p class="error">Please Enter Your Email Address!</p>'; } if (empty($_POST['password1'])) { $problem = TRUE; print '<p class="error">Please Enter A Password!</p>'; } if ($_POST['password1'] != $_POST['password2']) { $problem = TRUE; print '<p class="error">Please Enter A Password!</p>'; } if (!$problem) { print '<p>blah blah need to do this bit of script to MySQL still</p>'; $_POST = array(); } else { print '<p class="error">Please Try Again</p>'; } } ?> <form action="register.php" method="post"> <p>First Name: <input type="text" name="fname" size="20" value="<?php if (isset($_POST ['fname'])) { print htmlspecialchars($_POST['fname']); } ?>" /></p> <p>Last Name: <input type="text" name="lname" size="20" value="<?php if (isset($_POST ['lname'])) { print htmlspecialchars($_POST['lname']); } ?>" /></p> <p>Email: <input type="text" name="email" size="20" value="<?php if (isset($_POST ['email'])) { print htmlspecialchars($_POST['email']); } ?>" /></p> <p>Password: <input type="password" name="password1" size="20" /></p> <p>Confirm Password: <input type="password" name="password2" size="20" /></p> <p>Password: <input type="submit" name="submit" value="Register" /></p> <p>Password: <input type="hidden" name="submitted" value="true" /></p> </form> <?php include('footer.html'); ?>
header.html
PHP Syntax (Toggle Plain Text)
<!DOCTYPE html PUBLIC "-//WC3//DTD// XHTML 1.0 Transitional//EN"> <html xmins="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Register</title> <style type="text/css"> body { margin: 0px 0px 0px 0px; background: #9F9; } #leftcontent { float: left; width: 67%; background: #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; margin-right: 15px; padding-bottom: 20px; } p,h1,pre { margin: 0px 30px 10px 30px; } h1 { font-size: 14px; padding-top: 10px; } #rightcontent p { font-size: 14px; margin-left: 0px; } </style> </head> <body> <div id="leftcontent"> <!-- BEGIN CHANGEABLE CONTENT --!>
footer.html
PHP Syntax (Toggle Plain Text)
</div> </body> </html>
Last edited by daryll1; Nov 7th, 2009 at 7:51 pm.
-1
#2 Nov 7th, 2009
PHP Syntax (Toggle Plain Text)
print '<style type="text/" media="screen> .error { color: red; } </style>';
This is wrong. You have a mess. If you delete this the form will show. You have an unclosed ". So everything that follows is assumed to be an attribute value until we reach the next ".
PHP Syntax (Toggle Plain Text)
<style media="screen">.error { color: red;}</style>';
The above should be in the 'head' area not in the 'body'.
If you don't reply to your own thread or you can't find the solved link - you're off my Christmas list - permanently! Bah humbug!
![]() |
Similar Threads
- How can I show a form? (VB.NET)
- the form that wont die... (Visual Basic 4 / 5 / 6)
- createElement wont show table/div (JavaScript / DHTML / AJAX)
- Edit email form replies to not show blank answers (HTML and CSS)
- Screen just wont show anything (Troubleshooting Dead Machines)
- msn messenger..contacts display pictures wont show (Windows NT / 2000 / XP)
- msn messenger...wont show contacts display pics (Windows Software)
Other Threads in the PHP Forum
- Previous Thread: Make HTML page through PHP script
- Next Thread: PHP and webcam
Views: 259 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array autosuggest beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email emptydisplayvalue error explodefunction file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery keywords limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search searchbox select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube






