Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP: Restrict access to a section of code

New Here ,
Jun 09, 2006 Jun 09, 2006
hi guys,

I have implemented the login/user auth sections of my webby without any problems. Ive used the built in server behaviours in DW8. So i have a session variable called MM_username.

now instead of restricting access to a whole page, i just need to restrict access to certain sections inside a page. For example i have a user admin panel that i only want to show if they are logged in. and i only want the logout button to show if they are logged in etc.

im not great at hand coding php yet , so any help would be greatly appreciated.

thanks,

ted.
TOPICS
Extensions
565
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 09, 2006 Jun 09, 2006
On 09 Jun 2006 in macromedia.exchange.extensions.dreamweaver,
tedrodgers wrote:

> I have implemented the login/user auth sections of my webby without
> any problems. Ive used the built in server behaviours in DW8. So i
> have a session variable called MM_username.
>
> now instead of restricting access to a whole page, i just need to
> restrict access to certain sections inside a page. For example i
> have a user admin panel that i only want to show if they are logged
> in. and i only want the logout button to show if they are logged in
> etc.

<?php if($_SESSION['MM_username']) { ?>
<!-- HTML code you want displayed goes here -->
<form name="logoutform" method="POST" action="logout.php">
<input type="submit" name="Submit" value="Log Out">
</form>
<?php } ?>

http://www.php.net/manual/en/ref.session.php

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 09, 2006 Jun 09, 2006
On 09 Jun 2006 in macromedia.exchange.extensions.dreamweaver, tedrodgers
wrote:

> hi guys,

By the way: you'd be much better off in the macromedia.dreamweaver or
macromedia.dreamweaver.appdev groups; this group is fairly low volume.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2006 Jun 09, 2006
LATEST
oops i meant to put it in appdev 🙂 thnx
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines