The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Include Pages?

Discussion in 'General Discussion' started by jackal, May 4, 2003.

  1. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    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:
      <?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:
    <?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. rnh

    rnh Well-Known Member

    Joined:
    Apr 15, 2003
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
  3. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    Thanks but no thamks
     
  4. rnh

    rnh Well-Known Member

    Joined:
    Apr 15, 2003
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    You expect people to do PHP programming for you for free?
     
Loading...

Share This Page