Hi, how do I insert an image into my index.php file? As of now it looks like this:
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.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<img src="/images/image1.png" width="280" height="125" title="Logo of a company" alt="Logo of a company" />
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['DOCUMENTROOT']."/include/logo.php") ?>
If that was not what you are looking for, try restating your question.
The server will compile the php code , and send it along with your php file.
So you can just
<html><head><title><?php echo "cool title";?></title></head>
<img src="<?php echo $image_url;?>">
So depending where your image is coming from, inserting an image in your index.php could be as simple as
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<img src="myPic.jpg" alt="myPic" />
You can insert image in Index.php file by(<img src="myPic.jpg">) img src command.