SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict SniperUK's Avatar
    Join Date
    Jul 2000
    Location
    UK
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How can I run my site so it goes some thing like this.
    Index.php3?subject=home
    Index.php3?subject=pictures
    Index.php3?subject=winamp
    Index.php3?subject=conatct

    Thanks

  2. #2
    SitePoint Wizard jonese's Avatar
    Join Date
    Jul 1999
    Location
    Powder Springs GA (Atlanta)
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    read Kevin Yank's tutorial on PHP and mySQL databasing of a site.

    you should be able to alter the coding he uses to build what you want.
    http://www.webmasterbase.com/article.php3?aid=228&pid=0

    ------------------
    Eric Jones - SitePoint Administrator
    http://www.sitepoint.com
    eric@sitepoint.com

  3. #3
    SitePoint Addict Chris Roane's Avatar
    Join Date
    Jul 1999
    Location
    Helena, MT
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    You could use this basic layout in one php page for what you want. You need to read Kevin's tutorial to be able to fully understand the basic concepts of php, if you don't have access to a book or other references.

    If ("submit" = $home) {
    Coding for main page goes here.
    }

    If ("submit" = $pictures) {
    Coding for picture page goes here.
    }

    If ("submit" = $winamp) {
    Coding for winamp page goes here.
    }

    If ("submit" = $contact) {
    Coding for contact page goes here.
    }

    I believe that coding is correct, but I am not 100% positive that it is.

    Chris Roane

    ------------------
    Web Services: DevStorm | Intersurge
    Web Tools: Web Site Resource | Free Web Site Tools

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 1999
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you have a page:
    Index.php3?subject=pictures

    it would look like:
    if("$subject"=="pictures"){
    Coding for winamp page goes here.
    }

    Misja

  5. #5
    SitePoint Wizard jumpthru's Avatar
    Join Date
    Apr 2000
    Location
    Los Angeles, California
    Posts
    1,008
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did this for just one page on my site and it made the page 40k. It doesn't matter cause I had to do it, but still, that was for only two sections, and if you have 5 it will take the page for ever to load. I am talking about the if (subject == "Contact) {
    echo ("Contact Text");
    }
    ...

    ------------------
    Nate - nate@jumpthru.com
    ICQ 70944023
    http://www.jumpthru.com - Unbelievable Website design!
    http://www.jumpthru.com/christian - Learn, live, love, jesus christ...

  6. #6
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jumpthru:
    The code for the page might be 40k but the output to the browser won't be.

    As for the code...this is more efficient.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    switch $subject {
    case "home":
    //HOME code
    break;
    #---------------#
    case "winamp":
    //WINAMP code
    break;
    }
    [/code]

  7. #7
    SitePoint Addict SniperUK's Avatar
    Join Date
    Jul 2000
    Location
    UK
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank To All
    Can if some one plz send me a template of aroud two pages. Which I can test on my computer as I have php etc installed.
    And can I change the
    index.php3?subject=contacts to
    index.php3?id=contacts
    Thanks
    Luqman@amjad9.freeserve.co.uk

    [This message has been edited by Luqman (edited July 25, 2000).]

  8. #8
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure, just use this code:

    EDIT: ERROR FIXED!

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    if ($id == "Contact) {
    echo ("Contact Text");
    }
    [/code]

    this code will do script.php3?id=Contact

    ------------------
    ICQ Me! (73902680)

    [This message has been edited by Matt Kaufman (edited July 25, 2000).]


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •