PDA

View Full Version : insert $_POST and name



Hamed
July 23rd, 2008, 12:32
I want to insert into table $_post value and the name of $_POST (I mean $_POST['(this name)'])
I do not how can I do it.
I can not get all get $_POST name.


$cat = $_POST;
$AID = $db->getID();
foreach ($cat as $id)
{
$db->read("INSERT INTO `asems` (
`aid` ,
`cid` ,
`eid`
)
VALUES (
'$AID', '', '$id'
);");
}
$cid is $_POST name and eid is value of $_POST
How can I do it?

Dynash
July 23rd, 2008, 12:50
Using a form. This seems to help http://www.blazonry.com/scripting/linksdb/insert_data.php

krakjoe
July 23rd, 2008, 12:57
foreach( $_POST as $id => $cat )

now $id is the member key and $cat is the posted member data inside of that loop ...