Jump to content

WebsiteSolutions

New Members
  • Posts

    3
  • Joined

  • Last visited

WebsiteSolutions's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. No worries! It's basically like a routing system, in the "else" tags you'll need to create something that allows the application to load the HTML file according to the GET request (in the URL, e.g ?id=pagehere.html. You'll have to create a validation too which checks to see if the html exists in correspondance with the ID request... For example: If user has "index.php?id=pagehere.html" and "pagehere.html" is in your directory, then include it, else you'll show a 404.html template, if that makes sense? You can normally code that using the "file_exists" method in PHP.
  2. Basically you need a script which will tell your application that if the ID is defined, then you need to check to ensure that the html file exists and then if it does, show that html file. Do you require the code for that? Because it all depends on your directory structure and the way your application needs to work, but the IF statement mentioned before will allow you to initially check for a valid ID input, and if so then it'll show the file, but you need some extra code to load the HTML files.
  3. Hi Raven, I don't fully understand what you mean, but my only guess is that if the ID is not defined, then you want to automatically include the "content.html"; really I need to see the rest of your code to see exactly how you get the page from the ID, or if you're trying to grab someone else's website from the ID... You would need to use an if statement to validate that the ID is not null, the easiest way to do this is probably... $id = $_GET['id']; if (!isset($id)) { // The ID is not set, therefore we would then load the "Content.html" page... } else { // The ID IS set, therefore we continue with the script as normal... }
×
×
  • 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.