user3387719
user3387719

Reputation: 55

can't get values form html select to php

i can't get values from the HTML select menu to js and from there to sql... the problem is in the JS code - it's probably caused by bad syntax... or misplace values.....

here is the varibles from the JS file

var select = $('select.select').val();

here is the varibles from the PHP file

$select = filter_var($_POST['select.value'],FILTER_SANITIZE_STRING);

here is the SELECT menu from the HTML file

 <select name ="select" class="select">

<option disabled selected id="none"> -- select an option -- </option>
<option value="roy">roy</option>

here is the FULL code , the PHP code is in the Console area - because i didn't manage to upload the code correctly...

code Thanks Ahead !

Upvotes: 0

Views: 403

Answers (1)

dap.tci
dap.tci

Reputation: 2485

$_POST uses name="select", so:

$select = filter_var($_POST['select'],FILTER_SANITIZE_STRING);

Upvotes: 1

Related Questions