Jump to content

Recommended Posts

I have quick question, when using sessions, is it safe to use "include.html"

For example if I wanted to make a control panel for my users instead of converting html into a big slash quote mess using an echo, I would just design a "controlpanel.html" and use it to add and remove information, now as long as I have sessions checking the user information

[code=php:0]
if (!isset($_SESSION['checker']))
{
  die ('you are not logged in!');
}
[/code]
would there be problems with people bypassing the login if they knew my controlpanel.html page?
Link to comment
https://forums.phpfreaks.com/topic/19764-is-it-safe-too/
Share on other sites

If you dont want to add aslashes to quotes in your echo statement. Use the [url=http://uk.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc]HEREDOC syntax[/url]. You can put anythink into a HEREDOC statement without having to escape characters. If you use PHP variables in heredoc make sure you wrap the variable up in curly braces, eg: {$var_name}

ALso if you are including a file that doesnt have a php extension and has PHP code in it. PHP will treat that file as a PHP file and will parse the code in that file.
Link to comment
https://forums.phpfreaks.com/topic/19764-is-it-safe-too/#findComment-86378
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.