Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm middle of a confusion here. I'm learning PHP and studied about the advantages and disadvantages of it. Basically, I have to put PHP code inside HTML codes, thus when we load the .php file, it loads a HTML page. I'm unclear here! Why use a server-side scripting to output a HTML page, while I can simply create a .html file and open it?
Why use a server-side scripting to output a HTML page, while I can simply create a .html file and open it? You do not need PHP for that, you can always output a HTML page with .html extension.
PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.PHP code can be simply mixed with HTML code, or it can be used in combination with various templating engines and web frameworks. PHP code is usually processed by a PHP interpreter, which is usually implemented as a web server's native module or a Common Gateway Interface (CGI) executable.
However you NEED PHP for one too many reason, i.e. File Uploading/Database/Dynamic Websites and the list goes on and on, which obviously can't be done using HTML only.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I made a NGO website that has customer service in it, means that clients are able to chat directly to the admin. I've built 30% of it with PHP. But, I thought it's difficult to make a chat application with PHP. I've been told that Node.js is the best web development to make chat application. Can I mix PHP with Node.js ?
Generally, people name files depending on what language the code inside is written in. For example, the .php extension is run by a PHP interpreter. Certain files can have other languages mixed in. For example, a .html file can contain CSS and Javascript. Another example is the .html.erb extension in a Rails app, which can contains both Ruby and HTML/CSS/JS code. This is accomplished by something known as a preprocessor.
You could use a preprocessor to mix mostly any language together, but I'm not sure that will make your life any easier making an app. It's probably a better idea to separate your app into microcomponents, which can all be written in different languages.
For example, a chat server could be written in Node and a REST API written in Rails. They might be hosted on separate servers and communicate with each other by sending HTTP requests.
As far as Node being "the best" for making a chat server, that's a totally subjective point and StackOverflow discourages opinion-based conjectures.
It's also worth considering whether an open-source chat project could be integrated with your existing code. I.e. something already made.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Couldn't find anything about this online so I'm giving it a try here. (Not sure what to look for in google so maybe that's why I couldn't find it).
My client wants (for some strange reason) a dynamic, pure HTML5-website with no PHP at all. The webpages can be created with PHP, but after he is done, he wants it to (automatically) generate HTML5-webpages so these can be put online on a server with no PHP.
Is this at all even possible? Writing an API myself that gets the content from the server and converts it to HTML5 is not really an option due to time ...
Thanks
FYI: If what you want is a Single Page Application, you're asking the wrong question.
Seems like what your client wants is a pure HTML site because he might have the idea that pure HTML sites are better for SEO.
What do to?
Alternative 1:
Create a different server to generate pages. Either local (with vagrant) or in another remote server. Have your content generated there by using a CMS of your choice.
Periodically generate a mirror of your site using a tool like HTTrack or wget. Hand this mirror to your client.
Alternative 2:
Use a static site generator like Jekyll. Have the server run a cron task to automatically generate HTML from the changes.
Alternative 3:
Be the expert and explain to him that his ideas are probably unfounded.
Yes, you could use the HTML5 Filesystem API and Javascript to read/write from a JSON file as a backend. It's definitely not ideal, but it would satisfy your requirements.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So I have two ruby scripts that scrape two websites for information based on what it entered via a form. Basically, the form outputs to a file, and the two ruby scripts take their input from that file and proceed to scrape and return a viewable html file. My problem is that I have no idea how to connect the php file to the ruby scripts. When I was writing them, I just tested them via the terminal to ensure they worked correctly. Now that I have everything done, I am lost when it comes how to actually execute the scripts from the php file that writes the user input to file.
You should write a poller in the ruby script that checks the file you write from PHP periodically. There is an issue of concurrency when you are trying to do this: the producer could be writing at the same time the consumer is reading.
I suggest to read and write to DB, so you don't have to worry about it. If you don't want to setup a fully professional DB, you can use SQLite (ruby PHP).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to implement an already coded image upload system which has been written purely in php. I have a html website but did not know that I could direct users to a pure php page. Surely it would just show in a browser as coding. How do I make this pure php webpage into a html webpage? I am new to web design so any help is muchly appreciated.
Would I have to implement it as an iframe within a html page?
Thanks
The output of the PHP program just needs to be an HTML document (unless you override it, it will output a text/html content-type so you only have to provide the HTML document itself).
There is no need to involve iframes.
Surely it would just show in a browser as coding.
No, unless you are using a server which does not support PHP or have not configured it correctly, the PHP will be executed on the server and the output delivered to the browser.
Install PHP with Apache. If you are feeling tough to install it manual, go to www.apachefriends.org, find the suitable version of XAMPP for you, download and install in in your machine.
Make sure you install the Apache service. This will make Apache to run whenever you boot your system.
Move your PHP, HTML and all associated CSS, JS files to the following folder path, C:\xampp\htdocs\YOUR_FOLDER_NAME
In your browser, you can open the files as http://localhost/YOUR_FOLDER_NAME/FILENAME.php.
Now you will see it as processed HTML page. This will work for both your HTML and PHP pages.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have been using eclipse for years now creating php projects, and I have a not touched any java code or c++ code with it so far.
My assumptions are that when eclipse does a "Build Project", it is doing something useless to interpreted languages such as php, and a "Project Refresh" would scan files to detect classes, methods, namespaces.
But all that are just assumptions... Could someone shed some light please?
In an Eclipse project, builders are used both to produce artifacts of compilation and to perform validation. I am referring to problems view entries, not to be confused with validation you see an editor when you have a particular file open. For a scripting language like PHP, there are no artifacts to produce, but there is a need to validate source files.
The set of builders is controlled by project type. Eclipse then tracks what has changed and calls those builders. This typically happens transparently (auto build). There are also a few menu items like "Build Project" that explicitly trigger different levels of re-build activity.
For a PHP project, calling "Build Project" will force re-validation of PHP source files.
Off the top of my head, you can use 'build project' to run your custom builder (hooked up via Preferences->Builders). Which in turn lets you execute any type of script/tool-chain you want to run over your code or project, e.g. build code documentation or run a regression test.