+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
Like Tree5Likes

Thread: Php Script Help!

  1. #11
    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!

    You didn't seem to get the message.

    File uploading/sharing scripts are not allowed on x10hosting.
    Nothing is always absolutely so.

  2. #12
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Php Script Help!

    Rather than asking for help every time you get a warning about the deprecated POSIX regex functions, read the PHP manual page on the differences between POSIX and PCRE regexes and learn to do the conversion yourself. It's not hard at all.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #13
    sonicx.forums65 is offline x10Hosting Member sonicx.forums65 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    5

    Re: Php Script Help!

    Quote Originally Posted by w_d_liu1091 View Post
    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!
    try
    PHP Code:
    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

  4. #14
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Php Script Help!

    @sonicx.forums65: suppressing warnings only works in the short term. Long term, calls to the POSIX regex functions need to be replaced with PCRE. See "PHP 5.3 Help" for more.

    Not that it matters much to the OP, since his site breaks X10's terms of service. Others with the same issue, however, will need the long term solution.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread
Page 2 of 2 FirstFirst 12

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