Jump to content

form in a table?


euel

Recommended Posts

Gud morning ppl!

I nid some enlightenment,

so i have a code like this, (i removed the exact variable name and stuff to make it simple..)

 

function some_function()
{
      echo "<table>";
      echo "<th>";
        $variable_set = select_all_variable(); // function to call data
         while($variable = mysql_fetch_array($variable_set))
             {
                    echo "<form action='link.php' method='post'>";	
	    echo "<input type='hidden' name='name' value='{$variable['id']}'>";
	    echo "<input type='hidden' name='name' value='{$session_id}'>";
                    echo "<tr>"
                    echo "<td>" .  $variable['name'] . "</td>";
                    echo "<td>" .  $variable['location'] . "</td>";
                echo "<td>";
	echo "<input type='submit' name='submit' value='Submit' />";
        echo"</td>";
		echo "</tr>";
	echo "</form>";	
	}
echo "</table>";


}

 

my setup is to display the all data from the database in a table and make a submit button on each row to able to relay the id's to an another page..

my question is.. this gonna work ?

cuz when i click the submit button it doesn't send/post the data i need specifically both the hidden input type.. which will be displayed on the link.php page..

any thoughts?

thanks nub here..  :-*

Link to comment
https://forums.phpfreaks.com/topic/252361-form-in-a-table/
Share on other sites

i cant seem to make it work like this..so decided to remove the form and change the submit button to a <a>

like this

 

            echo "<a href=\"link.php?event_id=" . urlencode($variable['id']) . "&user_id=" . urlencode($session_id) . "\">";

 

then throw and catch it the link.php... the only problem here is that user can see from the address bar the id's which is not a good thing cuz they might change it..  :'(

im gonna test it if will work fine on the insertion process then if it working well, I'll mark this thread as solved.

thoughts and ideas are still welcome though!  ;D

Link to comment
https://forums.phpfreaks.com/topic/252361-form-in-a-table/#findComment-1293790
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.