Insert an image into index.php file

You insert images with php in much the same way you insert images with html.

If you are wanting to stay in php, echo the html code.


<?php
echo ' 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<img src="/images/image1.png" width="280" height="125" title="Logo of a company" alt="Logo of a company" />

</html>
';
?>

I left out a lot of the html code that should be on most pages.

If you just want to use a little php, you can just use short bits of php inserted where you need it.

Some html pages actually using the php include to create parts of the website that are repeated on many (or all) pages. If you want to include an image on every page, copy the code you use on your page and save it to a include folder besing sure to start and stop the code with the php start and stop tags.

Then locate the place you want the image to show on your webpage, and use code similar to this:
<?php include($_SERVER[‘DOCUMENT_ROOT’].“/include/logo.php”) ?>

If that was not what you are looking for, try restating your question.