Email conversation
From | BVLS Prasad |
To | Me |
Subject | Server Side JavaScript - AJAX Vs PHP!! Which One ? |
Date | 28 February 2007 09:03 |
Hi Tarquin,
I should admire your expertise in JavaScript.
I am inspired and am trying to learn JavaScript through your Tutorials.
You have Conveyed the essentials in a very efficient way.
Hats Off!! I mean it.
My desire is to develop Web Based Applications.
Here is My Question : (I need your Opinion/Suggestions/Advice
Before I jump into any Web Technology)
If I want to develop a web based application which involves a
backend database such as MySQL,
and client-Server side interactive web program, how do I proceed:?
Is PHP better?
What is your opinion about Server Side JavaScript in general?
Can PHP and Client Side JavaScript be used together to create
more powerful web applications?
Whats your take on Today's Wiki Technologies?
I want to develop a JavaScript based Wiki myself. Could you advice?
I am looking for an expert advice and I consider you and I
sincerely believe in your comments especially
after reading your sincere replies to many of the people around.
Thank you. I hope you will understand what I am up for,
though the sentences might not clearly be reflecting the same.
I am good at C++ programming, just lately planning to enter
Web Application Development.
Your advice will be greatly appreciated.
Looking forward to hearing from you.
Prasad.
From | Me |
To | BVLS Prasad |
Subject | Re: Server Side JavaScript - AJAX Vs PHP!! Which One ? |
Date | 28 February 2007 16:25 |
Prasad,
> If I want to develop a web based application which involves a backend
> database such as MySQL, and client-Server side interactive web
> program, how do I proceed:?
You need to find a good tutorial for teaching you MySQL if you do not know
it already. The MySQL site has a good one:
http://dev.mysql.com/doc/refman/5.1/en/tutorial.html
> Is PHP better?
Better than what?
PHP is a programming language that works very well hand in hand with MySQL.
The MySQL database stores your data, and allows you to query it. The PHP
prepares the queries, reads the responses, and creates the HTML that is then
sent to the browser.
Even if your application is mainly client side, you will still need a server
side language, such as PHP, to read the data from the database, and convert
it into something useful (such as XML) to send it to the client. If you
choose to use PHP, search online for 'php mysql tutorial' - there are plenty
of very good ones.
> What is your opinion about Server Side JavaScript in general ?
What language you choose to use on your server is entirely up to you, and
what your needs are. I use PHP because it is very mature and popular,
supported by around 60% of all Web hosts, has excellent support for MySQL
integration, runs entirely on free software, is powerful, and yet easy to
learn. I have not seen any need to learn or use server-side JavaScript.
Maybe you do, but you should select whatever language suits your needs.
Remember that whatever happens on the server does not depend on the
capabilities of the client, so you really can use anything you want, as long
as your server can support it.
> Can PHP and Client Side JavaScript be used together to
> create more powerful web applications?
To some extent, maybe. They can be used to make a more convenient interface
perhaps, but too much reliance on client side scripting can lead to
inaccessible applications. Personally, I am a big fan of making apps that
work the traditional way, using normal HTML forms, and server side scripting
to interact with the database and produce the HTML. These work in absolutely
any browser that can support forms (so in general, that means all of them).
What's more, they often work more reliably, and do not annoy people so much
with 'features' that get in the way.
On top of those, you can build a client side app that enhances the basic
HTML page and makes it behave more like a client side application, including
using XMLHttpRequest to send and retrieve data from the server side scripts,
and DHTML effects to do things like drag-and-drop, etc. If JavaScript is not
available, it can fall back to the basic HTML app. The real 'power' of an
app comes from whatever the server can do with the data, but the feeling of
the interface comes from the client side scripting.
> Whats your take on Today's Wiki Technologies?
I love the idea and the capability, providing you have a good enough
archiving system to allow rollback after any vandalism. In addition, it
helps if you only allow registered users to make modifications, as that
makes it harder for spammers to add random garbage to your pages, as well as
making it easier to work out who is the source of vandalism (keep their IP
addresses too, so you can have the option to block access based on that if
needed). Wikipedia is obviously the best example of just how well a wiki can
work when you get a big enough community to manage it.
I absolutely _hate_ the syntax though. I know it is done to avoid users
abusing the system by adding scripts, but I already know HTML, and I hate
being forced to learn a less intuitive syntax (at least most HTML tags have
descriptive names, while most wikis use '|||' '**' '{{}}' and other such
nonsense) to allow a script to convert that back into HTML. Personally I
find BBcode to be better at being understandable, while also being easier
than HTML to filter out abusive elements and attributes.
Note that if you plan to make one, it is essential that you protect it
against this abuse:
http://www.howtocreate.co.uk/crosssite.html
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | BVLS Prasad |
To | Me |
Subject | Re: Server Side JavaScript - AJAX Vs PHP!! Which One ? |
Date | 6 March 2007 23:11 |
Thank you Tarquin.
I could not reply earlier than this.
So, after some research, I felt that:
MySQL <-- --> PHP || Server || <--- ----> || Client || JavaScript is the
Best Combination to develop a Web Application.
Once again, thank you for the time and the wonderful Content.
Prasad.
From | BVLS Prasad |
To | Me |
Subject | Re: Server Side JavaScript - AJAX Vs PHP!! Which One ? |
Date | 14 March 2007 07:32 |
hi tarquin,
I am stuck with a small problem.
I appreciate, if you could help me.
I have a function with parameters/arguments such as
findRootEquation(a,b,c){......code ...}
I want to activate this on click...
like
document.body.aButtonElement.onclick=findRootEquation(20,30,40); (using DOM
Event Model rather than DHTML).
[Ed. that was actually the traditional event model]
But, what I observed is:
onclick=findRootEquation -- would work
but NOT with arguments.
and "without Arguments", the answers are erratic.
Could you give me some clue of how to go about this ???
Thanks alot.
Prasad.
From | BVLS Prasad |
To | Me |
Subject | Thank You. I got the Sol. for my earlier Query. Dont bother. Thanks. |
Date | 14 March 2007 18:45 |
Thank You. I got the Sol. for my earlier Query. Dont bother. Thanks.
From | Me |
To | BVLS Prasad |
Subject | Re: Server Side JavaScript - AJAX Vs PHP!! Which One ? |
Date | 18 March 2007 16:07 |
Prasad,
> I have a function with parameters/arguments such as
> findRootEquation(a,b,c){......code ...}
>
> I want to activate this on click...
I get asked about this quite often, so I have written an article about it
here:
http://www.howtocreate.co.uk/referencedvariables.html