how to add this captcha code into my file

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

    how to add this captcha code into my file

    hi,
    plz help in dis. i want to add captcha code in my form. i had done this but i cant merge the processed file in captcha code file.see dis


    here is my processed file
    PHP Code:
    <?php 
    include("conf.php");
    include(
    "func.php");
    connect($dbserver,$dbname,$dbuser,$dbpass);
    resetcou();
     
    ?>
    <?php
    $uid
    =$_GET["uid"];
    $pwd=$_GET["pwd"];
    $snm=$_POST["snm"];
    $lnk=$_POST["lnk"];
    $imgu=$_POST["imgu"];
    $catg=$_POST["catg"];
    $dsc=$_POST["dsc"];
    $image=$_POST["image"];
    $keywords=$_POST["keywords"];
    ?>
    <!DOCTYPE HTML PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title><?php echo"Add Site  |  $site_name"?></title>
    <link rel="stylesheet" type="text/css" href="themes/style.css"/>
    </head>
    <body>
    <div class="ttl">Add Site</div>
    <?php
    $uidid
    =MySQL_Fetch_Array(MySQL_Query("SELECT * from tusers where name='".$uid."';"));
    $res=addsite($uid,$pwd,$snm,$lnk,$imgu,$catg,$uidid[0],$dsc);
    $snm=HTMLSpecialChars($snm);
    if(
    $res)
    {
        
    $stid=MySQL_Fetch_Array(MySQL_Query("SELECT * from sites where sitelink='".$lnk."';"));
        echo
    "<div class=\"success\"><img src=\"images/accept.png\"/>$snm added Successfully.NOW put bellow code in home page of ur site...</div>";
        echo
    "<div class=\"content\">";
        echo
    "Site ID: <b>$stid[0]</b><br/>";
        echo
    "Text link to Our Site:<br/>";
        echo
    "<b>$site_url/in.php?sid=$stid[0]</b><br/><textarea name=\"code\"row=\"3\">&lt;a href=&quot;$site_url/in.php?sid=$stid[0]&quot;&gt;WapTOPS.CoM&lt;/a&gt;</textarea><br/>";
        echo
    "Image counter link:<br/>";
        echo
    "<b>$site_url/cou.php?sid=$stid[0]</b><br/><br/><textarea name=\"code\"row=\"3\">&lt;a href=&quot;$site_url/in.php?sid=$stid[0]&quot;&gt;&lt;img src=&quot;$site_url/cou.php?sid=$stid[0]&quot; alt=&quot;$site_name&quot;/&gt;&lt;/a&gt;&lt;br/&gt</textarea><br/>";
        echo
    "You can Change counter type in CPanel<br/><b>You should have to send the Initial 1 hits to us in order to display your site!</b><br/><br/>";
        echo
    "<a class=\"b\"href=\"addsite.php?uid=$uid&amp;pwd=$pwd\">Add Another Site</a><br/>";
        echo
    "<a class=\"b\"href=\"cpanel.php?uid=$uid&amp;pwd=$pwd&amp;logm=gt\">CPanel</a>";
        echo
    "</div>";
    }
    elseif(
    $res==1){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter your site name.</div>";}
    elseif(
    $res==2){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter your site link.</div>";}
    elseif(
    $res==3){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter description.</div>";}
    elseif(
    $res==4){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter your keywords.</div>";}
    elseif(
    $res==5){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter the write answer.</div>";}
    else {echo
    "<div class=\"error\"><img src=\"images/warning.png\"/> You don't have the Privileges to do this.</div>";}
    echo
    "<div class=\"center\"><a href=\"addsite.php?uid=$uid&amp;pwd=$pwd\">Back</a></div>";
    include
    "foot.php";
    echo
    "</body></html>";
    ?>

    and here is captcha code processed file

    PHP Code:
    <?php 
    session_start
    ();

    if( isset(
    $_POST['submit'])) {
       if( 
    $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) {
            
    // Insert you code for processing the form here, e.g emailing the submission, entering it into a database. 
            
    echo 'Thank you. Your message said "'.$_POST['message'].'"';
            unset(
    $_SESSION['security_code']);
       } else {
            
    // Insert your code for showing an error message here
            
    echo 'Sorry, you have provided an invalid security code';
       }
    } else
    ?>
    or u have any other captcha script??

    http://WapTops.com- Get Real High Traffic
    http://WapFun.info-Fun 4 Wap

    #2
    you would be better off adding it into the function addsite()
    eg:
    $res = addsite($uid,$pwd,$snm,$lnk,$imgu,$catg,$uidid[0],$dsc,$_SESSION['security_code'],$_POST['security_code']);
    then on that function adding another return code

    Comment


      #3
      Originally posted by something else View Post
      you would be better off adding it into the function addsite()
      eg:
      $res = addsite($uid,$pwd,$snm,$lnk,$imgu,$catg,$uidid[0],$dsc,$_SESSION['security_code'],$_POST['security_code']);
      then on that function adding another return code
      hey, here is my addsite function plz do it for me.

      PHP Code:
      function addsite($username,$pass,$snm,$lnk,$imgu,$catg,$uid,$dsc)
      {
          if(
      login($username,$pass)==0)
          {
              
      $adds=mysql_query("INSERT INTO sites SET sitename='".$snm."',sitelink='".$lnk."',slogo='".$imgu."',cid='".$catg."',uid='".$uid."',dscr='".$dsc."',keywords='".$keywords."'");
              if(
      $adds){return true;}else{return false;}
          }
          else{return 
      false;}


      http://WapTops.com- Get Real High Traffic
      http://WapFun.info-Fun 4 Wap

      Comment


        #4
        strange your addsite function returns just a true or false when the register coding says it returns a number:
        PHP Code:
        $res=addsite($uid,$pwd,$snm,$lnk,$imgu,$catg,$uidid[0],$dsc);

        elseif(
        $res==1){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter your site name.</div>";} 
        elseif(
        $res==2){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter your site link.</div>";} 
        elseif(
        $res==3){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter description.</div>";} 
        elseif(
        $res==4){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter your keywords.</div>";} 
        elseif(
        $res==5){echo"<div class=\"error\"><img src=\"images/delete.png\" alt=\"\"/> Please enter the write answer.</div>";} 
        so that whole section above doesn't work....

        without all that working here is a bit to add to that function:
        PHP Code:
        function addsite($username,$pass,$snm,$lnk,$imgu,$catg,$uid,$dsc,$sec1,$sec2)
        {
        if(
        $sec1!=$sec2){
        return 
        false;
        }else if(
        login($username,$pass)==0)
            {
                
        $adds=mysql_query("INSERT INTO sites SET sitename='".$snm."',sitelink='".$lnk."',slogo='".$imgu."',cid='".$catg."',uid='".$uid."',dscr='".$dsc."',keywords='".$keywords."'");
                if(
        $adds){return true;}else{return false;}
            }
            else{return 
        false;}

        it should really return a number rather than true or false

        Comment

        Working...
        X