Jump to content

saint959

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by saint959

  1. Hi everyone, I am trying to get a php script i wrote to monitor/process an email account and run each time a new email is received. is this possible? What im doing is, currently i manually load the php file to check an email account and then insert the emails into a MySQL database, then i finaly delete the email from the account, but i need this to be done without human intervention. Please if someone can point me in the right direction i would really appreciate it.
  2. just for a test have you tried to hard code the username and see if you get any results?
  3. Hi, I am hoping someone can help. I need to allow users to send details through email into a MySQL database. Please if anyone could point me in the right direction it would be hugely helpful: This is the code i have done so far: <?php $mbox = imap_open("{serverip:serverhost}", "email address", "email password"); $MC = imap_check($mbox); $overview = imap_fetch_overview($mbox, "1:{$MC->Nmsgs}"); $msgcount = 1; if (is_array($overview)) { foreach ($overview as $val) { $message_body = imap_fetchbody ( $mbox,$msgcount,'1'); $messages_found[$msgcount] = "$val->from||$val->from||$val->to||toname||$val->subject||$message_body"; $msgcount ++; } } $msgcount = 1; include '../db.php'; $messagedate = date("Y-m-d"); foreach ($messages_found as $message_part){ $message_split = explode("||", $message_part); $query = "INSERT INTO `$tablename` (`messagedate`,`fromnumber`,`fromname`,`tonumber`,`toname`,`subject`,`message`,`status`) VALUES ('$messagedate',"; foreach ($message_split as $message){ $message = str_replace('@findza.co.za','',$message); $message = str_replace('http://','',$message); $message = str_replace('<','',$message); $message = str_replace('>','',$message); $query .= "'$message',"; } $query .= "'unread')"; print "</br></br>"; print "$query"; //printing the query to check the output before integrating with database } imap_close($mbox); ?> The above code does work, most of the time, but is there a way i can get the script to permantely monitor the catch all email account and run each time a new email gets found. If someone has a better solution then please let me know
  4. Hi, is it possible to have a if statement that checks if a variable is LIKE a string. basically what i need is, if ($var1 LIKE $string) { mysql query here"; } What would the syntax for the if statement be?
  5. hi try this: $to = 'tlsarna@wyan.org';
  6. should the backround tag not be in "" i.e. background="SB1_anubis.png" ? echo "background=\"SB1_anubis.png\"";
  7. i would recommend you do not use LIKE in your SQL query. you could run into problems if users have simliar usernames. i.e. if a user has the username "andrew" and another users username is "andrews", when andrew logs in he will also see andrews contacts because of the likeness in usernames. another feature i had was, when one user added another they had to be accepted by the user before he would be visible. i have a similiar table structure to how supermerc recommended, i just had another field "status" where i would change the value in the field to "verified" once the contact had been accepted. so when i (for example) added a contact the status field would be "pending" until the user i added accepted me as their contact. here is the SQL Query i use: SELECT * FROM `tablename` WHERE `username` = '$username' AND status = "verified"; This is to stop users from spamming other users by guessing usernames and sending messages to randomn people.
  8. Hi, i have managed to find this functions thanks to mjlogan's idea: exif_read_data(): Does anyway one maybe have an idea how i can get out just a specific section of the function (or just one variable). I checked the PHP manual at (http://www.php.net/manual/en/function.exif-read-data.php) but i do not really understand what they say there. i have tried different combinations for the function without much success. Here is a the section of code that displays all the photos meta information. $exif = exif_read_data("photoname.jpg", 0, true); foreach ($exif as $key => $section) { foreach ($section as $name => $val) { echo "$key.$name: $val<br/>"; } } This then prints ALL the photos information whereas i only need one line of the above output. If you would like to see the out put from the above code then let me know and ill paste it here ASAP. Thanks again
  9. hi, i did something similiar not too long ago. i wrote all the users' contacts into one table and linked them using the users' unique username. One table with many records. hope this helps
  10. hi mjlogan, thanks for the reply. Thats exactly what i thought the problem was going to be. i am going to do more research on the meta data you mentioned. hopefully something will come from that. pls if anyone else has ideas please let me know. thanks again
  11. Hi All, I am new to this forum and am hoping that someone will be able to help me. I am writing an application that allows users to upload images to our server. which i have done fine, I then need to check the date that the image was created to confirm that it was taken as recently as possible. i.e. minutes before uploading the image. The problem i am having is: when the file has been uploaded all the properties of the image are re-created because they get changed by the server during the upload process.(all the dates are the same as the submission of the form). Is it possible to get the properties of the image before the server changes the creation date? I hope this makes sense, and any help will be hugely appreciated!
×
×
  • 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.