-1

im making a php ebooksotre thing for my lass and i want to put an image but when i try it don't show up i run the file that have

<?php<div id="logo">
<img alt="logo" src="../images/logo.gif"
style="width: 200px; height:100px;" /> <h4>My e-Book Store</h4></div> ?>
It works like an HTML thing but when i put this code into main php file
 <?php require_once('lib/bookstoreimg.php'); ?> 
It show's a small thing(like when you type wrong name/ file dont exists) i tried 'bloginfo ('template_url'); and that does crazy things my container page and footer page disappears show exactly nothing not even the other thing not even the h4 tag (it was showing before) if you want i can send you my whole index.php so you can figure out what is going on exactly but i dont think something else affecting it .... UPDATE: i was trying to find out how to show code
  • 2
    `if you want i can send you my whole index.php` .. What are you waiting for. Send it dude. :D :) – Nana Partykar Nov 12 '15 at 19:27
  • php won't display an image. You can use it to generate the HTML that will show an image. But by itself, it won't do anything. It's entirely server side, meaning that the client only gets the result. – durbnpoisn Nov 12 '15 at 19:29
  • How do you expect us to help identify the problem if you don't show *any* code which demonstrates the problem? You know we can't see your screen from here, right? – David Nov 12 '15 at 19:30
  • http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php <-- reading this will help you help yourself as well as help us help you. – Martin Nov 12 '15 at 19:30
  • Everything in your example should not be enclosed in php tags. That's HTML. – Jaime Nov 12 '15 at 19:47

1 Answers1

0

You need to use 'echo' command to print anything on screen. To print your image on screen use:

<?php
echo'<div id="logo"><img alt="logo" src="../images/logo.gif" style="width: 200px; height:100px;" /> <h4>My e-Book Store</h4></div>'; ?>

PHP is made to dynamically show content. For example showing date. You can read more about PHP here: http://php.net/docs.php

ano95
  • 11
  • 6