Jump to content

leodirk

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

leodirk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Er I couldnt find an edit button? Sorry if there is one, I'm just out of it. But anyway, if it helps at all, the IDs i want to display are 1-100 so if that makes it any easier.. Since it wont have to deal with the highest value for the ID, or being over 0..
  2. Thanks but uh, I get quite a few errors when using that and trying to fix it x.x dunno why. I'll try to fix it up some more, if I use it as is, it tells me "Parse error: syntax error, unexpected '=', expecting ';' in 'location' on line 21"
  3. Its basically just <?php SQL login here $sql="SELECT * FROM $tbl_name ORDER BY id ASC"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ if ($rows['id'] > 0){ echo $rows['name']; echo "<br>"; } } mysql_close(); ?>
  4. Ok well basically I have a table that lists a ton of items in it which have a name, and ID and some other things. I am trying to get it to repeat the whole list of them ordered by the ID, but because not every number for the ID is used I want to display "Empty" or something for each time there is not an item with that ID. I know it is most likely some pretty easy script but I have been off lately with my PHP scripting x.x.. Thanks.
  5. Yea it just displays the url to the php image when the "imagettftext($image, 15, $angle, 200, 25, $red, $font, $name);" line is in it. And nope the whole php file is just <?php $host="localhost"; $username=""; $password=""; $db_name=""; $tbl_name=""; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $id=$_GET['id']; $sql="SELECT * FROM $tbl_name WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); header('content-type: image/jpeg'); $image_path= "images/thumbs/"; $url= $image_path . $rows['pic']; $watermark = imagecreatefrompng('watermark.png'); $watermarks = imagecreatefromjpeg($url); $watermark_width = imagesx($watermarks); $watermark_height = imagesy($watermarks); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg('classes.jpg'); $size = getimagesize($url); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopy($image, $watermarks, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); $name = $rows['name']; $font = "Verdana.ttf"; $angle = '0'; $red = imagecolorallocate($image, 255, 0, 0); imagettftext($image, 15, $angle, 200, 25, $red, $font, $name); imagejpeg($image); imagedestroy($image); imagedestroy($watermarks); imagedestroy($watermark); ?> and thats all thats in it.
  6. Weird cause it really isn't working for me lol x.x. I even copied your code exactly and renamed images for it and it did the same thing for me. Could it be some settings or something? I have no idea..
  7. Ah.. Still can't get it to work x.x
  8. when i put it back in, with the font in the folder with it all it says is the url back, "http://192.168.1.130/tbc/viewimage.php?id=7"
  9. Any help? =s still can't find out what will print text on that image bigger than font 5..
  10. lol sorry, here it is. The output is a sheet for a class the store has, with the image of the project/the watermark somewhere (its current location isnt where it should be, ill fix that later). And I need to display the name of the class at the top, and some other information down the rest of the sheet. <?php $host="localhost"; $username="username"; $password="password"; $db_name="db"; $tbl_name="tbl"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $id=$_GET['id']; $sql="SELECT * FROM $tbl_name WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); header('content-type: image/jpeg'); $image_path= "images/thumbs/"; $url= $image_path . $rows['pic']; $watermark = imagecreatefrompng('watermark.png'); $watermarks = imagecreatefromjpeg($url); $watermark_width = imagesx($watermarks); $watermark_height = imagesy($watermarks); $image = imagecreatetruecolor($watermark_width, $watermark_height); $image = imagecreatefromjpeg('classes.jpg'); $size = getimagesize($url); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopy($image, $watermarks, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); imagecopy($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height); //below was just basically me testing out random imagettftext and imagestring commands. $name = $rows['name']; $font = "verdana.ttf"; $angle = '0'; $red = imagecolorallocate($image, 255, 0, 0); //imagettftext($image, 16, $angle, $x, 35, $colour1, $font, $name); //imagettftext($image, 20, 0, 10, 20, $black, $font, $name); //imagestring($image, 5, 200, 0, $name, $black); imagejpeg($image); imagedestroy($image); imagedestroy($watermarks); imagedestroy($watermark); ?>
  11. Thanks I got the two images to work fine but I can't seem to get the text working how I want it to. If I use imagestring() the font wont get bigger than font size 5 which is too small for what I am doing. And when I try to use imagettftext() the image just wont load. I've tried a ton of various things I found off the internet but none of it is working for me. Oh and just in case it may help, the images are merged with imagecopy() because imagecopymerge() wont support png-24.
  12. Still can't figure this out =s.
  13. Alright so I am working on my mother's work website and I need to be able to make a image with php that uses the same default background image, text from the database depending on which page they are viewing, and a picture also from the database that is generated dependent on the ID of the page. Sorry if that doesn't make any since it is kind of hard for me to describe. It would be awesome if someone could contact me about it on AIM or MSN if they wanted seeing how i have questions/problems with coding it a lot. It is my first self built website anyway. Thanks.
  14. Ok for whatever reason I can't figure this out and it seems like it would be fairly easy to me, maybe its because I'm tired. Ok I am coding a website for my mom's new shop and basically there is a class list and a calendar that list the classes on what day they are taught. I can get the site to add the class into the database fine and the classes on the calendar for what date they should be. But I tried adding onto the page I add new classes on to have an option to add it to the calendar too. The thing is is the calendar calls the class by the classes ID which increments up by 1 for each new class automatically. The classes are stored in the 'classes' table and the calendar in 'events' and I just can't figure out how to get the page to post the new classes data while getting the new ID and posting it along with the class time/date. Sorry if this doesn't make much sense I'll try to post scripts/more later just too tired to now.. Thanks.
×
×
  • 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.