I'm trying to build an Adobe Air app which runs from a PHP file.
Currently I have an index.html file which then performs a location.href to move to realfile.php - this gets round the limitation that a root file has to be HTML.
My problem is that the *.php files contain JavaScript which in turn make use of Adobe Air code, specifically printing. I overwrite window.print to the Air version which works fine in HTML.
As soon as the code is copied to the PHP file it doesn't even attempt to call it, yet other JavaScript works fine.
I read around a bit more and now know that Air will only run in a HTML page. Although there is no explanation that I could find that explains why this is...
How I think I can fix this:
My current idea is to add a RewriteRule in my htaccess to make PHP files accessible via a .html file extension. This should trick Air into thinking it's a HTML document, whilst the server is still able to process the PHP that is on the page.
When I get around to it, I'm more than happy to re-write the app to make it fully AJAX driven, which is what everyone else seems to be doing.
Related
I have an issue migrating a site where the links are all broken. It's a html site but uses php file system. The links in the index.html has \ in front of it. There's a file of php files like: Configuration.php, FileSystem.php, Bootstrap.php, Handler.php. How do I revert to just regular hmtl links.
Thanks!
If all you want to do is convert the dynamic PHP based website to a static HTML is easy.
Open the website in Firefox (Chrome will probably work too, but I did not test).
Go to File->Save Page As... and select a directory on your PC.
Firefox will then download the main file and needed dependencies to the PC eliminating all the PHP since it doesn't even know the server generated the page dynamically using PHP.
You can now deploy the site where ever you like.
Please note that if there are JS files that actively communicate with the server to download content dynamically you'll have to edit them yourself.
I have some PHP files, my IT department wants to perform accessibility checks on these files, but they said that these files need to be converted to HTML first before they run the checker on them.
Now, I loaded the pages in browser and save them as HTML, but what happens is that the accessibility checker extension which is installed on Chrome (Siteimprove Accessability Checker), does not work anymore. It only works on the PHP files that I see in my browser.
Has anyone had a similar experience? Is there any way to fix it?
I designed my web page using ms office frontpage 2003 as I am little bit familiar with that.Later I saved that using php extension as I want to use more php code in there.But soon after i include any php code it only shows the HTML code in the browser.
Your kind consideration given with this regard is highly appreciated.
You seem to be confused about how PHP and HTML work.
Feel free to use whatever text editor you wish, but PHP code will not show up in the browser. This is the intended behavior. PHP is executed server side, and therefore it is completely invisible to the eyes of the clients (browsers.) If you're not using a server with PHP installed, then your PHP code wont execute, obviously, but under no circumstances should you see PHP code in your browser.
Use an editor like Notpad++ (notepad-plus-plus.org), Editpad Pro (www.editpadpro.com) sublime text (www.sublimetext.com) etc. to edit your html files. Go ahead open your .html or .php files in these editors and make appropriate changes.
UPDATE: PHP scripts run on web server. You cannot just open .php files in browser like .html files. For PHP scripts to execute you need to have a web server. Install XAMPP in your system. https://www.apachefriends.org
Does anybody know of a software program that will convert a website built with PHP, JSON and jquery into a mainly HTML format. We need to do a conversion for SEO purposes and don't want to have to rewrite the whole site.
HTML is a language used for markup, PHP is an object oriented functional language. You cannot convert one to the other, I'm sorry.
If you're trying to make sure that you have nothing but .HTML extensions on your public URLs for SEO purposes:
Someone's selling you a line of BS.
You need access to your server configuration.
You don't have to convert anything but your links.
The .PHP extension is the default file extension configured to be sent from Apache to the PHP engine for parsing. You can change what file extension gets parsed in your configuration file.
http://encodable.com/parse_html_files_as_php/
This will allow you to keep .HTM files static and have .HTML files parsed as if they were .PHP files.
Try this: http://www.httrack.com/
It will only return a static HTML site. But it might be a good base for you.
Since the only thing which really knows what type of file you're using is the server itself, it does not really matter what you're using on the back end. Most search engines are smart enough to know that so they don't really care so much. Now, people might care. People might say, "Hm, well, this is .html, that means that this person must have a flat file which is constantly being updated," but I doubt it.
If you're really concerned about having a .html extension, then you can fake it by using htaccess:
RewriteRule ^(.*)\.html$ $1.php [L]
If that is placed in a .htaccess file at the root of your site, it will redirect all requests which end with .html to a corresponding page with .php. It will do that transparently both to the user and to the crawlers.
Of course, every link on your site will need to convert from linking to .php, but it will replace the impossible task of using only .html files with the annoying task of replacing all of your .php links.
As to removing JavaScript, well, you could do that, or you could design your site in such a way that it still uses AJAX but it works with the search engines instead of against them. The biggest trick is to make sure that your site can work with as little AJAX as possible and then use AJAX to supplement. We've come a long way from requiring that all websites work in lynx, but it is still good practice to make sure that they are still sane without the benefit of JS/CSS.
Besides, search engines are getting smarter. Google has been working to read AJAX intelligently since 2009. But even if they weren't, there are plenty of articles out there on using AJAX without hurting SEO.
There is no need to nerf your site because of SEO -- You can have your AJAX and SEO too.
This is hard to accomplish if there is a lot of dynamic data. For a simple website you can just cache every page and make that your new website. I am not sure how useful that would be. For example if you have forms or other user input fields then things will just not work. In any case this is how you do it using wget.
$ wget -m http://www.example.com/
More reading here.
I built a php site that is hosted with an ISP. A friend who is a designer is supposed to edit the page content. There's an area on the page that is open for page content, but most of the outer "wrapper" is built with include() files.
When she opens the files in design mode, everything is broken. I tried to set up a test server in DW, but this didn't work either. I never use DW and am stuck.
Is it possible to work on a file off of a server via ftp in real time with DW? If not, can it at least be configured to render the php code in design mode somehow?
Thanks,
D.
PHP is a server-side language, Dreamweaver is catered toward simple client-side HTML web pages. You would need to setup a PHP interpreter somehow in order for Dreamweaver to show you the output of the PHP, last I recall when I used DW years ago it didn't have that feature, so I doubt you'll be able to do this.
#meder: It appears you are correct for exactly the reasons you stated. The last time I used DW, I was only on the code side, so it never came up. I know we were saving to the server then, so I was thinking it could draw it from the server as well.
Alas, no luck. Sorry to post before I RTFW more.