Page 1 of 1

How difficult would be the transition?

Posted: Sat Aug 29, 2009 1:53 am
by jewelthief
Hello!

I have done some work in Asp.net but now thinking to move to Php. I have only seen the basic tutorials of Php for now and it seems to me difference in syntax only. The outermost structure looks the somewhat same. So i want you guys to tell me how difficult my transition from Asp.net to Php would be? What are the main difference one have to face during such transition.

Advices would be appreciated. Thanks

Re: How difficult would be the transition?

Posted: Sat Aug 29, 2009 6:56 am
by JAB Creations
I've dabbled with some ASP.NET...I'm not sure if it was VB of JScript though. :lol:

PHP totally rocks and there are tons of built-in functions and tons of support from the community. Best of all PHP has with little doubt the best documentation available at php.net where you can simply type in a command such as explode after php.net as so: http://php.net/explode.

What's also great about PHP is you're not stuck on a WAMP server. Granted I find XP to be for now the only viable web production environment (as far as not having learning be a complete wall versus only a slow-down factor, at least for now) though Wine has really been tempting me to move over to Ubuntu...so a whole lot of free as in not spending money...did I mention the awesome php.net website? LAMP servers are always cheaper though they're also better.

You may end up developing locally on a WAMP server and hosting live on a LAMP server like I currently do. The only difference in the environments basically (from my own experience) barrels down to file system paths and for me it's been pretty rare when I encounter those situations.

Some basic code differences...

Client Output

Code: Select all

response.write "clientside text"

Code: Select all

echo 'clientside text';
Includes

Code: Select all

<!--#include virtual="footer.html"-->

Code: Select all

include("footer.html");
Notice the less verbose syntax? Less syntax to write and more stuff gets done!

Here is an example of connecting to a database with PHP. I've added the bit I use that makes the same build work both on my local computer (WAMP server) and my live server (LAMP) minus exact details (user/pass).

Code: Select all

<?php
if ($_SERVER['HTTP_HOST']=="www.example.com")
{
 $truedbuser = "example_user";
 $truedbpass = "example_pass";
}
else
{
 $truedbuser = "localhost_user";
 $truedbpass = "localhost_pass";
}
 
$db = mysql_connect("localhost", $truedbuser, $truedbpass);
 
if ($db) {echo '<div>connected to database!</div>';}
else {echo '<div>could not connect to database!</div>';}
 
$db_selected = mysql_select_db("database_name", $db);
 
if ($d_selectedb) {echo '<div>found database!</div>';}
else {echo '<div>could not find to database!</div>';}
?>
PHP is simply awesome and it's pretty much the best supported serverside scripting language you could choose to learn considering it's the most widely used. :)

Re: How difficult would be the transition?

Posted: Sat Aug 29, 2009 7:36 am
by jewelthief
Thanks for the information. I am really enlightened. I'll see what can i do in Php. Thanks again.

Re: How difficult would be the transition?

Posted: Sun Aug 30, 2009 12:45 am
by Cirdan
Yea, I have to agree. PHP has the best documentation on the net.