collapse

Author Topic: form wont show up  (Read 1133 times) Bookmark and Share

0 Members and 1 Guest are viewing this topic.

Offline daryll

  • Newbie
  • *
  • Posts: 3
  • Reputation Power: 0
  • daryll has no influence.
  • Referrals: 0
  • Referrals: 0
form wont show up
« on: 07 November 2009, 20: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






Code: [Select]
<?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'); ?>
« Last Edit: 17 July 2010, 19:02:10 by Scott »

Offline notbanksy

  • Global Moderator
  • ********
  • Posts: 497
  • Reputation Power: 2
  • notbanksy barely matters.notbanksy barely matters.
  • Gender: Male
  • Thought Police
    • a branch of design
  • Referrals: 0
  • Referrals: 0
Re: form wont show up
« Reply #1 on: 07 November 2009, 21: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.
Bloomin' good web design and copywriting from a branch of design

Offline daryll

  • Newbie
  • *
  • Posts: 3
  • Reputation Power: 0
  • daryll has no influence.
  • Referrals: 0
  • Referrals: 0
Re: form wont show up
« Reply #2 on: 07 November 2009, 22: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:

Offline Car

  • Full Member
  • ***
  • Posts: 191
  • Reputation Power: 0
  • Car has no influence.
  • Gender: Female
    • CHouseLive
  • Referrals: 0
  • Referrals: 0
Re: form wont show up
« Reply #3 on: 08 November 2009, 00: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: [Select]
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: 08 November 2009, 00:25:32 by Car »

Offline daryll

  • Newbie
  • *
  • Posts: 3
  • Reputation Power: 0
  • daryll has no influence.
  • Referrals: 0
  • Referrals: 0
Re: form wont show up
« Reply #4 on: 08 November 2009, 00: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

Offline notbanksy

  • Global Moderator
  • ********
  • Posts: 497
  • Reputation Power: 2
  • notbanksy barely matters.notbanksy barely matters.
  • Gender: Male
  • Thought Police
    • a branch of design
  • Referrals: 0
  • Referrals: 0
Re: form wont show up
« Reply #5 on: 08 November 2009, 10: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.
Bloomin' good web design and copywriting from a branch of design

Offline Carl

  • <?php nerd?>
  • Newbie
  • *
  • Posts: 11
  • Reputation Power: 0
  • Carl has no influence.
  • Gender: Male
    • Carl-Brown
  • Referrals: 0
  • Referrals: 0
Re: form wont show up
« Reply #6 on: 11 January 2010, 14: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.

 


* Featured Tutorials