The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

PHP or HTML ?

Certainly if you don't have much experience with programming languages, you're best with Worpress, it's feature rich and easy to get up and running and most Hosting companies have it integrated. However, if you want full control of your web site functionality i strongly suggest you use php and HTML5. Just buy a HTML5 template from one of the many template sites out there and integrate your php code. You won't regret it.
 
PHP will not display a website without HTML, notwithstanding Plain Test Output (echo)
HTML alone is pretty limited until you add JavaScript.
So a proper question might be;
HTML and JavaScript
HTML, JavaScript and PHP
or
HTML + other dynamic languages [Python, GO, or? Perl/SSI, PHP/SSI, Rust, C+ or C# ... ;) ]
 
Actually, what you should be asking is should I go for Javascript or PHP? Because you cannot even write a complete PHP script without HTML, and both don't even have the same type of features. But Javascript and PHP can do similar things in different ways.

The difference being that with javascript most times you don't need to refresh the page. It process the script on the fly because it is client side and works with your browser only. But with PHP you need to refresh the page before the script processes its instructions because it is server side and works with the server.

My recommendation is to use both. For example in user authentication, I prefer to implement both javascript (AJAX) and PHP in the authentication . This is because javascript can be turned off from the browser and in that case your website will not be working very well.

But if you implemented both languages, then when Javascript is turned off, PHP still processes the script.
 
Purely from the coding aspect, always use php - its 100 times faster to develop. You write a header.html, your use readfile() in php to include it in all your pages; you make a nav.tml file, you use php readfile() to include it in all your pages, and then a footer.html and again readfile().

This way in the future when you change your navigation links or rename something, you only change 1 file and don't have to change multiple pages. Same with adding facebook preview code and twitter cards code, etc. So much easier to just have templates instead of changing 5 ot 10 different pages.
 
Someone that has JavaScript disabled or unavailable is generally a bot or a hacker ... ERROR No JavaScript -- contact support :p

[most] 90%+ of real users have current browsers and accept HTTP/2.0 as well as have JS enabled -- I recently tested thousands -- mobile and desktop ...
 
PHP will not display a website without HTML, notwithstanding Plain Test Output (echo)

Wherever did you come up with this? And I see it stated by more than one..... this is not at all true. I can output json, js, xml, html, pdf, SASS, SVG, HAML, etc. etc. etc. One is not limited to html output when using php on the web.
 
Sorry but thats not correct (accept for PDF), XML (no to be confused with xhtml) can be used to publish a website as easily as html. SASS, HAML and the likes are html alternatives. In fact HAML stands for HTML Abstraction Markup Language so clearly it is intended for making websites. These are not just for "printing on the web" unless html itself is also just for "printing on the web". Do a search for "What alternatives exist to html" and you will find plenty, and php can output pretty much all of them. :)
 
I didn't say you are likely to find one, as why would one add to their work when html already exists. It used to be that the ubuntu website was nearly all entirely pure xml unless you want to count the link to the XSLT definition file an html element, but that is no longer the case. I could show you pure PUG examples if I had enough rep (look up codepen user alvaromontoro pen id gjWPNW) but much like is the case with javascript, the output is still going to be html.

I didn't argue that its practical, only that its possible to output languages other than html or plain text. One could also write a pure js website but why would they. The fact that it outputs html doesn't actually make it html. If it did php could also be considered html, but its not, its a language that can output html.
 
I can execute .sh, .pl, RUST, all without HTML code, yada yada with PHP but that is not a 'website'. PDF is not a website. XML is not a website.
You are just printing with PHP 'on the web' lolz
 
LOL we are arguing semantics here. I am actually not wrong, the fact that by default a web server serves up html is a moot point. You could just as easily use 'ForceType application/javascript' in your config (assuming apache 2.4) and change that default to serve up javascript instead of html. Or on web sphrere use <jspAttributes xmi:id="JSPAttribute_4" name="jsp.file.extensions" value="*.jsp"/> to serve JavaServer Pages. But the default web server settings do not define php as a language. They only interpret the output. Since you like code so much let me ask you a very basic question.... what type of content would this serve.... if its anything but html and/or text I rest my case....

<?php
header('Content-Type: application/javascript');
echo "alert('case in point');";
 
