Jump to content

Linking to Specific Id's


ltoto

Recommended Posts

I didn't see that... It doesn't make sense now.  In one post you said this:
[quote]
Also a quick question, what include would i put on the index page for the hotels page, i would use this normally because i put most things in one page
[/quote]

Now you're saying:
[quote]
there is still a problem, which is, thi results now appear on the index page, or the home page when you click on the link, instead of  it being on its own page
[/quote]

Tell me what you want on each page and we'll work out how you need to do it.

Huggie
Link to comment
Share on other sites

ok, so i want the hotels to appear, like , on its own blank page so there is no other content, but it to still be an include, obviously so the design is around it, because at the moment, you click on the region, and the list of hotels within it would appear on the page people see when they first come on the site
Link to comment
Share on other sites

Do you have individual navigation/design elements on seperate pages that you include?

e.g Index.php includes header.php, navigation.php, sidebar.php etc.

If so, then create a new page called hotellist.php with ecah of those elements on it and still include pages.php for the content.

Huggie
Link to comment
Share on other sites

OK, I remember, I'm guessing you only have one page at the moment though?  If you had more than one page you'd have come up against this sooner.

The problem you have is that you want the content for every page on pages.php and then just to include that in the rest of the pages across the site.  If that's the case then you need lots of conditional IF statements on pages.php like I mentioned earlier.

Create hotels.php and include pages.php on it.  Then change the links in index.php

[b]From:[/b][code=php:0]
<a href="{$_SERVER['PHP_SELF']}?id={$row['Id']}">{$row['regionName']}</a><br>
[/code]
[b]To:[/b][code=php:0]
<a href="pages/hotels.php?id={$row['Id']}">{$row['regionName']}</a><br>
[/code]

This should still work with the index.php and pages.php that I provided in the earlier post.

Huggie
Link to comment
Share on other sites

i was thinking that if i added a new page, then all we would need to do is change the include so that in it it has

index.php?Id=16 (this would be the hotelistpage)

so i thought i could some hwo add that to this

<?
if  (isset($_GET['id'])){
  $id = $_GET['id'];
  include('pages/hotels.php');
}
?>

and also have to change this link here aswell

"{$_SERVER['PHP_SELF']}?id={$row['Id']}">{$row['regionName']}

any suggestions anyone ? or do i need to go into more detail

Link to comment
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.