The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniWeb > OmniWeb General
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
PHP page type text/php displays as source Thread Tools Search this Thread Display Modes
I have a web page with the extension php. This page displays correctly in Opera but it is displayed as source in OmniWeb. However, OmniWeb displays the same file (more or less) correctly when accessed from a web server.

Clearly I have a difference in this file that causes it to have the wrong type. If I look at the Page Info on OmniWeb the type for the local file is text/php but the type for the remote file is text/html.

What factors are causing this difference? I should note that so far Opera is the only browser that displays the local file the same way as the remote one.
 
Well, PHP is not HTML. ;-)

When the PHP script is run, it spits out HTML. That's what a web server does: It runs he script, and whatever the script prints out is sent to the browser that is accessing the page. From what you say, it seems that Opera has some built-in magic to execute the PHP program and then display the results. I don't think I would really like that, personally, as not every PHP script actually produces HTML – it's a programming language that can do pretty much everything else, too, so it doesn't seem so clever to me to execute the script instead of just displaying the source. True, PHP isn't widely used for anything but HTML, but I still don't like the idea very much.

Best regards,

Christian
 
I sort of understand PHP but am not completely sure how it works on my local server. I have installed PHP to generate my own web pages and that is a PHP application. However, when I look at that page in OmniWeb it shows that the Type is text/html. So that is what puzzles me ... why does that page show as text/html when it is has a php extension and why did the other page I mentioned show as text/php with the same extension?
 
Actually it is a bit more complex than I originally thought ... if I open the page from finder (Open with) then it gets interpreted as text. However, if I open it via my localhost URL it gets processed as HTML/PHP.

I'm still not sure why Opera works differently but now I can get it to work in OmniWeb.
 
Sure – that's the expected behaviour: If you open the file on the disk with OW, OW won't run PHP and show what the script prints out, but show the file itself, just as it should, IMHO.

OTOH, if use your localhost URL, the web server on your computer feeds the script to PHP and presents the result to OW, just as any web server out there on the web would.

The point is: If you install a PHP script somewhere on your web server, you do this because it is a script that prints out HTML to be viewed by some browser. If you have a PHP script lying around just anywhere in your folders, it might also be a script that you (or someone else) has set up to delete all files in the current directory and print out nothing, or to scan your home directory folders and print out a CSV style "database" file that holds the amount of space each directory uses, or to convert all PDFs in a certain directory to TIFFs and print out a summary of its work in MS Word format – or just about anything else. In either mentioned case, the printed result is nothing OW could show you properly, and it's even potentially dangerous.

That's why I don't like the Opera way you mentioned. ;-)

Best regards,

Christian
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to FIND text in columns that have the type property set to "pop-up list" qomni OmniOutliner 3 for Mac 20 2013-12-04 03:18 PM
Source View not obeying colors set in HTML Source Editor jashugan OmniWeb Bug Reports 0 2007-05-02 04:36 PM
'date' column type text styles terryg OmniOutliner 3 for Mac 2 2007-03-08 04:09 AM
how to reference the source for an OmniWeb page via AppleScript eYeToEyeRob OmniWeb General 3 2006-06-30 08:37 PM
Source Editor & Page Inspector andreas_g OmniWeb Feature Requests 1 2006-05-09 08:24 AM


All times are GMT -8. The time now is 02:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.