Member Avatar

Hi,

I'm new to php, and I would just like to know if PHP has a client side and a server side similar to jsp?

Reason being - I have completed the front end of a website and I want to add all the functionality now so I'm wondering if I just use <php> tags on the client side or if I made another php file with all the code and import it into the client side and call methods/classes, etc.

Thanks,
Ashton.

Recommended Answers

PHP is server side only. All processing takes place there and only the results of the processing (an html page usually) are sent to the client.

Jump to Post

All 3 Replies

PHP is server side only. All processing takes place there and only the results of the processing (an html page usually) are sent to the client.

Member Avatar

If you want to dinamically change something use AJAX (PHP and JavaScript)

Member Avatar

Hi,

I've researched a bit and found this answer:

You make a front end page (HTML/PHP) then you make a folder with all your PHP files inside where you'll have your code. For example:

GetNamesFromDB.php file has the code:

<?php
//Code Here
?>

Which is then called using AJAX from an onclick, onchange, etc. i.e:

xmlhttp.open("GET","PHPScripts/GetNamesFromDB.php?MyVar="+MyVar,true);

Thanks,
Ashton.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.