Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Default Include Pages?

    Below are 2 pages. We open the first one and it brings up topics. When You click on one of the topics it brings up the questions pretaining to the topic. Only problem is that it brings up the questions on the second page. What change can we make that when clicked on the questions they come up on the same page underneath the topics?


    Topic Page

    PHP Code:
      <?php 
    $dbi
    mysql_connect('localhost','user','pass');
    mysql_select_db('dbname');
      
    $sql_get_faq_categories1_txt "select cid,cname from faq_categories1 where cid IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24)";
      
    $sql_get_faq_categories1 mysql_query($sql_get_faq_categories1_txt);
      if (!
    $sql_get_faq_categories1)
        die (
    "Error displaying information.  Please report this information to the administrator -- ".$sql_get_faq_categories1_txt " - " mysql_error());
      while(list(
    $cid,$cname)=mysql_fetch_row($sql_get_faq_categories1))
      {
        echo 
    "<a href=\"questions.php?cid=$cid\">$cname</a><br>";
      }  
    ?>

    Where The Topics Pull Their Questions From


    PHP Code:
    <?php
    include("./toppage.php");
    ?>
    <?php 
    $dbi
    mysql_connect('localhost','user','pass');
    mysql_select_db('dbname');
      
    $sql_get_faq_questions1_txt "select fid,cid,question,answer,timestamp from faq_questions1 where cid=$cid";
    ;
      
    $sql_get_faq_questions1 mysql_query($sql_get_faq_questions1_txt);
      if (!
    $sql_get_faq_questions1)
        die (
    "Error displaying information.  Please report this information to the administrator -- ".$sql_get_faq_questions1_txt " - " mysql_error());
      echo 
    "<table cellpadding=0 cellspacing=0 border=0 align=center width=100%>";  
      while(list(
    $fid,$cid,$question,$answer,$timestamp)=mysql_fetch_row($sql_get_faq_questions1))
      {
        echo 
    "<link href=\"/base.css\" rel=\"stylesheet\" type=\"text/css\">
           
         <tr>
           <td valign=top>
                <table>
                   <tr>
                    <td>
            Q: 
    $question
            </td>
                   </tr>
            </table>
            <table cellpadding=0 cellspacing=0 border=0 align=center width=100%>
         <tr>
           <td valign=top>
                <table>
            <tr>
                    <td>
            A:
    $answer
            </td>
                   </tr>
                       </table>
                    </td>
                   </tr>"

      }  
      echo 
    "</table>";
    ?>
    <?php
    include("./bottompage.php");
    ?>

  2. #2
    rnh
    rnh is offline
    Member
    Join Date
    Apr 2003
    Posts
    118
    __________________

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge jackal's Avatar
    Join Date
    Feb 2002
    Posts
    708

    Default

    Thanks but no thamks

  4. #4
    rnh
    rnh is offline
    Member
    Join Date
    Apr 2003
    Posts
    118

    Default

    You expect people to do PHP programming for you for free?
    __________________

Similar Threads & Tags
Similar threads

  1. Pre Main Include or Post VirtualHost Include ?
    By SecondSight in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 11-15-2010, 12:07 AM
  2. Include Problem
    By ManXP in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 07-15-2008, 04:18 PM
  3. PHP or include
    By msh100 in forum Themes and Branding
    Replies: 2
    Last Post: 06-29-2008, 05:32 PM
  4. When loading the fantastico pages, I get blank pages..
    By billau in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-22-2004, 11:02 AM
  5. Adding Custom Error Pages for non-existant pages
    By YukFoo in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-16-2002, 03:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube