Jump to content

schilly

Members
  • Posts

    870
  • Joined

  • Last visited

    Never

Everything posted by schilly

  1. http://php.net/manual/en/function.mail.php The 3rd parameter is your email body. The 4th parameter is headers like To: From: BCC: CC: etc. Change to: if (mail($email, "message1", $message)) { // $email = to address, "message1" = subject, $message = email body You should only use the 4th parameter if you are adding extra headers.
  2. Why are you passing in "Message2" as a header?
  3. Anyone? Connection usage doesn't look to be more than 10%. Traffic Ave: 110000 Number of SQL Queries: Ave: 19, Max: 166 Query Cache Hitrate: Ave. 54% Key Buffer usually sits around 84M of 115M and average hitrate is 77% Query Cache Hitrate seems low. Should I increase the cache?
  4. yes you can't have echo'd any code to the browser when you do a redirect. This includes any debug stuff you are printing to the screen. also add a exit(); after the redirect.
  5. if($result){ $thread_id = mysql_insert_id(); header("Location: path_to_thead.php?id=$thread_id"); } something like that.
  6. is there a reason you're doing nothing with those for loops? i'm pretty sure for loops require {}
  7. Our db is running into max connections every now and then and we're trying to figure out why. I've been running the mysql administrator but don't totally understand what all the info means. Can someone point in the right direction of some good resources to read up on? Also some suggestions on what to do to figure out exactly what the problem is. Current max connections is 150. I'm not sure if it's better to increase the max connections or the different buffers. Thanks.
  8. What's the problem? Also put your code in the code tag.
  9. i think you need to either hack PHPMailer to remove the content-type header it adds or write your own smtp authentication.
  10. well your a little off. ignore the year in their birthday unless your calculating how old they are. then you need to see if the date (day and month) is greater than the current date. if not you need to add one to the year because their birthday won't happen until next year. then create the timestamp. then take the difference from the current date. once you have the difference divide it by 86400 (number of seconds in a day. 60*60*24) and ceil it. This will give you the number of days until that date ie. birthday. hope that helps.
  11. Well I've already done the query and pretty much spelled out the whole thing so I believe it's up to you now. A little trial and error and you should have it.
  12. $hour = date('G'); $minute = date('i'); //add 30 to minutes. if its over 60 minus 60 off it and add one to hour. if hour is then over 23 set to 1. similar for minus 30 minutes. //put your times together $time_string = $hour . $minute; //now use $time_string in your query.
  13. this should work as long as you have a db column named "name": while ($row = mysql_fetch_array($r)) { print_r($row); //show whats in the array echo $row['name']; }
  14. not with that query. it is assuming you are using a datetime or timestamp field. try SELECT * from `dep` WHERE dtime >= $time_minus_thirty AND dtime <= $time_plus_thirty order by rand() limit 15 you going to need to create time_minus_thirty and time_plus_thirty by yourself using php.
  15. that looks fine. mysql_query returns a resource. now use mysql_fetch_array or mysql_fetch_assoc or mysql_fetch_object on it to get your rows.
  16. -/+ 7200 on the $send->date for 2hr difference.
  17. yea not my choice =( thanks for the help.
  18. i think you need to do this: echo date("g:i A - F j, Y", $send->date);
  19. well looks like magic_quotes_gpc is set to on. never seen this option turned on before in the php.ini file. so does this mean i dont need to use mysql_real_escape_string?
  20. so i'm printing out some post data from a form and it already has slashes added to the data. i've never seen this before and is hence messing up all my queries when i use mysql_real_escape_string on the form data. this is through the go daddy preview dns feature. we are upgrading a site so the dns hasn't been switched over yet. i'm fairly certain this preview dns thing has already broken some of my jquery code. here's my code. basic html <form method="post" name="furniture_form" action="" enctype="multipart/form-data"> <table> <tr><td colspan="2" align="center"><?php echo isset($msg) ? $msg : " "; ?></td></tr> <tr> <td>Item Number:</td> <td><input type="text" name="item_num" value="<?php echo $item_num; ?>"></td> </tr> <tr> <td>Category:</td> <td><select name="category"><?php echo getCatMenu($category); ?></select></td> </tr> <tr> <td>Style:</td> <td><select name="style"><?php echo getStylesMenu($style); ?></select></td> </tr> <tr> <td>Dimensions:</td> <td><textarea name="dimensions" rows="2" cols="25"><?php echo $dimensions; ?></textarea></td> </tr> <tr> <td>Description:</td> <td><textarea name="description" rows="5" cols="50"><?php echo $description; ?></textarea></td> </tr> <tr> <td>Picture:</td> <td> <input type="file" name="file"> <div style="float:right"><?php if($picture != "default.jpg") echo "<img src='/includes/makeThumb.php?name=$picture&type=0'>"; ?></div> </td> </tr> <tr> <td>Comments:</td> <td><input type="text" name="comments" value="<?php echo $comments; ?>"></td> </tr> <tr> <td> </td> <td><input type="submit" name="furniture_submit" value="<?php echo $button_name; ?>"><input type="hidden" name="furniture_id" value="<?php echo $_GET['id']; ?>"</td> </tr> </table> </form> php code at the top of the page: <?php print_r($_POST); //processing code ?> so if i add some quotes and stuff in the fields and post here is what gets posted: Array ( [item_num] => 15432a [category] => Dining Room [style] => Tapered Leg [dimensions] => asdfsdfasdf [description] => testing\'s [comments] => whooo whooo [furniture_submit] => Update Furniture [furniture_id] => 2 ) anyone seen this before?
  21. $query = "SELECT title, author, content, UNIX_TIMESTAMP(entry_date) as date FROM news WHERE id = '$id'"; remove the "AND" see if that works.
  22. hmmm strange. the first one should work. the second definitely won't. try $option = "<span id='foo' onclick=\"alert('foo');\">Add as friend</span>";
×
×
  • 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.