Welcome to Geeklog Thursday, December 14 2017 @ 11:10 pm EST


Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
I'm trying to impliment GL Captcha 1.0 and can't seem to the something right. Maybe I'm just dense.

Anyway when I try to modify my lib-custom get errors. something about variable being already declared. Can someone drop me a pre hacked lib-custom or tell me where to make the modifications.

Thanks,
Ron

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
Ron,

If you can give me a specific error message, I bet we can get you fixed up. Sorry, but I don't work so well with 'something about variable being already declared', that could be all kinds of problems and I wouldn't know where to start. But, the actual error message will help narrow it down.

Thanks!
Mark

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
I added the lines to lib-custom and I get this. Also the memberdetail example doesn't find the images. I am using gd lib.
PHP Formatted Code
Fatal error: Cannot redeclare custom_userform() (previously declared in F:\geeklog10\system\lib-custom.php:235) in F:\geeklog10\system\lib-custom.php on line 1077
 



Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
Okay I seem to have everything installed and working except that the image doesn't display. When I look at properties it says

www.mysite.com/captcha/captcha.php?.png

I'm trying to figure out what it's not displaying properly but if you have an idea let me know. Maybe I have something in the wrong location.

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
Ron,

There are a couple of configurations you can try to see if you can get things to work. First, try the different graphic drivers. In public_html/captcha.php change the $gfxDriver to 0 for GD libs, if that doesn't work, then try 1 for ImageMagick and if that fails, give the static image method a try by setting it to 2.

What I've seen happen is that a lot of GD and ImageMagick graphic package installs do not seem to support True Type Fonts which are used to actually create the image. This is why I have the static image option, it doesn't rely on any external graphic packages.

Let me know if this helps.

Thanks!
Mark

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
I've tried all 3 and get the same results for all three.

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
Ron,

Where do you have the static images stored?

The program is looking for them in the:

$_CONF['path'] . '/captcha-images/ directory. Where $_CONF['path'] is defined in your Geeklog config.php file.

Are they there? And are the permissions set properly on that directory so the web server can read files there?

Thanks!
Mark

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
F:\geeklog\captcha-images

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
OK, in your Geeklog config.php, what is $_CONF['path'] set to? If it isn't F:\Geeklog then we'll need to move the captcha-images so the /captcha-images/ directory is under whatever directory is show in $_CONF['path'].

But, if it is in the right place, are you sure the web server can read that directory. It looks like you are running on a Windows box, are you using Apache or IIS as the web server? If it is IIS, you'll probably need to specifically add the proper permissions to that directory so the web server can open and read the graphic images stored there.

Thanks!
Mark

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
$_CONF['path'] = 'F:/geeklog/';


Neither, I am on Win XP running Xitami web server. However what you said may give me an idea. Of course the web server can find and read the geeklog files. I am running gd lib and ImageMagick and have tested ImageMagick and it seems to work ok.

Where can I change the path information if I were to put the captcha-images elsewhere?

Ron

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
The path is hardcoded in captcha.class.php. You can edit it and change line 179, it will look like this:
PHP Formatted Code

                $fp = fopen($_CONF['path'] . '/captcha-images/' . $filename, 'r');
 


Just change the $_CONF['path'] . '/captcha-images/' to wherever you put the images.

Thanks!
Mark

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
I tried running http://www.miplanet.com/captcha/captcha.php?.png by itself and it returns text no matter which I try 0, 1 or 2. With 2 (static) I also get the css text. Go ahead and take a look.

Ron

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
Ron,

I think the issue may be with how the image is being sent. I went to the URL you gave me and sure enough it doesn't work, but if I view the source of the page, I can actually see all the binary data for the image.

The way I send the image is this:

I send a header stating the image type and then send the image data. My guess is that the Xitami web server does not like this method. I'm not sure how to correct this, sending image data this way is pretty standard stuff. Anything in the server docs that might give me a hint on how I can do it differently for that server?

Thanks!
Mark


Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
It very well could be the header. All Xitami documentation is on it's website www.xitami.com.

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
here are the Xitami mime types I can add whatever we need.

