Jump to content

Anandlall12

New Members
  • Posts

    3
  • Joined

  • Last visited

Anandlall12's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey guys. I am trying to strip everything between a key phrase and ending tag but for some reason it is not working. I always get blank data. I've tried many different ways but no luck. basically I have a script that connect to imap and store emails into MySQL as service tickets. works great but I am trying to strip everything except for user reply because currently if a user reply to an email it re-inserts the entire email into MySQL. I added a key phrase at the top of all outgoing emails . 1. structure looks like this. --Reply below this line to respond-- ------------------------------------------------------------------------------------------------ Email body message... 2. When replying to the message it becomes New Message reply...... --Reply below this line to respond-- old message body. 3. so I would only like to insert the new reply message only. This is what I got so far. $message=strip_tags($message, "<br><div><p><u><hr></section>"); $message=preg_replace("</p>", "br /", $message); $message=preg_replace('#--REPLY above this line to respond--(.*?)</section>)#s', ' ', $message); $message=clean("<br/><hr><u>Received On $rep_date / $from_email</u><br><br/>$message"); it inserts the "Received On date and From but $message is blank. If i remove $message=preg_replace('#--REPLY above this line to respond--(.*?)</section>)#s', ' ', $message); it inserts the entire email Any suggestion on what i am doing wrong? thank you all very much.
  2. I am having some issues assigning values from MySQL to GetMenu2 properties. I am trying to select a option by default, it works if I put a static number in but I would like it to load a value from MySQL column. php code: $employee=$rs->GetMenu2('sm_employee','2',null,null,null,'class="selmenu-noborders" onchange="this.form.submit()"'); $smarty->assign('employee', $employee); so basically what's going on here is I've assigned a class and java onChange to the GetMenu2 properties. everything works well but I would like it to "Select" a value from the list by default, which currently is "1" and it does select it, but I need it to get that value from MySQL table. Can anyone help with this? I've spent many hours on it but nothing.. This is the output in html: < select name="sm_employee" class="selmenu-noborders" onchange="this.form.submit()"> < option value='1'>Sam</option> < option selected='selected' value='2'>Nick</option> < option value='3'>James</option> < /select>
×
×
  • 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.