Jump to content


Photo

Embedding HTML help


  • Please log in to reply
3 replies to this topic

#1 patsyd_uk

patsyd_uk
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 October 2006 - 02:50 PM

Hi i'm having trouble embedding HTML in some PHP coding. Was wondering if someone could explain to me what i'm doing wrong:

<?php
session_start();

if( @$_SESSION['login']!="yes")
{
echo" NOT LOGGED IN";
exit();
}
else
{
if(@$_SESSION['user']!="")
{
$username = $_SESSION['user'];

}


}

?>

<html>

<head>
<title>Top</title>
<base target="right-frame">
<link rel="stylesheet" type="text/css" href="style.css">

</head>


<body>

<DIV ALIGN = "right"><img src="welcome.gif"></DIV>

<?php echo"You are logged in as  $username ";?>

</body>

</html>


Thanks in advance

x

#2 Gruzin

Gruzin
  • Members
  • PipPipPip
  • Advanced Member
  • 448 posts
  • LocationGeorgia

Posted 16 October 2006 - 02:54 PM

What do you want to be displayed?
I don't need your script, I'll try to write it myself

#3 patsyd_uk

patsyd_uk
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 October 2006 - 03:06 PM

Really sry, but I worked out what was wrong  :P I hadnt changed the site links

#4 xsist10

xsist10
  • Members
  • PipPipPip
  • Advanced Member
  • 114 posts

Posted 16 October 2006 - 03:17 PM

I'd just like to point out that that is a bad way to do authentication and can be circumvented quite easily. Remeber that the user can change $_SESSION variables himself, so he could manually set $_SESSION["login"] and $_SESSION["user"].
SA PHP Archives - www.phparchives.za.org




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users