0

Hello Everyone,

I am totally new to php, I would like to know if I can be able to use it. within my website,I am using javascript and a database.

what is the relation between php and ajax. Can I use php if I am using javascript? How can I start using php within my java project? Where is php code written in?

Thanks

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by omaiaa0p
0

Firstly PHP is server side while Javascript is Client side.
If you want a fully functional site you will need PHP
and you can use javascript yo make it dinamic.

0

Firstly PHP is server side while Javascript is Client side.
If you want a fully functional site you will need PHP
and you can use javascript yo make it dinamic.

Thank you, but you have not answered all my questions, where can I use PHP and how?

Where exactly does PHP's functionality lie in?

0

OK, you will probably need a local copy of php, mysql and Apache. You can download the xampplite package from xampp. Once this is installed, you go to c:\xampplite\htdocs\ and start placing your php/web files in there. To view them, simply lookup something like http://localhost/mypage.php in your browser. If everything seems OK, simply FTP your files to your remote site (you have to buy a domain name and get some hosting for your site - there are loads of cheap hosts out there).

For a quick scan of php usage, look up w3schools. JS works 'in the browser' (client) or on YOUR computer. php works on the webserver - this could be your machine if you're using localhost or your host's machine if you're using a remote site. php always runs before js.

Ajax is simply a method to stop whole page refreshes when you want the server (php) to react to an action by the user (js). A js script is run (e.g. by link click or button press) which calls a php script which can do all sorts of stuff. The js then usually gets a response to this and updates an area of the page with this info. This is just a small part of what you can do with ajax. If you are considering using Ajax, I would suggest that you use something like jQuery, which eases the pain of dealing with the ajax object better than morphine.

I don't see why you'd want to use php in Java. I assume you mean Java as opposed to Javascript.

0

Thank you ardav for your clarification.

I have my work on a java web application, I know see that php is not crucial for the ajax goals I need. I am user servlets anyways so I dont think a php application has servlets.

Thanks again

OK, you will probably need a local copy of php, mysql and Apache. You can download the xampplite package from xampp. Once this is installed, you go to c:\xampplite\htdocs\ and start placing your php/web files in there. To view them, simply lookup something like http://localhost/mypage.php in your browser. If everything seems OK, simply FTP your files to your remote site (you have to buy a domain name and get some hosting for your site - there are loads of cheap hosts out there).

For a quick scan of php usage, look up w3schools. JS works 'in the browser' (client) or on YOUR computer. php works on the webserver - this could be your machine if you're using localhost or your host's machine if you're using a remote site. php always runs before js.

Ajax is simply a method to stop whole page refreshes when you want the server (php) to react to an action by the user (js). A js script is run (e.g. by link click or button press) which calls a php script which can do all sorts of stuff. The js then usually gets a response to this and updates an area of the page with this info. This is just a small part of what you can do with ajax. If you are considering using Ajax, I would suggest that you use something like jQuery, which eases the pain of dealing with the ajax object better than morphine.

I don't see why you'd want to use php in Java. I assume you mean Java as opposed to Javascript.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.