Sign in:
Username:
Password:  
»Forgot your password?

Home | Forum | How to Protect Your Web Form | How to Protect Your Email | Sign Up

Insure yourself from spam! The Anti Spam Insurance Company - ProtectWebForm!

Forum - It keeps saying that the verification code is wrong

PostMessage
drumcritic
2007-03-27 18:05:26
It keeps telling me that the code that I input is wrong.
please take a look:
<?php
////////////////////////////////////////////////////////////
// Code provided by http://www.protectwebform.com
function file_get_contents2($url){
$url_parsed = parse_url($url);
$fd = fsockopen($url_parsed[host], 80);
$data = ''; $header = false;
$reques_url = (strlen($url_parsed[query]) > 0) ?
$url_parsed[path]."?".$url_parsed[query] : $url_parsed[path];
fputs($fd,"GET ".$reques_url." HTTP/1.0\r\n");
fputs($fd,"Host: ".$url_parsed[host]."\r\n");
fputs($fd,"Connection: close\r\n\r\n");
while($line = fgets($fd)) {
if($header) $data .= $line;
if(strlen($line) <= 2) $header = true;
}
fclose($fd);
return $data;
}
if($_GLOBALS['REQUEST_METHOD'] == 'POST' || count($_POST) > 0) {
$pwf_message = "The image code you have provided does not match the
actual one. Hit the 'back' button of your browser and input the
correct code please.";

if(strlen($_POST['protectwebformcode']) > 30) {

die($pwf_message);
}

$protectwebformresult =
@file_get_contents2(
"http://protectwebform.com/verify01?vui=8308&vp=8yw6pr13vkc2&ri=" .
urlencode($_SERVER['REMOTE_ADDR']) . "&vs=" .
urlencode($_POST['protectwebformcode']));

if(preg_match("|<authorization status=\"0\"|", $protectwebformresult))
{
echo "Warning. You are not authorithed to use image protection
provided by
http://www.protectwebform.com. Read http://www.protectwebform.com
FAQ for more information";
} elseif(!preg_match("|<verification result=\"yes\"/>|",
$protectwebformresult)) {

die($pwf_message);

}
}
// End of code provided by http://www.protectwebform.com
////////////////////////////////////////////////////////////
?>
oleg
2007-03-28 01:58:29
Hello drumcritic,
try to add
---------------------------------
echo htmlspecialchars($protectwebformresult);
---------------------------------
line before "if(preg_match("|<auth ....."
Then submit the form and see if you get a result like this: "<?xml
version="1.0"><protectwebform><verification
result="no"/><authorization status="1"/></protectwebform>"

if not, you need to ask your hosting if you can make http requests
somehow.
drumcritic
2007-03-28 11:52:09
it says:
<?xml version="1.0"><protectwebform><verification
result="no"/><authorization status="1"/></protectwebform>
so i guess that's not the problem. maybe the problem's in the submit
form.
here it is:

<p id="p">
<!-- protectwebform.com html code -->
<a href="http://www.protectwebform.com/" title="Captcha service -
protectwebform.com!"><img
src="http://www.protectwebform.com/images/ssl_lock.gif"
border="0"></a>

<span id="protectwebform_text_block">Enter the code shown in the
image:</span><br />


<span NOWRAP id="protectwebform_image_block" ><img
id="protectwebform_image"
src="http://www.protectwebform.com/image/8308/"></span><span
style="visibility:hidden;" NOWRAP
id="protectwebform_reload_block">&nbsp; &nbsp;<a
id="protectwebform_link_reload" href="" title="Click here to reload
the image." onclick="return protectwebform_reload_image();"><img id
="ref" src="http://www.protectwebform.com/images/reload.gif"
border=0></a></span><span style="visibility:hidden;" NOWRAP
id="protectwebform_audio_block">&nbsp;&nbsp;<a
id="protectwebform_link_audio" target="_blank"
href="http://www.protectwebform.com/audio/" title="Listen to the
code."><img id="speak" border=0
src="http://www.protectwebform.com/images/play.gif"></a></span>

<script language="JavaScript"
src="http://www.protectwebform.com/javascript/8308/"></script>

</p>
<form enctype ="multipart/form-data" onSubmit="return verify();"
target="_blank" action="/up/upload2.php" method="post" >

<span NOWRAP id="protectwebform_textbox_block"><input
id="protectwebform_textbox" type="text" style="vertical-align:top;"
name="protectwebformcode" value=""></span>

<input name="Submit" type= "submit" id="sub" value="Submit">

</form>
oleg
2007-03-28 13:13:27
When I submit your form on your site, I do not see the verification
code in my log files.
you are using: "<form enctype ="multipart/form-data" onSubmit="return
verify();" target="_blank" ..."
are you sure that using popup page will transfer all the post data?
if you add
------------------------------------
phpinfo();
------------------------------------
line in your upload2.php file in the beginning, and try to submit the
code, you should see the
_POST["protectwebformcode"] and the code to the right of this field.

If everything works, try to add the line:
----------------------------------
echo $_POST['protectwebformcode'];
----------------------------------
before the "$protectwebformresult =
@file_get_contents2( ... "
to see if the code is really outputed.

This all seems strange.

drumcritic
2007-03-28 18:44:14
next to _POST["protectwebformcode"] it says "no value"
i guess that means that there is a problem.
oleg
2007-03-30 04:13:43
Yes, this must be the problem. you need to contact any php programmer
to see what the problem is in.
dextra
2007-05-27 09:38:14
drumcritic, did you resolve this issue? I seem to have the same
problem.

$protectwebformresult =
@file_get_contents returns no value.






Post Reply:

You must be logged in to reply.
Post message
Name: 
Email: 
Url: 




Registered users: 88191

Forms protected: 48551

Further Reading & Anti Spam Resources:

Directory


    ©Copyright 2006 ProtectWebForm.com. All rights reserved. Read our Privacy Policy

Page copy protected against web site content infringement by Copyscape