PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > graphics and text dont mix
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
graphics and text dont mix

Réponse
 
LinkBack Outils de la discussion
Vieux 03/03/2008, 03h09   #1
barret bonden
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut graphics and text dont mix

Trying to get a jpg and some text on the same page - I can get the image but
as soon as I add text - either in an echo as shown below in my code or with
embedded HTML inside a <html></html > it blows up.
I know it's a header issue but how to get past it ?

<?php
$imagepath='keywest.jpg';
$image=imagecreatefromjpeg($imagepath);

header('Content-Type: image/jpeg');
echo "<h5>I love using PHP!</h5>";

imagejpeg($image);
?>


  Réponse avec citation
Vieux 03/03/2008, 04h05   #2
larry@portcommodore.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: graphics and text dont mix

On Mar 2, 6:09 pm, "barret bonden" <supp...@networks-cc.com> wrote:
> Trying to get a jpg and some text on the same page - I can get the image but
> as soon as I add text - either in an echo as shown below in my code or with
> embedded HTML inside a <html></html > it blows up.
> I know it's a header issue but how to get past it ?
>
> <?php
> $imagepath='keywest.jpg';
> $image=imagecreatefromjpeg($imagepath);
>
> header('Content-Type: image/jpeg');
> echo "<h5>I love using PHP!</h5>";
>
> imagejpeg($image);
> ?>


What you output from PHP should be HTML if you want to include text
and images - so you chould use

<img src="<?php echo $filename; ?>">

or something to that effect to add images to text.
  Réponse avec citation
Vieux 04/03/2008, 02h20   #3
barret bonden
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: graphics and text dont mix

Very kind of you. Makes sense and worked.




<larry@portcommodore.com> wrote in message
news:08716c2d-de34-4c8f-8264-840b159c831e@e23g2000prf.googlegroups.com...
> On Mar 2, 6:09 pm, "barret bonden" <supp...@networks-cc.com> wrote:
>> Trying to get a jpg and some text on the same page - I can get the image
>> but
>> as soon as I add text - either in an echo as shown below in my code or
>> with
>> embedded HTML inside a <html></html > it blows up.
>> I know it's a header issue but how to get past it ?
>>
>> <?php
>> $imagepath='keywest.jpg';
>> $image=imagecreatefromjpeg($imagepath);
>>
>> header('Content-Type: image/jpeg');
>> echo "<h5>I love using PHP!</h5>";
>>
>> imagejpeg($image);
>> ?>

>
> What you output from PHP should be HTML if you want to include text
> and images - so you chould use
>
> <img src="<?php echo $filename; ?>">
>
> or something to that effect to add images to text.



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h12.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10835 seconds with 11 queries