Jump to content

Blank page..

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
Guest_Jaan_*

Guest_Jaan_*
  • Guests
Yo dudes.. umm.. i have this script.

$cookie = array();

			$cookie['uname'] = $_COOKIE['uname'];

			$cookie['loggedin'] == $_COOKIE['loggedin'];

						

			if(isset($cookie['uname']) && (isset($cookie['loggedin'] && $cookie['loggedin'] == "yes")){

			

			$query = mysql_query("SELECT * FROM users WHERE uname = '".mysql_real_escape_string($cookie['uname'])."'");

			$row = mysql_fetch_array($query);

			$real_name = $row['real_name'];

			$end_time = $row['end_time'];

			echo "<font>Welcome ".$real_name."! (<a href='index.php?act=logout'>Log Out</a>) Your account expires on ".$end_time.". <a href='index.php?act=extend'>Extend your account!</a>";

			

			}else{

			

			echo "Welcome quest! Please <a href='index.php?act=login'>Log in!</a>";

			

			}

and umm.. when i execute it.. it just throws a blank page up.. no errors.. no nothing..
i don't understand.. maybe you can help me..

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Dude, umm umm... turn error reporting on

Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' on line 7

#3
Guest_Jaan_*

Guest_Jaan_*
  • Guests
yes i had error thingy on.. but i fixed it soon after i posted this and i forgot to tell ya :D

#4
phpforfun

phpforfun

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,236 posts
you forgot a )

if(isset($cookie['uname']) && (isset($cookie['loggedin'] && $cookie['loggedin'] == "yes")){ 
should be
if(isset($cookie['uname']) && (isset($cookie['loggedin'] && $cookie['loggedin'] == "yes"))){ 

was that it?
Checkout my new forum! http://adminreference.com/

#5
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Something I learned a few days ago, you can pass multiple arguments to isset meaning:
if(isset($cookie['uname'], $cookie['loggedin']) && $cookie['loggedin'] == "yes")
would do the same thing.

#6
Guest_Jaan_*

Guest_Jaan_*
  • Guests
oh..cool trick.. thanks dude ^^

#7
phpforfun

phpforfun

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,236 posts
John.. Write a book on cool little php tricks on cutting corners and making php life easier. Lol
Posted via CodeCall Mobile

#8
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Not a bad idea :)

#9
phpforfun

phpforfun

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,236 posts
I'd read it!!
Posted via CodeCall Mobile

#10
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I'd read it too!

Lately I'm really falling in love with PHP.. literally! It's making me some money too.. so I love it even more! :D:D

#11
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
I'd read it too!

Lately I'm really falling in love with PHP.. literally! It's making me some money too.. so I love it even more! :D:D