Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. If its Width ways then your need to use a Div or something to force a word wrap if its length ways.. then the browser should take care of ie.. eitherway its not a "PHP" problem but more s CSS problem (if i understand you correctly)
  2. you need to use a php script in replacement of an image BUT you still need to write the HTML to use it as an image ie <?php header("Content-type: image/png"); $name = $_GET['text']; # get value for name... $im = imagecreatefrompng("background.png"); $white = imagecolorallocate($im, 255, 255, 255); #loads font $font = "ariblk.ttf"; # this is for name imagettftext($im, 14, 0, 300, 315, $white, $font, $name); imagepng($im); imagedestroy($im); ?> save that as image.php now the image to use that would be <img src="image.php?name=Hello"> **untested
  3. you can not output html into the image.. <?php ### when the user presses the submti button then use gd functions... if (isset($_POST['submit'])) { header("Content-type: image/png"); $name = $_POST['text']; # get value for name... $contact = $_POST['contact']; # get value for contact... $product = $_POST['product']; # get value for product... $price = $_POST['price']; # get value for price... $description = $_POST['description']; # get value for price... $im = imagecreatefrompng("background.png"); $white = imagecolorallocate($im, 255, 255, 255); #loads font $font = "ariblk.ttf"; # this is for product // imagestring($im, 5, 190, 20, $product, $white); imagettftext($im, 18, 0, 10, 40, $white, $font, $product); # this is for description... $text = $description; $new_text = wordwrap($text, 15, "\n", true); imagettftext($im, 18, 0, 10, 90, $white, $font, $new_text); # this is for name //imagestring($im, 5, 300, 300, $name, $white); imagettftext($im, 14, 0, 300, 315, $white, $font, $name); # this is for contact number //imagestring($im, 5, 300, 320, $contact, $white); imagettftext($im, 14, 0, 300, 340, $white, $font, $contact); # this is for price //imagestring($im, 5, 370, 80, $price, $white); imagettftext($im, 17, 0, 363, 88, $white, $font, $price); imagepng($im); imagedestroy($im); exit; //<--ADDED this stops the html loading after the post! } ?> <html> <head> <meta name="Rexcel Cariaga" content="Interactive PNG Creation" /> <title>Untitled Document</title> </head> <body> </body> </html>
  4. 1. Welcome to the board. The problem with readfile is that it read the whole file into memory.. which with large files can be a problem, 2. try this updated code <?php $file = "C:/path/to/files/filename.zip"; $fname = "File.zip"; set_time_limit(0); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); #header("Content-Type: application/force-download");//removed #header("Content-Type: application/x-download");//try header('Content-Type: application/octet-stream'); //I used header("Content-Transfer-Encoding: binary");//added header("Content-Disposition: attachment; filename=\"$fname\""); header("Accept-Ranges: bytes"); header("Content-Length: ".filesize($file)); header("Content-Description: File Transfer"); //@readfile($file); readfile_chunked($file); //updated //added function readfile_chunked($filename,$retbytes=true) { $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $cnt =0; // $handle = fopen($filename, 'rb'); $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); echo $buffer; ob_flush(); flush(); if ($retbytes) { $cnt += strlen($buffer); } } $status = fclose($handle); if ($retbytes && $status) { return $cnt; // return num. bytes delivered like readfile() does. } return $status; } ?>
  5. also this sounds like a html/css problem not PHP.. but same here.. i'm not reading all that!
  6. Me persaonlly i would use something like Camtasia, and create flash/videos..
  7. using ereg your want this <?php //valid //$field='111-22-3333'; //$field='111-2-3333'; //$field='111--3333';// as you have up to two digest if (eregi('^[[:digit:]]{3}\-[[:digit:]]{0,2}\-[[:digit:]]{4}$', $_POST['socials'])) { echo 'Valid Social Security Format'; }else{ echo 'Invalid Social Security Format'; } ?> <form method="post" action="test.html" name="number1"> Social Securtiy <input type="text" name="socials" id="socials" /> <input type="submit" value="Submit" name="Submit" /> </form> ?>
  8. Glade you got it working sorry for late replie.. if this is fixed can you click tpoic solved..
  9. you don't need the do unless you have the condition at the end of the loop.. as you need the condition at the start (to set $row_rs5) do is unneed.. as for the results i have to assume their are connect.. you could try this echo $query_rs5; //<--Add this while ($row_rs5 = mysql_fetch_assoc($rs5)) then copy the statement into PMA and run it..
  10. okay as your not telling us the error i'll guess.. its on this line imagecopymerge($im, $secondim, 0, 0, 15, 15);; //<-Right ? Now i can see 2 problems with that.. 1. you have 2 ;;'s 2. read the manual for the imagecopymerge sorry but if you won't make an effort then why should i!
  11. rs5 will neverend, as it starts the search over evertime /// code on page /// <?php /*MOVED out of loop*/ mysql_select_db($database_connDW, $connDW); $query_rs5 = "SELECT * FROM restaurant_comments WHERE rating_id = '$commentid'"; $rs5 = mysql_query($query_rs5, $connDW) or die(mysql_error()); $row_rs5 = mysql_fetch_assoc($rs5); $totalRows_rs5 = mysql_num_rows($rs5); while ($row_rs5 = mysql_fetch_assoc($rs5)) { $cmessage = $row_rs5['message']; $cname = $row_rs5['name']; $ccreated = $row_rs5['created']; ?> <p><strong><?php echo $cname ?></strong> comments <br> <?php echo $ccreated ?><br> <?php echo $cmessage ?></p> <?php } mysql_free_result($rs5); ?> **UPDATED.. try the above
  12. Humm okay i think you wany this!! $temps = array( 'FORM_ACT' => "<?php echo $_SERVER['PHP_SELF']; ?>" );
  13. Create a new image palette (imagecreate) then merge the image into it imagecopymerge
  14. Okay.. so what are we talking..?
  15. welcome, just click topic solved bottom left
  16. What! you lost me.. you don't want php code in their.. so you added php code !!
  17. i don't see how.. your not saving the image!
  18. if(ereg("^".$_GET['search'], $value)) add ^ at the start
  19. thats like saying "the door is green, is the door green?" but i assume you mean this <?php $temps = array( 'FORM_ACT' => $_SERVER['PHP_SELF'] ); ?>
  20. erm.. maybe this <?php $im= imagecreatefromgif("images/".$_GET['img']); //Image i want to use ?>
  21. So whats the question ?.. sounds like you just want someone to add code and explain it step by step ! also how urgent is this ?
  22. okay i had a ton of questions.. but instead.. i thought i'll create an example and you could add it to your code.. hope this helps (added comments to help) <?php //Where are we starting from $StartDir = dirname(__FILE__)."/FileStuff/"; //What folder are we in (follow from above) $SubPath = (isset($_GET['dir']))?$_GET['dir']:""; //create folder if(isset($_GET['mk'])) { //Check it doesn't already exist mkdir($StartDir.$SubPath."/".$_GET['mk'],0777); } //List files if ($handle = opendir($StartDir.$SubPath."/")) { while (false !== ($file = readdir($handle))) { //don't list . or .. if ($file != '.' && $file != '..') { ///File or folder ?? if(is_dir($StartDir.$SubPath."/".$file)) { //Folders echo "<a href=\"?dir=$SubPath/$file\">$file</a><br>"; }else{ //Files echo "$file<br>"; } } } //create folder (only creates one named "test") //but you can add a form etc.. echo "<a href=\"?dir=$SubPath&mk=TEST\">Create Test folder</a><br>"; } ?>
  23. Debug your code then.. but i'm out!
  24. only skimmed the code.. but shouldn't $arCurrentLine = $arParsedLines[$arCurrentServer]; be $arCurrentLine = $arParsedLines[$i]; also whats the error ?
  25. <?php $str = $matches[1]; echo $str; ?> if that doesn't work can you post the results of print_r($matches[1]);
×
×
  • 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.