PDA

View Full Version : embed html into php



Cyrus
Tue 6th Nov '01, 9:05am
I want to embed a html page into a php file so that ONLY registered members can see the page, not anyone who is unregistered or logged out.

Does anyone know how this can be done ?

thanks

Cyrus
Tue 6th Nov '01, 6:17pm
anyone ?

menator
Tue 6th Nov '01, 9:56pm
You could try using sessions


if($session)
{
then show page
}
else
{
show this
}

just a thought

The Prohacker
Tue 6th Nov '01, 10:44pm
For anyone thats registered correct?

Well a very simple and kinda insecure way would be:


<?
if (!isset($bbuserid)) {
include(/path/to/html/file.html);
} else {
print "You need to login or register to view this page... ";
}
?>


Thats a rough way to do it, but it should give you an idea....

Cyrus
Wed 7th Nov '01, 1:33pm
i get this error :-

Parse error: parse error in /home/xxxxx/public_html/xxxx.php on line 3

Cyrus
Wed 7th Nov '01, 1:37pm
btw, i am totally new to php ! :) BUT, am VERY interested in learning it vastly

megahard
Wed 7th Nov '01, 4:05pm
always helps to know wot ur line 3 actually is

Craig Armstrong
Wed 7th Nov '01, 4:07pm
Originally posted by Cyrus
i get this error :-

Parse error: parse error in /home/xxxxx/public_html/xxxx.php on line 3

Try this...


<?
if (!isset($bbuserid)) {
include('/path/to/html/file.html');
} else {
print "You need to login or register to view this page... ";
}
?>

The Prohacker
Wed 7th Nov '01, 4:23pm
Thanks... I did that when I was up late lastnight and not awake enough to remember it all...