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
How difficult would be the transition?
Moderator: General Moderators
-
jewelthief
- Forum Newbie
- Posts: 13
- Joined: Sat Aug 29, 2009 1:46 am
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: How difficult would be the transition?
I've dabbled with some ASP.NET...I'm not sure if it was VB of JScript though. 
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
Includes
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).
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. 
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';Code: Select all
<!--#include virtual="footer.html"-->Code: Select all
include("footer.html");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>';}
?>-
jewelthief
- Forum Newbie
- Posts: 13
- Joined: Sat Aug 29, 2009 1:46 am
Re: How difficult would be the transition?
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?
Yea, I have to agree. PHP has the best documentation on the net.