Jump to content

jackr1909

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Sydney, Australia

jackr1909's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, first of all, using ltrim with the value of 0 might lead to problems with significant figures (remember, after the decimal point, every 0 is as important as all the other numbers, because it holds a place. Just as 0.3045 != 0.345 Here's what i would do: Find the negative numbers (preg_match maybe) and multiply them by -1 and then trim the 0 and multiply by negative one again
  2. Hi, I have a function that converts URL's in a string to links: $return = preg_replace('@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?)?)@', '<a href="$1" target="_blank">$1</a>', $return); Can i have some help amending it to exclude any links that are in quotes. Thanks
  3. No thanks, but some more helpful users offered a better suggestion, Thanks anyway
  4. Hi, I need to send automated HTML emails with PHP for my web-server. I have SMTP with Postfix and Sendmail. When i send an email, it just goes to the spam folder of the mail client (tried with GMAIL as well as Microsoft outlook). Could i have the code for sending emails so they don't go to the spam folder. With full headers, etc. Thanks a lot, Jack
  5. Hi everyone, i have a user posting system and i want to echo data so that any HTML tags of any kind will be regarded as plaintext, so that it will have no effect on the webpage, thanks Jack
  6. Thanks a lot, kickstart, it works fantastically, Jack
  7. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To: Jack <jack@example.com>, Jack <jack@example1.com>' . "\r\n"; $headers .= 'From: Jack <jack@example.com>' . "\r\n"; $headers .= 'Cc: jack@example.com' . "\r\n"; $headers .= 'Bcc: jack@example.com' . "\r\n"; $headers .= "Reply-To: jack@example.com\r\n"; $headers .= "Return-Path: jack@example.com\r\n"; That should probably do it, if it make sure all of the adresses are consistent with eachother (from is your postfix account, return-patch and reply-to are the same as from). Change the Content type if you ant plain text. Also, you can remove CC and BCC.
  8. the hyphen doesn't usually cause an issue with mail, many organizations actually delete spam as it arrives, so make sure your have your give your headers in full (return addresses, etc). Chances are that your mail is being caught in SPAM and either the mail is automatically deleted by the receiving organizations mail client (Microsoft does this with webmail, and client email services, if the user is not an administrator). The best cure is to list headers (Just google, full php mail headers.) Since you're recieving the mail on a seperate client, it wouldn't be a postfix issue, or a php syntax error.
  9. Hi everyone, i have a 2 tables, one of which contains a list of friends. My username = jack. Any number of those records may or may not contain my username jack in one of two rows (adder or addee). I want to select the highest, second highest, etc (all in seperate query's), id from the other table (links) that was posted by a username (column 'postedby') that is on the same mysql row as my name (in either the adder or the addee columns) and the column (in the table friends 'approved' = yes. Any help would be greatly appreciated, i am a n00b at mysql-networking. Thanks, Jack
  10. Hi everyone, i have this code: SELECT f.*, (SELECT id FROM posts l WHERE l.username = f.addee OR l.username = f.adder ORDER BY id DESC LIMIT $select1,1) AS maxValue FROM friends f WHERE f.adder = '$_SESSION[username]' OR f.addee='$_SESSION[username]' and from friends in the WHERE, i would also like to check that a column 'xyz' = 'yes'. I have tried to simply add it to the end of the query, but i'm getting errors (not MySQL, just nothing is showing) And help would be much appreciated, Thanks, Jack
  11. Dont worry, i got the desc bit. ( added a limit to id FROM POSTS and changed max(id) to id SELECT f.*, (SELECT id FROM posts l WHERE l.username = f.addee OR l.username = f.adder ORDER BY id DESC LIMIT 1,1) AS maxValue FROM friends f WHERE f.adder = 'jackr1909' OR f.addee='jackr1909' ORDER BY maxValue DESC Thanks very much, Jack
  12. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS maxValue FROM friends f WHERE f.adder = 'jack' OR f.addee='jack'
  13. I'm getting syntax error, in regards to your edit, adder and addee are in a different table, the first reply was exactly what i wanted. Thanks, Jack
  14. Thankyou so much, is there anyway that i could order results, so that i could get the second highest value, etc., etc. Thanks again, Jack
×
×
  • 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.