Re: Help with captcha

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not sure but i think that you need to place your javascript inside the
head tags, which you (i guess) output in header.php

Tijnema


On 3/9/07, Joker7 <sat_ring@xxxxxxxxxxx> wrote:

Im trying to use a captcha script from :
http://www.boutell.com/newfaq/creating/captcha.html
I can get it to work with plan HTML forms but not with this PHP form I
use.
Any help with this would be a great help.
Cheers
Chris

<?
include "header.php";
?>
<SCRIPT LANGUAGE="Javascript">
//<!--
// pop a windoid (Pictures)
function popWin(url, w, h)
{
  var madURL = url;
  var x, y, winStr;
  x=0; y=0;
  self.name="opener";
  winStr =

"height="+h+",width="+w+",screenX="+x+",left="+x+",screenY="+y+",top="+y+",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0";
  lilBaby = window.open(madURL, "_blank", winStr);
}
//--> </script>


<?
if (!strstr($_SERVER['HTTP_REFERER'], 'teaup.me.uk')) { exit ("Invalid
referrer");
}
include "admin/connect.php";
$s=$_SERVER["REMOTE_ADDR"];
$ipbancheck="SELECT * from gb_banip where IP='$s'";
$ipbancheck2=mysql_query($ipbancheck);
while($ipbancheck3=mysql_fetch_array($ipbancheck2))
{
$IPBANNED=$ipbancheck3[IP];
}
if ($IPBANNED)
   {
      print "You have been banned from posting";
   }

else
  {

   if (!isset($_POST['submit']))
   {
    print "<table border='0' cellpadding='6'><tr><td class='book'>";
    print "<form method='post' action='try.php' name='form'>";
    print "<p class=content>Name:</p> <input type='text' name='name'
size='40'><br>";
    print "<p class=content>Country:</p><input type='text' name='country'
size='40'><br>";
    print "<p class=content>Homepage</p><input type='text' name='homepage'
value='http://' size='40'><br>";
    print "<p class=content>E-mail:</p><input type='text' name='email'
size='40'><br>";
    print "<p class=content>Aim:</p><input type='text' name='aim'
size='40'><br>";
    print "<p class=content>ICQ:</p><input type='text' name='icq'
size='40'><br>";
    print "<p class=content>Yahoo:</p><input type='text' name='yim'
size='40'><br>";
    print "<p class=content>MSN:</p><input type='text' name='msn'
size='40'><br>";
    print "<p class=content>Comment:</p>";
    print "<textarea rows='6' name='comment' cols='45'></textarea><br>";

    print "<input type='submit' name='submit' value='submit'>";
    print "</form><br>";
    print "<p class='big'>Clickable Smilies</p>";
    print "<a onClick=\"addSmiley(':)')\"><img src='images/smile.gif'></a>
";
    print "<a onClick=\"addSmiley(':(')\"><img src='images/sad.gif'></a>
";
    print "<a onClick=\"addSmiley(';)')\"><img src='images/wink.gif'></a>
";
    print "<a onClick=\"addSmiley(';smirk')\"><img
src='images/smirk.gif'></a> ";
    print "<a onClick=\"addSmiley(':blush')\"><img
src='images/blush.gif'></a> ";
    print "<a onClick=\"addSmiley(':angry')\"><img
src='images/angry.gif'></a> ";
    print "<a onClick=\"addSmiley(':shocked')\"><img
src='images/shocked.gif'></a> ";
    print "<a onClick=\"addSmiley(':cool')\"><img
src='images/cool.gif'></a> ";
    print "<a onClick=\"addSmiley(':ninja')\"><img
src='images/ninja.gif'></a> ";
    print "<a onClick=\"addSmiley('(heart)')\"><img
src='images/heart.gif'></a> ";
    print "<a onClick=\"addSmiley('(!)')\"><img
src='images/exclamation.gif'></a> ";
    print "<a onClick=\"addSmiley('(?)')\"><img
src='images/question.gif'></a><br>";
    print "<a onclick=\"addSmiley(':{blink}')\"><img
src='images/winking.gif'></a>";
    print "<A onclick=\"addSmiley('{clover}')\"><img
src='images/clover.gif'></a>";
    print "<a onclick=\"addSmiley(':[glasses]')\"><img
src='images/glasses.gif'></a>";
    print "<a onclick=\"addSmiley(':[barf]')\"><img
src='images/barf.gif'></a>";
    print "<a onclick=\"addSmiley(':[reallymad]')\"><img
src='images/mad.gif'></a>";
    print "<script language=\"JavaScript\" type=\"text/javascript\">\n";
    print "function addSmiley(textToAdd)\n";
    print "{\n";
    print "document.form.comment.value += textToAdd;";
    print "document.form.comment.focus();\n";
    print "}\n";
    print "</script>\n";
    print "<br><br>";
    print "<p class='big'><A href=\"javascript:popWin('bbcode.php',400,
5)\">BBCode instructions</a></p>";
  }




else if (isset($_POST['submit']))
{
   $name=$_POST['name'];
   $country=$_POST['country'];
   $email=$_POST['email'];
   $homepage=$_POST['homepage'];
   $aim=$_POST['aim'];
   $icq=$_POST['icq'];
   $yim=$_POST['yim'];
   $msn=$_POST['msn'];
   $comment=$_POST['comment'];
   if(!$name || !$comment)
   {
     print "<font color='red'>Name or comment not entered, please go back
and sign again</font><br>";
   }
  else
   {
    $r=$_SERVER["REMOTE_ADDR"];
    $day=date("D M d, Y H:i:s");
    $timegone=date("U") ; //seconds since Jan 1st, 1970
    $putinguestbook="INSERT INTO gbook(name, country, mail, homepage,
comment, realtime, aim, icq, yim, msn, time,IP)

VALUES('$name','$country','$email','$homepage','$comment','$day','$aim','$icq','$yim','$msn','$timegone','$r')";
    mysql_query($putinguestbook);
    print "Thanks for posting, you will now be redirected <META HTTP-EQUIV
= 'Refresh' Content = '2; URL =index.php'> ";
   }
}
}
?>

</td></tr></table>

</center>
<?
include "footer.php";
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux