rhock_95 Posted September 18, 2007 Share Posted September 18, 2007 I have a site running phphnuke 6.9...it is running on a hosted server with PHP Version 4.3.4 because of the older version of PHP I am unable to get a captcha script to run correctly...what I would like to do is implement the existing (php nuke) security code app into a database query form.... Below is the code from the nuke (admin) login form...is it possible to plug this code into my existing (php)scripts that query a database? if (extension_loaded("gd")) { echo "<tr><td colspan='2'>"._SECURITYCODE.": <img src='admin.php?op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'></td></tr>" ."<tr><td colspan='2'>"._TYPESECCODE.": <input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\"></td></tr>"; } echo "<tr><td>" ."<input type=\"hidden\" NAME=\"random_num\" value=\"$random_num\">" with the way the code is (like above) I am getting the following error: Parse error: parse error, expecting `','' or `';'' on the first line of the code above.. can someone take a look and offer advice on whether I will be able to do this? thanks Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted September 18, 2007 Share Posted September 18, 2007 please highlight the exact line Quote Link to comment Share on other sites More sharing options...
rhock_95 Posted September 18, 2007 Author Share Posted September 18, 2007 well on my first attempt to use the code I got the error on this line: if (extension_loaded("gd")) { howevr not being a php coder I will won't know what to expect with the rest of the code either thanks Quote Link to comment Share on other sites More sharing options...
freakstyle Posted September 18, 2007 Share Posted September 18, 2007 Hey there, your code looks fine. and valid. if your server doesn't have gd installed you wouldn't need this script though. i usually just look at phpinfo(); and see for myself vs adding the logic in there. but if you are offering this as software it would make sense. the file admin.php may be the culprit here. what i would suggest is to remove the image link "admin.php?op=...." and see if your error goes away. if it does, then the issue is in that admin.php page and you should debug in there. if it doesn't then perhaps you have code above this if statement that is causing the issue, easy way to tell, would be to add another if statement above this one. make it generic and see where the error happens. ( if ( 1!=2) ) : do this; endif; ) in php4 you can use captcha's. so long as you have gd installed. you're script to generate the captcha must not use any php5 functions or classes of course. but apart from that you should be good. happy debugging and good luck Quote Link to comment Share on other sites More sharing options...
rhock_95 Posted September 18, 2007 Author Share Posted September 18, 2007 thanks for the reply... still getting the same error Parse error: parse error, expecting `','' or `';'' on the same line from <phpinfo.php> GD Support enabled GD Version bundled (2.0.15 compatible) FreeType Support enabled FreeType Linkage with TTF library GIF Read Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.