[Mime]
# Default MIME type
default=*/*
# Text MIME types
.=text/plain
etx=text/x-setext
htm=text/html
html=text/html
htp=text/html
rtx=text/richtext
rss=text/xml
rdf=text/xml
xml=text/xml
tsv=text/tab-separated-values
txt=text/plain
# Image MIME types
fh=image/x-freehand
fh4=image/x-freehand
fh5=image/x-freehand
fh7=image/x-freehand
fhc=image/x-freehand
gif=image/gif
ief=image/ief
jpe=image/jpeg
jpeg=image/jpeg
jpg=image/jpeg
pbm=image/x-portable-bitmap
pgm=image/x-portable-graymap
png=image/png
pnm=image/x-portable-anymap
ppm=image/x-portable-pixmap
ras=image/x-cmu-raster
rgb=image/x-rgb
tif=image/tiff
tiff=image/tiff
xbm=image/x-xbitmap
xpm=image/x-xpixmap
xwd=image/x-xwindowdump
# Video MIME types
avi=video/msvideo
mov=video/quicktime
movie=video/x-sgi-movie
mpe=video/mpeg
mpeg=video/mpeg
mpg=video/mpeg
qt=video/quicktime
qtv=video/quicktime
# Audio MIME types
aif=audio/x-aiff
aifc=audio/x-aiff
aiff=audio/x-aiff
au=audio/basic
m3u=audio/mpegurl
mid=audio/midi
mp3=audio/mpeg
mp3url=audio/mpegurl
ra=audio/x-realaudio
ram=audio/x-pn-realaudio
rm=audio/x-pn-realaudio
rmi=audio/midi
rpm=audio/x-pn-realaudio-plugin
snd=audio/basic
wav=audio/wav
# Application MIME types
aab=application/x-authorware-bin
aam=application/x-authorware-map
aas=application/x-authorware-seg
ai=application/postscript
bcpio=application/x-bcpio
bin=application/octet-stream
cdf=application/x-netcdf
cpio=application/x-cpio
csh=application/x-csh
dcr=application/x-director
dir=application/x-director
doc=application/msword
dvi=application/x-dvi
dxr=application/x-director
eps=application/postscript
exe=application/octet-stream
gtar=application/x-gtar
gz=application/x-gzip
hdf=application/x-hdf
jar=application/java-archive
js=application/x-javascript
latex=application/x-latex
ltx=application/x-latex
lzh=application/x-lzh
man=application/x-troff-man
me=application/x-troff-me
ms=application/x-troff-ms
nc=application/x-netcdf
oda=application/oda
pdf=application/pdf
ps=application/postscript
roff=application/x-troff
rtf=application/rtf
sh=application/x-sh
shar=application/x-shar
spl=application/futuresplash
src=application/x-wais-source
sv4cpio=application/x-sv4cpio
sv4crc=application/x-sv4crc
swf=application/x-shockwave-flash
t=application/x-troff
tar=application/tar
tcl=application/x-tcl
tex=application/x-tex
texi=application/x-texinfo
texinfo=application/x-texinfo
tgz=application/x-gzip
tr=application/x-troff
txi=application/x-texinfo
ustar=application/x-ustar
zip=application/zip
# VRML MIME types
wrl=x-world/x-vrml
wrz=x-world/x-vrml
Php=application/php
Phps=application/php
Phtml=application/php
php=application/x-httpd-php
phtml=application/x-httpd-php
php3=application/x-httpd-php
php4=application/x-httpd-php
vbs=application/x-vbs
vbs=text/vbs
vbs=text/vbscript
asp=text/html
asp=text/asp

Status: offline

ronack

Forum User
Full Member
Registered: 27/05/2003
Posts: 612
Okay, I have made a little progress. It appears that the Geeklog header is over riding the header sent by the captcha script. Now I need to figure out why. What I did was create a small php file like so just to test. If I include the require_once line it doesn't work if I remark it out like below it works.

PHP Formatted Code
<?PHP

//require_once ('lib-common.php');

$tag = fopen('f:/geeklog/captcha-images/1F770D.jpg', 'rb');
if ($tag) {
header('Content-Type: image/jpeg');
fpassthru($tag);
}


?>

Status: offline

mevans

Forum User
Full Member
Registered: 08/02/2004
Posts: 393
Location:Texas
Ron,

I'm not sure the CAPTCHA will work properly without lib-common.php being included. It sounds like your web server doesn't like having a content header sent mid-stream. I've done extensive testing with Apache and IIS and haven't seen any issues like this with them. Maybe you could use the server's support forums and see if anyone else has had an issue like this or has a work around?

Thanks!
Mark

Filin

Anonymous
I got the same problem.

If some one will find this topic hope this solusion will help him.

You need to remove any symbols aftrer "?>" "cr" "lf" and others characters in all included files by lib-common.php (plugin's functions.inc and so).
Server understand it as HTML code and send it to client with own headers.
Then capthca whant to send its own headers but it cause errors because headers was sent already.

Status: offline

jmucchiello

Forum User
Full Member
Registered: 29/08/2005
Posts: 985
Are you actually using Captcha 1.0? The latest version is 3.0.2 assuming you are running GL 1.4.1.

Filin

Anonymous
Actually our project based on GL 1.3.11 Smile and can't be upgraded for now because of many changes implemened in GL core.

Thanks, I will look at new version when I have a time.

All times are EST. The time is now 11:10 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content