Jump to content

Patriot

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by Patriot

  1. Haha that did the trick! Thanks!
  2. Thanks for helping. I'm having trouble with the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php $image = imagecreatefrompng("images/esuom.png"); if(!$image) die("Error loading image."); $text_color = imagecolorallocate($image, 13, 37, 62); $x = 100; $y = 30; $fontsize = 12; $fontfile = "fonts/VAG Rounded BT.ttf"; $text = "Hello World!"; imagettftext($image, $fontsize, 0, $x, $y, $text_color, $fontfile, $text); header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> </body> </html> I have it uploaded here: http://imobworld.com/dynamicsigs/ Does anyone know what's wrong? Thanks, Gil
  3. Haha it worked like a charm. THANK YOU SOOO MUCH!
  4. Here you go: Thanks! Gil
  5. The gift on the right side is dynamically placed on the background using image copy. Before the copy, the image of the gift looks fine. Now it loses color and turns pinkish. CODE: $banner = imagecreatefromgif("tbg1.gif"); $prizeimage = imagecreatefromgif("tgt1.gif"); $fontcolor = imagecolorallocate($banner, 0, 0, 0); imagettftext($banner, 13, 0, 7, 74, $fontcolor, "myriadregpro.otf", "Stuff: " . $prize); imagecopyresampled($banner, $prizeimage, 312, 4, 0, 0, 84, 97, 84, 97); Does anyone know what is wrong?
  6. Yes, they're both gif's... the other used to be PNG but we changed it (that's just the old version, the messed up images are based on the new version). Any ideas?
  7. It's all .gif... Thanks for the reply! (the top one is now .gif... it just wasn't when I uploaded that) Any idea why it's not working?
  8. What our page does is takes a background and places a picture of a gift on it using imagecopy. We also tried the imagecreatetruecolor function, but that didn't work either; if you know anything about it, please post. Background: .gif, 400 * 105 Gift: .gif, 84 * 97 ================================== Examples: ================================== Separated images: ================================== Does anyone know why the prize is losing color/resolution when placed on the background? Thanks, Gil
  9. The following code: $banner = imagecreatefromgif("backgrounds/sigt" . rand(1,6) . ".gif"); $prizeimage = imagecreatefromgif("prizes/ps3.gif"); $fontcolor = imagecolorallocate($banner, 0, 0, 0); imagettftext($banner, 13, 0, 7, 73, $fontcolor, "MyriadPro-Regular.otf", "Freebie: " . $prize); imagecopy($banner, $prizeimage, 312, 4, 0, 0, 84, 97); Selects a random background and writes text on it. While the text should be black, it is becoming partially transparent on some backgrounds, making it gray or almost invisible. Does anyone know why this is? Thanks!
  10. Thanks for the reply! I'm taking the iPod and placing it on the background. It seems to be losing quality when it is placed on the background, as you can see in the first image. The colors on the iPod have degraded.
  11. Sorry, it got messed up. Here's the image:
  12. The following iPod Touch is placed on the image with imagecopy. The code is: // selectPrizeImage() is a function that tells it which image to use for the freebie, don't worry about that. $prizesimage = imagecreatefrompng(selectPrizeImage($prizenumber)); imagecopy($banner, $prizesimage, 303, 0, 0, 0, 97, 105); Does anyone know why the quality is so poor?
  13. Hey, I saw you were helping people with mod_rewrite and was wondering if you could please help me. This works fine: RewriteEngine On RewriteBase / RewriteRule ([0-9]+).png sig/index.php?g=$1 And this one doesn't... (loads a smarty tpl file for some reason.) RewriteEngine On RewriteBase / RewriteRule ([0-9]+).html tutorials/promo-page.php?p=$1 I have everything placed in the respective folders correctly. Any ideas? Thanks, Gil
  14. Haha thanks everyone! mod_rewrite did the trick! Ex: http://freebiemachine.com/images/sig/100.png Change 100 to whatever you want
  15. I mean if someone goes to image.png, not .php, it will show the generated image. For example site.com/imageinfo/image.png Ex: http://www.3604free.com/goods/14430203.png
  16. The following works fine if I go to that php page, but I was wondering how I can go to an image file and see that, such as banner.png ============================================================== <?php /* Now for the GD stuff, for ease of use lets create the image from a background image. */ $banner = imagecreatefrompng("sigbackground.png"); /* Lets set the colours, the colour $line is used to generate lines. Using a blue misty colours. The colour codes are in RGB */ $goal = $_GET['g']; $black = imagecolorallocate($banner, 0, 0, 0); imagestring($banner, 5, 20, 10, "Current Freebie Goal: " . $goal, $black); imagestring($banner, 5, 20, 20, "sup", $black); /* Output the image */ header("Content-type: image/png"); imagepng($banner); ?>
  17. I've been trying to create a RegExp using eregi that will allow spaces and letters. When I test it with the online regex testers, everything comes out fine. My site then comes up with different results. ^[a-z\s]+$ For example: United Kingdom doesn't work, while Canada does. Anyone know why this isn't working? Thanks!
  18. Thanks for looking. I have the following questions. QUESTION 1: I usually just use session variables, but I have decided to use cookies this time. Should I encrypt the password and username of the user before I store it as a cookie? What is the best way to destroy a cookie? QUESTION 2: How can I make the URL have a default variable such as "testsite.com/jon" where it will connect to the database and pull up information about a person named jon as opposed to making the url "testsite.com/?username=jon"? Thanks! Gil
  19. I don't really know much about regex and PHP... how can I search a string to make sure it ONLY has letters (uppercase or lowercase) and numbers, and then return a bool answer? Thanks, Gil
  20. ??? Thanks, I didn't even think of this. For some reason, it seemed like people couldn't edit PHP files (wow, I need to think a little more)
  21. Thanks for looking! I am making a public script and I'm wondering how the owner can edit a text file that has the name of the site. Then, when people view pages, the title will be the name of the site stored in the text file. I was going to do this with a MySQL query, but figured it makes more sense to retrieve it from a text file. Thanks, Gil
×
×
  • 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.