Help - Search - Members - Calendar
Full Version: HTML Forms
HTMLHelp Forums > Programming > Server-side Scripting
tudsy
Hi



I have two problems:

1. I set one of the input controls to checked (radio button) but when it appears in the browser the
action is of the following: When I select the other other option, both options are checked.
Can anyone help?

2.I cannot read the variables e_address and value by the PHP script when i press the submit button.


Thanks.

Adrian
Click to view attachment Click to view attachmentClick to view attachment
Christian J
QUOTE(tudsy @ Sep 30 2014, 01:12 PM) *

1. I set one of the input controls to checked (radio button) but when it appears in the browser the
action is of the following: When I select the other other option, both options are checked.

Both radio buttons need the same NAME attribute value (currently they share the same ID value, which is not allowed in HTML). The NAME value must match that used in the PHP script:

CODE
$_POST['value']

(which currently uses the confusing value "value").

QUOTE
2.I cannot read the variables e_address and value by the PHP script when i press the submit button.

This is because the form fields lack NAME attributes. See also http://php.net/manual/en/tutorial.forms.php

Also you must sanitize user data with e.g. mysqli_real_escape_string before querying your database, or you will end up with an SQL injection (perhaps someone stealing or deleting your whole email address table).



This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.