#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    houston, tx
    Posts
    21
    Rep Power
    0
    At the moment, what I'm trying to do is using index.php3 to open up link within itself. Or something of that nature. Someone told me of a way that you could type a link (ie. index.php3?contact.html), but I can't remember how to do the whole thing.

    If I'm not explaining myself clearly, please let me know. I'd REALLY like to learn how to do this.

    Thanks
    diversereality
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    told me of a way that you could type a link (ie. index.php3?contact.html), but I can't remember how to do the whole thing.
    >>

    actually if you are doing like that probably you can redirect page to contact.html.

    see the following link forexample:
    http://www.dvaar.com/goto.cfm?link=w...elsofindia.com

    but if you are looking for displaying dynamic contents then you may need to pass a value with your url and later retrieve the related contents from the database based on that.

    it will be something like:

    index.php3?news=sports

    then in your php page you can retrieve news based on that passed value(here value is 'sports'.so sports news will be displayed).

    <?
    if(isset($news)){
    $query="SELECT * FROM tblname WHERE news='sports'"
    }
    ?>

    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited September 14, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    houston, tx
    Posts
    21
    Rep Power
    0
    Ok, what I'm wanting to do is open contact within a certain area on index.php3, kinda like a frame. To do that, would I have to create the body as a variable for when I call it within index.php3?

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    63
    Rep Power
    15
    You could do something like:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    <HTML>
    ... code for header
    <? switch($page) {
    case "contact": ?>
    <? include('contact.html'); ?>
    <? break; ?>
    <? case "someotherpage": ?>
    <? include('someotherpage.html'); ?>
    <? break; ?>
    <? } ?>
    ... code for footer
    </HTML>
    [/code]

    To access the conact page you would use index.php3?page=contact

    For you index.php3 file, I would suggest using a table with seperate rows for the header, the content (decided by the value of $page) and the footer.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    houston, tx
    Posts
    21
    Rep Power
    0
    Interesting, is there anything that I need to do to the contact file before I do this? For example, take out <html> or <body> or something of that nature?

    btw, Thanks to everyone helping me out. You've all helped me out ALOT.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    63
    Rep Power
    15
    You need to take out the <HTML>, <HEAD> and <BODY> tags.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    houston, tx
    Posts
    21
    Rep Power
    0
    Thanks alot. Oh, and can I keep it as *.html?
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    63
    Rep Power
    15
    .html extension will work fine.
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    houston, tx
    Posts
    21
    Rep Power
    0
    Thanks alot. At the moment I'm at school in my last clas for the day but when I get home I'll recode index.php3 and see how everything works out.

    Thanks to everyone that gave info.
  18. #10
  19. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,646
    Rep Power
    4492
    You can use include for .html or for .php3 pages. I define my database connections in one file, database.php3, and my functions for the page in functions.php3, then include those at the beginning of the page. There is no <html>, <head>, or <body> tags in the include files, everything is enclosed within <? and ?>.

    The switch method that chris22 gave is a good way to make php templates. You basically make a 3 row table, and in each row, include a file based on user input or your own criteria. include a header and footer file in the top and bottom. That way, it gives you a one header and footer file to modify, and it takes effect in all the pages that use it.

    ---John Holmes...

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  2. Replies: 7
    Last Post: March 17th, 2004, 06:39 AM
  3. I need some specific php work done for my website
    By Noah Neiman in forum Hire A Programmer
    Replies: 1
    Last Post: January 21st, 2004, 12:31 AM
  4. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 02:14 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 02:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo