Jump to content

Cronthenoob

Members
  • Posts

    312
  • Joined

  • Last visited

Posts posted by Cronthenoob

  1. How do I remove spaces from something a user typed in?If they type "hello world" into the text box and hit submit, how would i make it submit as "helloworld"??php.net doesnt like me and I can't really find anything on that site ever. I've used this before but can't remember what it is.

  2. 		if ($error == 0) {			$_GET['login'] == "reg_complete";			$_GET['action'] == "ignoredefaultmain";		}	}

    Ok, i fixed it. for some reason it needed to beif ($error == "0") instead of without " around the 0.I also fixed the == in the $_GET right after i posted it the first time, so that wasnt the issue.If someone knows why i need the quotes around the 0, it'd be some helpful information. Don't think i've had to do that before.Thanks!
  3. In case i'm wrong, insert some echo statements into the $error == 0 code block and see if they're ever reached.
    They aren't even reached. Nothing happens.and the $_GET im using just loads another section, it doesnt even interact with the database at all.
  4. If I hit the submit button for my form and there are errors, it displays what the error was and prints out how many errors there are.However, if there are no errors, it prints out that there are no errors, but it doesnt do what its supposed to. (the if $error == 0 part )

    if ($_GET['action'] == "newregister") {			$password=$_POST['des_password'];		$verpassword=$_POST['ver_password'];		$ecpassword=md5($_POST['ver_password']);		$des_username=$_POST['des_username'];		$error=0;				$query = "SELECT field FROM table where field='".mysql_real_escape_string($des_username)."'";		$results = mysql_query($query);		echo mysql_error();				if (mysql_affected_rows() > 0) {			echo "<div class='error'>Sorry, the username <strong>".$des_username."</strong> already exists</div>";			$error=$error+1;			$_GET['login'] = "register";		}				if ($password != $verpassword) {			echo "<div class='error'>Your passwords do not match!</div><br /><br />";			$error=$error+1;			$_GET['login'] = "register";		}		echo "you have ".$error." errors!";				if ($error == 0) {			$_GET['login'] == "reg_complete";			$_GET['action'] == "ignoredefaultmain";		}	}

    So if the username exists in the database and the passwords match it will echo that there is one error and it will display the error message. If the passwords don't match and the username exists, it will display both error messages and say that there were 2 errors. When there are no errors, it will print that there are 0 errors but it won't do:if($error == 0)

  5. try this in the login file
    <form name="login" method="post" action="index.php?action=login" style="margin:0px;padding:0px">

    :) Worked. I guess IE doesnt default 0 for margin and padding in a form.
  6.  		<a href="index.php?login=register" class="links">Click here to register!</a><br />		<form name="login" method="post" action="index.php?action=login">			<font class="formtext">Username:<br /><input type="text" name="username" size="15"><br />			Password:<br /><input type="password" name="password" size="15"></font><br />			<img src="images/login-button.gif"></form>

    Thats all that is in login file.And here is the table where that file is called up:

    		<table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0">						<tr>				<td><?PHP include("login.php");?></td>			</tr>		</table>

  7. This is mostly just a cosmetic problem, but it drives me insane :)ieff.gifwhy does IE space out everything so much? There is a huge break below the "click here to register" and another below the login button.

  8. So I finally convinced my system admin to allow me to run firefox on this computer!!YAY!My question is this :I heard somewhere that there was a way to view a website in firefox how IE would display it. It was refered to as the "IE tab" I don't know if they were being sarcastic, or if there is really a way to do that. If there is a way to do that, how do I?

  9. The banner image repeats once in the background it looks like.I added background-repeat:no-repeatIf that didnt work, ill just have to work on it at home.Oh, and i really appreciate the help :)I can't say thank you enough.

  10. <html><head><title>Map</title></head><body><body bgcolor="black"><table cellspacing="0" cellpadding="0" border="0"><tr><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td></tr><tr><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td><td><img src="grass10-10.gif"></td></tr></table></body></html>

    Try that out :)

  11. So basically:If i'm using post method in the form, use $_POSTand if I'm using get method in the form, use $_GET ??because $_REQUEST cause allow attackers to inject through the querystring.

  12. Is there a difference between $_GET and $_REQUEST ??I was always told to use $_REQUEST because the server I learned on wouldnt accept anything else.I've never seen $_GET before :) Probably something else my teacher decided to leave out to make me the worst programmer ever.

  13. margin:auto works when i set the doctype.I'm not able to check it in FF here at work. Not sure if it works or notNow how in the world can i get the height to scale to 100% of the page.When I declare a doctype, height:100% doesnt work anymore. And width:100% makes the outerdiv stretch further than the size of the window.

×
×
  • Create New...