Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Use the modulus operator (%) if (($i % 10) == 0) { echo "$i is a multiple of 10<br />"; } Basically checks if $i / 10 has a remainder, if it does it is not a multiple of the number you are checking it against.
  2. If you use the preg_split function it can do regex matching. I am not 100% sure but this should work: $_emails=preg_split("([, ;\n])", $_POST['sendemails']);
  3. On that note as well, if you are looking for help with a particular problem, it is better to post that question in the Help sections with a thread of it's own instead of in this generic type thread.
  4. What is this "XBox Live" you are talking about. All I have is a Comodore 64.
  5. echo "<select name=\"course applied for\">\n"; Should be: echo "<select name=\"course_applied\">\n"; As spaces cause some funky issues. Then to call that: $course_applied = $_POST['course_applied']; A side note, you use "$course" inside of single quotes, that is taken literally and not evaluated to the value. Either encase it in double quotes or remove the quotes all together. Hope that helps.
  6. Well the only way I could think of doing this with smarty, is you either need to pass it as a string (so use file_get_contents or cURL) to retrieve the data or write the file to a file on your server. Which can be done with the fopen functions coupled with file_get_contents / cURL. I do think you can pass a string to Smarty to parse but I am unsure how to do that and would referrer you to the Smarty Forums / Documentation.
  7. Show your current code for the dropdown and I am sure someone can easily help you.
  8. Is there a reason you do not just download the remote template file and save it to your server to access from there?
  9. http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=php+curl+tutorials Would be my place to start learning how to use cURL.
  10. Yea, I meant get_clean, thanks for correcting me teamatomic for pointing that out.
  11. You close the mysql connection before you pull the results. Generally you should not close the mysql connection as when the scripts stops executing php will do this automatically for you.
  12. Perhaps this will help you: http://codingforums.com/showthread.php?t=181757
  13. Sader is correct, however, if you do want the "output" from an included file returned in a variable you can use output buffering: ob_start(); include("srs/".$_POST['report_types'].".php"); $report_info = ob_end_clean(); Would do it, however, I highly suggest against calling files with include like you have. It is a security risk.
  14. Leave is a reserved word in MySQL, either encase it in backticks (`) or rename the column (preferred). http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html For a list of reserved words in MySQL.
  15. Perhaps this might be what you are after (note the extension is for Chrome). https://chrome.google.com/extensions/detail/gbnlondidnnfmfnglkpaoagecnkkpcjp?hl=en-US
  16. Are you sending the email as HTML? If so a modification to my code would be: $message = "<table><tr><td>ProductID</td><td>Count</td></tr>"; while ($rows = mysql_fetch_assoc($result)) { $message .= "<tr><td>{$rows['ProductID']}</td><td>{$rows['Count']}</td></tr>"; } $message .= "</table>"; Which should send properly as html.
  17. $message = "ProductID\tCount\n"; while ($rows = mysql_fetch_assoc($result)) { $message .= "{$rows['ProductID']}\t{$rows['Count']}\n"; } Should do the trick.
  18. Change each of these items to be as follows: //From $eventsrow['details'] //to {$eventsrow['details']} Inside of the echos.
  19. You have a ton of unnecessary if statements... You can replace the majority of them with simply this, and only add the extras in as they are needed. $urls= array("http://" . $st . ".craigslist.org");
  20. You are missing a quote: echo "</tr>;"
  21. If you are using Vista or Windows 7 there is a gadget for Time Until, look through those gadgets.
  22. Before you add it to the body of the email call nl2br on the data to convert newline characters to their html equivalent <br />
  23. The single quotes are for surrounding MySQL strings to avoid syntax errors, the double quotes and dot exit out of the string to concatenate a variable, $new_password, onto it.
  24. I do not even see an else statement in that code. You have way too many braces } which could be because you have not posted the whole code. Before you venture further into programming I would highly suggest you read up on Ident Styles for programming, pick one and stick to it. As well PHP has it's own standards set by PEAR which you can find Pear PHP Code Standards It will help you throughout programming doing proper indentation as it helps with debugging. If you are just using notepad, I would suggest getting an editor like Notepad++ or Netbeans by Java with PHP Syntax Highlighting.
×
×
  • 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.