How to load image in php

Extensions, styles and support for everything else about phpBB
Post Reply
User avatar
title10usc311
Donor
Posts: 14
Joined: 10 Feb 2018, 23:13
Location: USA
Contact:

How to load image in php

#1

Post by title10usc311 » 13 Apr 2018, 08:15

Hello, I have a chat here that id like to add a little avatar before the username. You can see the "NEED IMAGE HERE" My question is how can i display a image there using php? Did I ask that right? :oops: html does not seem to work.. I know this isnt exactly phpbb but, Kasimi!!! The chat master! Please help me!

Thank you!

Post.php

Code: Select all

<?php
session_start();
if(isset($_SESSION['name'])){
    $text = $_POST['text'];
     
    $cb = fopen("log.html", 'a');
    fwrite($cb, "<div class='name'>NEED IMAGE HERE<b>".$_SESSION['name'].":&nbsp;</b><i>(".date("F j, Y").")</i></div><br><div class='msgln'>".stripslashes(htmlspecialchars($text))."<br><br></div>");
    fclose($cb);
}
?>
CSS is needed.

Code: Select all

.name { margin:0 0 2px 0;
    font:12px arial;
    display: inline; color: #ffffff; text-shadow: 0 0 1em #1DFF38, 0 0 1em #1DFF38, 0 0 1.2em #1DFF38;}
UPDATE:
I was having issues with the image not loading, than blinking..Moreover, i added this and it seemed to work.

Code: Select all

<?php 
    $src = 'avatar.gif';
 ?>

 <img src='<?php echo $src ?>'>
Thanks anyway. By the way, love the new chat buttons! Looks great!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest