Jump to content

GregL83

Members
  • Posts

    119
  • Joined

  • Last visited

    Never

Posts posted by GregL83

  1. yea... no its not installed.

     

    I downloaded the imagick-2.2.1 but I don't have a .dll file... I am wondering if I might need to compile this or something? I have never done anything like that before.

     

    The installation instructions I have found are definately not for noobs...

  2. Me neither... I was wondering if there is a memory leak or something.  I have done the calculations and a uncompressed version should not come near 50MB let alone 80+.

     

    I am speaking with my web host now and trying to find out how to install a php extension i.e. imagick.  I have never installed an extension and the instructions look like chinese to me... Any simple informative guides not from php.net or pecl?

  3. i find it good practice to write a query like so when using variables:

    $query = "SELECT username FROM members WHERE user_id = '".$uid."'";

     

    try doing this:

     

    mysql_select_db("$db_name") or die("Could not find database");
          $uid = $_GET['uid'];  // Added to get the id from the URL
          $query = "SELECT username FROM members WHERE user_id = '".$uid."'";
          echo $query; // see what the query looks like
          exit; //stop script
          $result = mysql_query($query) or die(mysql_error()); // Added or die for debugging

     

    you should always learn to echo back a query if it is not working correctly...sometime you find that the $uid variable isn't gettting inserted into the query properly.

     

    let us know what you find.

  4. I downloaded a larger jpeg file. The properties are as follows...

     

    ext: .jpg

    size: 3.71 MB

    w: 3648 px

    h: 2736

    h-res: 72 dpi

    v-res: 72 dpi

    bit-depth: 24

     

    This image also won't upload correctly!!!!! WTF.

    Out of memory (allocated 80740352) (tried to allocate 65496 bytes)

     

    If this is a hosting issue, than I am done with PowWeb. Period.  I have had so many issue with them screwing up my settings or speaking with techies that know absolutely nothing.

     

    Why is a 3.71 MB file using 80 megs for a simple resize?  Plus the 400kb .bmp file?? This is insane.

     

    I currently have my max mem set to 300M.........

  5. I tried uploading another bitmap and ran into a different error.  The page seems to hang and never returns an error, but no image upload...

     

    This is so f'n annoying.  Nothing is worse than having the app work fine on your local machine and then it blow up online.

  6. I created an image handling script.  So far it works well; however, when I try to upload a bitmap / bmp file all hell breaks loose.

     

    The file properties are as follows:

    extension: .bmp

    size: 425,122 bytes

    width: 430 px

    height: 329 px

    horizontal res: 96 dpi

    vertical res: 96 dpi

    bit depth: 24

     

    I recieve the following error:

    Allowed memory size of 18874368 bytes exhausted (tried to allocate 16973 bytes)

     

    To uncompress or load the image I use the following:

    private function open_image($file){
    	# Php.ini Fixes
    	ini_set('memory_limit', '128M');
    	ini_set('gd.jpeg_ignore_warning', 1);
    
    	# Find correct image type and return image object
    	# JPEG:
    	$image = imagecreatefromjpeg($file);
    	if($image){return $image;}
    	# GIF:
    	$image = imagecreatefromgif($file);
    	if($image){return $image;}
    	# PNG:
    	$image = imagecreatefrompng($file);
    	if($image){return $image;}
    	# GD File:
    	$image = imagecreatefromgd($file);
    	if($image){return $image;}
    	# GD2 File:
    	$im = imagecreatefromgd2($file);
    	if($image){return $image;}
    	# WBMP:
    	$image = imagecreatefromwbmp($file);
    	if($image){return $image;}
    	# XBM:
    	$image = imagecreatefromxbm($file);
    	if($image){return $image;}
    	# XPM:
    	$image = imagecreatefromxpm($file);
    	if($image){return $image;}
    	# Try and load from string:
    	$image = imagecreatefromstring(file_get_contents($file));
    	if($image){return $image;}
    	return false;
    }

     

    I understand that in the php.ini file you have a memory limit for a particular function.  Mine was set to 18M.  I changed it to 128M in the php.ini file and the ini_set function in the code above.  Now, I get an error:

    Out of memory (allocated 81264640) (tried to allocate 16973 bytes)

     

    I can't figure out why a 430kb image needs 81+Mb to resize and save.  This makes no sense.  Also, this only happens with .bmp files.  Any GD gurus?

     

     

    Please help!!  ???

  7. I have a query where the variable id is pulled from the page url.

     

    $query = "SELECT id FROM table WHERE id = '".$_GET['id']."'";

     

    The table's id column is auto incrementing.

     

    My problem is that 1a returns the results for a record with the id 1.

    How is this possible when I am surrounding the variable in single quotes?  My expected results would be returning a row for 1 an NOT 1a...

     

    Do I need to do anything special?

  8. I am not entirely sure who the prospective audience is...

     

    But lets say these kids are trying to further their education and are applying for college.  This website screams Texas football then wallmart employment.  I think it looks good, but i tried to find some criticism to help the designer because thats what jcombs is looking for.  Check out a university level 'good' school with great sports: www.bc.edu .

     

    If I were still in high school I would hope my school would be represented by academics before sports (including the look and feel of the website that is public access).

  9. I like it, but i will play devils advocate.

     

    Most high school sites i have seen are not boring by poor design.  They are supposed to have a business feel and look.  As are business sites, financial sites, and university sites.

     

    I like the look, but I think for a high school site it could look less like espn.com or ign.com and more like a high school site.  Maybe a good medium?

  10. I know there are tutorials out there and I have read some, but I am having trouble figuring out which direction to go.  I want to track users and guests.  I need to display the number of users online and the number of guests online.  Also, some pages will show which users and how many guests are viewing the current pages.  PHPfreaks uses this tech.

     

    I have found tutorials that do this using a mysql database and timeouts.  I have also seen this done using sessions variables and session_save_path().  Session save path can tell when a user closes connections to the website and is apparently faster than connecting to the database, but setting the timeout of session variables can destroy other important session variables.  Using the mysql method has issues as well.  The accuracy is dependent on the timeout value.  If too long, then some users could have left your site 30 minutes ago but will still appear as an online user viewing a page.  Also,  if too short the user may still be reading a page or browsing a page but will be reported as offline after the session timeouts.

     

    Which is the best way to do this?  A combination?  I want this information to be accurate.  Are there any tutorials I might have missed?

  11. The problem is the zipcode databases I have seen DO NOT have unique identifiers.

     

    A zipcode can have more than one city.  See the sample download I provided.

     

    That rules out using an id to determine if an update is needed.  Also, changes are not listed.

    So when:  02134 | Bostun | MA is in the database table instead of 02134 | Boston |MA

    You cannot determine that was a change and not an additional city belonging to 02134 zipcode.

     

     

    Hence my problem.  Has anyone successfully used zipcode tables to map locations?  And updated the tables?

  12. How would you determine an update vs. an addition?

    For example:

     

    Old Table:

    1 | 02134 | Boston | MA

     

    New Database of Zipcodes (boston changes the city name to bostun):

    02134 | Bostun | MA

     

    My new table would come out like:

    1 | 02134 | Boston | MA

    2 | 02134 | Bostun | MA

     

    All locations still linking to ID 1 would be wrong (outdated).  Also, old cities (bad data) would be stored??  Or is the zipcode unique to one city?  I thought you could have a zip code that is existent for 2 different adjacent cities...

  13. Does that mean I need to add logic for every record?  Update or add if necessary...  I was thinking there would be a way to drop all records and insert the newer zipcode database as a replacement.  That would keep the organization of the zipcode database.  There are over 42,000 records for the US.  I could do this with a cron job...

     

    Sites that have other countries and provinces do it this way?  With so many records and needing to run logic I feel like there is a better way.

     

    A sample database is:

    http://www.download.com/USA-5-digit-ZIP-Code-Database-Premium-Edition/3000-2210_4-10679966.html?part=dl-USA5digit&subj=dl&tag=button&cdlPid=10679967

     

    That is from http://www.zipcodedownload.com

×
×
  • 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.