Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search
 Follow the forum on Twitter!
3,391 Posts in 376 Topics by 151 Members
Latest Member: enjoyhole
Pages: [1]   Go Down
Print
Author Topic: form wont show up  (Read 772 times)
0 Members and 1 Guest are viewing this topic.
daryll
Newbie
*
Offline Offline

Posts: 3



« on: 07 November 2009, 19:36:56 »

i have written this as my register page on my site but when i load it i cannot see any of my boxes, any ideas?
thanks, daryll






<?php 

define('TITLE', 'Register');
include('header.html');

print '<h1> Please Register To Continue </h1>';
print '<style type="text/css"
      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'); ?>
Logged
notbanksy

Thought Police

Global Moderator
********
Offline Offline

Gender: Male
Posts: 307


notbanksy
WWW
« Reply #1 on: 07 November 2009, 20:14:23 »

Try disabling your stylesheet and see if they reappear... If you're using a CSS reset, sometimes the borders that define the input boxes are styled as borderless.
Logged

daryll
Newbie
*
Offline Offline

Posts: 3



« Reply #2 on: 07 November 2009, 21:07:41 »

nope disableing css didn't work, the only way i can get it to show up is by removing the whole top php section  blink
Logged
Car

Jr. Member
**
Offline Offline

Gender: Female
Posts: 73

caraewilton
WWW
« Reply #3 on: 07 November 2009, 23:16:49 »

Hi there.  Are you saving the page as a php page?  Remember, you can only view a page if you are running a local server through something like xampp.

Looking at things on my pc, the following appears to be the problem:

Code:
print '<h1> Please Register To Continue </h1>';
print '<style type="text/css"
      media="screen>
      .error { color: red; }
      </style>';

If you remove that, the form then shows up, otherwise only the -h1- content appears.
« Last Edit: 07 November 2009, 23:25:32 by Car » Logged
daryll
Newbie
*
Offline Offline

Posts: 3



« Reply #4 on: 07 November 2009, 23:48:56 »

i see, any ideas why this would happen?

yeah im trying it through my localhost and i have it up on a server too, still when i remove this section i dont see my error messages :/

the external host if you want it is http://darylldoyle.host22.com/register.php
Logged
notbanksy

Thought Police

Global Moderator
********
Offline Offline

Gender: Male
Posts: 307


notbanksy
WWW
« Reply #5 on: 08 November 2009, 09:42:39 »

What browser are you checking this in?
It works for me in ff3 and Safari 3 (mac) but not Opera 10. 

I found the problem.....


Your comment looks like this <!--  ...   --!> but it should look like this <!-- --> without the second exclamation mark.  Remove it, and your form will appear.
Logged

Carl

<?php nerd?>
Newbie
*
Offline Offline

Gender: Male
Posts: 11


WWW
« Reply #6 on: 11 January 2010, 13:50:47 »

Straight away I can see you have a missing " from media="screen> I would assume that is why the display fails.

I wouldn't use print either, echo is much better.
Logged
Pages: [1]   Go Up
Print
Jump to: