Discussion:
Browser displaying php code
Richard Dunne
2014-03-13 17:35:37 UTC
Permalink
I installed Bluefish editor with the default configuration. I am trying to
display PHP variables in a html table using echo statements. Without any
html code in the echo statement, no php displays in the webpage as
expected. However, after I insert the html code between the " ", the php
code appears in the webpage, for loop code and php variables in the echo
statement. I don't understand why. Is this a configuration issue? Or is
this a bug? This issue doesn't occur with Notepad++. Appreciate any
advice.

Richard Dunne
Lindsay Haisley
2014-03-13 18:00:03 UTC
Permalink
This isn't entirely clear. Can you give an example?
Post by Richard Dunne
I installed Bluefish editor with the default configuration. I am
trying to display PHP variables in a html table using echo statements.
Without any html code in the echo statement, no php displays in the
webpage as expected. However, after I insert the html code between
the " ", the php code appears in the webpage, for loop code and php
variables in the echo statement. I don't understand why. Is this a
configuration issue? Or is this a bug? This issue doesn't occur with
Notepad++. Appreciate any advice.
--
Lindsay Haisley | "The only unchanging certainty
FMP Computer Services | is the certainty of change"
512-259-1190 |
http://www.fmp.com | - Ancient wisdom, all cultures
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
the body of a message to listar-QLpEr2logwzILq5++***@public.gmane.org
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Richard Dunne
2014-03-13 18:14:19 UTC
Permalink
Hi Lindsay,

