What do you like/dislike about PHP?

@CS Geek: Exactly ! Super Easy !

  1. Someone told me I should use $_GET !
  2. Does the code need placing in a different PHP file ? Or can it reside in the same file ?

EDIT: Sorry forgot the topic of this thread :blush:

If it’s a form that’s posting a value then use POST. If you are trying to get a URL parameter use GET, or you can just use REQUEST to do both and save time:

Use Get or Request (I prefer request): index.php?value=true&othervalue=false
Use Post or Request (I prefer post): <input type=“text” name=“hi” />

It is not a form and it is not a value from a URL.

It is a Simple Click on a Button. hehe See why I say ASP.NET is much easier when it comes to Button Clicks. :slight_smile:

Ciwan, do you learn PHP at university as well or just ASP.NET? And which language you learn with ASP.NET is it C# or VB.NET?

Why does this remind me of the old quip “Those who can, do. Those who can’t, teach.” Your teachers are out of touch - PHP has about 3 times the market presence that ASP.NET does. Hell, Java has more presence than all .NET deployments combined.

What is more than likely is your institution is bought and paid for by Microsoft and they are telling that lie to prevent biting the hand that feeds.

No we don’t sadly !! The Lecturers decided to teach us ASP.NET cause they say the Industry has higher demand for ASP.NET developers than they do PHP ones !!

That’s what they told me ! Though I still want to learn PHP cause you can see everything. There is no hidden code …etc Plus it is free in terms of servers …etc

However when I get to stuff like button clicks and such … I can definitely see the advantage of ASP.NET … it is much easier to build a fully working application in ASP.NET (check out videos on their site) than it is in PHP I think !

True there will be a lot of generated code …etc but if that code doesn’t affect the speed (which I’m not sure if it does or not) … then it’s OK I guess LOL

The Lecturer is teaching us VB, however I always go with C# cause I learnt Java in my first year … and C# is closer to Java than it is to VB.

It’s fine but… :slight_smile: You should also learn what is actually happening, what a form is, how it works, what Post variables are, how to pass parameters in the url in an http get request, etc. This is all the stuff that underlies what you’re doing, and if you don’t know it you’re limited in what you can achieve.

It’s also quite important in terms of SEO to be using the right kind of request. I’m fixing up a site at the moment which uses a post request to paginate news items. This means the URL is the same for each page of news so their old content isn’t getting indexed and they’re not ranking. I see this sort of stuff all the time from ASP developers.

Simple is good but you really really need to know what’s being simplified :slight_smile:

I like the much in php but I dislike the framework by third parties.

When it comes to Forms I fully understand how the $_POST and $_GET work.

I’ve watched many tutorials on this, from KillerPHP.com and many other sites that offer PHP video tutorials.

But >> Isn’t this different ? Isn’t a button click different from a Form and how to process a form ? :frowning:

Ouch !! haha

It could be true … I don’t know … I’m just a little ant trying to learn both.

A button is a form element. It has to live inside a form to work (unless you’re using some fancy-shmancy ajaxy javascript). The ASP sites I’ve seen wrap the whole page in a form, and button clicks submit that form. Check your html on one of your sites and see if I’m right :slight_smile:

I am still getting my head around ASP.NET. The wrapping the whole thing in a form, comes down to the author does not know how to code, and is using a WYSIWYG editor, or there is something wrong with the code, so when it hits the server, the server is like elephino (Source), and wraps it all in a form.

I miss that show too :slight_smile:

@GoldFidget: you are right, the whole thing is wrapped inside a form element. When we were first introduced to ASP. NET I actually asked my lecturer why this form element was here !! He said just ignore it and do the work as if it is not there !!! Lol I didn’t like it, but then I thought > if it works nicely > let it be. :smiley:

By the way I still haven’t built anything in ASP, we’re still being introduced to it.

I have actually talked to a couple of businesses regarding this and they said they DO NOT CARE about ASP.NET OR PHP. lol which I found surprising at first.

They said " We want something that just works and does what it is suppose to at decent speed, also looks good and user friendly "

These sort of discussions only go o. Between us code geeks. Business doesn’t give a crap hehe

So now you know how it works :slight_smile:

You’ll also often find a bunch of hidden input fields like viewstate which lets you track sessions across multiple forms. You wouldn’t know unless you looked for them and it would seem like it just works by magic. On the internet, nothing is magic, and everything is :slight_smile:

Yep, they just want the job done. If you’re a freelancer doing a small CMS, for me, it’s Wordpress all the way.

That’s true, but Visual Studio also makes things easier for the developer espeically for maintenance later on.

Forms can cause issues with accessibility. So depending on how the page is and who it is for, just going with “oh it looks fine” could wind you up in a world of hurt.

Do you mean forms in ASP.NET? What issues with accessibilty are you talkining about, could you give me an example?