Jump to content

[SOLVED] change "image source "


ilikephp

Recommended Posts

Hello!!

 

Please is there a way to insert pictures in dreamweaver other than this:

<img src="header/header_01.jpg" width="850" height="83">

 

My problem is: when I put the header.php files inside a folder, the header section in my website will not be displayed. I think from the above code :S

 

Can u help me plzz!!

Link to comment
https://forums.phpfreaks.com/topic/101570-solved-change-quotimage-source-quot/
Share on other sites

header.php (it is inside the folder: arabic/MainPage/PHP_Files/)

and the index.php is inside the root folder.

header_01.jpg and header_02.jpg are inside: arabic/MainPage/PHP_Files/header/

 

 

<body>

<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td height="83"><img src="header/header_01.jpg" width="850" height="83"></td>

  </tr>

  <tr>

    <td height="86"><img src="header/header_02.jpg" width="850" height="83">

</td>

  </tr>

</table>

</body>

 

header.php

 

<body>

<table width="850" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td height="83"><img src="header/header_01.jpg"></td>

  </tr>

  <tr>

    <td height="86"><img src="header/header_02.jpg" width="850" height="86"></td>

  </tr>

</table>

</body>

 

 

so I receive an error picture

 

I AM VERY SORRY, coz I did not understand well :S

can u plz give me more explanation?

 

I am really sorry :S:S

 

 

this is inside the index.php:

<tr>

    <td height="169" colspan="3" align="center" valign="bottom"><?PHP include "arabic/MainPage/PHP_Files/header.php"; ?></td>

  </tr>

Even though the img src is in the header.php file, when you use the include, it's loading the information verbatim in the index.php file.

 

Therefore, you need the path from index.php to the image in order to load the image instead of what you originally had, which was the path from header.php to the image.

 

e.g.

www.site.com/index.php

"image/img.gif" -> www.site.com/image/img.gif

www.site.com/header/header.php

"image/img.gif" -> www.site.com/header/image/img.gif

 

BUT when you have header.php inside of index.php you see

www.site.com/index.php

"image/img.gif" -> www.site.com/image/img.gif

"header/image/img.gif" -> www.site.com/header/image/img.gif

Thx for the explanation :)

 

 

I put this code inside my header.php that is inside the folder: arabic/MainPage/PHP_Files/

 

<td height="86"><img src="arabic/MainPage/PHP_Files/header/header_02.jpg" width="850" height="86"></td>

 

but still have the error image

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.