• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged form

Web Dev> Handling dynamically created checkboxes

May02
2012
Written by Scott Rowley

Ok, so let’s say I have a list of users in a database. I want to get that list out on the screen and allow someone to be able to use checkboxes to do something with each of those users. In this example we’re going to say we are deleting any users that have been checked. If you are not already familiar with building dynamic output from mysql then I suggest you first read over Web Dev> Populate PHP/HTML table from MySQL database

First we’ll build our form to show our users, in this example I’m actually building my list of users from a query to a mail server which gets returned to me first as a string. I need to change this into an array so I’m going to use explode(). I’ll go through this all step by step so it’s easy to follow along and you can skip whatever parts you feel you are already familiar with.

So lets say the mail server returns this string to me of users:

$members_string = 'Bruce Chuck Jackie Jet';
echo "Members string is '$members_string'";

Which gives us an output of

Members string is 'Bruce Chuck Jackie Jet'

Since I want to loop through each of these members I need to first create an array that I can loop through, this is where explode() comes in.

// Members are separated by spaces, so explode on spaces
$members = explode(' ',$members_string);

READ MORE »

Posted in PHP, Web Development - Tagged checkbox, dev, dynamic, php, web, web dev, Web Development

Web Dev> HTML form ‘Back’ button

Apr07
2011
Written by Scott Rowley

It may be necessary at some point to send a user back to a previous page. This could be useful in cases such as errors or letting a customer review information and go back to change it.

<form><input type="button" value="Back" onClick="history.go(-1);return true;"></form>

The -1 indicates to go back a single page.

Posted in Web Development - Tagged back, button, html

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top