Closed Thread
Results 1 to 6 of 6

Thread: help

  1. #1
    chaganlal1's Avatar
    chaganlal1 is offline x10 Elder chaganlal1 is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    SC
    Posts
    1,007

    help

    Hey I want to use my HTML template on my site, but I am making my whole site into PHP. Is there anyone that can help me on how to do this.
    Like I want www.site.com/testpage.php to be like
    www.site.com/index.php?page=testpage
    How can it be done? What steps do I need to do?

    -Thank you

  2. #2
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,746

    Re: help

    On your index page, have it first check the variable in the URL by using something like this:
    PHP Code:
    $PAGE $_GET['page]; 
    Next, for each page you have, you need to have index.php do something with it:
    PHP Code:
    if ($PAGE=='testpage') {
    //?page=testpage. Here is the "testpage" page.
    } elseif ($PAGE=='lolz') {
    //?page=lolz. Here is the "lolz" page.

    Does that make sense? Between each bracket pair put the PHP to be executed for that page.

    EDIT: It appears I've found an error in the forums... disregard the 'BEGIN__VBULLETIN__CODE__SNIPPET' things in the above codes, I don't know why they are there... I also didn't put the <?php things in there either, so disregard those, assuming you know how to use those tags.
    Last edited by Cynical; 05-02-2006 at 07:52 PM.
    Seven: This rule is so underrated, keep your family and business completely separated.

  3. #3
    chaganlal1's Avatar
    chaganlal1 is offline x10 Elder chaganlal1 is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    SC
    Posts
    1,007

    Re: help

    No no i dont have a Forums i have a site. I still have everything in HTML I need to change it to PHP but with not just simple www.site.com/test.php links i want full links like
    www.site.com/index.php?page=test

  4. #4
    jensen's Avatar
    jensen is offline x10 Lieutenant jensen is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    At my desk
    Posts
    438

    Re: help

    One option is to rename all your html files to PHP and it works just fine. Also when you have a link just make sure the name is changed to .php what do you mean by full links?

    Are you using a CMS that's why you want it with that index.php?page=test
    "For I am not ashamed of the gospel of Christ: for it is the power of God unto salvation to every one that believeth" Romans 1:16

  5. #5
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,746

    Re: help

    I wasn't implying you had a forum, I mentioned that this forum had an error (which is why the "BEGIN__VBULLETIN__CODE__SNIPPET" appears in the code I mentioned above.
    Last edited by Cynical; 05-03-2006 at 08:27 PM.
    Seven: This rule is so underrated, keep your family and business completely separated.

  6. #6
    jensen's Avatar
    jensen is offline x10 Lieutenant jensen is an unknown quantity at this point
    Join Date
    Nov 2005
    Location
    At my desk
    Posts
    438

    Re: help

    http://www.netcode.net/tutorials/php_mysql/ has a specific answer to your question.

    Hope you are doing well with your friend's help. Didn't realise that there would be a simpler way than just a direct link. To look "cool" you have to add so much more code. I wonder if it's worth the effort? Remeber, content is as important if not more important than looks
    "For I am not ashamed of the gospel of Christ: for it is the power of God unto salvation to every one that believeth" Romans 1:16

Closed Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers