Page 1 of 1

Login PHP Code

Posted: Wed Nov 16, 2011 5:30 am
by johnmergene

Code: Select all

<html>
<?
session_start();
$emailadd = $_SESSION['Emailadd'];
if(!session_is_registered(myemailadd)){
echo "
<title>xxxxxxxxxx
</title>
<style>
.whole{
position:absolute;
top:0px;
left:0px;
width:100%;
}
.whole2{
position:absolute;
top:0px;
left:0px;
width:1000px;
height:600px;
background-color:#3a3a3a;
}
.whole3{
position:absolute;
top:0px;
left:0px;
width:1000px;
height:600px;
}
.stream{
position:absolute;
top:105px;
left:80px;
width:150px;
height:128px;
background-color:red;
}
.sched{
position:absolute;
top:80px;
left:745px;
width:237px;
height:290px;
}
.ads{
position:absolute;
top:495px;
left:480px;
width:500px;
height:90px;
}
.chat{
position:absolute;
top:80px;
left:305px;
width:410px;
height:375px;
}
.links{
position:absolute;
top:250px;
left:120px;
}
</style>
<body bgcolor=black oncontextmenu='return false;' alink=black vlink=black link=black>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message='';
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function('return false')
// --> 
</script>
<div class=whole>
<div class=whole2>
<img src=cp.jpg>
</div>
<div class=stream>
</div>
<div class=sched><font color=red face=verdana size=3><b>
Very important:
<font color=red face=verdana size=3>
<br>
*
<font color=white face=verdana size=3>
To be able to view settings, Please Login

</div>
<div class=whole3>
&nbsp;
</div>
<div class=chat>
<form name=login action=login.php method=post>
Emailadd:<br>
<input type=text name=Emailadd id=Emailadd><br>
Password:<br>
<input type=password name=Password id=Password><br>
<input type=submit value=Login><br>
</div>
<div class=links>
<font size=3 color=black face=verdana>
<a href=index.html>Home</a><br>
<a href=advertise.html>Advertise</a><br>
<a href=login.html>Control Panel</a><br>
<a href=join.html>Join as DJ</a><br>
<a href=join2.html>Join as Mod</a><br>
</div>

</div>

</body>
</html>";}
else {
echo "<html>
<title>xxxxxxxxxxxxx
</title>
<style>
.whole{
position:absolute;
top:0px;
left:0px;
width:100%;
}
.whole2{
position:absolute;
top:0px;
left:0px;
width:1000px;
height:600px;
background-color:#3a3a3a;
}
.whole3{
position:absolute;
top:0px;
left:0px;
width:1000px;
height:600px;
}
.stream{
position:absolute;
top:105px;
left:80px;
width:150px;
height:128px;
background-color:red;
}
.sched{
position:absolute;
top:80px;
left:745px;
width:237px;
height:290px;
}
.ads{
position:absolute;
top:495px;
left:480px;
width:500px;
height:90px;
}
.chat{
position:absolute;
top:80px;
left:305px;
width:410px;
height:375px;
}
.links{
position:absolute;
top:250px;
left:120px;
}
</style>
<body bgcolor=black oncontextmenu='return false;' alink=black vlink=black link=black>
<script language=JavaScript>
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function('return false')
// --> 
</script>
<div class=whole>
<div class=whole2>
<img src=cp.jpg>
</div>
<div class=stream>
</div>
<div class=sched><font color=red face=verdana size=3><b>
Very important:
<font color=red face=verdana size=3>
<br>
*
<font color=white face=verdana size=3>
To be able to view settings, Please Login

</div>
<div class=whole3>
&nbsp;
</div>
<div class=chat>
<form name=login action=login.php method=post>
Emailadd:<br>
<input type=text name=Emailadd id=Emailadd><br>
Password:<br>
<input type=password name=Password id=Password><br>
<input type=submit value=Login><br>
</div>
<div class=links>
<font size=3 color=black face=verdana>
<a href=index.html>Home</a><br>
<a href=advertise.html>Advertise</a><br>
<a href=login.html>Control Panel</a><br>
<a href=join.html>Join as DJ</a><br>
<a href=join2.html>Join as Mod</a><br>
</div>

</div>

</body>";}
?>
</html>


Guys. any wrong here? i cant see it.
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /srv/disk4/862430/www/pdrtesting.atwebpages.com/login.html on line 247

Re: Login PHP Code

Posted: Wed Nov 16, 2011 7:08 am
by Celauran

Code: Select all

var message=""
There's the problem. Since you're trying to basically echo out an entire HTML page as a string (protip: don't), it sees the opening " from var message as the closing " from the echo statement. Since it is not followed by a semi-colon, you get the error. Either use single quotes or escape the ones for var message.

Re: Login PHP Code

Posted: Thu Nov 17, 2011 2:47 am
by johnmergene
what is the disadvantages of echo out an entire HTML page?

Re: Login PHP Code

Posted: Thu Nov 17, 2011 6:55 am
by Celauran
I'd have thought the error you just encountered would be a pretty good indicator of at least one of the drawbacks. Spaghetti code is difficult to read, debug, and maintain.