If I use
for($x=0; $x<$array.length; $x++)
{echo $phpvariable[$x];}
nothing appears unless/until $phpvariable[$x] holds a value.
If I use
for($x=0; $x<$array.length; $x++)
{echo "<tr><td>" . $phpvariable[$x] . "</td></tr>";}
this appears in the browser
for($x=0; $x<$array.length; $x++) { $phpvariable[$x]";}
Its as if Bluefish is not interpreting correctly, or am I missing
something?

I am a novice at php admittedly!

Richard Dunne
Post by Lindsay Haisley
This isn't entirely clear. Can you give an example?
Post by Richard Dunne
I installed Bluefish editor with the default configuration. I am
trying to display PHP variables in a html table using echo statements.
Without any html code in the echo statement, no php displays in the
webpage as expected. However, after I insert the html code between
the " ", the php code appears in the webpage, for loop code and php
variables in the echo statement. I don't understand why. Is this a
configuration issue? Or is this a bug? This issue doesn't occur with
Notepad++. Appreciate any advice.
--
Lindsay Haisley | "The only unchanging certainty
FMP Computer Services | is the certainty of change"
512-259-1190 |
http://www.fmp.com | - Ancient wisdom, all cultures
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Richard Dunne
2014-03-13 20:56:21 UTC
Permalink
The problem I think might be the file extension .php vs .html None of the
php code appears if the file is .php

Richard Dunne BSc.
Information Systems & Information Technology
Post by Lindsay Haisley
This isn't entirely clear. Can you give an example?
Post by Richard Dunne
I installed Bluefish editor with the default configuration. I am
trying to display PHP variables in a html table using echo statements.
Without any html code in the echo statement, no php displays in the
webpage as expected. However, after I insert the html code between
the " ", the php code appears in the webpage, for loop code and php
variables in the echo statement. I don't understand why. Is this a
configuration issue? Or is this a bug? This issue doesn't occur with
Notepad++. Appreciate any advice.
--
Lindsay Haisley | "The only unchanging certainty
FMP Computer Services | is the certainty of change"
512-259-1190 |
http://www.fmp.com | - Ancient wisdom, all cultures
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Mitra IMAP
2014-03-14 00:37:28 UTC
Permalink
What you describe sounds like a web server issue unrelated to bluefish. A Web server will take its cue from the filename extension. If it's ".html" it will not interpret PHP code but pass it on to your browser. If it's ".php" it will interpret PHP code and pass the results of that interpretation on you.

Lindsay Haisley
(512) 259-1190 (land line)
(512) 496-7118 (mobile)
Sent from my iPhone
The problem I think might be the file extension .php vs .html None of the php code appears if the file is .php
Richard Dunne BSc.
Information Systems & Information Technology
Post by Lindsay Haisley
This isn't entirely clear. Can you give an example?
Post by Richard Dunne
I installed Bluefish editor with the default configuration. I am
trying to display PHP variables in a html table using echo statements.
Without any html code in the echo statement, no php displays in the
webpage as expected. However, after I insert the html code between
the " ", the php code appears in the webpage, for loop code and php
variables in the echo statement. I don't understand why. Is this a
configuration issue? Or is this a bug? This issue doesn't occur with
Notepad++. Appreciate any advice.
--
Lindsay Haisley | "The only unchanging certainty
FMP Computer Services | is the certainty of change"
512-259-1190 |
http://www.fmp.com | - Ancient wisdom, all cultures
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Olivier Sessink
2014-03-13 19:29:19 UTC
Permalink
Post by Richard Dunne
I installed Bluefish editor with the default configuration. I am trying
to display PHP variables in a html table using echo statements. Without
any html code in the echo statement, no php displays in the webpage as
expected. However, after I insert the html code between the " ", the
php code appears in the webpage, for loop code and php variables in the
echo statement. I don't understand why. Is this a configuration issue?
Or is this a bug? This issue doesn't occur with Notepad++. Appreciate
any advice.
Hi Richard,

how do you preview the php code? do you preview it over a webserver with
php enabled? or do you just view the php file directly in the browser?

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
the body of a message to listar-QLpEr2logwzILq5++***@public.gmane.org
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Richard Dunne
2014-03-13 20:07:03 UTC
Permalink
View the file in the browser via localhost (WAMP)

Richard Dunne BSc.
Information Systems & Information Technology
Post by Olivier Sessink
Post by Richard Dunne
I installed Bluefish editor with the default configuration. I am trying
to display PHP variables in a html table using echo statements. Without
any html code in the echo statement, no php displays in the webpage as
expected. However, after I insert the html code between the " ", the
php code appears in the webpage, for loop code and php variables in the
echo statement. I don't understand why. Is this a configuration issue?
Or is this a bug? This issue doesn't occur with Notepad++. Appreciate
any advice.
Hi Richard,
how do you preview the php code? do you preview it over a webserver with
php enabled? or do you just view the php file directly in the browser?
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Lindsay Haisley
2014-03-14 03:00:15 UTC
Permalink
Post by Richard Dunne
View the file in the browser via localhost (WAMP)
If you're using a URL containing "localhost" you're passing your code
through your Apache web server with its PHP module, and PHP code gets
parsed and interpreted accordingly, if the filename extension is ".php"
then the server's PHP module will parse the PHP code and return the
logical result as instructed by the code.

To bypass Apache and the PHP module, you'll need to retrieve your file
directly from the drive using a URL starting with "file:"
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
the body of a message to listar-QLpEr2logwzILq5++***@public.gmane.org
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Richard Dunne
2014-03-14 08:48:42 UTC
Permalink
I thought Apache was, could be configured to parse both html and php code
irrespective of the file type? And I thought there was no limit to what
technology could do.

Richard Dunne BSc.
Information Systems & Information Technology
Post by Lindsay Haisley
Post by Richard Dunne
View the file in the browser via localhost (WAMP)
If you're using a URL containing "localhost" you're passing your code
through your Apache web server with its PHP module, and PHP code gets
parsed and interpreted accordingly, if the filename extension is ".php"
then the server's PHP module will parse the PHP code and return the
logical result as instructed by the code.
To bypass Apache and the PHP module, you'll need to retrieve your file
directly from the drive using a URL starting with "file:"
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Lindsay Haisley
2014-03-14 15:40:11 UTC
Permalink
Post by Richard Dunne
I thought Apache was, could be configured to parse both html and php
code irrespective of the file type?
It can be, depending on the AddHandler and SetHandler directives in play
for a particular directory, but this is beyond the scope and topic of
this list since it really doesn't concern bluefish. There are a number
of Apache user forums and lists if you need help beyond the
documentation at http://httpd.apache.org/docs/2.2/. By default, on all
the installs I've seen, Apache is configured to invoke the PHP parser
only for files with the expected PHP file types - .php, .php5, .phtml,
etc.
Post by Richard Dunne
And I thought there was no limit to what technology could do.
I guess there are still a few things, such as mending a broken heart ;)
--
Lindsay Haisley | "Fighting against human creativity is like
FMP Computer Services | trying to eradicate dandelions"
512-259-1190 |
http://www.fmp.com | -- Pamela Jones
--
To unsubscribe from this list: send the line "unsubscribe bluefish-users" in
the body of a message to listar-QLpEr2logwzILq5++***@public.gmane.org
List Web Page: http://www.ems.ru/cgi-bin/listargate.cgi
Main Web Page: http://bluefish.openoffice.nl/
Loading...