Xhtml Toplist

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Xhtml Toplist

    hi everyone, im writing a xhtml toplist script, i need help with two little things, the search function and edit site function. i want to know whats wrong with these two queries
    Code:
    $sites = mysql_query("SELECT id, sitename FROM wiz_sites WHERE cid='".$cid."' AND description LIKE '".$word."' OR keywords LIKE '".$word."' ORDER BY id, sitename");
    for the search function and for the edit site [code]$sitename = $_POST["sitename"];
    $sitelink = $_POST["sitelink"];
    $sitelogo = $_POST["sitelogo"];
    $keywords = $_POST["keywords"];
    $description = $_POST["description"];
    $cid = $_POST["cid"];

    if($sitename=="")
    {
        echo "Site Name Cannot be left Blank";
    }else if($sitelink=="")
    {
        echo "Site Link Cannot be left Blank";
    }else if($description=="")
    {
        echo "description Cannot be left Blank";
    }else if($keywords=="")
    {
        echo "Keywords Cannot be left Blank";
    }
    else{
          $res = mysql_query("UPDATE wiz_sites SET sitename='".$sitename."', $sitelink='".$sitelink."', logourl='".$sitelogo."', cid='".$cid."', description='".$description."', keywords='".$keywords."' WHERE id='".$site."'");
      
            if($res)
          {

            echo "Site updated successfully
    ";
    echo "Add this link on your site where users can see
    ";
    echo "http://$siturl/in.php?site=$site
    ";
          }else{
            echo "Error Adding Site, Please Contact Owner";
          }

    }
    [code] i get the error field
    Code:
    Error Adding Site, Please Contact Owner
    thank you... you can view my work@ http://top.wizardwap.net
    Attached Files

    #2
    i have fixed the search section. can someone please help me with the section to update a site details

    Comment


      #3
      sql
      Code:
      CREATE TABLE `wiz_sites` (
        `id` int(99) NOT NULL auto_increment,
        `cid` int(99) NOT NULL,
        `sitename` varchar(100) NOT NULL,
        `sitelink` varchar(200) NOT NULL,
        `logourl` varchar(200) NOT NULL,
        `hin` int(99) NOT NULL,
        `hout` int(99) NOT NULL,
        `owner` int(99) NOT NULL,
        `description` varchar(250) NOT NULL,
        `keywords` varchar(150) NOT NULL,
        PRIMARY KEY  (`id`),
        FULLTEXT KEY `sitelink` (`sitelink`)
      ) ENGINE=MyISAM;
      editsite.php
      Code:
      <?php
      
      header("Content-type: text/html; charset=ISO-8859-1");
      
      echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
      
      ?>
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
      
      <?php
      
      $sid = $_GET["sid"];
      $site = $_GET["site"];
      
      include("core.php");
      include("config.php");
      
      
      
      $bcon = connectdb();
      if (!$bcon)
      {
          echo dberror();
      }
      $uid = getuid_sid($sid);
      if((islogged($sid)==false)||($uid==0))
      {
      
      
            echo "You are not logged in
      ";
      
            echo "<a href=\"index.php\">Login</a>";
           echo "</body></html>";
            exit();
      }
      echo "<head>";
      echo "<title>$stitle</title>";
      echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
      echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />";
      echo "<meta name=\"description\" content=\"description\" />";
      echo "<meta name=\"keywords\" content=\"keywords\" />";
      echo "</head>";
      echo "<body>";
      
      $owner = mysql_query("SELECT owner from wiz_sites WHERE id=&#39;".$site."&#39;");
      $isowner=mysql_fetch_array($owner);
      if(!$isowner[0]=="$uid") {
      echo "this site is not yours";
      }else{
      
      $sitename = $_POST["sitename"];
      $sitelink = $_POST["sitelink"];
      $sitelogo = $_POST["sitelogo"];
      $keywords = $_POST["keywords"];
      $description = $_POST["description"];
      $cid = $_POST["cid"];
      
      if($sitename=="")
      {
          echo "Site Name Cannot be left Blank";
      }else if($sitelink=="")
      {
          echo "Site Link Cannot be left Blank";
      }else if($description=="")
      {
          echo "description Cannot be left Blank";
      }else if($keywords=="")
      {
          echo "Keywords Cannot be left Blank";
      }
      else{
            $res = mysql_query("UPDATE wiz_sites SET sitename=&#39;".$sitename."&#39;, $sitelink=&#39;".$sitelink."&#39;, logourl=&#39;".$sitelogo."&#39;, cid=&#39;".$cid."&#39;, description=&#39;".$description."&#39;, keywords=&#39;".$keywords."&#39; WHERE id=&#39;".$site."&#39;");
        
              if($res)
            {
      
              echo "Site updated successfully
      ";
      echo "Add this link on your site where users can see
      ";
      echo "http://$siturl/in.php?site=$site 
      ";
            }else{
              echo "Error Adding Site, Please Contact Owner";
            }
      
      }
      }
      
      echo "<div class=\"hd1\"><img src=\"images/menu1.png\" alt=\"\"/><a class=\"sub\" href=\"menu.php?sid=$sid\">control Panel</a></div>";
      echo "<div class=\"hd1\"><img src=\"images/home.png\" alt=\"\"/><a class=\"sub\" href=\"index.php?sid=$sid\">$siturl</a></div>";
      echo "</body>";
      
      
      ?>
      
      </html>
      eds.php
      Code:
      <?php
      
      header("Content-type: text/html; charset=ISO-8859-1");
      
      echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
      
      ?>
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
      
      <?php
      
      $sid = $_GET["sid"];
      
      $site = $_POST["site"];
      
      include("core.php");
      include("config.php");
      
      
      
      $bcon = connectdb();
      if (!$bcon)
      {
          echo dberror();
      }
      $uid = getuid_sid($sid);
      if((islogged($sid)==false)||($uid==0))
      {
      
      
            echo "You are not logged in
      ";
      
            echo "<a href=\"index.php\">Login</a>";
           echo "</body></html>";
            exit();
      }
      
      echo "<head>";
      echo "<title>$stitle</title>";
      echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
      echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
      echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />";
      echo "<meta name=\"description\" content=\"description\" />";
      echo "<meta name=\"keywords\" content=\"keywords\" />";
      echo "</head>";
      echo "<body>";
      
      $wizard = mysql_fetch_array(mysql_query("SELECT COUNT(distinct id) FROM wiz_sites WHERE owner=&#39;".$uid."&#39; ORDER BY id DESC"));
      if($wizard[0]>0) {
      $wizz = mysql_fetch_array(mysql_query("SELECT sitelink, sitename, logourl, cid, description, keywords FROM wiz_sites WHERE id=&#39;".$site."&#39;"));   
      
      echo "<form action=\"edsite.php?sid=$sid&amp;site=$site\" method=\"post\">";
      echo "sitename:
      ";
      echo "<input name=\"sitename\" maxlength=\"25\" emptyok=\"false\" type=\"text\" value=\"$wizz[1]\"/>
      ";
      echo "sitelink:
      ";
      echo "<input name=\"sitelink\" maxlength=\"25\" emptyok=\"false\" type=\"text\" value=\"$wizz[0]\"/>
      ";
      echo "logo (optional):
      ";
      echo "<input name=\"sitelogo\" maxlength=\"100\" emptyok=\"true\" type=\"text\" value=\"$wizz[2]\"/>
      ";
      
      echo "description:
      ";
      echo "<input name=\"description\" maxlength=\"150\" emptyok=\"true\" type=\"text\" value=\"$wizz[4]\"/>
      ";
      
      echo "keywords (separate by ,):
      ";
      echo "<input name=\"keywords\" maxlength=\"100\" emptyok=\"true\" type=\"text\" value=\"$wizz[5]\"/>
      ";
      
      echo "Category:  <select name=\"cid\" value=\"$wizz[3]\">";
          $wiz_cats = mysql_query("SELECT id, name FROM wiz_cats ORDER BY name;");
        while ($wiz_cat = mysql_fetch_array($wiz_cats))
        {
          echo "<option value=\"$wiz_cat[0]\">$wiz_cat[1]</option>";
          }
          
          echo "</select>
      ";
      
      
      echo "<input type=\"submit\" value=\"Edit\"/>";
      echo "</form>";
      
      }else{
      echo "You currently have no sites in our toplist system";
      }
      
      
      echo "<div class=\"hd1\"><img src=\"images/menu1.png\" alt=\"\"/><a class=\"sub\" href=\"menu.php?sid=$sid\">control Panel</a></div>";
      echo "<div class=\"hd1\"><img src=\"images/home.png\" alt=\"\"/><a class=\"sub\" href=\"index.php?sid=$sid\">$siturl</a></div>";
      echo "</body>";
      
      
      ?>
      
      </html>

      Comment


        #4
        sql
        Code:
        CREATE TABLE `wiz_sites` (
          `id` int(99) NOT NULL auto_increment,
          `cid` int(99) NOT NULL,
          `sitename` varchar(100) NOT NULL,
          `sitelink` varchar(200) NOT NULL,
          `logourl` varchar(200) NOT NULL,
          `hin` int(99) NOT NULL,
          `hout` int(99) NOT NULL,
          `owner` int(99) NOT NULL,
          `description` varchar(250) NOT NULL,
          `keywords` varchar(150) NOT NULL,
          PRIMARY KEY  (`id`),
          FULLTEXT KEY `sitelink` (`sitelink`)
        ) ENGINE=MyISAM;
        editsite.php
        Code:
        <?php
        
        header("Content-type: text/html; charset=ISO-8859-1");
        
        echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
        
        ?>
        
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
        
        <?php
        
        $sid = $_GET["sid"];
        $site = $_GET["site"];
        
        include("core.php");
        include("config.php");
        $bcon = connectdb();
        if (!$bcon)
        {
            echo dberror();
        }
        $uid = getuid_sid($sid);
        if((islogged($sid)==false)||($uid==0))
        {
              echo "You are not logged in
        ";
        
              echo "<a href=\"index.php\">Login</a>";
             echo "</body></html>";
              exit();
        }
        echo "<head>";
        echo "<title>$stitle</title>";
        echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
        echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
        echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />";
        echo "<meta name=\"description\" content=\"description\" />";
        echo "<meta name=\"keywords\" content=\"keywords\" />";
        echo "</head>";
        echo "<body>";
        
        $owner = mysql_query("SELECT owner from wiz_sites WHERE id=&#39;".$site."&#39;");
        $isowner=mysql_fetch_array($owner);
        if(!$isowner[0]=="$uid") {
        echo "this site is not yours";
        }else{
        
        $sitename = $_POST["sitename"];
        $sitelink = $_POST["sitelink"];
        $sitelogo = $_POST["sitelogo"];
        $keywords = $_POST["keywords"];
        $description = $_POST["description"];
        $cid = $_POST["cid"];
        
        if($sitename=="")
        {
            echo "Site Name Cannot be left Blank";
        }else if($sitelink=="")
        {
            echo "Site Link Cannot be left Blank";
        }else if($description=="")
        {
            echo "description Cannot be left Blank";
        }else if($keywords=="")
        {
            echo "Keywords Cannot be left Blank";
        }
        else{
              $res = mysql_query("UPDATE wiz_sites SET sitename=&#39;".$sitename."&#39;, $sitelink=&#39;".$sitelink."&#39;, logourl=&#39;".$sitelogo."&#39;, cid=&#39;".$cid."&#39;, description=&#39;".$description."&#39;, keywords=&#39;".$keywords."&#39; WHERE id=&#39;".$site."&#39;");
          
                if($res)
              {
        
                echo "Site updated successfully
        ";
        echo "Add this link on your site where users can see
        ";
        echo "http://$siturl/in.php?site=$site 
        ";
              }else{
                echo "Error Adding Site, Please Contact Owner";
              }
        
        }
        }
        
        echo "<div class=\"hd1\"><img src=\"images/menu1.png\" alt=\"\"/><a class=\"sub\" href=\"menu.php?sid=$sid\">control Panel</a></div>";
        echo "<div class=\"hd1\"><img src=\"images/home.png\" alt=\"\"/><a class=\"sub\" href=\"index.php?sid=$sid\">$siturl</a></div>";
        echo "</body>";
        ?>
        
        </html>
        eds.php
        Code:
        <?php
        
        header("Content-type: text/html; charset=ISO-8859-1");
        
        echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
        
        ?>
        
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
        
        <?php
        
        $sid = $_GET["sid"];
        
        $site = $_POST["site"];
        
        include("core.php");
        include("config.php");
        $bcon = connectdb();
        if (!$bcon)
        {
            echo dberror();
        }
        $uid = getuid_sid($sid);
        if((islogged($sid)==false)||($uid==0))
        {
              echo "You are not logged in
        ";
        
              echo "<a href=\"index.php\">Login</a>";
             echo "</body></html>";
              exit();
        }
        
        echo "<head>";
        echo "<title>$stitle</title>";
        echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style.css\" />";
        echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />";
        echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />";
        echo "<meta name=\"description\" content=\"description\" />";
        echo "<meta name=\"keywords\" content=\"keywords\" />";
        echo "</head>";
        echo "<body>";
        
        $wizard = mysql_fetch_array(mysql_query("SELECT COUNT(distinct id) FROM wiz_sites WHERE owner=&#39;".$uid."&#39; ORDER BY id DESC"));
        if($wizard[0]>0) {
        $wizz = mysql_fetch_array(mysql_query("SELECT sitelink, sitename, logourl, cid, description, keywords FROM wiz_sites WHERE id=&#39;".$site."&#39;"));   
        
        echo "<form action=\"edsite.php?sid=$sid&amp;site=$site\" method=\"post\">";
        echo "sitename:
        ";
        echo "<input name=\"sitename\" maxlength=\"25\" emptyok=\"false\" type=\"text\" value=\"$wizz[1]\"/>
        ";
        echo "sitelink:
        ";
        echo "<input name=\"sitelink\" maxlength=\"25\" emptyok=\"false\" type=\"text\" value=\"$wizz[0]\"/>
        ";
        echo "logo (optional):
        ";
        echo "<input name=\"sitelogo\" maxlength=\"100\" emptyok=\"true\" type=\"text\" value=\"$wizz[2]\"/>
        ";
        
        echo "description:
        ";
        echo "<input name=\"description\" maxlength=\"150\" emptyok=\"true\" type=\"text\" value=\"$wizz[4]\"/>
        ";
        
        echo "keywords (separate by ,):
        ";
        echo "<input name=\"keywords\" maxlength=\"100\" emptyok=\"true\" type=\"text\" value=\"$wizz[5]\"/>
        ";
        
        echo "Category:  <select name=\"cid\" value=\"$wizz[3]\">";
            $wiz_cats = mysql_query("SELECT id, name FROM wiz_cats ORDER BY name;");
          while ($wiz_cat = mysql_fetch_array($wiz_cats))
          {
            echo "<option value=\"$wiz_cat[0]\">$wiz_cat[1]</option>";
            }
            
            echo "</select>
        ";
        echo "<input type=\"submit\" value=\"Edit\"/>";
        echo "</form>";
        
        }else{
        echo "You currently have no sites in our toplist system";
        }
        echo "<div class=\"hd1\"><img src=\"images/menu1.png\" alt=\"\"/><a class=\"sub\" href=\"menu.php?sid=$sid\">control Panel</a></div>";
        echo "<div class=\"hd1\"><img src=\"images/home.png\" alt=\"\"/><a class=\"sub\" href=\"index.php?sid=$sid\">$siturl</a></div>";
        echo "</body>";
        ?>
        
        </html>
        [/b]
        Your mysql query is wrong,it sud be
        $res = mysql_query("UPDATE wiz_sites SET sitename=&#39;".$sitename."&#39;, sitelink=&#39;".$sitelink."&#39;, logourl=&#39;".$sitelogo."&#39;, cid=&#39;".$cid."&#39;, description=&#39;".$description."&#39;, keywords=&#39;".$keywords."&#39; WHERE id=&#39;".$site."&#39;");

        Comment


          #5
          g thanks man. i didnt notice that $

          Comment


            #6
            Nyc one there really nice emaybe i&#39;ll try it!

            Comment


              #7
              @wizard
              your hosting account is suspended lol

              Comment

              Working...
              X