TOPIC:

Image in pdf mail 6 years 4 months ago #110939

  • Topic Author
  • Pierre2bzh
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 2
  • Thanks: 0
Hello the world! ;)I'me french so sorry for mistakes... :sI have a problem. I've red this ( crosstec.org/en/forums/3-breezingforms-f...-pdf-attachment.html ) but it doesn't work... :s

I have a form here:
idactylo.fr/homepage/index.php/l-associa...demander-une-chambre
I want people upload a picture.
When I receive the mail after validation, it gives that:
zimbra.free.fr/service/home/~/ffexport-p...c=fr&id=61043&part=2

Here is my code of pdf_attachment.php:

<?php
/**
* BreezingForms - A Joomla Forms Application
* @version 1.8
* @package BreezingForms
* @copyright (C) 2008-2012 by Markus Bopp
* @license Released under the terms of the GNU General Public License
**/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// IMPORTANT!
// Supported Tags: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small
?>
<img src=" www.idactylo.fr/homepage/images/headeraihbbreezingforms.jpg ">
</br>
<div align="center"> DEMANDE DE CHAMBRE A L'INTERNAT</div>
<p></br></br></br> <font color="red"><b>DATE DE DEMANDE :<?php echo $this->submitted; ?></b></font></div>
</br></br></br></p>
<table border="1" width="100%">

<tr>
<td colspan="2" bgcolor="#cccccc">
<strong><?php echo BFText::_('COM_BREEZINGFORMS_DATA') ?>:</strong>
</td>
</tr>
<?php
if (count($xmldata)){
foreach ($xmldata as $data) {
?>
<tr>
<td>
<strong><?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true); ?>:</strong>
</td>
<td>
<?php echo nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8')); ?>
</td>
</tr>
<?php
}
}
?>
</table>

THANKS A LOT, i become crazy... :s
Have a good day!
Pierre

Please Log in or Create an account to join the conversation.

Image in pdf mail 6 years 4 months ago #111086

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1075
Bonjour Pierre,

Look at your code and compare it with the Muffiman´s one: you dont define the name of your upload field (for example $field). Please, dont edit your document with microsoft word, use the note pad or another simple text editor.

This kind of code is not clear, dividing and cutting the php code:

<?php
if (count($xmldata)){
foreach ($xmldata as $data) {
?>
<tr>
<td>
<strong><?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true); ?>:</strong>

Try to do it exactly like in the Muffiman post, without such cuts

TheMuffinMan wrote: In your case, you need to determine the name of the field for uploads and then add an image tag, for example:

<?php
$name = '';
$upload = '';

if (count($xmldata)){
   foreach ($xmldata as $data) {
      $value = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
      switch($data[_FF_DATA_NAME]){
        case 'upload':
          $upload = $value;
          break;
        case 'email':
          $email = $value;
          break;
      }
    }
}
?>
<tr>
<td>
   <strong>Image:</strong>
</td>
<td>
  <img src="<?php echo $upload; ?>"/>
</td>
</tr>
<tr>
<td>
   <strong>Email:</strong>
</td>
<td>
  <?php echo $email; ?>
</td>
</tr>

In the above I am assuming a field called "upload" and a field called "email" in your form.

Please Log in or Create an account to join the conversation.

Image in pdf mail 6 years 4 months ago #111252

  • Topic Author
  • Pierre2bzh
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 2
  • Thanks: 0
Hi Pedro!
Thanks a lot for your answer! I progress!
Could you please finish to help me?
Here is now my problem:
I have the official website and a test website.
About the test website, its perfect, i obtain this result: (look at that! without you it could'nt be possible :s):
aihb.org/formok.pdf
it's perfect, there is a picture!

BUT I have a problem with the officiel website.
I obtain this message:
TCPDF ERROR: [Image] No such file or directory in /homepages/18/d515529670/htdocs/asso/administrator/components/com_breezingforms/libraries/tcpdf//asso/demandeinternat/inscription.png
I'm surprising there is a couple of "//"
But what is more surprising for me is that the url seems to be good. When i write echo $url i obtain that:
aihb.org/formnok.pdf
So the adress is correct and work greats.
Why doesn't it work when i write <img src... ?

Here is the part of code written with notepad++:

<?php
$name = '';
$upload = '';
if (count($xmldata)){
foreach ($xmldata as $data) {
$value = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
switch($data[_FF_DATA_NAME]){
case 'upload':
$upload = $value;
break;
case 'email':
$email = $value;
break;
}
}
}
$recup=explode("/", $upload);
$recupfin=$recup[7];
$url=" www.aihb.org/asso/demandeinternat/$recupfin ";
?>
<img src="<?php echo $url; ?>"/>

I'm sorry to waste your time but it's really important for me and i really don't understand because it works great in the test website...

Thanks a lot everyone!!
Pierre, a little frenchie! ;)

Please Log in or Create an account to join the conversation.

Image in pdf mail 6 years 4 months ago #111326

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1075
Hi Pierre,

You are editing a .php file, but this last line
<img src="<?php echo $url; ?>"/>
is html code.

Try it entering this line in your below code:
$recup=explode("/", $upload);
$recupfin=$recup[7];
$url="www.aihb.org/asso/demandeinternat/$recupfin";
echo $url;
?>

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.049 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!