Jump to content

Help


fife

Recommended Posts

Sorry I wouldn't know what to call this question.  Right I have this query

if(isset($_POST['insert_club'])){   
//Process data for validation  

$name    = trim($_POST['name']); 
$cat = trim($_POST['cat']);   
$memberID		=	trim($_POST['memberID']);
$validationID	=	trim($_POST['validationID']);
$creation_date   =	trim($_POST['CreationDate']);

$new_cat = trim($_POST['newCat']);

//perform validations
$errors = array();    
if(empty($name))    {        
$errors[] = "Please enter a name for your club";    
}


//Check if there were errors
if(count($errors)===0)    {        
//	Prepare data for db insertion        
$name    = mysql_real_escape_string($name);
$cat 	=	mysql_real_escape_string($cat);
$memberID		=	mysql_real_escape_string($memberID);
$validationID	=	mysql_real_escape_string($validationID);
$creation_date   =	mysql_real_escape_string($creation_date);
//post the details of the new category to me



$query = "INSERT INTO clubs                      
(`name`, `cat`, `memberID`, `validationID`, `CreationDate` )
VALUES                    
('$name', '$cat', '$memberID', '$validationID', '$creation_date' )";

$result= mysql_query($query) or die(mysql_error());
$url = "address.php?new_club=$validationID";        
header("Location: $url");     
}}

It works great.  Within that query there is a unused post  $new_cat = trim($_POST['newCat']);

 

Now I dont ever want this field entered into the database.  Firstly.  If its empty then I want nothing to happen with it but, if the user has entered something into the field then I want the contents of the field emailed to an address without effecting the rest of the query.  Is this possible?  I have written it so many different ways now and none of them seem to work.

Link to comment
Share on other sites

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.