Jump to content

mreish

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by mreish

  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.
  15. When you float something, that something gets removed from the flow of the document. It's almost like the browser doesn't see the thing - it just tries to display other stuff around your thingy. So to speak. One trick I've seen quite a bit is to put a paragraph tag right after the div that's getting floated with a clear on it. So your CSS/HTML would look like this: .clearBoth { clear: both; } <div id="crazyFoltedDiv"> Content goes here. </div> <p class="clearBoth">&bnsp;</p>
  16. My personal favorite is TinyMCE though I've only played with a few others so I don't have the widest experience base. TinyMCE - http://tinymce.moxiecode.com/ CKEditor - http://ckeditor.com/ NiceEdit - http://nicedit.com/ eLRite - http://elrte.org/ CLEditor - http://premiumsoftware.net/cleditor/ Aloha Editor - http://aloha-editor.com/ openWYSIWYG - http://www.openwebware.com/ Enjoy.
  17. Are you saying that when you view the page in a browser, the information is already filled in? If so, this isn't a DreamWeaver issue. Your browser is setup to remember the form information. If by saying "hide password characters" you mean you don't even want the bullets to display, you'll need to create a rule that changes the font colour to match the background of the text area. Or, find a javascript (JQuery, Mootools, etc) script that hides them. I hope that was helpful. It's not entirely clear to me what you're asking.
  18. You do need to have a page open in some versions of DreamWeaver to add a database. Having said that, looking at your screen capture, I wonder if you've defined the testing server?
  19. Yes, close all documents and hit CTRL-F (or command-f), you'll get the find window. Starting at the top: Find In- set this to the folder with all your stuff - your local root folder (now called local site folder) Set Search for - source code Then just type in what you want to replace in the find box and what you want to replace it with in the replace box. You may or may not want to check Match case. [attachment deleted by admin]
  20. Is there a feed for each forum as well? I think it would be handy to have a feed for the one forum that I can answer questions in.
  21. I'm sorry. Duh. When you hit the save button, only the tab positions save. I also want to save the tab contents. Sorry, sorry, sorry.
  22. Check connect.php and make sure it doesn't have ANY of the <html><head> stuff in it. It should only have the things you want to display in that cell.
  23. I've done this quite a bit. Here's what my testing server dialog looks like. [attachment deleted by admin]
×
×
  • 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.