Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: cannot execute img src in localhost

Reply
Thread Tools

Re: cannot execute img src in localhost

 
 
Jonathan N. Little
Guest
Posts: n/a
 
      11-09-2012
se wrote:
>
> "Lewis" <(E-Mail Removed)> skrev i meddelelsen
> news:(E-Mail Removed)...
>> In message <k7ffae$8of$(E-Mail Removed)>
>> se <(E-Mail Removed)> wrote:
>>
>>> <link href="mystyle.php" rel="stylesheet" type="text/css">
>>> A stylesheet must have the extention .css

>>
>> What idiot told you that?

>
> A .php extention won't work together with a rel="stylesheet"
> At least not in EW2. I just made a trial. You should do.


I guess you never heard of the ForceType directive nor the PHP header()
function.

What is EW2?


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
Denis McMahon
Guest
Posts: n/a
 
      11-10-2012
On Fri, 09 Nov 2012 22:12:28 +0100, se wrote:

> "Lewis" <(E-Mail Removed)> skrev i meddelelsen
> news:(E-Mail Removed)...
>> In message <k7ffae$8of$(E-Mail Removed)>
>> se <(E-Mail Removed)> wrote:
>>
>>> <link href="mystyle.php" rel="stylesheet" type="text/css">
>>> A stylesheet must have the extention .css

>>
>> What idiot told you that?

>
> A .php extention won't work together with a rel="stylesheet"
> At least not in EW2. I just made a trial. You should do.


I have no idea what ew2 is, but a php file can return a stylesheet as
long as it sets the correct content type (and even that might not be
essential as the mime type should be defined in the link element).

<?php

header( "Content-Type: text/css; charset=utf-8" );

session_start();

echo "body {padding:1em 3em}";

if ( !isset( $_SESSION["logged_in"] ) )
echo "body {background-color:#ffcccc}";
else
echo "body {background-color:#ccffcc}";

unset( $_SESSION );

?>

This can be seen at:

http://www.sined.co.uk/tmp/phpcss.htm

which calls the css without starting a session first

and:

http://www.sined.co.uk/tmp/phpcss2.php

which creates a session and then calls the css

Note - the "unset( $_SESSION );" is inserted so that calling phpcss2.php
followed by phpcss.htm doesn't create a false "logged in" colour when
you're meant to see the not logged in colour. Otherwise the session from
the earlier call to phpcss2.php would persist to the later call to
phpcss.php.

Rgds

Denis McMahon
 
Reply With Quote
 
 
 
 
Denis McMahon
Guest
Posts: n/a
 
      11-10-2012
On Sat, 10 Nov 2012 02:21:51 +0000, Denis McMahon wrote:

> unset( $_SESSION );


This should have been:

session_destroy();

Rgds

Denis McMahon
 
Reply With Quote
 
Lewis
Guest
Posts: n/a
 
      11-11-2012
In message <k7jrjs$ev7$(E-Mail Removed)>
se <(E-Mail Removed)> wrote:

> "Lewis" <(E-Mail Removed)> skrev i meddelelsen
> news:(E-Mail Removed)...
>> In message <k7ffae$8of$(E-Mail Removed)>
>> se <(E-Mail Removed)> wrote:
>>
>>> <link href="mystyle.php" rel="stylesheet" type="text/css">
>>> A stylesheet must have the extention .css

>>
>> What idiot told you that?


> A .php extention won't work together with a rel="stylesheet"


You have to specify the type="text/css".

> At least not in EW2. I just made a trial. You should do.


I have no idea what EW2 is, but yes it does work, I have tried it.

If it is not working for you, it is probably your web-server overriding
the type declaration, usually like this:

AddType application/x-httpd-php .php

Although, I *believe* the local type declaration should always override
the server default. *That* I have not tested.

Regardless, a stylesheet does not require .css. Never has. Anyone who
told you that was ignorant or lying.

