Jump to content

[SOLVED] Minor problem retrieving form array names in php


acctman

Recommended Posts

in my FORM I have the names setup to be retrieved with an array in php in php I use the following code to Update the database

  foreach ($_POST['add'] as $col => $value) $_POST['add'][$col] = strip_tags(stripslashes($value)); {
  mysql_query("UPDATE rate_members SET m_".$col."='".sql_escape_string(stripslashes($value))."' WHERE m_id='$m_id'");
}

 

my problem is how do I retrieve a single $_Post name and value from the FORM? I know how to do it when and array grabbing all, but what about just one item? example code is that I'm trying to run but its not working since the name values are name=add[city] name=add[state] name=add[country] etc in the FORM.

 

if ($_POST['city'] == "" || $_POST['orientation'] == "" || $_POST['status'] == "" || $_POST['ethnicity'] == ""){
	$err;
}

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.