Jump to content

litebearer

Members
  • Posts

    2,356
  • Joined

  • Last visited

Everything posted by litebearer

  1. Look into... strpos() and substr() You can accomplish what you want with the help of those. Lite...
  2. Might try... [code]<?PHP $contents="lots and lots of text and more and more"; $max_words=4; $content_array = explode(" ",$contents); $count = count($content_array); if ($count> $max_words) {     $i=0;     for ($i=0;$i<$max_words;$i++) {         $leading_text[$i] = array_shift($content_array);     }     $contents = implode(" ",$content_array);     $bolded_text = '<B>' . implode(" ", $leading_text) . ' </b>' . $contents; }else{     $bolded_text = '<B>' . $contents . '</b>'; } echo $bolded_text; ?>[/code] Lite...
  3. Look here... [a href=\"http://www.nstoia.com/toh/technical/imageresize/\" target=\"_blank\"]http://www.nstoia.com/toh/technical/imageresize/[/a] Lite...
  4. Hmmm... Kind of like asking how do I fix an engine.. are the bolts metric or US, are they left hand thread or right etc etc. In other words, start with the structure of the file... does each line end with the same 'character', such that said 'character' is ONLY used to end lines. does each line represent a unqiue piece or group of information? and if it is a 'group' how are the pieces DISTINCTIVELY separated? Will the file and subsequent versions of it follow the same format? Those kinds of questions and answers about the file will narrow down the method of using the information in the file simply and effectively. do a google search on php file handling read write Lite....
  5. or... [code] //    get the first xx words for the teaser $contents="some text"; $max_words=50; if (count(explode(" ", $contents))> $max_words) { $contents = substr($contents, 0, strnpos($contents, " ", $max_words)); } $contents = $contents . "...More>"; [/code] (part of ... [a href=\"http://www.nstoia.com/toh/technical/teasers/)\" target=\"_blank\"]http://www.nstoia.com/toh/technical/teasers/)[/a] Lite...
  6. Might look here, altho it deals with resizing, it may explain about the saving... [a href=\"http://www.nstoia.com/toh/technical/imageresize/\" target=\"_blank\"]http://www.nstoia.com/toh/technical/imageresize/[/a] Lite...
  7. Sorry couldn't resist.... When asked by his patient why he used two fingers, the proctologist replied... "I always like to get a second opinion"
  8. Take a look at this script and adapt it as needed... [code] <?php //Name you want to save your file as $save = 'myfile.jpg'; $file = 'original.jpg'; echo "Creating file: $save"; $size = 0.45; header('Content-type: image/jpeg'); list($width, $height) = getimagesize($file); $modwidth = $width * $size; $modheight = $height * $size; $tn = imagecreatetruecolor($modwidth, $modheight); $image = imagecreatefromjpeg($file); imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height); // Here we are saving the .jpg, you can make this gif or png if you want //the file name is set above, and the quality is set to 100% imagejpeg($tn, $save, 100); ?> [/code] Lite...
  9. Since the script is being parsed, you apparently have php on your server. Perhaps if you showed us the code you are using we would be in a better position to assist. Lite...
  10. Not sure what you mean by "PHP image". Are you alluding to creatring an image via php & gd? If so simply save the image created in the format you desire. might look here as a start [a href=\"http://it2.php.net/manual/en/function.imagejpeg.php\" target=\"_blank\"]http://it2.php.net/manual/en/function.imagejpeg.php[/a] Lite...
  11. You could use Sessions and pass the information that way
  12. I could be mistaken; but when you use the number format to place a 'value' into a variable, that variable is treated as a string NOT a numerical value. Suggest you use the number formating AFTER you have done all your math. Try adding 3 to your variable and echo it, see what happens Lite...
  13. Hmmm. Suggestion.... Already include the field when you first enter the data. place a 0 (zero) in that field. Then you can simply change the zero to 1 when the link is clicked. [It might also help if you had a unique id field for each 'record'.] Lite...
  14. Thank you!. Your test lead me to see the error of my thinking. Too much wine and tight swim goggles can do that. I was clicking thru too fast and completely missed the fact that it was in fact doing things properly, I simply was in error. Thanks again. Lite...
  15. I used an 'install package' to install apache/php/mysql on my system (WIN XP) at home. I used the EXACTLY identical 'install package' to install apache/php/mysql on my system (Same verion of XP as at home - all updates and patches are identical) at the office. I did NOT change any of the ini settings on either system so they too should be identical. (I downloaded the 'package' to my thumb drive and installed both systems from the same thumb drive). The Problem: when this script is run at home, it echos out [!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]Claims to be set[!--colorc--][/span][!--/colorc--]. when I run the identical script at my office it echos out [!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]Says not set[!--colorc--][/span][!--/colorc--] if I put an exclamation mark in front of isset, then they reverse their ouptuts. Why???? [code] if (isset($_SESSION['yesitis'])) {     echo "Claims to be set"; }else{     echo "Says not set"; }[/code] Thanks, Lite...
  16. Might look into Imagemagick [a href=\"http://www.imagemagick.org/script/index.php\" target=\"_blank\"]http://www.imagemagick.org/script/index.php[/a] Lite...
  17. As a start try changing this [code]<form method="post" action="addbiz.php">[/code] to this [code]<form enctype="multipart/form-data" action="addbiz.php" method="post">[/code] Lite...
  18. Here's one that may help. The mysql version will be ready in a day or two; but the flat file version is ready now. [a href=\"http://www.nstoia.com/toh/technical/teasers/\" target=\"_blank\"]http://www.nstoia.com/toh/technical/teasers/[/a] Lite...
  19. Might look here [a href=\"http://www.phpconcept.net/pclzip/man/en/index.php?understand\" target=\"_blank\"]http://www.phpconcept.net/pclzip/man/en/index.php?understand[/a] Lite...
  20. Setup a taskscheduler on your local pc to run your browser (pointed at the appropriate php script on your host) at the appointed time interval.
  21. look at this thread [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=71665\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=71665[/a] Lite...
  22. Unfortunately, empty() will accept spaces as being valid,
  23. Not what you want to hear, but, if the registered user is willing to breach his word and give the link to someone else, what is to prevent him/her from simply giving the file itself away?
  24. How about instead of... [code] $totalamount = $tireqty * TIREPRICE + $oilqty * OILPRICE + $sparkqty * SPARKPRICE; $totalamount = number_format($totalamount, 2); echo "<br>"; echo "Items Ordered: ".$totalqty."<br>"; echo "Subtotal: $".$totalamount."<br>"; echo gettype($totalamount)."<br>"; //I added this in myself just to see the variable type echo $totalamount."<br>"; $taxrate = 0.10; $tax = $totalamount * $taxrate; $totalamount = $totalamount + $tax; echo "Tax amount: ".$tax."<br>"; $totalamount = number_format($totalamount, 2); echo "Total including tax: $".$totalamount."<br>"; [/code] we do.... [code] $sub_totalamount = $tireqty * TIREPRICE + $oilqty * OILPRICE + $sparkqty * SPARKPRICE; $taxrate = 0.10; $tax = $sub_totalamount * $taxrate; $totalamount = $sub_totalamount + $tax; echo "Sub total before taxes..... " .  number_format(sub_$totalamount, 2) . "<br>"; echo "taxes............................. " .  number_format($tax, 2) . "<br>"; echo "Grand Total ................... " . number_format($totalamount, 2) . "<br>";[/code] Lite...
  25. I've been frequenting this forum for a couple of years now and have a hopefully helpful hint for the noobies and oldies like myself. Take a few minutes each time you come to this forum and do a search for posts/replies by the following people... Barand, AndyB and Toplay. You would be amazed at what you will learn simply by reading their answers and suggestions. Even if you have no need at that particular moment for the content, the idea will stick somewhere in your brain and you will be able to track the answer down when you need it. Ba Da Ba Da Ba Da, That's All Folks! Lite...
×
×
  • 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.