--
You know, in a world in which Bush and Blair can be nominated for the
Nobel Peace Prize, "for having dared to take the necessary decision to
launch a war on Iraq without having the support of the UN" I find myself
agreeing with Tom Lehrer: satire is dead. - Neil Gaiman
 
Reply With Quote
 
BootNic
Guest
Posts: n/a
 
      11-11-2012
In article <(E-Mail Removed)>, Lewis
<(E-Mail Removed)> wrote:

> In message <k7jrjs$ev7$(E-Mail Removed) se <(E-Mail Removed):


[snip]

>> At least not in EW2. I just made a trial. You should do.


> I have no idea what EW2 is, but yes it does work, I have tried it.


Microsoft Expression Web 2 perhaps

[snip]

> Regardless, a stylesheet does not require .css. Never has. Anyone who
> told you that was ignorant or lying.


If It's On The Internet, It Must Be True

google: stylesheet "must have" "css extension"

Easy to see where some may get the impression that a stylesheet needs
an extension.

Sometimes it takes a several wacks with a clue club to undo a stupid
stick.


--
BootNic Sun Nov 11, 2012 03:24 am
I had a monumental idea this morning, but I didn't like it.
*Samuel Goldwyn*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAlCfYMwACgkQOcdbyBqMFBHR3wCfcdxepPeCqy JywvNV1L9zimJ7
dpgAoNSQoZODABDN71OVILYdeWLyRhfE
=X+KQ
-----END PGP SIGNATURE-----

 
Reply With Quote
 
se
Guest
Posts: n/a
 
      11-11-2012

"Lewis" <(E-Mail Removed)> skrev i meddelelsen
news:(E-Mail Removed)...
> In message <k7jrjs$ev7$(E-Mail Removed)>
> se <(E-Mail Removed)> wrote:
>
>> "Lewis" <(E-Mail Removed)> skrev i meddelelsen
>> news:(E-Mail Removed)...
>>> In message <k7ffae$8of$(E-Mail Removed)>
>>> se <(E-Mail Removed)> wrote:
>>>
>>>> <link href="mystyle.php" rel="stylesheet" type="text/css">
>>>> A stylesheet must have the extention .css
>>>
>>> What idiot told you that?

>
>> A .php extention won't work together with a rel="stylesheet"

>
> You have to specify the type="text/css".
>
>> At least not in EW2. I just made a trial. You should do.

>
> I have no idea what EW2 is, but yes it does work, I have tried it.
>
> If it is not working for you, it is probably your web-server overriding
> the type declaration, usually like this:
>
> AddType application/x-httpd-php .php
>
> Although, I *believe* the local type declaration should always override
> the server default. *That* I have not tested.
>
> Regardless, a stylesheet does not require .css. Never has. Anyone who
> told you that was ignorant or lying.
>
> --
> You know, in a world in which Bush and Blair can be nominated for the
> Nobel Peace Prize, "for having dared to take the necessary decision to
> launch a war on Iraq without having the support of the UN" I find myself
> agreeing with Tom Lehrer: satire is dead. - Neil Gaiman


Denis showed it. And you're right.

Regards

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      11-11-2012
BootNic wrote:
> In article <(E-Mail Removed)>, Lewis
> <(E-Mail Removed)> wrote:


>> I have no idea what EW2 is, but yes it does work, I have tried it.

>
> Microsoft Expression Web 2 perhaps


Oh! Well I have never put anything with "Microsoft" and "standards
compliant" in the same sentence so I would not use it for validating any
code...


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: cannot execute img src in localhost Ian HTML 0 11-08-2012 12:35 AM
Re: cannot execute img src in localhost Ben Bacarisse HTML 0 11-08-2012 12:17 AM
What does the SRC in <IMG SRC> stand for? pheadxdll HTML 16 06-06-2007 02:45 AM
<txt src= ...> equivalent of <img src= ...> Steve Richter ASP .Net 3 02-09-2006 08:44 PM
src.jar (src.zip) missing on Mac OSX Java 1.4.1 installation? Greg Johnson Java 4 09-18-2003 07:21 AM



Advertisments