Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. SMS can be sent via email by addressing the email to phonenumber@provider.com...you should be able to find the @provider.com part from google...for example, verizon is 123456789@vzw.com I think. Remember that SMS is limited to 160 characters.
  2. First one tells the browser how much data to expect, so you can get a progress bar during the download. Second one tells it what kind of data (csv). What that does is offer the "open with default application" and it gives you a choice, such as Excel. Without that header, it doesn't know what type of file it is until it's fully stored on the file system and can associate the ".csv" with excel. Third one tells it to download as an attachment and what the filename should be.
  3. don't store the text with the nl2br function applied to it. Apply the nl2br just before displaying back the text.
  4. What do you mean "What about the media?"? A file, is a file, is a file, regardless of what type it is. Playback of the file is a different question...you'll need to embed a player in your website, or just offer the files for download and let the user worry about codec support and the like.
  5. This will create a multidimensional array of all the articles, sorted by date, with the date being the first key... $query = "SELECT * FROM News ORDER BY date DESC"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { $articles[$row['date']][] = $row; } echo '<pre>' . print_r($articles, true) . '</pre>'; To print articles: foreach ($articles as $date => $articles) { echo 'Articles for ' . $date . ':'; foreach ($articles as $article) { echo '<a href="' . $article['link'] . '">' . $article['title'] . '</a>'; } echo '<br /><br />'; }
  6. http://us2.php.net/manual/en/features.file-upload.php
  7. The only thing that class does is run some commands via the exec function...which should be platform independent. Once you install rar to your linux server, then you simply change the variable in the class to point to the executable. You will either need to find some binaries for your linux distro, or get the source from rar labs and compile it. Then it should work fine. I believe the reason that you can not compress to rar with the pecl library is because you must purchase a license for the rar software.
  8. It's already been done.......... http://www.phpclasses.org/browse/package/3556.html
  9. $_SERVER['HTTP_REFERER'] http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server
  10. http://www.mysql.com/products/tools/administrator/
  11. $str = 'message_id=a1&recipient=unit1&sendday=fri'; $parts = explode('&', $str); foreach ($parts as $var) { $var = explode('=', $var); $$var[0] = $var[1]; } echo $message_id . "<br />" . $recipient . '<br />' . $sendday;
  12. Depends on your host...you'll have to ask them
  13. Make sure display errors is on too... ini_set("display_errors", 1); ...just after John's code.
  14. Only thing I can think would be to use the "-f address@mail.com" option... mail($to, $subject, $message, $headers, "-f address@mail.com");
  15. mysql_query($sql) or die(mysql_error()); echo "User's ID: " . mysql_insert_id();
  16. What SQL queries are being passed to the function? That is what will determine the amount of memory it takes up. If you do a "SELECT * FROM table_name" and that table contains 1000 rows, even if you only use 10 of them, all 1000 are going to be loaded into memory.
  17. May not help, but force the script to recognize that you mean "the current directory" by prepending "./" to the folder name: move_uploaded_file($_FILES[$filename]['tmp_name'], "./awards_paddles_img/$upload_id") Is it moving the file at all, or is it moving it to an incorrect location?
  18. What code are you using? a basic example: mysql_query("INSERT INTO table_name (col1) VALUES ('foo')"); echo "Foo was inserted with an ID of " . mysql_insert_id();
  19. linux cron jobs or windows scheduled tasks...
  20. you're calling a function, not echoing out a value in an object... $result = GetFIPSByAddress($addnum,$addpredir,$addst,$addstsuf,$adddir,$city,$zip,$pluszip,$reqdate); foreach ($result->FIPSRecordList as $record) { foreach ($record as $key => $value) { echo $key . " = " . $value . "<br />"; } } I think that should loop through them...
  21. It's an object, not an array...I think...it's hard to tell...put the print_r result into a code block so it will preserve formatting. echo $result_object->intReturnCode; should result in "0" being echoed.
  22. I'm sure if you even glance at the manual you can figure it out... http://www.php.net/mysql
  23. You could also do: myArray = array('Blue', 'Green', 'Yellow') { for ($i = 0; $i < count($myArray); $i++) { ${"var" . $i} = "The color is $myArray[$i]"; } echo $var1; or $var = "var_name"; myArray = array('Blue', 'Green', 'Yellow') { for ($i = 0; $i < count($myArray); $i++) { ${$var . $i} = "The color is $myArray[$i]"; } echo $var_name1;
  24. Since you didn't do a many-to-many relationship, and therefor can't do a simple join to get your data, you will have to retrieve the data from your table and store it in a temporary array, then reference it for each floor type. Fortunately, your non-normalization normalization has a very small dataset.... <?php mysql_select_db($database_mysql_connect, $mysql_connect); $query = "SELECT * FROM listings WHERE id = '".$_GET['ID']."'"; $results = mysql_query($query, $mysql_connect) or die(mysql_error()); $row = mysql_fetch_assoc($results); $floorchoices = explode(", ",$row['floortype']); $query2 = "SELECT * FROM floortype"; $results2 = mysql_query($query2, $mysql_connect) or die(mysql_error()); while ($row = mysql_fetch_assoc($results2)) { $floor_type[$row['id']] = $row['floortype']; } echo "This listing has the following floor types:"; foreach ($floorchoices as $f) { echo $floor_type[$f] . ", "; }
×
×
  • 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.