Announcement

Collapse
No announcement yet.

embed html into php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • embed html into php

    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

  • #2
    anyone ?

    Comment


    • #3
      You could try using sessions
      PHP Code:
      if($session)
        {
           
      then show page
       
      }
       else
        {
         
      show this

      just a thought

      Comment


      • #4
        For anyone thats registered correct?

        Well a very simple and kinda insecure way would be:
        PHP Code:
        <?
        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....

        Comment


        • #5
          i get this error :-

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

          Comment


          • #6
            btw, i am totally new to php ! BUT, am VERY interested in learning it vastly

            Comment


            • #7
              always helps to know wot ur line 3 actually is

              Comment


              • #8
                Originally posted by Cyrus
                i get this error :-

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

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

                Comment


                • #9
                  Thanks... I did that when I was up late lastnight and not awake enough to remember it all...

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...
                  X