Posts filed under 'PHP'

One Form, Multiple Actions

Not everyone is aware of this fact, so I thought I'd share it. You can have a single form, with multiple submit buttons, and then determine which button was clicked as to what action to take. Take the following code:


If your user clicks on the "edit" button, then $_POST["edit"] will be available, and the same if they click on the "delete" button. You can test for these buttons within your PHP code, and then perform the related actions:

PHP:
  1. if(isset($_POST["edit"]) && trim($_POST["edit"])!=='') {
  2. //they clicked edit
  3. //perform INSERT SQL Query
  4. } elseif(isset($_POST["delete"]) && trim($_POST["delete"])!=='') {
  5. //they clicked delete
  6. //perform DELETE SQL Query
  7. } else {
  8. //nothing has been clicked
  9. //load initial form
  10. }

3 comments November 16th, 2005

Running Oracle 10g XE & PHP on Linux

I decided to reformat my local webserver the other day. This server generally runs all my code on it before its published onto the web. I was using Fedora Core 4 Test 3, but decided to lose some stuff I've installed on there, and put a full release of FC4 on.

I settled on the following LAMP options:

I decided that I'd stick Oracle XE on as well, and have a play with that. Surely if MySQL is that simple to install then Oracle can't be that much harder! Or so I thought...

Continue Reading 1 comment November 15th, 2005

Next Posts


Calendar

November 2008
M T W T F S S
« Sep    
 12
3456789
10111213141516
17181920212223
24252627282930

Posts by Month

Posts by Category