tippy_102
Members-
Posts
446 -
Joined
-
Last visited
Never
Everything posted by tippy_102
-
[SOLVED] how to properly use a config.php file?
tippy_102 replied to xiao's topic in PHP Coding Help
Here is the information on using constants: http://ca.php.net/constants -
Rename photo upload with member ID number
tippy_102 replied to dmagyar's topic in Third Party Scripts
Do the members have to be logged in to upload a file? If so keep their member id in a session and retrieve it for the file name. -
You could use if statements, or something like this... switch ( $p[4] ) { case 'UK' : ....do whatever... break; case 'Canada' : ....do whatever... break; default : ...catch all for countries you haven't accounted for... break; }
-
help direction, change dropdown search to checkbox
tippy_102 replied to msin147's topic in Third Party Scripts
This is beyond my abilities (or lack thereof), so hopefully someone else will jump in and show us how to attack this problem. -
Have you looked at fpdf? http://www.fpdf.org/
-
Search for "php watermark" in google and you'll see that it definitely is possible.
-
help direction, change dropdown search to checkbox
tippy_102 replied to msin147's topic in Third Party Scripts
You need to show is the part that contains the mysql_query. -
That looks very nice but why use tables for layout? CSS is much more versatile.
-
The top 2 look very nice but they load quite slowly. Also, you used tables - all the cool kids are using CSS for layout now. The HABIB DECOR site doesn't match the quality of the others, and the perspective is not correct with the nav bar items between the columns.
-
help direction, change dropdown search to checkbox
tippy_102 replied to msin147's topic in Third Party Scripts
You will have to change your form and your mysql_query so it searches the multiple values. If you post some code it might be easier to explain. -
If you want to do it yourself, have a look at php's SimpleXML functions: http://ca.php.net/manual/en/ref.simplexml.php or grab a copy of SimplePie (http://simplepie.org/) and you'll be reading feeds within a few minutes.
-
Check that your path is correct for getimagesize - $dimensions = getimagesize("http://www.x.com/uploads/charlie.gif"); If you're using a gif file, you have to use imagecreatefromgif
-
If you want to display the file instead of saving it.... header("Content-type: image/png"); imagepng($canvas);
-
[SOLVED] Unable to POST all the sudden...
tippy_102 replied to jdorenbush's topic in PHP Coding Help
Unless I'm overlooking something, you haven't told INSERT which columns to insert into. -
This should get you started.... <?php header('content-type: image/jpeg'); $original_image = "image.jpg"; $watermark = imagecreatefrompng('watermark.png'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg($original_image); $size = getimagesize($original_image); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?>
-
function FriendlyDate($SqDate) { list($Year,$Month,$Day) = split('-',$SqDate); //Remove the '-' from the standard MySQL date format //check to see if year is NULL or 0000 if so, lets not print anything if (($Year == "0000") or ($Year == NULL)) { $realDate = ""; } ELSE { $stampeddate = mktime(12,0,0,$Month,$Day,$Year); //Create a UNIX style timestamp from the result $realDate = date("M d, Y",$stampeddate); //Format the UNIX timestamp } $realDate = str_replace (" ", " ", $realDate); return $realDate; }
-
Someone solved this a few days ago. Perhaps their solution will help you: http://www.phpfreaks.com/forums/index.php/topic,190882.0.html
-
Hard to say without seeing your entire code, but here's what I use: <?php // creates a copy of a selected chunk of image.jpg $filename= "image.jpg"; list($w, $h, $type, $attr) = getimagesize($filename); $src_im = imagecreatefromjpeg($filename); $src_x = '0'; // begin x $src_y = '0'; // begin y $src_w = '100'; // width $src_h = '100'; // height $dst_x = '0'; // destination x $dst_y = '0'; // destination y $dst_im = imagecreatetruecolor($src_w, $src_h); $white = imagecolorallocate($dst_im, 255, 255, 255); imagefill($dst_im, 0, 0, $white); imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); header("Content-type: image/png"); imagepng($dst_im); imagedestroy($dst_im); ?>
-
GD and imagettftext() - center variable length string
tippy_102 replied to Beauford's topic in PHP Coding Help
Try this: <?php $text = "Center This Text!"; $image = "image.jpg"; $font = "arial.ttf"; $font_size = "25"; $image_2 = imagecreatefromjpeg($image); $black = imagecolorallocate($image_2,0,0,0); $image_width = imagesx($image_2); $image_height = imagesy($image_2); $text_box = imagettfbbox($font_size,$angle,$font,$text); $text_width = $text_box[2]-$text_box[0]; // lower right corner - lower left corner $text_height = $text_box[3]-$text_box[1]; $x = ($image_width/2) - ($text_width/2); $y = ($image_height/2) - ($text_height/2); imagettftext($image_2,$font_size,0,$x,$y,$black,$font,$text ); header ("Content-type: image/png"); imagejpeg($image_2); ?> -
Red text on medium grey is never a good idea, and the blue link on grey is really hard to see. I really like the header.
-
Maybe it's my monitor, but that black text on light blue is hard on the eyes.
-
I had this little snippet tucked away. It should help you. <?php $path = "gal"; echo "Folder $path = ".filesize_r($path)." bytes"; function filesize_r($path){ if(!file_exists($path)) return 0; if(is_file($path)) return filesize($path); $ret = 0; foreach(glob($path."/*") as $fn) $ret += filesize_r($fn); return $ret; } ?>
-
Help me to download and install php.
tippy_102 replied to junaidjee's topic in PHP Installation and Configuration
Download the installer - it's the easiest set-up. They have forums as well: http://www.apachefriends.org/f/ -
Help me to download and install php.
tippy_102 replied to junaidjee's topic in PHP Installation and Configuration
I use xampp with windows. You can download xampp from: http://www.apachefriends.org/en/xampp.html It contains an installer so it is a simple process. -
Code from scratch or use an existing toolkit?
tippy_102 replied to kendhal's topic in PHP Coding Help
Unless you are doing this project for the learning experience, there is no sense re-inventing the wheel, so I'd say use existing code to speed up production.