unknown gamer Posted May 18, 2008 Share Posted May 18, 2008 Hey, i have this login system i got off a website. I installed it properly and everything but when i go on the "register.php" and click the text box for "username" i can't type.the link is here:Herethe code for it is: <?/** * Register.php * * Displays the registration form if the user needs to sign-up, * or lets the user know, if he's already logged in, that he * can't register another name. * * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) * Last Updated: August 19, 2004 */include("include/session.php");?><html><title>Registration Page</title><body><?/** * The user is already logged in, not allowed to register. */if($session->logged_in){ echo "<h1>Registered</h1>"; echo "<p>We're sorry <b>$session->username</b>, but you've already registered. " ."<a href=\"main.php\">Main</a>.</p>";}/** * The user has submitted the registration form and the * results have been processed. */else if(isset($_SESSION['regsuccess'])){ /* Registration was successful */ if($_SESSION['regsuccess']){ echo "<h1>Registered!</h1>"; echo "<p>Thank you <b>".$_SESSION['reguname']."</b>, your information has been added to the database, " ."you may now <a href=\"main.php\">log in</a>.</p>"; } /* Registration failed */ else{ echo "<h1>Registration Failed</h1>"; echo "<p>We're sorry, but an error has occurred and your registration for the username <b>".$_SESSION['reguname']."</b>, " ."could not be completed.<br>Please try again at a later time.</p>"; } unset($_SESSION['regsuccess']); unset($_SESSION['reguname']);}/** * The user has not filled out the registration form yet. * Below is the page with the sign-up form, the names * of the input fields are important and should not * be changed. */else{?><h1>Register</h1><?if($form->num_errors > 0){ echo "<td><font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font></td>";}?><form action="process.php" method="POST"><table align="left" border="0" cellspacing="0" cellpadding="3"><tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr><tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr><tr><td>Email:</td><td><input type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>"></td><td><? echo $form->error("email"); ?></td></tr><tr><td colspan="2" align="right"><input type="hidden" name="subjoin" value="1"><input type="submit" value="Join!"></td></tr><tr><td colspan="2" align="left"><a href="main.php">Back to Main</a></td></tr></table></form><?}?></body></html> -thanks Link to comment Share on other sites More sharing options...
Ingolme Posted May 18, 2008 Share Posted May 18, 2008 Your page isn't even valid HTML.You have a <title> element outside of a <head> element.I don't know why the input field isn't working, but it's best if you make your page valid code first. Link to comment Share on other sites More sharing options...
unknown gamer Posted May 18, 2008 Author Share Posted May 18, 2008 what do u mean? how do i make it valid?i didn't do anything to the script.. thats straight from the download. Link to comment Share on other sites More sharing options...
virthen Posted May 18, 2008 Share Posted May 18, 2008 If you go to the password field, and then back tab, you can enter stuff in your username field. But anyways, it appears this is an html issue and not anything that has to do with a script etc.1. There's no DOCTYPE.2. There's no <head></head> section.3. There's an ending body tag, but then you have more divs and stuff afterwards.Here's an html page that I put your code in (without the extra stuff after the </body> tag). Save it as an html/php/whatever file and view it on your browser, and it'll work as intended. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><title>test</title></head><body><h1>Register</h1><form action="process.php" method="POST"><table align="left" border="0" cellspacing="0" cellpadding="3"><tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value=""></td><td></td></tr><tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value=""></td><td></td></tr><tr><td>Email:</td><td><input type="text" name="email" maxlength="50" value=""></td><td></td></tr><tr><td colspan="2" align="right"><input type="hidden" name="subjoin" value="1"><input type="submit" value="Join!"></td></tr><tr><td colspan="2" align="left"><a href="main.php">Back to Main</a></td></tr></table></form></body></html> Link to comment Share on other sites More sharing options...
Ingolme Posted May 18, 2008 Share Posted May 18, 2008 There's an ending body tag, but then you have more divs and stuff afterwards.The code after body tag is actually put there automatically by his web host, it's what puts ads on the website. Link to comment Share on other sites More sharing options...
virthen Posted May 18, 2008 Share Posted May 18, 2008 You can validate your html code here. You should fix any errors that you come across, and it'll help with weird errors like you are getting. Link to comment Share on other sites More sharing options...
unknown gamer Posted May 18, 2008 Author Share Posted May 18, 2008 i used virthen's code but i'm still getting that error.http://unkowngamer.freeinternethosting.inf....0/register.php Link to comment Share on other sites More sharing options...
Ingolme Posted May 18, 2008 Share Posted May 18, 2008 I have a feeling the ads are interfering with the input boxes.Put this right before the </body> tag and see if it works: <div style="clear: both"></div>Oh, and I really recommend an HTML 4.01 doctype instead:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">There are still a lot of errors in your HTML. Link to comment Share on other sites More sharing options...
unknown gamer Posted May 18, 2008 Author Share Posted May 18, 2008 it works... thanks ingolme. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.