Jump to content

mreish

Members
  • Posts

    45
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mreish's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm trying to write a script to demenostrate JPG lossy compression. The idea is to start with an image called copy-0000.jpg that is at 100% quality then save it 100 times at 50 quality renaming the copies as it goes. So each copy will be half the quality of the previous. $j = 0; for ($i = 0; $i < 100; $i ++) { $j ++; $fileToCompress = imagecreatefromjpeg('copy-' . sprintf('%04d',$i) . '.jpg'); imagejpeg($fileToCompress, 'copy-' . sprintf('%04d',$j) . '.jpg', 50); imagedestroy($fileToCompress); } But I wind up with 100 copies of the original, each at 50 quality. I am open for ideas.
  2. Awesome. Thank you. Learned some thing new!
  3. Here's the code that assembles the array which is later tuned into an email CSV attachment. // this builds a list of field names foreach ($_POST as $key => $value) { $key= '"'.$key.'",'; $placeHolderData .= $key; } // pull the last extra comma off $placeHolderData = rtrim($placeHolderData, ","); // add a line feed and new line $placeHolderData .= "\r\n"; // this builds the list of field values foreach ($_POST as $key => $value) { $value= '"'.$value.'",'; $placeHolderData .= $value; } // pull the last comma off $placeHolderData = rtrim($placeHolderData, ",");
  4. Greetings folks, I've tried searching on this but couldn't find anything which I think is odd since I'm sure I'm not the first person with this question... I have a project that is basically a big (really big) form. When the user hits submit they get a CSV file. My client will then import the CSV into their database. The CSV is made up of two lines, the first being field names and the second line being the field values. Both the names and values are pulled from $_POST. The CSV looks like this: "Name","Age","Favorite Color" "Bob","12","Purple" The problem I having is if the user skips a question, let's say Age for this example, the CSV will look like this: "Name","Age","Favorite Color" "Bob","Purple" The clients database then freaks when it sees the value for Age is Purple. So my question is, how does one handle null values from from $_POST to avoid such an issue? Thank you! Thank you! Thank you!
  5. I might not understand what you're trying to do. The button labeled "works" sure seems to pass an argument to ManageTitles.php just fine. Remember that in ManageTitles.php you nee dot use the $_GET super global to read that argument. I can shoot you as sample if you like. Or, I don't understand what you're trying to accomplish. Edit: Ah, think I know what you're missing. Try this for the 'fails' button: <input type=button value="fails" onclick="window.location.href='ManageTitles.php?dog=<?php echo $row_rsDogsowned['idDogInfo']; ?>'" />
  6. We're making progress! Local site folder & Server folder should be: /Applications/MAMP/htdocs/ Remember that the MAMP directory is where the application executables reside (Apache and MySQL are) but the htdocs folder is where your hyper text documents are. Web URL should be http://localhost/ Remember that we changed the Apache port from 8888 to 80. The :8888 on the end tells the browser to use a specific port (8888 in this case). You could also use :80 but because that's the default port, it's assumed. So in a browser just visit locolhost. You don't even need the http:// in front of it.
  7. Make sure that MAMP is using the default MySQL port. In MAMP, go to Preferences then click on "Set to default MySQL and Apache Ports". MAMP comes with some non-standard port values in an attempt not to conflict with OS X's built in webserver (also Apache). So I make sure OS X web sharing is off then set the MAMP ports to default port. Apache port 80 and MySQL port 3306. I'm sure there's a way to tell DreamWeaver which ports to use but I've never bothered. Also make sure you've set up a remote and testing server in your site definition When setting up your connection the connection name can be anything you like. MySQL Server should be localhost.
  8. I'm not sure what a YRC is but depending on the format you need for the date, you'll want to put something like this: <input type="hidden" name="PU_DATE" value="<?php echo date('j/d/Y'); ?>" /> will return: <input type="hidden" name="PU_DATE" value="04/03/11" /> Check the PHP manual for date formatting here.
  9. Okay, I installed FF4 on my XP box and phpmyAdmin runs just fine from cPanel.
  10. What OS are you running? Works for me under OS X 10.6. I haven't tried it on my XP or Win 7 machine's yet.
  11. I don't have a clue. Try Googling some thing like "jquery equal columns".
  12. Ah, this isn't a DreamWeaver function but rather a CSS thing. One way to do it is to use a jQuery plugin (I don't have a link handy, sorry). Another way to do it is like this. Let's assume we have two columns, left, and right. Put those into a third div tag. Then, and this is the key, put a background graphic into that third div tag that has the background graphic for the left and right columns. Here's a demo I use in my classroom: http://43monkeys.com/temp/phpfreaks/equal-hight-columns/sample.html
  13. Do you mean you have a two column design and want one to stretch height or width?
  14. Hmm... I suspect the Javascript Forum would be a better place but I'm not sure. Surely more people will weigh in because this forum doesn't get looked at a lot. The people who write TinyMCE have a file manager available but it's not free. I have purchased several licenses of it over the years for my clients and they all seem happy with it. I like it because it's tightly integrated with TinyMCE - it has the same look and feel.
×
×
  • 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.