Ralf Eisenreich

SQLBlog.DE | ..things to remember

April 19th, 2006

HTML Forms & php

IT, by Ralf.

Wie man den Status von HTML Forms mit php abfragt zeigt folgendes Beispiel:

Checkbox

HTML:


<input type="checkbox" onclick="do();" name="chkTest" />

php:

// get checkbox status
if (array_key_exists('chkTest', $_POST) && $_POST['chkTest'] != null):
$value = 1;
else:
$value = 0;
endif;

Radiobutton

HTML:


<input type="radio" onclick="do();" value="1" name="radTest" />
<input type="radio" onclick="do();" value="2" name="radTest" />
<input type="radio" onclick="do();" value="3" name="radTest" />

php:

// get checkbox status
if (array_key_exists('radTest', $_POST) && $_POST['radTest'] != null):
$value = $_POST['radTest'];
endif;

Back Top

Responses to “HTML Forms & php”

Comments (0) Trackbacks (0) Leave a comment Trackback url
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Security Code: