Jump to content

spires

Members
  • Posts

    492
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

spires's Achievements

Advanced Member

Advanced Member (4/5)

1

Reputation

  1. Worked it out $findImg = preg_match_all('/<a(.*)<\/a>/i',$cleanMeg, $result); $stripFirstImg = str_replace($result[0][0], "", $cleanMeg); Thanks anyway.
  2. Hi I'm pulling my data from a database. I'm trying to grab the first <a> and place it in a String. Any ideas? <a> Tag: <a href="http://lwww.mysite,com"><img alt="" src="/media/lci_strip.png" style="width: 701px; height: 92px; " /></a> What I have so far - but not working: $findImg = preg_match_all('/<a[^</a>]+</a>/i',$cleanMeg, $result); $stripFirstImg = str_replace($result[0][0], "", $cleanMeg); Thanks
  3. Hi I have a string that is pulled from a database. I want to remove the title, but not sure how I do it. I was trying something like this: $string = '<strong>Dynamic Title, so will be different on every loop</strong> Rest of text etc'; $newString = preg_replace('<strong>[^A-Za-z0-9_-]+</strong><br />', '', $string); Any ideas? Thanks
  4. Hi Thanks for your reply. This is the header for every page. So what happens here happens all over. I'm guessing that the SESSION is getting populated with the GET. But as the next page has not GET, the SESSION end up blank. Which is why I have the IF. But that dose not seem to work. Global. How do I pass a variable from my main file to the header file, without global ? Thanks
  5. Hi I'm trying to save a $_GET[] in to a session. It's working on the page that is GETTING the variables from the url, but soon as I click to the next page the SESSION seems to empty out. Any Ideas? Header Script <?PHP session_start(); require_once('../../../includes/initialize.php'); global $page; global $metTitle; global $metDesc; global $metKey; $getFM = $_GET['fm']; $getKW = $_GET['kw']; $getGR = $_GET['gr']; if(!empty($getFM)){ $from = $_SESSION['FM'] = $getFM; }else{ } if(!empty($getGR)){ $interest = $_SESSION['GR'] = $getGR; }else{ } if(!empty($getKW)){ $ref = $_SESSION['KW'] = $getKW; }else{ } echo $getFM.' - '.$interest.' - '.$from.' - '.$ref; ?> Thanks
  6. Plue: $send = Form_signup::send_notification('email', 'BM', 'BM', 'email', $body_content, $subject); echo $send; Returns 1 So it should be working
  7. Hi All the Variable are getting pushed in to the function: send_notification($sendTo, $name, $from_name, $from_email, $body_content, $subject) As I can echo them out. So I'm guessing it would be in this section: public function send_notification($sendTo, $name, $from_name, $from_email, $body_content, $subject){ $mailMessage =<<<EMAILBODY {$body_content} EMAILBODY; $mailMessage = wordwrap($mailMessage, 70); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "localhost"; $mail->Port = 25; $mail->SMTPAuth = false; $mail->isHTML(TRUE); $mail->FromName = $from_name; $mail->From = $from_email; $mail->AddAddress($sendTo, $name); $mail->Subject = $subject; $mail->Body = $mailMessage; $result = $mail->Send(); return $result; } I ideas would be a great help thanks
  8. Hi. I'm using PHP mailer. But I can't get it to send the Email: Class: public function send_notification($sendTo, $name, $from_name, $from_email, $body_content, $subject){ $message =<<<EMAILBODY {$body_content} EMAILBODY; $message = wordwrap($message, 70); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "localhost"; $mail->Port = 25; $mail->SMTPAuth = false; $mail->isHTML(TRUE); $mail->FromName = $from_name; $mail->From = $from_email; $mail->AddAddress($sendTo, $name); $mail->Subject = $subject; $mail->Body = $message; $result = $mail->Send(); return $result; } PHP $body_content = ' Dear BusinessMobile.com <br /><br /> A website user has filled in the form on the website. See the details below. <br /><br /> Company: '.$company.'<br /> Name: '.$name.'<br /> Email: '.$email.'<br /> Tele: '.$telephone.'<br /> Message: '.$message.'<br /><br /> Interest: '.$Fpage.'<br /> Reference: '.$ref.'<br /><br />'; $subject = 'BusinessMobile.com - Contact Request'; Form_signup::send_notification('spires1@mail.com', 'BM', 'BM', 'spires1@mail.com', $body_content, $subject); Any ideas where i'm going wrong ? Thanks
  9. Hi Simple question, how do I reFormat a date. $dateCreated (2012-01-14) to become: 14th jan 2012 So far I have this, but it's not working: $expDate = explode('-',$dateCreated); $date1 = mktime(0, 0, 0, date('m', $expDate[1]), date('d', $expDate[2]), date('Y', $expDate[0])); $date = date('d m Y', $date1); Thanks
  10. CREATE TABLE IF NOT EXISTS `admin_emails_desc` ( `id` BIGINT( 11 ) NOT NULL AUTO_INCREMENT , `admin_emails_id` BIGINT( 11 ) NOT NULL DEFAULT '', `lang_id` BIGINT( 11 ) NOT NULL DEFAULT '', `name` VARCHAR( 150 ) NOT NULL DEFAULT '', `subject` VARCHAR( 150 ) NOT NULL DEFAULT '', `body_content` TEXT NOT NULL , `from_name` VARCHAR( 150 ) NOT NULL DEFAULT '', `from_email` VARCHAR( 250 ) NOT NULL DEFAULT '', PRIMARY KEY ( `id` ) , FOREIGN KEY ( `admin_emails_id` ) , FOREIGN KEY ( `lang_id` ) ) ENGINE = MYISAM AUTO_INCREMENT =1 MySQL said: #1064 - 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 ' FOREIGN KEY (`lang_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1' at line 11
  11. Hi, Thanks thats a big help Much appreciated. I'll look into how Google works. Thanks
  12. lol, Sorry it is a PHP question. Basically, yes I don't know where to get the info, which I'll be able to find. But also don't know who to structure the DB. What I'm after doing to just like on the dating sites. Where you can select an area, e.g London, then view profiles with a selected mile radious. e.g 10 miles. I'm assuming it is to do with the IOS. Before I had: Country - id - name Country - id - countryID - name Area - id - countryID - countyID Areacode - id - code But this is not going to allow me to do what I need. Any idea, ho I should be structuring it? Thanks
  13. yeah, Where I can find the information. I've got the countries, but thats it so far. Thanks for your help
  14. Hi I'm trying to build a register page for an international website. I currently have the IOS Code E.G: AFGHANISTAN AF AFG But how do I go about getting all of the sub Derivatives ? E.G UK - Essex, Harlow, London, Manchester etc Thanks
×
×
  • 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.