php warning

Discussion in 'PHP' started by Andi Mira, Nov 29, 2011.

  1. #1
    please help me
    captcha image on the web I do not want to appear and which arises is this message
    PHP Warning: imagefontwidth() expects parameter 1 to be long, string given in /home/hidecom/public_html/includes/libs/animatedcaptcha.class.php on line 236 ,272 and 274

    and this line236, 272 and 274 error reply

    line 236 $y = ($height-imagefontheight($random_font))/2;

    line 272 $offset_x += (imagefontwidth($random_font) * $this->font_size / 8) + $this->text_space;

    line 274 $offset_x += (imagefontwidth($random_font) * $this->font_size / 8) + ceil($this->text_space * 0.5);

    please help me
     
    Andi Mira, Nov 29, 2011 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    can you post the line that sets the $random_font variable? Without knowing what that is, there's no way to make a suggestion.
     
    jestep, Nov 29, 2011 IP
  3. intruder

    intruder Peon

    Messages:
    53
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yup as jestep said, it seems $random_font has a string length limitation to certain character or either its not being passed into that variable at all... So look into it, try echoing that variable and see what it outputs..
     
    intruder, Nov 29, 2011 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    I don't think you want to echo or vardump it. If it is a font file, it's going to be a huge mess of characters. Seeing how the variable is set should clear up some of the confusion.
     
    jestep, Nov 29, 2011 IP
  5. Andi Mira

    Andi Mira Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    so what should I do to overcome this
     
    Andi Mira, Nov 29, 2011 IP
  6. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #6
    You should post the line that sets $random_font.
     
    Rukbat, Dec 1, 2011 IP
  7. Andi Mira

    Andi Mira Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    and this line236, 272 and 274 error reply

    line 236 $y = ($height-imagefontheight($random_font))/2;

    line 272 $offset_x += (imagefontwidth($random_font) * $this->font_size / 8) + $this->text_space;

    line 274 $offset_x += (imagefontwidth($random_font) * $this->font_size / 8) + ceil($this->text_space * 0.5);
     
    Andi Mira, Dec 2, 2011 IP
  8. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #8
    None of those lines is the one that sets $random_font.
     
    Rukbat, Dec 2, 2011 IP
  9. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #9
    Look for:

    $random_font = ...something...
     
    jestep, Dec 2, 2011 IP
  10. Andi Mira

    Andi Mira Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    thanks for help I was able to overcome the above but I still run into obstacles

    I can not view the first loogin although admin username and password are correct
    please help
     
    Andi Mira, Dec 5, 2011 IP
  11. Andi Mira

    Andi Mira Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    This error message appears
    [04-Dec-2011 09:37:36] PHP Fatal error: Call to undefined method animated_captcha::animatedcaptcha_fonts() in /home/hidecom/public_html/includes/libs/animatedcaptcha.class.php on line 270
     
    Andi Mira, Dec 5, 2011 IP
  12. Andi Mira

    Andi Mira Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I can not view the first loogin admin by using captcha code
    and i want to remove the captcha code
    please help me remove the captcha code
    and this admin loogin.php
    <?php
    if (!defined('IN_SCRIPT')) {
    exit('NOT IN SCRIPT');
    }


    require(DIR.'includes/scripts/admin-login.php');
    ?>
    <form method="post" action="admin.php?do=admin-login">
    <input type="hidden" name="go" value="1"/>
    <table cellpadding="5" cellspacing="0">
    <tr><td>Username <span class="error">*</span></td><td>:</td><td><input type="text" name="username" value="<?php echo2($username); ?>" /></td></tr>
    <tr><td>Password <span class="error">*</span></td><td>:</td><td><input type="password" name="password" value="" /></td></tr>
    <?php if (get_config('image_verification_admin_login')) : ?>

    <tr valign="top">
    <td colspan="2">&nbsp;</td><td><img width="200" height="70" alt="Captcha" src="animatedcaptcha.<?php echo_if_rewrite_url('gif', 'php'); ?>?r=<?php echo md5(microtime()); ?>" id="idCaptcha" onclick="refreshCaptcha('idCaptcha', 'animatedcaptcha.gif')" class="hand" />
    <div>Enter <b>3 - 4 letters</b> that you see above.</div>
    <div class="refreshCaptcha">
    <a href="javascript:refreshCaptcha('idCaptcha', 'animatedcaptcha.<?php echo_if_rewrite_url('gif', 'php'); ?>')">Click the image</a> to refresh
    </div>
    </td>
    </tr>
    <tr valign="top">
    <td>Security Code <span class="error">*</span></td><td>:</td><td><input type="text" name="c" value="" size="10" style="text-transform:uppercase" /></td>
    </tr>
    <?php endif; ?>
    <tr><td colspan="2">&nbsp;</td><td><input type="submit" value="Login" class="submit" /></td></tr>
    </table>
    </form>
    <?php echo $scriptMessage; ?>

     
    Andi Mira, Dec 5, 2011 IP