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.
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 1 year ago.
Improve this question
I have made a webpage using .html and I would now like to change it to .php so I can connect it to a database. I have changed the file extension to .php but now it just opens the actual code in the browser as opposed to opening the website. I have googled it but all I can find is stuff about installing .php on a server, when I am just trying to open the file on my device. I am using Microsoft Edge if that matters. What do I do?
First of all, what you have to understand is php is a server side language whereas html is a client side language. As you might already know, html can be directly interpreted by browser but for php, the case is different. You need to have a server installed.
Moving on to your question How to change html to php!!, it's simple, just change the extension of the file.
To run the file, use local server. There are many options you can choose from. Personally I find Xampp easy to setup for beginner. It's my personal opinion though.
To sum up, to change html from php, install a localhost or local server to your computer, migrate your files to server's run directory. You can find plenty of tutorials on setting up localhost.
If you want to run a PHP file after changing its extension. You need to install xammp or lamp server. In the localhost server, you can view your PHP pages on any browser.
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.
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 9 years ago.
Improve this question
What kind of server configurations would I need to do in order to run a Python + Pygame code on a website.
Is php able to call and execute the python on server side? Do I need to install python on the server? I believe python is installed, but do I need to install the pygame library? What if I compile my code, will I need to install pygame on the server after that?
Can some one provide me a general list of things I will need to complete in order to make this happen?
My case:
I would like to put a game I made with Python on a website. I see how the python can run on the server no problem, but how can I ensure the client be able to play the game on their browser?
Web Browser can display/run HTML+JavaScript+SVG+(HTML)Canvas or (Adobe) Flash. You can't use PyGame to create game running on page. PyGame doesn't generate HTML+JavaScript or Flash
There might be a Python plugin somewhere, but I don't know of it and I can't imagine it's very popular. Your best bet would be to use Pyjs, previously called Pyjamas, which can translate Python to JavaScript. It doesn't support Pygame, but you might be able to write a Pygame-compatible module using the browser's canvas support. It's not a solution that you can just drop in and go, but I don't think there is one.
Yes, there is a mod like mod_php... The extension of files are
.psp
Python server pages
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i am doing a php program which requires doc file to be saved after every 10 secs.msword should not ask the path to be saved. actually i have written a program which opens a doc file. the file should be auto saved to the exact location from where the file is opened.
If I understand you correctly, what you want to do is not possible (sadly).
There is no standard or protocol for live editing of remote files that have been downloaded from a web page in a browser. The file will be downloaded to a temporary location and opened from there.
Hence, any notion of providing an auto-save mechanism from PHP or JavaScript is completely impossible. The client application will have to do that.
If you want to upload the downloaded and locally edited file back to the web site, you will need to provide an upload form for the user to do it manually. (Which is a shame and completely unintuitive, but that's the way technology is at the moment.)
Not possible due to security reason in web technology.