Discussion:
An HTML/CSS question
Ethan Rosenberg, PhD
2014-06-18 04:41:23 UTC
Permalink
Dear List -

I really do not know where to send this, but feel that PHP programmers
are well familiar with HTML/CSS.

See the attached program. The background file exists,

***@meow:/var/www/Webpages2# cd ..
***@meow:/var/www# ls Webpages2/Images/background3.jpeg
Webpages2/Images/background3.jpeg

but it does not display.

The script is in /var/www
The image is in /var/www/Webpages2/Images/

What is my mistake?

TIA

Ethan
Maciek Sokolewicz
2014-06-18 07:47:11 UTC
Permalink
Post by Ethan Rosenberg, PhD
Dear List -
I really do not know where to send this, but feel that PHP programmers
are well familiar with HTML/CSS.
See the attached program. The background file exists,
Webpages2/Images/background3.jpeg
but it does not display.
The script is in /var/www
The image is in /var/www/Webpages2/Images/
What is my mistake?
TIA
Ethan
Ethan, paths which you supply in CSS are paths to files called from the
client. This means that they have to be relative to the current URI, not
the system path. So this is fully dependent on how the server-path is
translated to a domain-URI.

I would guess that "/var/www/Webpages2" is translated to something like
www.example.com/, with "/var/www/Webpages2" thus being the domain root.
If you then supply "url("Webpages2/Images/background3.jpeg")" it will
look for www.example.com/Webpages2/Images/background3.jpeg in
/var/www/Webpages2/Webpages2/Images which is obviously wrong.

Change it to /Images/background3.jpeg and it will most likely work.

- Tul

P.S. Why did you bother to echo all that HTML in the document? Just make
it a fully static HTML file, no need for it to be partially PHP which
simply prints static content.

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Camille Hodoul
2014-06-18 08:09:12 UTC
Permalink
Hello,

if you use a browser with Developer tools, you can probably see in the
console or in the network tab an error message, e.g. "Failed to load
resource: the server responded with a status of 404 (Not Found) http://
www.example.com/var/www/Webpages2/Images/background3.jpeg ".
It can help you debug.

Camille
Post by Maciek Sokolewicz
Post by Ethan Rosenberg, PhD
Dear List -
I really do not know where to send this, but feel that PHP programmers
are well familiar with HTML/CSS.
See the attached program. The background file exists,
Webpages2/Images/background3.jpeg
but it does not display.
The script is in /var/www
The image is in /var/www/Webpages2/Images/
What is my mistake?
TIA
Ethan
Ethan, paths which you supply in CSS are paths to files called from the
client. This means that they have to be relative to the current URI, not
the system path. So this is fully dependent on how the server-path is
translated to a domain-URI.
I would guess that "/var/www/Webpages2" is translated to something like
www.example.com/, with "/var/www/Webpages2" thus being the domain root.
If you then supply "url("Webpages2/Images/background3.jpeg")" it will
look for www.example.com/Webpages2/Images/background3.jpeg in
/var/www/Webpages2/Webpages2/Images which is obviously wrong.
Change it to /Images/background3.jpeg and it will most likely work.
- Tul
P.S. Why did you bother to echo all that HTML in the document? Just make
it a fully static HTML file, no need for it to be partially PHP which
simply prints static content.
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Camille Hodoul
Jim Giner
2014-06-18 14:08:22 UTC
Permalink
Actually - I loaded this verbatim and it worked fine. Some minor layout
issues but with or without the image reference my IE10 showed all of
your buttons and such.

And yes - when will EVER learn some basic php? No need to use php and
echo at all here.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ethan Rosenberg, PhD
2014-06-22 04:20:54 UTC
Permalink
Post by Jim Giner
Actually - I loaded this verbatim and it worked fine. Some minor layout
issues but with or without the image reference my IE10 showed all of
your buttons and such.
And yes - when will EVER learn some basic php? No need to use php and
echo at all here.
Jim -

Thanks.

PHP and HTML hmm.....

Try this in HTML

Mary had a Little
Lamb

no matter how many %nbsp's you put in, it won't work.

Try

echo "Mary had a Little";
echo " Lamb";

BTW %nbsp can be used in an echo to exactly line up the elements.

Ethan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Giner
2014-06-22 12:46:16 UTC
Permalink
Post by Ethan Rosenberg, PhD
Post by Jim Giner
Actually - I loaded this verbatim and it worked fine. Some minor
layout issues but with or without the image reference my IE10
showed all of your buttons and such.
And yes - when will EVER learn some basic php? No need to use php
and echo at all here.
Jim -
Thanks.
PHP and HTML hmm.....
Try this in HTML
Mary had a Little Lamb
no matter how many %nbsp's you put in, it won't work.
Try
echo "Mary had a Little"; echo " Lamb";
BTW %nbsp can be used in an echo to exactly line up the elements.
Ethan
I have no idea what point you are trying to make to me. I made no
comment about non-breaking spaces to you nor did I criticize your
current sample script. I only said that you showed no improvement in
your programming skills in the last year or so since your last posts.

BUT - I did do a little test of your attempt to prove this point, and
found that using IE10 ( my preferred browser alas) in a plain HTML page
the non-breaking spaces did exactly what they purport to do.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Christoph Becker
2014-06-22 13:07:12 UTC
Permalink
Post by Jim Giner
Post by Ethan Rosenberg, PhD
Post by Jim Giner
And yes - when will EVER learn some basic php? No need to use php
and echo at all here.
PHP and HTML hmm.....
Try this in HTML
Mary had a Little Lamb
no matter how many %nbsp's you put in, it won't work.
Try
echo "Mary had a Little"; echo " Lamb";
BTW %nbsp can be used in an echo to exactly line up the elements.
I have no idea what point you are trying to make to me. I made no
comment about non-breaking spaces to you nor did I criticize your
current sample script. I only said that you showed no improvement in
your programming skills in the last year or so since your last posts.
BUT - I did do a little test of your attempt to prove this point, and
found that using IE10 ( my preferred browser alas) in a plain HTML page
the non-breaking spaces did exactly what they purport to do.
Anyway, it should not matter whether the HTML is hand-written or
generated by PHP.
--
Christoph M. Becker
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
James Moe
2014-06-18 21:19:10 UTC
Permalink
Post by Ethan Rosenberg, PhD
See the attached program. The background file exists,
but it does not display.
What is the Document Root?
How are you running the script?
--
James Moe
jmm-list at sohnen-moe dot com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
James Moe
2014-06-22 05:39:22 UTC
Permalink
On 06/21/2014 09:45 PM, Ethan Rosenberg, PhD wrote:>
Document Root: /var/www
How are you running the script? Sorry, I don't understand your question.
Could you please expand?
Are you using the File/Open File menu on your browser?
Or is it opened with a link in a web page? Was the linking page loaded
from the Document Root? If not, the relative path to the image will not
work. Unless there is some compelling reason otherwise, the path should
start at the root: "/Webpages2/Images/background3.jpeg".
Another thought: Is it spelled correctly? Is the case correct?
--
James Moe
jmm-list at sohnen-moe dot com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...