Jump to content

Check out our Community Blogs


Member Since 20 Mar 2010
Offline Last Active Aug 02 2012 11:51 AM

Posts I've Made

In Topic: Insert Not Work In Class!

01 May 2012 - 11:20 AM

For starters, you should be using the mysqli extension as it is improved.

Could you show your query? It would seem more plausible that your query is wrong.

In Topic: Help Php Error On My Php Blog

26 April 2012 - 12:30 PM

For starters, you are not closing your PHP tag properly at the end of the page. You cannot start a session after output has been sent. You should learn to properly indent your code so you could see what you did wrong... you forgot to close the if statement. You also did not use a semicolon when setting your variable and broke your or statement.

Try this instead...

if (isset($_POST['submit'])) {
	$name = $_POST['name'];
	$pass = $_POST['password'];
	$result = mysql_query("SELECT * FROM users WHERE name='".mysql_real_escape_string($name)."' AND pass='".mysql_real_escape_string($pass)."'");
	$num = mysql_num_rows($result);
	if ($num == 0) {
		echo 'incorect login try again, to try again press <a href="login.php">here</a>';
	} else {
		$_SESSION['name'] = $name;
		header("Location: admin.php");
		<form action="login.php" method="post">
			username: <input type="text" name="name" />
			<br />
			password: <input type="password" name="password" />
			<br />
			<input type="submit" name="submit" value="login!" />

This is a bad login script as there's not any secuirty to it. I helped you with SQL injection but you will want to make this script a little more secure if you want to use this on a live environment.

In Topic: NEW php function that could be useful

27 February 2012 - 01:11 PM

I would still use the PHP built in validation filters for this.

Any comments on this WingedPanther? I know you have higher knowledge in this stuff.

In Topic: Balls out., cookies are distracted.. help me in the same..

26 January 2012 - 07:37 AM

Try this but it seems you have a bigger issue than cookies.

In Topic: How to convert javascript to php code?

19 January 2012 - 06:53 AM

Hmm, what is the value of isTCUXT?
This is what I came up with for this solution. It would help to explain what this is suppose to do...
$TimeCC = (int) (strtotime('1 month ago') / 1000 / 60);

$result = (strtotime($isTCUXT) / 1000 / 60) + $TimeCC;

Double check this to make sure it functions how you want. I just woke up so my mind is a little groggy.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download