Inclure previsulisation thumbshots dans code php

  • Auteur de la discussion Auteur de la discussion mixmax06
  • Date de début Date de début
WRInaute occasionnel
Salut à tous.
J'ai un soucis pour inclure la previsulisation thumbshots dans mon code php. (suit fatigué lol)
voici mon code php avec ascreen à supprimer et mettre thumbshots.



Code:
echo "\n".'<table><tr><td style="vertical-align : top; width : 130px;"><img src="'.$i["url"].'/ascreen.jpg" style="border:0;" alt="" /></td><td style="vertical-align : top;">';

et la ligne thumbshots à inclure:

Code:
<img src="http://open.thumbshots.org/image.pxf?url=[LINK]" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">

Merci pour votre aide.

André
 
Z
Zim'
Guest
Si on suit ton résonnement:

Code:
<img src="http://open.thumbshots.org/image.pxf?url=<? "'.$i["url"].'" ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">

edit: raisonnement? ou résonnement? mon dieux :roll: suis une merde en autographe, cauze des fauroum ça
 
WRInaute occasionnel
Zim' a dit:
Si on suit ton résonnement:

Code:
<img src="http://open.thumbshots.org/image.pxf?url=<? "'.$i["url"].'" ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">

edit: raisonnement? ou résonnement? mon dieux :roll: suis une merde en autographe, cauze des fauroum ça

Marche pas ...

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /homepages/37/d169843185/htdocs/sources/fonctions.php on line 20

Snif... help me
:roll:
 
WRInaute occasionnel
Code:
<img src="http://open.thumbshots.org/image.pxf?url=<?= $i["url"] ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">

et comme ça?
 
Z
Zim'
Guest
mdr.... biscuit... tu sors!!!

Il te fait mettre un point virgule a la fin d'une instruction php, j'avais pas fait attention:

<img src="http://open.thumbshots.org/image.pxf?url=<? "'.$i["url"].'"; ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">
 
WRInaute occasionnel
Toujours l'erreur
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /homepages/37/d169843185/htdocs/sources/fonctions.php on line 20

revoici la ligne de code php:

Code:
echo "\n".'<table><tr><td style="vertical-align : top; width : 130px;"><img src="http://open.thumbshots.org/image.pxf?url=<? "'.$i["url"].'"; ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';"></td>
		<td style="vertical-align : top;">';
        echo '<div class="lien">'."\n".'<a onclick="window.open(this.href,\'_blank\');return false;" href="'.$i["url"].'" title="'.$i["name"].'">'.$i["name"].'</a>';

Merci à vous pour vos reponses.

André
 
WRInaute occasionnel
Zim' a dit:
mdr.... biscuit... tu sors!!!

Il te fait mettre un point virgule a la fin d'une instruction php, j'avais pas fait attention:

<img src="http://open.thumbshots.org/image.pxf?url=<? "'.$i["url"].'"; ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">

désolé zim' mais une inclusion de variable de cette manière: <?= $var ?> ne demande pas de ; !!!! C'est qui qui sors ?

Le problème est que cette ligne :
<img src="http://open.thumbshots.org/image.pxf?url=<? "'.$i["url"].'"; ?>" border="0" onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';">
était incluse dans un echo
 
WRInaute occasionnel
Code:
<?php
$i["url"] = "https://www.webrankinfo.com";
$i["name"] = "WebRankInfo";
?>

<table>
<tr>
<td style="vertical-align : top; width : 130px;">
<img src="http://open.thumbshots.org/image.pxf?url=<?= $i["url"] ?>" border="0" 
  onload="if (this.width>50) this.border=1; this.alt='Thumbnails by Thumbshots.org';"></td>
<td style="vertical-align : top;">
<div class="lien">
<a onclick="window.open(this.href,'_blank');return false;" href="<?= $i["url"] ?>" 
title="<?= $i["name"] ?>"><?= $i["name"] ?></a>
</div>
</td>
</tr>
</table>

ce bout de code fonctionne bien (voir ici)
 
Z
Zim'
Guest
si tu es dans une balise echo
euh... la fleme de tout retapper... il faut échapper les double guillemets si ton écho est entre simple guillemets et inversement... ne pas mettre le <? ?> pour encadrer le truc qu'on ta fait rajouter, et virer le point virgule qu'on t'as fait rajouté...
 

➡️ Offre MyRankingMetrics ⬅️

pré-audit SEO gratuit avec RM Tech (+ avis d'expert)
coaching offert aux clients (avec Olivier Duffez ou Fabien Faceries)

Voir les détails ici

coaching SEO
Discussions similaires
Haut