Jump to content

k998

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

k998's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Success Thank you so much for your replies. I was ready to scream and this little snippet of wisdom: made me sit back and look more methodically as to why I could call it from one page and not another. Thanks again, K
  2. Hi, thanks for your reply. Isn't <?php echo quickquote(); ?> 'calling' a function? It displays the output of the function ... But anyway, yes the problem is that I get a 'Fatal error: Call to undefined function quickquote() in /home/xxx/public_html/xxx/quickquote/contact.php on line 110' error. Line 110 is $messages.="Quick Quote Request: " . quickquote() . "<br>"; How do I define it? Why does it 'understand' the function to echo the results but then it's undefined when using in the mail() function? As you can see, I'm out of my depth with this but am desperate to get this resolved. I've tried adding global $quickquote; in the mail() function. Is that the correct way to define the function but I've just put it in the wrong spot?
  3. Hi all, I am just starting out in the world of php and have got this far with a lot of googling. But I'm really stuck with this part now. I have a function that works perfectly for display on a page, eg <?php echo quickquote(); ?> function quickquote() { global $db; global $cart; $cart = $_SESSION['cart']; if ($cart) { $items = explode(',',$cart); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $quickquote[] = 'Quote Required:<br />'; foreach ($contents as $id=>$qty) { $sql = 'SELECT * FROM products WHERE id = '.$id; $result = $db->query($sql); $row = $result->fetch(); extract($row); $quickquote[] = ''.$qty.''; $quickquote[] = ' x '; $quickquote[] = '' . $model . ''; $quickquote[] = ' (' . $type . '- '; $quickquote[] = ''. $basin . '- '; $quickquote[] = ''. $top . ')'; $quickquote[] = '<br />'; } $quickquote[] = 'End of Quick Quote Request'; } else { $quickquote[] = 'The quote cart is empty.'; } return join('',$quickquote); } However, i am trying to include this in an email message: if(!$error) { $messages="From: $email <br>"; $messages.="Name: $name <br>"; $messages.="Email: $email <br>"; $messages.="Phone: $phone <br>"; $messages.="Message: $message <br>"; $messages.="Quick Quote Request: $quickquote <br>"; $mail = mail($to,$subject,$messages,$headers); The email also works perfectly with the exception that the data is not there from $quickquote. I've tried all sorts of variations and suggested solutions from the web but nothing I've tried has been successful so far. It's amazing that I've got this far so I don't want to give up on it, but I'm just completely stumped ... All information and help very much appreciated. Cheers K
  4. From memory, it's in modules/order_status.php
×
×
  • 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.