How difficult would be the transition?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
jewelthief
Forum Newbie
Posts: 13
Joined: Sat Aug 29, 2009 1:46 am

How difficult would be the transition?

Post 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
User avatar
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?

Post 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. :)
jewelthief
Forum Newbie
Posts: 13
Joined: Sat Aug 29, 2009 1:46 am

Re: How difficult would be the transition?

Post by jewelthief »

Thanks for the information. I am really enlightened. I'll see what can i do in Php. Thanks again.
Cirdan
Forum Contributor
Posts: 144
Joined: Sat Nov 01, 2008 3:20 pm

Re: How difficult would be the transition?

Post by Cirdan »

Yea, I have to agree. PHP has the best documentation on the net.
Post Reply