Jump to content

ldougherty

Members
  • Posts

    319
  • Joined

  • Last visited

    Never

Everything posted by ldougherty

  1. So in other words you want to dynamically create the second drop down box based upon the result of the first drop down box. If you search Google for php dynamic select box you will find a lot of good results. http://www.plus2net.com/php_tutorial/php_drop_down_list.php
  2. If you wanted to input the data into a mySQL database follow this guide http://www.apluskb.com/scripts/How_can_I_send_form_answer3591.html If you wanted to send the data via email follow this guide http://www.thesitewizard.com/archive/feedbackphp.shtml There are plenty of articles on Google that will walk you though doing this, the ones I've referenced are just the results of a quick search
  3. The loaction header must contain an absolute URI!! See note above "Note: HTTP/1.1 requires an absolute URI as argument to » Location". Thus: <?php header("Location: /home.php"); ?> is wrong, but most browsers will follow it correctly (hence the common mistake). This is correct: <?php header("Status: 301"); # 301 Moved Permanently header("Location: http://{$_SERVER['SERVER_NAME']}/home.php"); exit; ?>
  4. I suggest looking at PHP Mail examples and then copying one to meet your needs. http://www.w3schools.com/PHP/func_mail_mail.asp
  5. I would suggest using the SUM function to total the columns of your database. This will give you total hours and total minutes. You could then (total hours * 60 + total minutes ) / 60 = total hours and minutes in decimal format
  6. You do not want to store the images themselves in the database, this causes the database to become absurdly huge and slow. Just store the images locally on the server and reference the paths in your database.
  7. You're page is coming up blank. I assume its PHP content inside of an HTML document? If so the blank page means you have a PHP error and display PHP errors is disabled. Try adding this to the top of your page ini_set ("display_errors", "1"); error_reporting(E_ALL); That should allow you to display the error you are experiencing.
  8. I'm not sure that I understand you completely but you could simply put the results into a table. Essentially start the <TR> before you start outputting the results Have a counter that increments after each set of data is echoed Have a <TD></TD> around each result Have an if statement stating if the counter is odd then </TR><TR> The logic is that you'll have a <TR>, two sets of <TD></TD> and then a </TR><TR> to start the next line.
  9. You could also just try and run the queries in a tool such as phpmyadmin to see how long the query itself takes to return. Another good site load test is tools.pingdom.com which will show you how long each aspect of your page takes to render.
  10. You should change or die ("could not execute query"); to or die('Invalid query: ' . mysql_error()); This will tell you the actual problem with your query.
  11. There would be a couple different ways logically to do this. You can either retain the existing document and remove the crap you don't want. Or you can find the stuff you do want from the document and grab it to store it in another document. I personally would probably use file_get_contents to return the file data into a string and then use the php string functions to use what you want and replace what you dont. http://us2.php.net/manual/en/function.file-get-contents.php http://us2.php.net/manual/en/ref.strings.php
  12. I assume you are referring to a Linux Server, in this case what you want is Per-User web directories http://httpd.apache.org/docs/2.0/howto/public_html.html
  13. I'm not sure I'm understanding. If the data is already in the database ie notify field is Y meaning they wish to be notified then when sending emails or at least generating the email list you should just use $sql = "SELECT email FROM contacts WHERE notify = 'Y' "
  14. Rather then running a query for each individual city I'd suggest having one query and then run a while loop that populates an array. IE.. result = select Count(City) FROM Photos row = fetch row result $city = $row[city]; then have a case statement case philly phillycount++ etc etc. hope that makes sense..
  15. There are several different PHP string functions that you could use to do this. Another would be stripos http://us2.php.net/manual/en/function.stripos.php I suggest familiarizing yourself with the PHP string functions http://us2.php.net/manual/en/book.strings.php
  16. Your SQL query is failing. More than likely your script is failing to connect to the database all together which would explain why the query fails. Use the or die mysql_error(); as this will display the problem.
  17. There are no limitations according to the manual. http://php.net/manual/en/control-structures.switch.php
  18. Since the field is a string there is no way to sort it as if it were a date because mySQL has no idea it's a date. Why not just make the field type date then you can sort by date as suggested.
  19. So the user actually enters the character £ into the quote field and this arrives via email with  in front of it? Have you tried outputting the form prior to sending the email to see if the text is outputted correctly before the mail is sent? This would at least let you know if the issue is with your form or mail delivery.
  20. With ImageMagick you should be able to pull of what you are trying to do. http://www.imagemagick.org/script/command-line-tools.php
  21. Do you have access to the mail logs on your server?? If the script is saying its sent then it's being blocked somewhere. If you do not have access to the mail logs ask your web host to take a look at the mail log to determine if the message is successfully leaving their network or not. If it is then the issue is with the recipient mail server, probably your junk mail folder.
  22. The function you are looking for would be SED which is a Search and Replace editor for Linux. I found a good article online which may assist you in using the functionality within PHP http://forums.tizag.com/showthread.php?t=9282 Hope that helps.
  23. "Why is it using more than 16MB of RAM? When it seems to be just trying to use less than 2kb?" This particular aspect of your script is not using more than 16Mb of ram, everything being run by PHP in that instance is using a total of more than 16Mb. "And how do I increase this limit?" The variable is memory_limit in your php.ini If this is a shared server you likely do not have access to adjust this value however you can usually do so via your code as well using this at the top of your page. ini_set("memory_limit","32M"); where 32M is the new value for PHP Memory.
  24. "Should I just reject them and tell the user "This image is too small for the website"." Exactly. On the upload form you should have something stating min and max resolution and after the upload have your script check to see if it falls in that range. If it is too small then reject it and bounce the user back to the upload screen with an error stating too small. It also would be helpful to state what the image uploaded actually was for the "not so smart" user who has no idea what resolution means. Failed Upload, Image Size (height x width) does not fall within allowed resolution.
  25. Also try changing the TO address from Yahoo to something else like a Gmail account. Yahoo is notorious for grey listing emails based on IP reputation. Therefore even if your script works properly Yahoo could be blocking your mail.
×
×
  • 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.