Results 1 to 5 of 5

Thread: Sort of iframing content on forum page to other page

  1. #1
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post Sort of iframing content on forum page to other page

    I was wondering if instead of manually add the news to the forums and my front page, is there a way that if theres a new post in the news category it will automatically add it to my page? (If I worded that right.....)
    Last edited by Nailgunpro; 03-01-2008 at 01:32 AM. Reason: mistake

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    It depends on how they are stored, but a simple example would be this:

    Code:
    <?php
     include('dbconnect.php'); //all your db info
    
     $query = mysql_query("SELECT * FROM `newstable` ORDER BY `postDate` DESC");
     $news = mysql_fetch_array($query); //get latest post in news table
    
     echo $news['newsTXT']; //display news on page
    ?>
    Of course, you would want to change according to your situation.
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Man, I seriously need to learn php.
    Im sorry, but will you rewrite that code being very specific on what should I input where?
    Again, sorry.
    And thanks.

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Well, again, depending on your situation/set up, I could rewrite the code in my free time (as can some of the other members here). If you want to learn php, you can visit some tutorial websites like http://www.php-mysql-tutorial.com or the official site http://www.php.net.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    OK ty I just spent like 2 hours learning some of php enough to understand it, but not write that much. Will you just tell me from that code what I need to input?

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
  •