Where to start: PHP Web GUI Programming

Status
Not open for further replies.
D

Deleted member 43669

Guest
Do you have any programming experience?

If you do, just jump in. Set up a dev environment where you can work to your heart's content and code away.

No programming experience? It kinda depends on what you need to do. Again, set up an environment so that you can experiment without trouble. Some changes you'll be able to locate quite easily; changing texts and small tweaks can be doable even if you don't know any programming- *simple* PHP code tends to be pretty accesible.

If you are no programmer and the web is moderately complex, you are in trouble.

PHP's website has pretty complete reference documentation. It has this nifty feature where if you visit http://www.php.net/<function name here> you will jump directly to the reference for a function.

Tutorials are hit and miss. Just pick one and have a critic eye.
 

betacoder

Seniorius Lurkius
2
You have several options here.

1. Code everything manually. Not the easiest choice for beginner. Tutorials definitely can help but picking the right one can be tough.

The good idea is to separate HTML from PHP code using templating engine like Smarty. You also going to need a solid IDE like Eclipse or PHPStorm.

2. Learn one of PHP frameworks. The learning curve will be longer though it will pay off on the long run. Top five PHP frameworks are Yii, CodeIgniter, Zend, CakePHP and Symfony. More detailed comparison at http://www.phpframeworks.com/top-10-php-frameworks/

3. Pick PHP code generator that can handle both PHP and HTML parts for you. I recommend PHPRunner that comes with visual editor though there are tons of others on the market.
 
I ended up following this article: http://www.zalas.eu/setting-up-a-php-de ... buntu-1004

So now I have a web server set up on my Ubuntu VM. I am able to create some text boxes and buttons and labels using a php script. What do I use to add actions to these buttons?

For example,

<div><input type="checkbox" id="myCheckbox" /><label for="myCheckbox" id="lblMyCheckbox">Check me!</label></div>

creates a checkbox, how can I read the state of this checkbox and do something?
 

btmlltt

Ars Legatus Legionis
15,156
Falcan":2acjrs08 said:
I ended up following this article: http://www.zalas.eu/setting-up-a-php-de ... buntu-1004

So now I have a web server set up on my Ubuntu VM. I am able to create some text boxes and buttons and labels using a php script. What do I use to add actions to these buttons?

For example,

<div><input type="checkbox" id="myCheckbox" /><label for="myCheckbox" id="lblMyCheckbox">Check me!</label></div>

creates a checkbox, how can I read the state of this checkbox and do something?
You need to find a programming tutorial (that uses PHP) and start from there. If that's the level you're starting from, just creating this thread and asking questions is going to be way too painful and slow for you.
 
D

Deleted member 43669

Guest
If you want the raw way, learn how the HTTP protocol works (RFC 2616), HTML (w3.org) and how PHP fits into that.

Surprisingly (or not), the PHP manual doesn't teach you the missing piece.

It goes something like this (somewhat simplified).

When a browser requests an URL, it uses HTTP to request the URL to the appropriate web server. The web server receives the HTTP request. Typically, when using PHP, what the web server does is map the URL to a path in the filesystem; that is, http://www.example.com/foo/bar.php goes to a path in the webserver's filesystem like /var/www/foo/bar.php. The web server detects this is a PHP script and invokes the PHP interpreter, passing along the details of the web request as variables (see http://www.php.net/manual/en/reserved.variables.php ). Your PHP script can use this variable to see, for instance, if the request was a form submission and which was the state of the form controls.
 

ronelson

Ars Legatus Legionis
21,399
Subscriptor
I know in Java it's not that hard to create a panel, add a button, and assign an action listener to it. I hoped PHP was similar to that.
There is a pretty significant difference between a client app and a web app (and even within web apps). PHP can't "listen" because it's sent you the form and it's done, at least until you push the button that sends your POST. AJAX can do some listening for you, but that's not what an HTML form does.
 
Status
Not open for further replies.