PHP development

Hello,

Can anyone tell me if it is posible to store file paths in a variable in order to call a page or section of a page dynamically.

Something like this:

$thevariable = '/path/path/path/$nameoffile.php';

include $thevariable;

I have been working on this for ages and it works fine on my computer, but when I upload it to the server, I can't get it to work. Any ideas what I could be doing wrong?

Reply

User Comments

  1. that's okay but don't that kind of variable for user input.

    Otherwise you create a risk for XSS attacks

Add Your Comment

Login to leave a message.

  • Group Search

  • Recent Readers

    • finalwebsites
    • namibnat
  • Subscribe via Email