+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14
Like Tree5Likes

Thread: Php Script Help!

  1. #1
    w_d_liu1091 is offline x10Hosting Member w_d_liu1091 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    15

    Question Php Script Help!

    I've got this script from a admin configuration from a mega file manager script.

    but i need help to fix the eregi is deprecated error!

    the eregi is located where i coloured it in red.

    Please help me!

    Thank You!

    The script below:


    <?php
    while($each_file = @mysql_fetch_array($final_query)){
    ?>
    <table width="100%" border="0" cellspacing="0" cellpadding="2" style="border:1px solid #CCCCCC;">
    <tr bgcolor="#FFFFFF">
    <td width="10%" style="border:1px solid #CCCCCC;"><?=$each_file['file_id']?></td>
    <td width="11%" style="border:1px solid #CCCCCC;"><div align="left">
    <?php
    if(strlen($each_file['file_name_is']) > '2'){
    echo '<input type="text" value="'.$each_file['file_name_show'].'" title="'.$each_file['file_name_show'].'" style="width:100%;" readonly>';
    } else {
    if(eregi('object',$each_file['file_name_show'])){
    echo 'Object File';
    } else {
    echo '<a href="'.$each_file['file_name_show'].'" target="_blank">Link</a>';
    }
    }?>

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Php Script Help!

    Switch

    PHP Code:
    if(eregi('object',$each_file['file_name_show'])){ 
    to

    PHP Code:
    if(  stristr$each_file['file_name_show'] ,  'object' )   )  { 
    w_d_liu1091 likes this.
    Nothing is always absolutely so.

  3. #3
    w_d_liu1091 is offline x10Hosting Member w_d_liu1091 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    15

    Re: Php Script Help!

    it worked!
    it actually worked!

    THANK YOU descalzo!

    This post is now closed!

  4. #4
    kimiwadesu12 is offline x10Hosting Member kimiwadesu12 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    1

    Re: Php Script Help!

    or
    PHP Code:
    if( stripos$each_file['file_name_show'], 'object' ) !== FALSE ){ 
    or
    PHP Code:
    if( preg_match'/object/i'$each_file['file_name_show'] ) ){ 
    w_d_liu1091 likes this.

  5. #5
    w_d_liu1091 is offline x10Hosting Member w_d_liu1091 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    15

    Question Re: Php Script Help!

    I've got this send file by e-mail script which is part of the mega file manager too, but it has another error:

    Warning: Division by zero in

    the error is on line 116 which is the line i coloured in red!

    The script is below (this is not the full script don't worry!):

    //Function to encrypt
    function encode_password($data,$keyfile) { //ecncrypt $data with the key in $keyfile with an rc4 algorithm
    $pwd = $keyfile;
    $pwd_length = strlen($pwd);
    for ($i = 0; $i < 255; $i++) {
    $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1));
    $counter[$i] = $i;
    }
    for ($i = 0; $i < 255; $i++) {
    $x = ($x + $counter[$i] + $key[$i]) % 256;
    $temp_swap = $counter[$i];
    $counter[$i] = $counter[$x];
    $counter[$x] = $temp_swap;

    }
    for ($i = 0; $i < strlen($data); $i++) {
    $a = ($a + 1) % 256;
    $j = ($j + $counter[$a]) % 256;
    $temp = $counter[$a];
    $counter[$a] = $counter[$j];
    $counter[$j] = $temp;
    $k = $counter[(($counter[$a] + $counter[$j]) % 256)];
    $Zcipher = ord(substr($data, $i, 1)) ^ $k;
    $Zcrypt .= chr($Zcipher);
    }
    return $Zcrypt;
    }


    Please help!
    Thank You!
    Last edited by w_d_liu1091; 10-31-2011 at 01:31 PM. Reason: add detail

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Php Script Help!

    PHP Code:

    $pwd 
    $keyfile;
    $pwd_length strlen($pwd);
    for (
    $i 0$i 255$i++) {
    $key[$i] = ord(substr($pwd, ($i $pwd_length)+11)); 

    It is saying that you are calling the function with $keyfile as an empty string, so $pwd is empty, so $pwd_length is 0, so
    $i % $pwd_length is dividing by zero.

    Find out where you are calling the function.
    Nothing is always absolutely so.

  7. #7
    w_d_liu1091 is offline x10Hosting Member w_d_liu1091 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    15

    Question Re: Php Script Help!

    the full code can be found here:

    http://flameup.x10.bz/files/code.txt

  8. #8
    w_d_liu1091 is offline x10Hosting Member w_d_liu1091 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    15

    Re: Php Script Help!

    you can test out the mega file manager here:

    FlameUp

    you can test the error here by trying to email a file to someone (you can use fake details but the captcha has to be correct because it dosen't work anyway):

    Email File Music.jpg
    Last edited by w_d_liu1091; 11-01-2011 at 11:57 AM.

  9. #9
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Php Script Help!

    http://x10hosting.com/terms

    a link for you.

    Please note:

    * File Hosting Every file on your site must have to do with the website you put up, we are not a file storage service and we strictly prohibit scripts such as torrentflux or rapidleech.
    So the site you are building is in violation of the T.O.S. Not to mention the fact that you will probably end up with copyright infringement too.
    Nothing is always absolutely so.

  10. #10
    w_d_liu1091 is offline x10Hosting Member w_d_liu1091 is an unknown quantity at this point
    Join Date
    Sep 2011
    Posts
    15

    Re: Php Script Help!

    I got another eregi error, please help me!

    All of the eregi in this snippet of the script is deprecated.


    //Open image
    list($width, $height) = getimagesize($image_tmp);
    if (eregi('\.jpg$', $image_tmp)){
    $image = imagecreatefromjpeg($image_tmp);
    }else if (eregi('\.gif$', $image_tmp)){
    $image = imagecreatefromgif($image_tmp);
    }else if (eregi('\.png$', $image_tmp)){
    $image = imagecreatefrompng($image_tmp);
    }else{
    RedirectMessage("upload", "Unable to read preview image. Invalid format. Supported Formats: jpg, gif, png");
    }
    $ratio = $height/$width;

    Thank You!
    Last edited by w_d_liu1091; 11-01-2011 at 12:29 PM.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 07-01-2011, 01:10 PM
  2. need a free classified script and free article content script
    By indians in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 12-16-2010, 06:17 AM
  3. [PHP] Script terminating in middle of script for no reason
    By jkmaster9918 in forum Programming Help
    Replies: 2
    Last Post: 04-09-2010, 05:08 PM
  4. 50 Credits for Bash Script/Php Script
    By javajenius in forum The Marketplace
    Replies: 0
    Last Post: 04-21-2008, 10:40 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers