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
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>

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Ok, then I want you to put in the full path the arabic/MainPage/PHP_Files/header/header_01.jpg as your img src and post the img src line from view source on the browser page when you get the page that doesn't display any image.

Link to comment
Share on other sites

you don't have to do your domain, just the path from where index is located as Zhadus stated

 

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

 

Ray

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.