Jump to content

Somebody HELP !!!!!!


carefree

Recommended Posts

 

Im fairly new to php and ive recently encountered a problem. I dont know the exact term but parts of my site look like this:

 

" class="biglink" >Flash

( 0 resources)

" class="biglink" >CGI and Perl

( 0 resources)

 

" class="biglink" >ASP

( 0 resources)

" class="biglink" >Hosting

( 0 resources)

 

" class="biglink" >JavaScript

( 0 resources)

" class="biglink" >PHP

( 0 resources)

 

" class="biglink" >Linux

( 0 resources)

" class="biglink" >Mac

( 0 resources)

 

" class="biglink" >XML

( 0 resources)

" class="biglink" >Windows

( 0 resources)

 

 

I have an idea this might be a table.sql issue, but if any of you php gurus know where i could start looking i would be forever in your debt!!

 

Let me know what you think

 

Thanks Darryl

Link to comment
Share on other sites

The relevent code would help.

 

That was a users view of my site heres the index code view:

 

<?

include_once "config.php";

include_once "left_index.php";

include_once "right_index.php";

function main()

{

?>

<table width="420" border="0" align="center" cellpadding="0" cellspacing="0" dwcopytype="CopyTableCell">

  <tr>

    <td valign="top"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

        <tr>

          <td>

            <?

if ( isset($_REQUEST["msg"])&&$_REQUEST['msg']<>"")

{

?>

            <br> <table align="center" bgcolor="#FEFCFC"  border="0" cellpadding="5" >

              <tr>

                <td><b><font face="verdana, arial" size="1" color="#666666">

                  <?

print($_REQUEST['msg']);

 

?>

                  </font></b></td>

              </tr>

            </table>

            <?

}//end if

?>

          </td>

        </tr>

        <tr>

          <td> </td>

        </tr>

        <tr>

          <td><form name="form2" method="post" action="showcategory.php">

              <table width="100%" border="0" cellspacing="0" cellpadding="2">

                <tr>

                  <td width="17%"><FONT color=#000000><strong><font color="#000000" size="2" >SEARCH</font></strong></FONT></td>

                  <td width="31%"><input type="text" name="keyword"></td>

                  <td width="24%"><select name="cid">

                      <?

  $cats=mysql_query("select * from sbwmd_categories where pid=0");

  while($rst=mysql_fetch_array($cats))

  {

    ?>

                      <option value="<? echo $rst["id"]; ?>"><? echo $rst["cat_name"]; ?></option>

                      <?

}//end while

?>

                    </select></td>

                  <td width="28%"><input type="submit" name="Submit2" value="Go" class="input"></td>

                </tr>

              </table>

            </form></td>

        </tr>

        <tr>

          <td> </td>

        </tr>

        <tr>

          <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">

              <tr>

                <td height="25" background="images/bargb.gif"> <div align="left"><FONT color=#000000><strong> <font color="#FFFFFF" face="Tahoma, Verdana, Arial, Helvetica, sans-serif">    <font color="#000000">Software

                    Categories </font></font></strong></FONT></div></td>

              </tr>

              <tr>

                <td bgcolor="#F3F3F3"><table width="100%" border="0" cellspacing="2" cellpadding="1">

                    <?

  $cats1=mysql_query("select * from sbwmd_categories where pid=0 ");

  $cnt=1;

  while($rst=mysql_fetch_array($cats1))

  {

  if(($cnt%2)==1)

  {

   

  ?>

                    <tr>

                      <? } //end if?>

                      <td width="50%" bgcolor="#FFFFFF" > <table width="100%">

                          <tr>

                            <td width="55"> <img src="images/folder.gif" width="50" height="45"></td>

                            <td> <div align="justify"><font color="#FF0000" size="3">

                                <strong> <a href="showcategory.php?cid=<? echo $rst["id"]?>" class="biglink"?>"  class="biglink" ><? echo $rst["cat_name"]; ?></a>

                                </strong> <font color="#666666" size="1"><br>

                                (

                                <?php

///////////////////////////////////////////////

///////////////////////////////////////////////

/// GENERATE CLIST ////////////////////////////////////////////  

$rst1_query=mysql_query("Select * from sbwmd_categories where pid=" . $rst["id"]);

$clist=$rst["id"];

while ( $rst1=mysql_fetch_array($rst1_query) )

{

$clist.="," . $rst1["id"];

while ( $rst1=mysql_fetch_array($rst1_query) )

{

$clist.="," . $rst1["id"];

}

   

$rst1_query=mysql_query("Select * from sbwmd_categories where pid IN (" . $clist . ") and id not in ( ". $clist . ")") ;

}

/// CLIST GENERATED /////////////////////////////////////////

 

//echo "[" .  $clist . "]";

 

 

$rst1_query=mysql_query("Select count(*)  from sbwmd_softwares where approved='yes' and cid in (" . $clist . ")"  );

$rst1=mysql_fetch_array($rst1_query);

 

$items=$rst1[0]  ;

echo  $items ;  

////////////////////////////////////////////

////////////////////////////////////////////

////////////////////////////////////////////

?>

                                resources)</font></font> </div></td>

                          </tr>

                        </table></td>

                      <? if(($cnt%2)==0)

  {  

  ?>

                    </tr>

                    <? } //end if?>

                    <?

$cnt++;

}//end while

?>

                  </table> </td>

              </tr>

            </table></td>

        </tr>

      </table>

      <p> </p>

      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">

        <tr>

          <td height="25" background="images/bargb.gif"> <div align="left"><FONT color=#000000><strong><font color="#000000" face="Tahoma, Verdana, Arial, Helvetica, sans-serif">  

               Featured Resources</font></strong></FONT></div></td>

        </tr>

        <tr>

          <td bgcolor="#f3f3f3" ><table width="100%" border="0" cellspacing="2" cellpadding="1">

              <?

  $featured_sites=mysql_query("select * from sbwmd_featuredads ");

  $cnt=0;$num=0;

  while($rst=mysql_fetch_array($featured_sites))

  {

  if(($cnt%2)==1)

  {

  $num++;  

  ?>

              <tr>

                <? } //end if?>

                <td width="100%" bgcolor="#ffffff"> <div align="justify">

                    <a  class="insidelink" href="<? echo $rst["url"]; ?>" target="_blank" ?>" target="_blank"><? echo $rst["name_url"]; ?></a><br>

                    <font color="#666666"> <? echo str_replace("\n","<br>",$rst["fd_desc"]); ?></font></div><BR></td>

                <? if(($cnt%2)==0)

  {  

  ?>

              </tr>

              <? } //end if?>

              <?

$cnt++;

}//end while

?>

            </table></td>

        </tr>

      </table>

      <br>

    </td>

  </tr>

</table>

<?

}// end main

