Jump to content

form help needed


rhock_95

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.