can any one help with this display code

Discussion in 'PHP' started by dougvcd, Aug 19, 2007.

  1. #1
    ok this code puts an image on a page and other fields down the side
    what i would like is the image in center and all fields below
    if any one can help
    cheers
    Doug

    //Outputs the image and other data
    Echo "<img src=http://www.uk-caravan-hire.com/images/".$info['pname'] ." alt=\"Image\" align=\"left\" width=\"100px\" height=\"75px\" hspace=\"10px\" vspace=\"8px\"> <br>";
    Echo "<b>Park Name:</b> ".$info['parkname'] . " <br>";
    Echo "<b>Park Location:</b> ".$info['parklocation'] . " <br>";
    Echo "<b>Details:</b> ".$info['caravandetails'] . " <hr>";
     
    }
    ?> 
    PHP:

     
    dougvcd, Aug 19, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    <p style="text-align: center;"> your image here </p>
    
    HTML:
     
    nico_swd, Aug 19, 2007 IP
  3. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok thanks for the info but where do i put that line of code
    cheers
    Doug
     
    dougvcd, Aug 19, 2007 IP
  4. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    cant get this to work
    Doug
     
    dougvcd, Aug 20, 2007 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    
    Echo "<p style=\"text-align: center;\"><img src=http://www.uk-caravan-hire.com/images/".$info['pname'] ." alt=\"Image\" align=\"left\" width=\"100px\" height=\"75px\" hspace=\"10px\" vspace=\"8px\"></p>";
    
    PHP:
     
    nico_swd, Aug 20, 2007 IP
  6. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i am very sorry but this does not work right
    still getting image on left and writting down the side of image
    what i was looking for was
    image in the center of the page
    and the writting underneath to the left
    cheers
    Doug
     
    dougvcd, Aug 20, 2007 IP
  7. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #7
    Oh yeah, remove this from the <img> tag:
    
    align=\"left\" 
    
    Code (markup):
     
    nico_swd, Aug 20, 2007 IP
  8. shotazi

    shotazi Peon

    Messages:
    422
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #8
    image will in center if you edit this align=\"left\" and write align=\"center\"

    Echo "<img src=http://www.uk-caravan-hire.com/images/".$info['pname'] ." alt=\"Image\" align=\"center\" width=\"100px\" height=\"75px\" hspace=\"10px\" vspace=\"8px\"> <br>";
     
    shotazi, Aug 20, 2007 IP
  9. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Echo "<img src=http://www.uk-caravan-hire.com/images/".$info['pname'] ." alt=\"Image\" align=\"center\" width=\"100px\" height=\"75px\" hspace=\"10px\" vspace=\"8px\"> <br>";
    PHP:
    sorry this just does not work
    Doug
     
    dougvcd, Aug 20, 2007 IP
  10. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    any more offers of help as i would like to get this right
    cheers
    Doug
    and thanks for all who have tried so far
     
    dougvcd, Aug 21, 2007 IP
  11. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #11
    Lol at 10 replies and still no luck aligning an image. Jeeze... this does work:

    
    Echo '<p style="text-align: center;"><img src="http://www.uk-caravan-hire.com/images/'.$info['pname'] .'" alt="Image" width="100px" height="75px"></p>';
    Echo "<b>Park Name:</b> ".$info['parkname'] . " <br>";
    Echo "<b>Park Location:</b> ".$info['parklocation'] . " <br>";
    Echo "<b>Details:</b> ".$info['caravandetails'] . " <hr>";
    
    PHP:
     
    nico_swd, Aug 21, 2007 IP
  12. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #12
    //Outputs the image and other data
    Echo "<center><img src=http://www.uk-caravan-hire.com/images/".$info['pname'] ." alt=\"Image\" align=\"left\" width=\"100px\" height=\"75px\" hspace=\"10px\" vspace=\"8px\"> <br>";
    Echo "<b>Park Name:</b> ".$info['parkname'] . " <br>";
    Echo "<b>Park Location:</b> ".$info['parklocation'] . " <br>";
    Echo "<b>Details:</b> ".$info['caravandetails'] . " <hr></center>";
     
    }
    ?>
    PHP:
     
    nhl4000, Aug 21, 2007 IP
  13. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #13
    <center> tags are deprecated.
     
    nico_swd, Aug 21, 2007 IP
  14. nhl4000

    nhl4000 Well-Known Member

    Messages:
    479
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #14
    Yeah, but it would still work...Wouldn't it?
     
    nhl4000, Aug 21, 2007 IP
  15. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #15
    I'm not too sure, since you didn't remove the align=\"left\" from the image tag.
     
    nico_swd, Aug 21, 2007 IP
  16. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #16
    big thanks nico
    that worked just as i needed
    and a big thanks to all for help
    till next time
    He He He
    Doug
     
    dougvcd, Aug 21, 2007 IP