?>

<?

 

include_once "template.php";

?>

 

 

Let me know if you need anything else:)

 

Thanks Darryl

Link to comment
Share on other sites

Now with highlighting!  (I haven't modified the code, apart from de-shortifying the opening php tags)

 

<?php
include_once "config.php";
include_once "left_index.php";
include_once "right_index.php";
function main()
{
?>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0" dwcopytype="CopyTableCell">
  <tr>
    <td valign="top"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td>
            <?php
if ( isset($_REQUEST["msg"])&&$_REQUEST['msg']<>"")
{
?>
           
<table align="center" bgcolor="#FEFCFC"   border="0" cellpadding="5" >
              <tr>
                <td><font face="verdana, arial" size="1" color="#666666">
                  <?php
print($_REQUEST['msg']);

?>
                  </font></td>
              </tr>
            </table>
            <?php
}//end if
?>
          </td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td><form name="form2" method="post" action="showcategory.php">
              <table width="100%" border="0" cellspacing="0" cellpadding="2">
                <tr>
                  <td width="17%"><FONT color=#000000><strong><font color="#000000" size="2" >SEARCH</font></strong></FONT></td>
                  <td width="31%"><input type="text" name="keyword"></td>
                  <td width="24%"><select name="cid">
                      <?php
           $cats=mysql_query("select * from sbwmd_categories where pid=0");
           while($rst=mysql_fetch_array($cats))
           {
                   ?>
                      <option value="<? echo $rst["id"]; ?>"><? echo $rst["cat_name"]; ?></option>
                      <?php
               }//end while
                ?>
                    </select></td>
                  <td width="28%"><input type="submit" name="Submit2" value="Go" class="input"></td>
                </tr>
              </table>
            </form></td>
        </tr>
        <tr>
          <td> </td>
        </tr>
        <tr>
          <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
              <tr>
                <td height="25" background="images/bargb.gif"> <div align="left"><FONT color=#000000><strong> <font color="#FFFFFF" face="Tahoma, Verdana, Arial, Helvetica, sans-serif">    <font color="#000000">Software
                    Categories </font></font></strong></FONT></div></td>
              </tr>
              <tr>
                <td bgcolor="#F3F3F3"><table width="100%" border="0" cellspacing="2" cellpadding="1">
                    <?php
           $cats1=mysql_query("select * from sbwmd_categories where pid=0 ");
           $cnt=1;
           while($rst=mysql_fetch_array($cats1))
           {
           if(($cnt%2)==1)
           {   
                  
           ?>
                    <tr>
                      <?php } //end if?>
                      <td width="50%" bgcolor="#FFFFFF" > <table width="100%">
                          <tr>
                            <td width="55"> <img src="images/folder.gif" width="50" height="45"></td>
                            <td> <div align="justify"><font color="#FF0000" size="3">
                                <strong> <a href="showcategory.php?cid=<?php echo $rst["id"]?>" class="biglink"?>"  class="biglink" ><? echo $rst["cat_name"]; ?>[/url]
                                </strong> <font color="#666666" size="1">

                                (
                                <?php
///////////////////////////////////////////////
///////////////////////////////////////////////
/// GENERATE CLIST ////////////////////////////////////////////          
   $rst1_query=mysql_query("Select * from sbwmd_categories where pid=" . $rst["id"]);
   $clist=$rst["id"];
   while ( $rst1=mysql_fetch_array($rst1_query) )
   {
    $clist.="," . $rst1["id"];
   while ( $rst1=mysql_fetch_array($rst1_query) )
   {
   $clist.="," . $rst1["id"];
   }
   
   $rst1_query=mysql_query("Select * from sbwmd_categories where pid IN (" . $clist . ") and id not in ( ". $clist . ")") ;
}
/// CLIST GENERATED /////////////////////////////////////////

//echo "[" .  $clist . "]";


$rst1_query=mysql_query("Select count(*)  from sbwmd_softwares where approved='yes' and cid in (" . $clist . ")"   );
$rst1=mysql_fetch_array($rst1_query);

$items=$rst1[0]  ;
echo  $items ;       
////////////////////////////////////////////
////////////////////////////////////////////
////////////////////////////////////////////
?>
                                resources)</font></font> </div></td>
                          </tr>
                        </table></td>
                      <?php if(($cnt%2)==0)
           {          
           ?>
                    </tr>
                    <?php } //end if?>
                    <?php
            $cnt++;
            }//end while
            ?>
                  </table> </td>
              </tr>
            </table></td>
        </tr>
      </table>
      <p> </p>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">
        <tr>
          <td height="25" background="images/bargb.gif"> <div align="left"><FONT color=#000000><strong><font color="#000000" face="Tahoma, Verdana, Arial, Helvetica, sans-serif">  
               Featured Resources</font></strong></FONT></div></td>
        </tr>
        <tr>
          <td bgcolor="#f3f3f3" ><table width="100%" border="0" cellspacing="2" cellpadding="1">
              <?php
           $featured_sites=mysql_query("select * from sbwmd_featuredads ");
           $cnt=0;$num=0;
           while($rst=mysql_fetch_array($featured_sites))
           {
           if(($cnt%2)==1)
           {   
           $num++;       
           ?>
              <tr>
                <?php } //end if?>
                <td width="100%" bgcolor="#ffffff"> <div align="justify">
                    <a   class="insidelink" href="<?php echo $rst["url"]; ?>" target="_blank" ?>" target="_blank"><? echo $rst["name_url"]; ?>[/url]

                    <font color="#666666"> <?php echo str_replace("\n","
",$rst["fd_desc"]); ?></font></div><BR></td>
                <?php if(($cnt%2)==0)
           {          
           ?>
              </tr>
              <?php } //end if?>
              <?php
            $cnt++;
            }//end while
            ?>
            </table></td>
        </tr>
      </table>
     

    </td>
  </tr>
</table>
<?php
}// end main
?>
<?php

include_once "template.php";
?>

Link to comment
Share on other sites

change line[code]<strong> <a href="showcategory.php?cid=<? echo $rst["id"]?>" class="biglink"?>"  class="biglink" ><? echo $rst["cat_name"]; ?></a>

to<a href="showcategory.php?cid=<? echo $rst["id"]?>" class="biglink"><? echo $rst["cat_name"]; ?></a>[/code]

Link to comment
Share on other sites

change line[code]<strong> <a href="showcategory.php?cid=<? echo $rst["id"]?>" class="biglink"?>"  class="biglink" ><? echo $rst["cat_name"]; ?></a>

to<a href="showcategory.php?cid=<? echo $rst["id"]?>" class="biglink"><? echo $rst["cat_name"]; ?></a>[/code]

 

 

Thankyou sooooooooooooooooooo Much, you fixed it !!!! check it out now its all clean:) http://www.simple-scripts-online.com

 

 

You are a true Guru!!

 

Thanks Darryl

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.