Question:
Does PHP use any other language such as JAVA for dynamic websites?
Rogue1988
2010-03-20 17:41:59 UTC
I've been using ASP.NET with C# (each ASP page has an associated C# file) and decided to try php. Does PHP use any other language like ASP does, for database connections, state, ect.. or is it all just done in PHP? If another language is used to code, what is it??

Thanks in advance :)
Six answers:
anonymous
2010-03-20 18:16:09 UTC
Well understanding that PHP operates via the server, there are a few things that you may want to have execute via the client. For anything that you want to write that acts on data from the Client's browser, you would want to use Javascript.



Other than that, PHP is self-sufficient. When it comes to database scripts, you will obviously need to incorporate your own SQL statements.
Wire Tapped
2010-03-20 17:45:53 UTC
Think of ASP and PHP as the same thing, just different flavors. Both are extensions of HTML. Both are somewhat prohibitive, for example, it would be difficult to program a site that used BOTH of these technologies.



PHP, ASP and HTML web sites can also utilize ajax, java, ruby, etc. Some are more difficult than others to implement depending on which design platform you are using. Some platforms do not allow (or make it extremely difficult) to implement the lower level platforms within the main platform.



PHP is commonly done in a LAMP setting. Linux, Apache, MySQL, and PHP.

Linux - OS

Apache - web server software

MySQL - Database

PHP - programming platform



You can add almost anything to PHP, like Perl, Ruby, etc.



It really depends on what you are trying to do as to whether PHP is the best choice. Some people will say you can do it in PHP, but the question is - IS it the BEST choice?
anonymous
2016-04-14 02:09:25 UTC
The direct answer is, the most commonly languages used to build dynamic, data-driven web sites these days are PHP, Java, Perl, ASP, Python, C++ and many others. Pretty much any language that has "print" statement can be used to build dynamic web site. Meaningful non-trivial web sites, however, are not just written in that language. They use application servers / frameworks such as Struts, WebSphere, Coldfusion, etc. The purpose of these is to take care of gazillion of low-level tasks such as database access, security, session management, templates etc. - things that you would otherwise write from scratch. A somewhat separate class of frameworks is CMS (Content Management Systems). Those are better suited to jump-start new dynamic site and usually can be quickly deployed and customized with minimal programming knowledge. Those can pretty much give you working web site that you only have stuff with your content. Examples of some popular free CMS are Drupal, Joomla, e107 (all those are PHP-based). If you are new to this and don't have a team of programmers, it's probably a good idea to pick one of those CMS and start playing with it. Heavyweights like the sites you mentioned typically take one of the existing frameworks and build their own logic on top of it in-house to fit their business requirements. It's not always easy to tell what technology they use, but from what I can tell Citysearch likely uses Java servlets and Yelp - something based on Python, but don't take my word for it.
Mohymen
2010-03-22 02:11:58 UTC
If I get the question, then my answer is -



PHP is independent rather than ASP.NET. ASP.NET is depending on .NET framework and server. In this point, PHP is standalone.



But their is NATIVE functionality to embed other languages, COMMUNICATION functionality to communicate other programs, SYSTEM accessibility with SYSTEM functions.



It has wide function list to connect various database such as mysql, postgresql, oracle etc. Go to http://php.net and you will get the clear concept about this language. :)
anonymous
2010-03-20 20:45:33 UTC
I've done both ASP and PHP development. PHP is exactly the same as embedded ASP.NET, only much easier. PHP uses only php in the backend - although it is possible to make external calls to things written in other languages. The PHP code is usually embedded directly inside the HTML page between some tags and it usually just resolves to the HTML that you would have written in that place. Consider a situation like where you might want to dynamically display a picture depending on a combobox that the user selects from. In ASP.NET, you'd have your separate code page and then you'd check the combobox, then set the properties for some image element using C#. With PHP, you'd check the value of the combobox, then generate the HTML element with the proper tags set. I guess the main difference here is that instead of just setting the property of the element like you would in ASP.NET and letting ASP.NET generate the HTML for you, PHP basically makes you figure out the HTML and displays it for you.

In example if you embed this code somewhere in you HTML, it connects to a database, grabs some data and then generates a table with the data and sticks it on the page.




$con = mysql_connect('localhost', 'user', 'password');

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db('Programs', $con);

$sql="SELECT * FROM programList;";

$result = mysql_query($sql);

echo"











" ;



while($row = mysql_fetch_array($result))

{

echo "";

if ($row['programScreenShotLocation']==NULL)

{

echo"";

}

else

{

echo "";

}

echo "";

echo "";

echo "";



echo "";

}

echo "
screenshot Name Description Location
No Image Available" . $row['programName'] . "" . $row['programDescription'] . "Download
";



mysql_close($con);

?>
?
2010-03-20 17:46:20 UTC
Yes and No. You do everything in PHP - however, for many things you may wish to use javascript especially when working with AJAX.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...