- Joined
- Jul 28, 2008
- Messages
- 3,300 (0.57/day)
System Name | Primary|Secondary|Poweredge r410|Dell XPS|SteamDeck |
---|---|
Processor | i7 11700k|i7 9700k|2 x E5620 |i5 5500U|Zen 2 4c/8t |
Memory | 32GB DDR4|16GB DDR4|16GB DDR4|32GB ECC DDR3|8GB DDR4|16GB LPDDR5 |
Video Card(s) | RX 7800xt|RX 6700xt |On-Board|On-Board|8 RDNA 2 CUs |
Storage | 2TB m.2|512GB SSD+1TB SSD|2x256GBSSD 2x2TBGB|256GB sata|512GB nvme |
Display(s) | 50" 4k TV | Dell 27" |22" |3.3"|7" |
VR HMD | Samsung Odyssey+ | Oculus Quest 2 |
Software | Windows 11 Pro|Windows 10 Pro|Windows 10 Home| Server 2012 r2|Windows 10 Pro |
I have a FORM in HTML file that has CHECKBOX:
<body>
<form id="form1" name="lastname" method="post" action="delete1.php">
<label>Label
<select name="lastname">
<option value="Ristovski">Ristovski</option>
<option value="Petacka">Petacka</option>
</select>
</label>
<input type="submit" />
</form>
that I want to send data to PHP file delete.php
<?php
$con = mysql_connect("localhost","root","00000000");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("proba", $con);
$sql="DELETE FROM Persons WHERE LastName='$_POST[lastname]' AND FirstName='$_POST[firstname]'";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record DELETED";
?>
The problem is in my html file. I`m new to this and I don`t know how to assign multiple names and values to one radio button so when I submit it would send that in to the PHP file LastName='$_POST[lastname]' AND FirstName='$_POST[firstname]'";
I just know how to set checkbox how to send just last name or first name. The question is how to send both with just one checkbox selected. I hope this make sense .
<body>
<form id="form1" name="lastname" method="post" action="delete1.php">
<label>Label
<select name="lastname">
<option value="Ristovski">Ristovski</option>
<option value="Petacka">Petacka</option>
</select>
</label>
<input type="submit" />
</form>
that I want to send data to PHP file delete.php
<?php
$con = mysql_connect("localhost","root","00000000");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("proba", $con);
$sql="DELETE FROM Persons WHERE LastName='$_POST[lastname]' AND FirstName='$_POST[firstname]'";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record DELETED";
?>
The problem is in my html file. I`m new to this and I don`t know how to assign multiple names and values to one radio button so when I submit it would send that in to the PHP file LastName='$_POST[lastname]' AND FirstName='$_POST[firstname]'";
I just know how to set checkbox how to send just last name or first name. The question is how to send both with just one checkbox selected. I hope this make sense .