Link to a working website with NO HTML elements in it's source code LMAO
Haml is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. Haml gives the flexibility to have some dynamic content in HTML.
HTML:
<!DOCTYPE html>
<!--[if lte IE 8]><html lang="en" class="ie"><![endif]-->
<!--[if gt IE 8]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset='utf-8'>
<meta content='width=device-width,initial-scale=1.0' name='viewport'>
<meta content='A Template Engine for Ruby on Rails' name='description'>
<meta content='Haml, HAML, haml, Rails, Ruby, Ruby on Rails, Template, Template Engine, HTML Abstraction Markup Language' name='keywords'>
<meta content='3zvYccFjus45bkqbIvoSzbVRlaQ3JBhHOcC/+DpAeoc=' name='verify-v1'>
<meta content='_HduvdWLa6WXLgvQNiBbFDb18ZqvHMp_4ocOTEz0Drc' name='google-site-verification'>
<title>Haml</title>
<link href='/images/favicon.ico' rel='shortcut icon' type='image/x-icon'>
<link href="/stylesheets/application.css" media="all" rel="stylesheet" type="text/css"/>
<!--[if lte IE 8]>
<script src='../javascripts/modernizr.js'></script>
<![endif]-->
</head>

Haml
abandoned not HTTPS? IDK
 
I read so many answers and can't see anything in JavaScript. Since when has PHP captured the world?
I believe you need a JavaScript stack to create a fast, dynamic and secure site. The stack will consist of NODE.js and React.js.
It will take more time, you will spend more money, but what is the result.
 
Since when has PHP captured the world?
Since forever. The MEAN/MERN stack you're talking about became popular in the past half-decade and they didn't even exist more than a decade ago, this industry did and its requirement for backend scripting also existed back then.

It will take more time
Exactly mate!! sometimes the dynamic pages just need a simple variable from backend like country/city name maybe, not something I'm willing to set up a node app for. Most small scale affiliates work on managed or maybe shared hosts, that doesn't support nodejs/react, I don't see any wrong if they use php instead. :confused:

PS: No hate towards node, I'm a node developer but I started php like a decade ago when there was almost no alternative. It was so easy to write, host, and see results that I still use it for minor tasks. ;)
 
You are wrong
< Content-Type: text/html; charset=UTF-8
This is the header 'normally sent' on the php-fpm for webserver use.

I am not impressed at all, nor expect you to give a shit. XLST is basically obsolete for some time now -- maybe you didn't get the memo.

This whole conversation has no point -- so I will end it here.

Code:
 curl  -v  -L -A "(Mozilla/5.0)" "http://localhost/de/getRef.php"
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /de/getRef.php HTTP/1.1
> Host: localhost
> User-Agent: (Mozilla/5.0)
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 05 Feb 2020 23:12:14 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Content-Length: 65
< Content-Type: text/html; charset=UTF-8 <<<<<<<<<
<
 <br>
 <br>
zone is: ;
* Connection #0 to host localhost left intact
<P>iframeis: iframeURL/?zoneid=&more=stuff
***with all <html> code removed from the script same header
Code:
curl  -v  -L -A "(Mozilla/5.0)" "http://localhost/de/getRef.php"
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /de/getRef.php HTTP/1.1
> Host: localhost
> User-Agent: (Mozilla/5.0)
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 05 Feb 2020 23:45:16 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Content-Length: 54
< Content-Type: text/html; charset=UTF-8 <-----------------
<


zone is: ;
* Connection #0 to host localhost left intact
iframeis: iframeURL/?zoneid=&more=stuff
**added
 
Last edited:
I started php like a decade ago when there was almost no alternative. It was so easy to write, host, and see results that I still use it for minor tasks. ;)

I remember the early days of php when you would go into irc rooms and see massive debates about whether php or perl was better (cgi/perl was "the language" of web scripting until php).
 
Hi dear friend. If I want to answer your question, I must say that: html is a markup language and never a programming language. But php is a programming language that provides the ability to connect between a website and a server, and you can use it to create a dynamic website. Now if you want to create a website it is better to learn both of them plus css. be successful and victorious.
 
That would render a blank page with a totally useless JS alert; xxx says: case in point. OK you are right thank you for the useless non-information arguing esoteric concepts -- I am probably guilty of the same.
That is what <script> tags are for normally --default header and <script> tags __END__
 
PHP the good language for website with the WordPress or for backend developing, but if you want to make the high-level skilled website, use the javascript
 
I'm thinking to build a new website , shall i go for html or php? looking for your suggestions....... thanks in Advance
For dynamic content, with database PHP is best. For just a website with content html will do. Have you checked the WIX platform?
 
Come on, dude! We live in the 21st century, of course php. I wouldn't really even look at the website which is written on pure HTML, it would make me think about the old times and bring about nostalgia and tears. I actually wouldn't advise you to use pure php as well. Watch some tutorials which show how to make modern websites using combination of languages like php, css, js.
 
Come on, dude! We live in the 21st century, of course php. I wouldn't really even look at the website which is written on pure HTML, it would make me think about the old times and bring about nostalgia and tears. I actually wouldn't advise you to use pure php as well. Watch some tutorials which show how to make modern websites using combination of languages like php, css, js.
This is a forum where people who do not know about something ask about it. I think you should consider tone in which you reply with. No one knows it all, not even you.
 
MI
Back