Multiple Submit Buttons on Forms: Part II

This is Part II in a discussion on how to incorporate multiple submit buttons on html forms.

Part I focused on having multiple submit buttons that performed completely different actions, such as going to different web pages.  Here we consider multiple submit buttons that launch the same php application, but take different actions within that application.

Here we have a simple form with three submit buttons:

<form name=”categories” method=”get” action=”action.php”>
<input type=”submit” name=”Submit_1″ value=”Submit”>
<input type=”submit” name=”Submit_2″ value=”Submit”>
<input type=”submit” name=”Submit_3″ value=”Submit”>
</form>

I am using the get method so that you can see what actually gets sent along with the url.
When you click on Submit_1 you see this URL:

http://www.urlkazoo.com/action.php?Submit_1=Submit

You can see that it is passing the name of the Submit button as a parameter.  To use this information, one simply needs to identify which parameter is being passed.  We can do this in the php code in action.php.  Here is a php snippet:

// Test is Submit_1 is defined
if (isset($_REQUEST["Submit_1"]))
{
$button = 1;
}
// Test is Submit_2 is defined
if (isset($_REQUEST["Submit_2"]))
{
$button = 2;
}
// Test is Submit_3 is defined
if (isset($_REQUEST["Submit_3"]))
{
$button = 3;
}

Of course the code above can be simplified using else statements.
But the point is to demonstrate that we can determine which button was pressed by figuring out which button’s name has been passed along as a parameter.

From here you can go on to perform different functions based on which submit button was pressed.

Good Luck!

Posted under Coding, Internet, Programming, Software, Space, Uncategorized

Knuth: Developing Robotic Scientists for Space Exploration

The University at Albany (SUNY) has highlighted Knuth’s research in a recent news piece.

UAlbany Professor Kevin Knuth with a robot built from LEGOs. (Photo Mark Schmidt)

UAlbany Professor Kevin Knuth with a robot built from LEGOs. (Photo Mark Schmidt)

Kevin Knuth has a laboratory in the physics department of the University at Albany that is filled with LEGOs. The bricks are relatively cheap and can be used to rapidly prototype a robot’s body. Knuth’s robots are being programmed to solve such problems as mapping complex terrain.

At UAlbany Day on Saturday, Oct. 25, he will give a demonstration on Robotics and Robotic Exploration in Life Sciences Room 143 at 10:45 a.m.

More here:
http://www.albany.edu/news/update_4522.shtml

Building instructions for the robot shown in the UAlbany article can be found on Brickengineer.com

Visit Autonomous Exploration News for information on Knuth’s company Autonomous Exploration Inc.

Visit Robots Everywhere for a general blog on robotics news.

Posted under Exploration, Fun, Intelligent Systems, Internet, Lego, Research, Robotics, Space

This post was written by drknuth on October 21, 2008

Tags: , , , , , , , , ,

Webcast on New Mars Science Laboratory Rover

Mars Science Laboratory

On Thursday October 16th at 7pm PST, JPL will host a webcast of a lecture on the new Mars Science Laboratory (MSL) Rover. This webcast will require RealPlayer—the free RealPlayer 8 Basic can be downloaded from RealPlayer.
More info can be found here at JPL.

This talk is part of the JPL von Kármán Lecture Series.
Here is the Summary from the JPL Website:

New Wheels on Mars: The Mars Science Laboratory
Dr. Richard Cook
Mars Science Laboratory Project Manager

Building on the success of the two rover geologists that arrived at Mars in January, 2004, NASA’s next rover mission will depart for the Red Planet in 2009. Twice as long and five times as heavy as the Mars Exploration Rovers, the Mars Science Laboratory will collect Martian soil and rock samples and analyze them for organic compounds and minerals which demonstrate that Mars can or did support life. This sophisticated science laboratory will be delivered to the Martian surface using an innovative new landing system. The spacecraft will start by steering itself through the Martian atmosphere in a fashion similar to the way the Apollo entry capsule controlled its entry through Earth’s upper atmosphere. This approach will allow the spacecraft to fly to a desired location above the surface of Mars before deploying its parachute for the final landing. Then, in the final minutes before touchdown, the spacecraft will activate its parachute and retro rockets before lowering the rover package to the surface on a tether.

If you are local, you may be able to attend the talk:

Thursday, October 16, 2008, 7p.m.
The von Kármán Auditorium at JPL
4800 Oak Grove Drive
Pasadena, CA
+Directions

Friday, October 17, 2008, 7p.m.
The Vosloh Forum at Pasadena City College
1570 East Colorado Blvd.
Pasadena, CA
+Directions

Posted under Astrobiology, Exploration, Mars, Research, Robotics, Space, Technology

This post was written by drknuth on September 13, 2008

Tags: , , , , , , , , , , ,

Advances in Science and Exploration

I have been thinking about human science and exploration, and how long it takes for these processes to initiate and result in acceptance and conclusion.  When considering exploration, it seems it takes about two human lifetimes to go from the initial explorations to settlement.  Perhaps this is the cultural time required for the old guys and their ideas to die off, and the next generation to think seriously about the problems.  Science seems to progress similarly.

This suggests the following timeline:

1969   Humans walk on the Moon

2050  Humans begin colonizing the Moon
2050  Humans begin exploring Mars

2150   Humans begin colonizing Mars
2150   Humans begin exploring the Outer Solar System
2150   Robotic explorers begin surveying Alpha Centauri and neary stars

2250   Humans begin colonizing Outer Solar System

Its too bad that this will take a long time, but each step requires dramatic cultural changes, which take lifetimes to perform.

Kevin Knuth
Boraceia, Brazil

Posted under Astronomy, Exploration, Space

This post was written by drknuth on July 11, 2008

Tags: , , ,

Phoenix from Space

Two great images from the HiRISE camera!

This is the Phoenix probe parachuting into Mars’ north polar region from orbit with Heimdall Crater in the background.  A larger image can be seen at Astronomy Picture of the Day.

Phoenix parachuting in

This image shows the Phoenix probe on the ground.

 Phoenix imaged from Mars orbit

At this point, a camera under Phoenix may have found a hard icy substrate underlying the topsoil (story here).

Kevin Knuth
Albany NY

Posted under Astronomy, Exploration, Mars, Robotics, Software, Space

This post was written by drknuth on June 1, 2008

Tags: , , , , , , ,