Jump to content

Rojay

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by Rojay

  1. <?php header ("Content-type: image/jpg"); $img_handle = ImageCreate (230, 20) or die ("Cannot Create image"); $back_color = ImageColorAllocate ($img_handle, 0, 10, 10); $txt_color = ImageColorAllocate ($img_handle, 233, 114, 191); ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color); ImagePng ($img_handle); ?> youre sending the headers as jpg but outputting png.. you either change the header to png or the output to jpg
  2. the code i gave him will do the same exact thing -only and if only http://example.com tried to access the file, the file will be sent unparsed/raw else send the normal output
  3. fromt he example on php.com put this code in image.php <?php // File and new size $filename = 'images/click.jpg'; //$percent = 0.5; // Content type header('Content-type: image/jpeg'); // Get new sizes //list($width, $height) = getimagesize($filename); //$newwidth = $width * $percent; //$newheight = $height * $percent; // Load $thumb = imagecreatetruecolor($_GET['width'], $_GET['height']); $source = imagecreatefromjpeg($filename); // Resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb); ?> and this code in form.php <b>Resized image</b> <? echo "<img src='image.php?width=".$_POST['width']."&height=".$_POST['height']."'>"; ?>
  4. <? if( $_SERVER['HTTP_REFERER'] == 'http://www.example.com') { echo file_get_contents($_SERVER['SCRIPT_FILENAME']); exit(); } ?> just replace http://www.example.com with the actual URL... the FULL URL
  5. http://www.php.net/manual/en/function.imagecopyresized.php
  6. curl still uses http requests which will send the output html i recommend to add a line at the begining of the PHP file like this <? if( $_SERVER['HTTP_REFERER'] == 'http://example.com') { echo file_get_contents($_SERVER['PHP_SELF']); exit(); } ?>
  7. what are the steps that i should folow to run a (child)thread from the parent process ?
  8. ohh then use php. you konw how to load data from the database,right? then use $short_desc = substr($description, 0, 250); echo $short_desc." <a href='profile.php?user_id=".$user_id."'> View profile</a>"; hope that helps
  9. okay. can you tell me exactly what are you trying to do ?? like you have page1 and there is a list of short descriptions and when you click on one it send you to another page with the full description and other information about the user? or it is more like a youtube kind of a thing like you one description per page but you dont want to the description to take the whole page so you want to display the first 250 and when the user clicks for example (View full desc.) it shows the full description?
  10. it can be done using php but why?? if youre going to do it using php that means that you will load another page with the full description. With JavaScript you can just send the short description using php and make a javascript/ajax function that loads the rest upon request.
  11. use a single qoute '<a href="http://www.xxxxxxxxx.com/partners/links/cards/details.asp?id=5&tempid=330133">';
  12. start with this http://www.php.net/file_get_contents AND http://www.php.net/manual/en/function.explode.php
  13. you uploaded the file on the server then you used localhost/ ?? how?? shouldn't you be using the domain name?
  14. hmm is your server also running the same OS as you are?
  15. well thats why you need to set the header the first thing header ("content-type: text/xml"); try to add this before echo-ing anything another thing is renaming the file to xml and create ".htaccess" file and put this in it <Files ~ "^[^\.]+$"> SetHandler application/x-httpd-php </Files> AddHandler application/x-httpd-php .xml but all the xml files in this directory will be treated as php files
  16. there is none for MSN but there is for AIM: aim:goim?screenname={SCREENNAME}&message=Hi.+Are+you+there?
  17. you might also try to send the header() for the XML so your browser would recognize it unless of course your page is .xml
  18. use $_SERVER['HTTP_REFERER'] to check the page that send them to the file if its not your domain then display an error message
  19. use this http://www.php.net/function.mysql-data-seek
  20. well you can put them in XML format and use SimpleXML to load them http://www.php.net/manual/en/ref.simplexml.php
  21. what do you mean the data is only accessed once? like one SQL query?
  22. thats easy the firs file should look like this $load = 1; $menu_item="General" then in the other file use include("file_path");
  23. http://www.php.net/manual/en/ref.simplexml.php as simple as it can be
  24. okay let's say you have three images that you want to be placed on each other first you create an image resource $im1 = imagecreatefromjpeg("img1.jpg"); $im2 = imagecreatefromjpeg("img2.jpg"); $im3 = imagecreatefromjpeg("img3.jpg"); now you want to place $im2 on $im1 where $x,$y is the position which you want to place $im2 knowing that the origin is at the top left corner and $x1,$y1 is the point where you want to start the copying probably it will jsut be 0,0 to copy the whole image imagecopyresampled ($im1, $im2, $x, $y, $x1, $y1, imagesx($im1), imagesy($im1), imagesx($im2), imagesx($im2) ) and repeat with $im3 as for transperancy you can use where $im1 is the image resource and $color is an RBG color created using imagecolorallocate($im1,255,255,255) imagecolortransparent($im1,$color)
×
×
  • 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.