Jump to content

Recommended Posts

hi, I was wondering if it's possible to take all the input values then store them within array which I can pass onto a script which will handle it.

 

The reason I'm doing this is because I have a script which will generate a different number of "checkbox" input types depending on how large the database has grown and I'm not sure how to pull these values since you need to declare the name of each input.

 

ex:

$_GET["name"]

 

I figured that if I could store them all within a single array then there wouldn't be a problem.  Is there a better way of doing this?

 

edit:

just wanted you guys to get an idea of what I'm working with

<?php
global $mainframe;
$db =&JFactory::getDBO();
$query = "SELECT * FROM #__AuthorList";
$db->setQuery( $query, 0, $count );
$rows = $db->loadObjectList();
$number = 0;

echo "<form method='get' action='script name'>";
echo "<table border = 1 width = 500><tr><td>";
echo "<center><b>Primary List</b></center>";
echo "</td></tr>";
foreach($rows as $row)
{
if (($row -> stage) == 0  && (($row -> AuthorName) != LeaveBlank) && (($row -> AuthorName) != null))
{
echo "<tr><td>";
echo $row ->AuthorName;
echo "</td><td>";
echo "<input type='checkbox' name='".$row->AuthorID."' value='".$row->AuthorID."'>";
echo "</tr></td>";
}
}
echo "</table>";


echo "<p/>";

echo "<table border = 1 width = 500><tr><td>";
echo "<center><b>Secondary List</b></center>";
echo "</td></tr>";
foreach($rows as $row)
{
if (($row -> stage) == -1 && (($row -> AuthorName) != LeaveBlank2) && (($row -> AuthorName) != null))
{
echo "<tr><td>";
echo $row ->AuthorName;
echo "</td><td>";
echo "<input type='checkbox' name='".$row->AuthorID."' value='".$row->AuthorID."'>";
echo "</tr></td>";
}
}
echo "</table>";
echo "<p/>";
echo "<input type='hidden' name='number' value='".$number."'>"

echo "<INPUT type='submit' value='Switch Current List'>";
echo "</form>";




?>

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.