PHP does server-side work, while JavaScript does client-side work. Hence, PHP seems to mostly be used for business logic, while JavaScript deals with the user interaction.
AJAX is not a language, it is a combination of JavaScript and XML that can be used to update parts of a webpage without having to reload the whole thing.
It sounds to me like you’re going to HAVE to use php because how else is your page/javascript going to be able to interact with the server to do things like uploading/managing content?
As someone already said, ajax is a javascript call to load something from the server after the page has loaded. It cuts down on the amount of page refreshes needed and lets you do multiple things with an existing page like updating portions of it, showing results, etc.
If you want to be a real man (and still use a scripting language) give Python a try. PHP is an awful, hacky language. If you’re starting from scratch and have the choice of what to use, stay away from PHP. If you have to learn or use it due to your choice of pre-made CMS, then so be it.
An Ajax solution often involves client-side (Javascript) and server-side (PHP) code. So it’s a case of one is okay, two is better, three is best! You shouldn’t choose between them.
I can’t say I’ve given Python a fair shake, but back when I was developing more web apps, I was quick to jump from Perl (for web apps) onto the PHP bandwagon because the PHP code ran faster, database access was simpler, and the code felt more intuitive. I certainly didn’t feel the less for using it!
Then again, Perl is about as hacky as it gets, so perhaps PHP was just the less hacky of the two. It was a long time ago and I no longer remembet the syntax that well. In any case if you’re accessing Python via CGI, PHP should still be the faster language choice on most servers.
That is seriously hilarious! I’ve been hearing Python nerds spew that exact same garbage for years now. It’s like they all read the same Python Is My Daddy blog or something. Python is a joke. Give it up already.
Well no, I’m saying that because I’ve used PHP since it was created (as a hack to perform dynamic operations inside HTML), and use Python at home for everything else. There’s no need to troll about this, as there really is no comparison and anybody with an ounce of Clue will confirm what I’m saying. It’s not like we’re arguing about our favourite football teams here - PHP is indeed a hacky language and that is how it was born and raised. I have no vested interest in either.
This is off-topic, but feel free to back up your claim if you can, I’d be interested to hear in what way you consider PHP to be a better language apart from its wider popularity in pre-built CMS software. I give your troll a 3/10, as it amused me briefly but has no substance. This guy’s question was utter gibberish, so I used it as a way to (comically) suggest he learn a real multi-purpose scripting language instead of PHP.
I would’ve suggested Perl, but I’ve never really used it much apart from simple maintenance scripts on some of our servers. Python is perfectly fast for web-based stuff, assuming you’re using FastCGI or similar. I haven’t used plain CGI (or even Apache) for a long time.
I’ve avoided ASP purely out of a deep-seated anti-MS attitude and the fact that we’re a Linux/BSD shop, which I’m sure is unjustified but I’ve never forgiven them for such crimes as MS DOS and pretty much every version of Windows < 2000. I don’t know enough about ASP to comment, other than it looking a lot like PHP with a Windows twist. I do know people who use it heavily and seem to get good results.
Ruby I do like, but performance and support wasn’t too great when I played with it some years ago. Rails just seemed like pure hype, with people jumping on the bandwagon to get away from PHP. I have spent some time with Django, which works in a similar (MVC) sort of way, and it’s really nice if you’re into that and want to write a custom CMS or web application.
My main issues with PHP are the terrible security history and “design by committee” approach to development. I just don’t like it, and I still have to look up function names and parameters after all these years because of the seemingly random function naming/case/parameter ordering system. Seeing them bolt a half-assed OOP system onto it just made me weep.
advice: use open standards/codebase frameworks/languages.
Reason one:
let’s look at the two most used languages on webservers today: ASP VS PHP, Or platform specific versus crossplatform. ASP.NET is windows ONLY. Thus once going the ASP route, you always need to be on a windows machine as host for your website. Too limited imho.
PHP is CROSS platform, it runs ons almost every operating system out there. thus far less limited.
Reason two: It’s more community supported, meaning more information is being shared freely.