asp.net to php - but frustrating at the moment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

asp.net to php - but frustrating at the moment

Post by Anant »

Hi Devs,

I have recently ended up in a situation where i have to leave asp.net and work on php. May be i don't have enough php knowledge at the minute but it's really confusing how things work in php.

Few things am looking for -

In asp.net we have toolbox controls like - panels, textbox, buttons, dataview, datagrid, update panel and many more. Do we have something similar in php by any chance. I am sure there are but it's just that i am not aware of.

How do you code in php - do you do html, php and sql queries in same page. There must be some way where we don't have to write sql queries in scripts itself as in asp.net it use to be considered dangerous for sql injection and all that.

How is the security like - how can you make application more secure.

Is there any plug ins/frameworks/library that i can use along with php to make my life bit easier.

I am using Dream weaver for php and navicat for mysql. But after working on visual studio for 3 yrs - i feel like sh*tt working in dreamweaver. Is there any good compiler with debug functionality etc and similar for mysql ?

oh lot of questions to ask - moving to different language is always a pain in the beginning.

Thanks a lot.
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

Re: asp.net to php - but frustrating at the moment

Post by Anant »

This forum seems to be dead ?? Is there any other better forum like we have code project for .NET where people reply straight off.
User avatar
timWebUK
Forum Contributor
Posts: 239
Joined: Thu Oct 29, 2009 6:48 am
Location: UK

Re: asp.net to php - but frustrating at the moment

Post by timWebUK »

You questions are a bit.... strange.

For example, when you talk about panels, textboxes etc, you are referring to an IDE. Not to PHP or ASP.NET features. There are PHP IDEs available.

PHP is written in PHP files, which can contain HTML. Putting SQL in a PHP file doesn't make it vulnerable to SQL injection, that all comes down to how you build and construct your SQL query.

Security is a HUGE subject and can't be covered with "how can you make application more secure". Just basic steps are do not trust ANY user input, validate everything, never pass an unsanitized SQL query to the database. Hash and encrypt senstive data. The list goes on.

There are lots of frameworks for PHP. Zend, CodeIgniter, CakePHP etc.

SQL isn't a compiled language.
Anant
Forum Commoner
Posts: 66
Joined: Wed Jul 14, 2010 11:46 am

Re: asp.net to php - but frustrating at the moment

Post by Anant »

is it really strange ??

What else questions would you expect from some one coming from .NET background. Okay you have still not answered any of my questions - ok it's IDE then tell me which IDE provides all these tools ?

Yeh putting sql in php doesn't make it insecure but it's bit messy. I prefer separating data layer, business layer and front end. So is there any way to achieve that or we just have to put everything in one php file.

Then how about the debug facility. I am unable to step through the code like i use to do in VStudio.. ? Any answer to this ??

I can see there are lots of frameworks - but which one is the best - what serves the best - which one are you using and why is it good for you.

Let's not discuss about SQL now.
jeshurun
Forum Newbie
Posts: 5
Joined: Wed Dec 02, 2009 5:37 am

Re: asp.net to php - but frustrating at the moment

Post by jeshurun »

hi,
you can use any framework depending on what you want to achieve and your current skill level.
since you are from an object-oriented background, why not try your hands on zend?
Hope this helps
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: asp.net to php - but frustrating at the moment

Post by internet-solution »

Anant wrote:is it really strange ??
What else questions would you expect from some one coming from .NET background. Okay you have still not answered any of my questions - ok it's IDE then tell me which IDE provides all these tools ?
Anant wrote: Then how about the debug facility. I am unable to step through the code like i use to do in VStudio.. ? Any answer to this ??
The above questions are related to IDE. I have not yet personally met anyone who uses IDE for PHP. Most PHP developers seem to use text editor. But I have googled "PHP IDE" and found a lot of opensource ones. There is a comparisaon on this site
Anant wrote: Yeh putting sql in php doesn't make it insecure but it's bit messy. I prefer separating data layer, business layer and front end. So is there any way to achieve that or we just have to put everything in one php file.
You don't have to put everything in one file. Its upto you how you develop your object model.

PHP is a object oriented language so any well designed site will have class files that define data layers etc. Even in my smallest site there are more than 10 php files.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: asp.net to php - but frustrating at the moment

Post by Jonah Bron »

Anant wrote:Yeh putting sql in php doesn't make it insecure but it's bit messy. I prefer separating data layer, business layer and front end. So is there any way to achieve that or we just have to put everything in one php file.
include() is your friend.
Anant wrote:Then how about the debug facility. I am unable to step through the code like i use to do in VStudio.. ?
Run the site on a localhost. Read any errors you get.
Anant wrote:I have recently ended up in a situation where i have to leave asp.net and work on php. May be i don't have enough php knowledge at the minute but it's really confusing how things work in php.
From the information I've gleaned about ASP.net, in is a major abstraction layer, and allows developers to go without knowing how things really work. Not good.
Anant wrote:...dangerous for sql injection and all that...
Always clean anything you take from the user and put into a query with mysql_real_escape_string(). Like Tim said, validate everything. There are no security measures that apply specifically to PHP, just general security practice.
Anant wrote:Is there any plug ins/frameworks/library that i can use along with php to make my life bit easier.
Zend, Codeigniter, CakePHP, just to name the more popular ones.
Anant wrote: Is there any good compiler with debug functionality etc...
You don't compile anything in web development.
Anant wrote:oh lot of questions to ask - moving to different language is always a pain in the beginning.
You might google for a tutorial for people ASP developers wanting to learn PHP.
Post Reply