Jump to content

RavenAoki

New Members
  • Posts

    4
  • Joined

  • Last visited

RavenAoki's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Actually.. I think i just got it working! <?php include $id = $_GET['id']; if (!isset($id)) { include "home.html"; } else { } ?> Seems to work fine, it took me a moment to realize what you had said. Either way, thank you, your a life saver!
  2. Now i'm a bit confused by that last post? Im not quite sure how to explain it.. ill try my best.. Basicly if someone goes to my website, lets say they type in www.website.com (it will automaticly go to www.website.com/index.php, because that is the home page.) On that page, I have the php include script that will check to see if there is a defined "id". Obviously, there is no defined id, so the page will not display anything. Once a user clicks a link, the link will change the url to something like www.website.com/index.php?id=contactus, or www.website.com/index.php?id=home, etc. Upon doing so, the space where the php include script is will be filled with "contactus.html" or "home.html" etc. What I need is basicly the script to include a default page, when the id is not defined (Basicly when they first visit the website, i need it to load home.html, even if the url is not "index.php?id=home") If that makes any more sense >.o? ((Edit: I can link the website or so, with a few experimental url's so that you can see what im trying to do, if that will help explain things?))
  3. Thanks for the quick reply You are correct, sorry if my original post was a bit confusing. Basicly if there is no defined id, I want it to load a default page. As for the whole script, that really is it! Its inserted into an index page, and its manipulated by the url. As for what you posted, where is the content.html page defined in that code? I see the if function (and i tried to use if earlier.. but alas, I screwed it up and kept breaking my server..) but I dont see where it will put the include 'content.html' in the else statement?
  4. Alright, im a super noob and I have not touched PHP for some time. But I've recently needed to get back into it to build a website and i've gotten myself a good bit frustrated on what to do here. Basicly (as simple as this is, and I USED to be able to do it.) I need a php include script that will take the url (IE: www.website.com/index.php?id=page.html) and include the file "Page.html" into the index.php where the include script is. Now, I got THAT part working. The issue i'm now having is I would like to have a default page (IE: Content.html) that will load if there is no defined "id" (IE: if you visit www.website.com/index.php, I want it to be as if you visted index.php?id=content.html by default, unless there is a defined ID. Here is what I have sofar.. <?php include $id = $_GET['id']; ?> ((Sorry if im posting this in the wrong area, or something. I'm new to the forums and desperate for assistance... :c ))
×
×
  • 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.