Jump to content

Recommended Posts

Hey all, hope this is the right forum to post this in.

 

I have a select box that connect to a database and shows a list of the items. I want to use $_post to get the option the user selects and then display this, however when I try display this its ALWAYS blank, it's annoying me, im about to hadouken my Mac out the window, can anyone help? here's my code.....

 

---delete.php----

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("stock", $con);

$query = mysql_query("SELECT brand FROM phonestock");
?>
<form action="new.php" method="post">
<select name="tink">
<option> test </option>
<?php

//for each row we get from mysql, echo a form input
while ($row = mysql_fetch_array($query)) {
echo "<option value=\"$row[model]\">$row[brand]</optio…
}
?>
</select>
<input type="submit"name="Submit" value="Submit">
</form>

 

 

---new.php----

<?php
echo $POST['tink'];
?>

 

NOTHING APPEARS, IF I TYPE SOMETHING ELSE THO THAN IT WILL APPEAR?? The <select> list show fine so im baffled

 

I tired putting 'brand' and 'model' inside '' marks however this just made the delete.php page display as blank... where as before it displayed the drop down box with a list of my items in it

 

Link to comment
https://forums.phpfreaks.com/topic/168097-getting-post-data-from-a-selection-box/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.