Is it better to include the PHP processing code in my HTML documents or should I create a link to PHP scripts that redirect back to static pages?

I am working on a website and am new to PHP.

Is it better to have .html pages that for the button Onclickwill invoke Javascript, which will link to a PHP page that links to the database and then returns back to the .html page? In my opinion, this will make PHP the background language, and you will never see the .php page in the URL.

Or is it better to make all my .php pages so that html and PHP code can work on the same page? Just curious because I don't notice tons of .php urls

+3
source share
5 answers

PHP HTML . PHP HTML, .

php html. HTML- .php - HTML. .php, apache php- (<?php ?>), - php-.

PHP , HTML . (HTML), , , (PHP), , .

+6

, .php URL- - AJAX , - SEO.

SEO ( " " ) , URL- , . , ( ) URL ( ).

URL-, , /questions/6387703/php-vs-html-which-extension-to-use, /questions.php?id=6387703, , .

URL-, , , .php, .asp .html URL-.

, , .

PHP , - Apache "mod_rewrite", URL-, , , PHP, PHP - URL- , .

, .

+3

.php. , mod_rewrite - URL-. .

0

PHP (HTML ). .php, RewriteEngine htaccess, URL-. : RewriteRule page.php page.html.

Javascript, PHP.

, .

0

php "" , php . "" URL-, php. AJAX, , , .

0

All Articles