Checking if Chrome Extension is installed or not [duplicate] - php

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Check whether user has my chrome extension installed
is there any easy way to display a div for users that have an chrome extension installed and different div for users that dont have, something like this:
<div>X Chrome Extension is installed</div>
<div>X Chrome Extension is not isntalled</div>
php or javascript something.

That's not possible. You can't get a simple list via JavaScript.
You could only check for things which specific extensions introduce (e.g. new DOM elements, etc.).
You cannot accomplish any client-side checks with PHP because it is interpreted and run on the server side.

Related

run PHP code inside HTML without using xampp and apache? [duplicate]

This question already has answers here:
How can I run a php without a web server?
(4 answers)
Closed 2 years ago.
i know there are many similar questions but tbh none of them really fit.
I have no problems running the php part of my Webpage and everything works fine. Now im asking if there is a way to run my webpage including the php part without using having to start apache and typing in localhost.
I just wanna open up my html document with a browser and display it, nothing else. However then, the php code isnt really executed but its necessary for me as it displays an essential table with data. And no I cant use javascript for a very specific reason. I have to use php for my project but its a bit inconvenient having to start apache everytime and i just want to open up the document with firefox for example.
Unfortunately, this will not be possible as PHP is a server side language. As such, you will have to have an application to serve the content. With HTML, you are able to open it directly and display as the client (Browser) is able to read it directly. Browsers do not read PHP - when the server compiles the PHP, it is only sending the DOM (HTML, etc.) to the browser.
Like other people said, PHP is a server side language so you need to run a server on your machine.
But maybe you could try using small local server like the Symfony Local Server
It should be faster to start than apache.

Trouble running my PHP files [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Question about php and dreamweaver?
I am having alot of trouble running my php file. I downloaded XAMPP and have both Apache and MySQL running. Do I need to save the file in a certain place, and what does Dreamweaver mean when it says:
To preview pages containing server-side code, you need a testing server. Would you like to specify one now?
I have good enough knowledge in HTML and CSS, and have gotten websites running, but I can't seem to get PHP to work. When I just run the code from google chrome plainly it looks like this:
"Hello World"
"; phpinfo(); ?>
You can put your PHP-files into the xampp/htdocs folder, e.g. xampp/htdocs/hello.php and then open it in your browser at http://localhost/hello.php.
The URL must say localhost or whatever you set it to in order to render a PHP page. You also need to make sure PHP handlers are working and correctly parsing PHP files.

Minify CSS and JavaScript files with PHP [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
PHP auto minify. Is there any?
I'm using PHP minify (http://code.google.com/p/minify/)
I have to go to my webpage, create the url's, click upload, copy the the link of the new compressed file into my PHP file as explained here: http://www.mrclay.org/2008/09/19/minify-21-on-mrclayorg/
This works fine, but how can this be automated? Is there a PHP class for this or can I use one of the PHP classes already included in minify?
I think you have two main options really.
Use cURL to call the google code minifier. http://php.net/manual/en/book.curl.php
Use a different minifier that you can run locally. Try:
http://developer.yahoo.com/yui/compressor/ (Requires Java runtime)
http://www.crockford.com/javascript/jsmin.html (Windows only)
You can write a wrapper with CURL to send your files to the server, gets the returned text and outputs it to the client.
Beware, though, that it will slow down your server a lot (it will minify the code every time someone asks for it). So you would need a caching mechanism to do it only once.

Why can't I compile PHP code? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can you “compile” PHP code?
After I write an application in PHP, why can't I compile it into machine language? I know that it's possible to make a byte-code version of the file, which (as I understand it) is basically a file that has already been parsed into tokens.
But that's not what I want. Clearly it can't work in a general sense, since compiled code will be platform-specific, but let's say I have chosen a given platform. Why can't I create a binary file that would be the same code that PHP would run when given my .php file?
You can, facebook released a project which is currently being updated for php 5.3 (supports everything lower iirc) called HipHop, you can find it here: https://github.com/facebook/hiphop-php
There are a few compilers out there like facebook's, mentioned by #Howard, or http://www.roadsend.com/home/index.php?pageID=compiler. I've never tried them though.

How can I modify exif data of an image with PHP [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How do I add exif data to an image?
I want to modify some information in exif data with PHP. I've googled around but no hope. There's function in PHP, exif_read_data. But it only reads not writes. Anybody knows how or walkaround?
Looks fairly old but may be something for you: http://pel.sourceforge.net/
This gets also mentioned in the linked article from Calvin L.
http://pel.sourceforge.net/
A php extension that can write exif data, with installation instructions using PEAR. It requires that you can control which extensions are being installed on the machine that runs your PHP, which is not the case in many virtual hosting environments.

Categories