Struggling to display phots
Posted by: Jaysdad (---.range165-120.btcentralplus.com)
Date: November 20, 2016 01:36AM

I have a database that holds the path to the photo and also the filename, I want to display the image on the screen, try as I might I cannot get this to work. I have simplified it, but still cant get it to work. Once I have the simple version working, I can do it properly

$imgurl = "G:wamp/www/images/";
$name = "mum.jpg";
echo '<img src="'.$imgurl.$name.'" />';

My images are saved in G:wamp/www/images
My photo in this case is mum.jpg

Help I am getting balder

Options: ReplyQuote
Re: Struggling to display phots
Posted by: RiggsFolly (Moderator)
Date: November 20, 2016 02:10AM

First try
$imgurl = "G:/wamp/www/images/";

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Struggling to display phots
Posted by: Jaysdad (---.range165-120.btcentralplus.com)
Date: November 20, 2016 10:29AM

Yes, sorry I realised that as I posted it, I changed my code but no difference.

Options: ReplyQuote
Re: Struggling to display phots
Posted by: RiggsFolly (Moderator)
Date: November 20, 2016 02:37PM

Ther are so many possible things, none of which are WAMPServer related.

I assume you have added these files to the \wamp\www folder. This is not a good idea as the WAMPServer homepage lives in there.
The normal process is to create a subdirectory and then create a Virtual Host to service each of your sites under development.

See [forum.wampserver.com]
And [forum.wampserver.com]
And [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Struggling to display phots
Posted by: Jaysdad (---.range165-120.btcentralplus.com)
Date: November 20, 2016 10:48PM

I have /wamp/www/images, the file is in there. (I had tried it initially in a separate directory of the hard drive, and it did not work there either.

when I type [localhost], the correct photo shows on the screen.

Options: ReplyQuote
Re: Struggling to display phots
Posted by: Jaysdad (---.range165-120.btcentralplus.com)
Date: November 20, 2016 10:51PM

When I echo the full path and filename, I don't have localhost

echo $imgurl.$fname;
G:/wamp/www/images/mum.jpg

Options: ReplyQuote
Re: Struggling to display phots
Posted by: RiggsFolly (Moderator)
Date: November 21, 2016 01:34AM

Where is the code that you are running situated in the file structure

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.