Still new to this, this one could be simple
Posted: Sun Oct 13, 2002 10:41 am
If I have a page with something like:
<input type="text" name="f_name" value="First">
How do I pull the name out with PHP? Is there a way to do it like it's done in javascript?
<javascript>
firstName=form.f_name.value;
</javascript>
I know you can set up the value $f_name, but I will tell you why I have the prob.....
for ($i=0; $i < $matches; $i++)
{
$row = mysql_fetch_array($search_row);
echo "<tr>\n<input type=\"hidden\" name=\"id\" value=\"".$row["id"]."\">\n";
echo "<td align=\"center\">".($i+1)."</td>\n<td><span class=\"in\">";
echo $row["u_name"];
echo "</span></td>\n<td><span class=\"in\">";
echo $row["f_name"];
echo "</span></td>\n<td><span class=\"in\">";
echo $row["l_name"];
echo "</span></td>\n<td><span class=\"in\">";
echo $row["dept"];
echo "</span></td>\n";
echo "<td align=\"center\">\n";
echo "<input type=\"submit\" value=\"Del\" name=\"del\">".$row["id"]."";
//echo "<input type=\"button\" value=\"Mod\"></td></tr>\n"; //modify button. Will get to work after Del works
}
echo "</table>\n";
If you look above you will see that the it is a dynamically created table based on $matches. Here, echo "<tr>\n<input type=\"hidden\" name=\"id\" value=\"".$row["id"]."\">\n"; I want to get the value from
value=\"".$row["id"]."\" because I am looking to be able to delete that username if it is no longer needed.
Maybe someone could walk me through this? I am still really new but I am determined to make this thing work.....
<input type="text" name="f_name" value="First">
How do I pull the name out with PHP? Is there a way to do it like it's done in javascript?
<javascript>
firstName=form.f_name.value;
</javascript>
I know you can set up the value $f_name, but I will tell you why I have the prob.....
for ($i=0; $i < $matches; $i++)
{
$row = mysql_fetch_array($search_row);
echo "<tr>\n<input type=\"hidden\" name=\"id\" value=\"".$row["id"]."\">\n";
echo "<td align=\"center\">".($i+1)."</td>\n<td><span class=\"in\">";
echo $row["u_name"];
echo "</span></td>\n<td><span class=\"in\">";
echo $row["f_name"];
echo "</span></td>\n<td><span class=\"in\">";
echo $row["l_name"];
echo "</span></td>\n<td><span class=\"in\">";
echo $row["dept"];
echo "</span></td>\n";
echo "<td align=\"center\">\n";
echo "<input type=\"submit\" value=\"Del\" name=\"del\">".$row["id"]."";
//echo "<input type=\"button\" value=\"Mod\"></td></tr>\n"; //modify button. Will get to work after Del works
}
echo "</table>\n";
If you look above you will see that the it is a dynamically created table based on $matches. Here, echo "<tr>\n<input type=\"hidden\" name=\"id\" value=\"".$row["id"]."\">\n"; I want to get the value from
value=\"".$row["id"]."\" because I am looking to be able to delete that username if it is no longer needed.
Maybe someone could walk me through this? I am still really new but I am determined to make this thing work.....