rmccarter721's Profile
Reputation: 8
Worker
- Group:
- Contributor w/DIC++
- Active Posts:
- 139 (0.07 per day)
- Joined:
- 10-September 07
- Profile Views:
- 5,884
- Last Active:
Jun 28 2012 05:44 AM- Currently:
- Offline
Previous Fields
- Country:
- IE
- OS Preference:
- Windows
- Favorite Browser:
- Chrome
- Favorite Processor:
- AMD
- Favorite Gaming Platform:
- PC
- Your Car:
- Who Cares
- Dream Kudos:
- 75
Latest Visitors
-
modi123_1 
30 Sep 2011 - 12:13 -
EnvXOwner 
08 Jan 2011 - 18:02 -
nehaarti 
01 Sep 2010 - 01:03 -
macosxnerd101 
27 Aug 2010 - 07:36 -
baljitsingh 
26 Aug 2010 - 23:43
Posts I've Made
-
In Topic: unexpected T_VARIABLE
Posted 25 Jun 2012
I changed the structure of the function and now it works. For reference new structure.
function saveImage($loc,$name,$ref,$caption){ // *** Get extension $db = new DB(); $checkName = $db->Query("SELECT * FROM `lik_photos` WHERE `lik_photos`.`ptName` = \"".clean_input($ref)."\""); if(mysql_num_rows($checkName) == 0){ $extension = strrchr($loc.$name, '.'); $extension = strtolower($extension); $name = date(zY) . hash('crc32',$name); switch($extension) { case '.jpg': case '.jpeg': if (imagetypes() & IMG_JPG) { imagejpeg($this->thumb, $loc.'/thumb/'.$name.$extension, 70); imagejpeg($this->image, $loc.'/full/'.$name.$extension, 100); } break; case '.gif': if (imagetypes() & IMG_GIF) { imagegif($this->thumb, $loc.'/thumb/'.$name.$extension); imagegif($this->image, $loc.'/full/'.$name.$extension); } break; case '.png': if (imagetypes() & IMG_PNG) { imagepng($this->thumb, $loc.'/thumb/'.$name.$extension, 3); imagepng($this->image, $loc.'/full/'.$name.$extension, 0); } break; default: break; } #TODO:ERROR Check for Same named image $db->Query("INSERT INTO `lik_photos` (`ptName`,`ptCaption`,`ptURL`) VALUES (\"".clean_input($ref)."\", \"".clean_input($caption)."\", \"".$name.$extension."\")"); imagedestroy($this->thumb); imagedestroy($this->image); } else{ imagedestroy($this->thumb); imagedestroy($this->image); header('Location: page/admin/uploadPhotos/errorNameAlreadyUsed'); exit; } } -
In Topic: unexpected T_VARIABLE
Posted 25 Jun 2012
Here is the entire function
function saveImage($loc,$name,$ref,$caption){ // *** Get extension $extension = strrchr($loc.$name, '.'); $extension = strtolower($extension); $name = date(zY) . hash('crc32',$name); switch($extension) { case '.jpg': case '.jpeg': if (imagetypes() & IMG_JPG) { imagejpeg($this->thumb, $loc.'/thumb/'.$name.$extension, 70); imagejpeg($this->image, $loc.'/full/'.$name.$extension, 100); } break; case '.gif': if (imagetypes() & IMG_GIF) { imagegif($this->thumb, $loc.'/thumb/'.$name.$extension); imagegif($this->image, $loc.'/full/'.$name.$extension); } break; case '.png': if (imagetypes() & IMG_PNG) { imagepng($this->thumb, $loc.'/thumb/'.$name.$extension, 3); imagepng($this->image, $loc.'/full/'.$name.$extension, 0); } break; default: break; } #TODO:ERROR Check for Same named image $db = new DB(); $checkName = $db->Query("SELECT * FROM `lik_photos` WHERE `lik_photos`.`ptName` = \"".clean_input($ref)."\""); if(mysql_num_rows($checkName) == 0){ $db->Query("INSERT INTO `lik_photos` (`ptName`,`ptCaption`,`ptURL`) VALUES (\"".clean_input($ref)."\", \"".clean_input($caption)."\", \"".$name.$extension."\")"); imagedestroy($this->thumb); imagedestroy($this->image); } else{ imagedestroy($this->thumb); imagedestroy($this->image); header('Location: page/admin/uploadPhotos/errorNameAlreadyUsed'); exit; } }
ps. The next step I plan to do is change my queries to PDO ones -
In Topic: Turning Blog/Forum Posts into Packets to store
Posted 30 Sep 2011
Ah ok, that makes sense now..
Cheers -
In Topic: Recommended Technology Sites/Articles/Blogs
Posted 5 Jun 2011
Thanks for placing this in the correct place, but I am actually looking for more the likes of sites that other users check regularly for industry related articles etc.
My Information
- Member Title:
- D.I.C Head
- Age:
- 20 years old
- Birthday:
- May 13, 1993
- Gender:
-
- Location:
- Ireland
- Full Name:
- Ryan McCarter
- Years Programming:
- 4
- Programming Languages:
- html, css, php, mysql
Contact Information
- E-mail:
- Click here to e-mail me
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
rmccarter721 has no profile comments yet. Why not say hello?