Jump to content

Recommended Posts

Hello I've been trying to get this to work for a few days but it still isn't working. I've narrowed the problem down to the If Statement surrounding the MySQL update query and the Query itself as neither seem to work with or without each other.

 

To explain, the form contains an existing value if the form hasn't been posted, if it has then whatever was in that form is kept on for Updating or for validating. The form and all the other parts work great except the previously mentioned sections.

 

Can anyone see where I am going wrong?

 

<?php
  $Submit = $_POST[submitB];
  $ItemType = $_POST[itemType];
  $EditThisItemType2 = $_POST[CurItemType];
  $NotExec = true;

  if ($_POST['SubmitB'] != "Submit")
   {
      $EditThisItemType = $_GET[EditThisItemType];
   } 

  if ($_POST['SubmitB'] == "Submit")
   {

     if ($ItemType == "")
     {
        ?>

        <div style="position:absolute; top:220px; left:200px; width:550px">   
          <span class="errmsg">Please Enter an Item Type</span>
</div>
      
     <?php    
        $Valid_form = false;
        $Valid_ItemType = false;
     }
     elseif($Edited == false)
     {
     ?>
       <div style="position:absolute; top:250px; left:200px; width:550px">   
       <span class="errmsg"><?php echo "Could not be edited, $ItemType may already exist!";
       ?></span>
       </div>
       <?php
     }  
     
     elseif($ItemType != "")
     {
       $Valid_form = true;
       $Valid_ItemType = true;
     }

      [b]if($Valid_form == true && $Valid_ItemType == true)
      {
        $conn = mysql_connect('host:port',username','password');

        $db = mysql_select_db('dbname', $conn);

        $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType2'";

        $rsUpdate = mysql_query($sqlUpdate,$conn);	

        if(mysql_affected_rows($conn) == "1")
        {
           $Edited = true;
           $NotExec = false;
}
        elseif(mysql_affected_rows($conn) =="-1")
        {
           $Edited = false;
           $NotExec = true;
        }

        mysql_close($conn);

     }[/b]

   }

?>




<html>
<head>
   <title>Clothing Line</title>
   <link href="stylesheetCL.css" rel="stylesheet">
   <?php require('jscript.inc') ?>
   
   <?php if($NotExec = false)
   {
   ?>
      <meta HTTP-EQUIV="REFRESH" content="0; url=display_item_types.php?Action=Edit&Edited=$Edited&NotExec=$NotExec">
   <?php
   }
   ?>
</head>
<body>

  <?php require('header.inc') ?>

  <?php require('menu.inc') ?>


<div style="position:absolute; top:75px; left:200px; width:550px">

<?php
if($_POST['SubmitB'] == "Submit")
{
?>
<span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType2 ?></span>
<br>
<br>

<?php
}
if($_POST['SubmitB'] !="Submit")
{
?>
<span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType ?></span>
<br>
<br>

<?php
}
?>

<form method="post" action='edit_item_type_form.php'/>

<?php
if($Valid_ItemType == false and $_POST['SubmitB'] == "Submit")
{
?>
<span class="errmsg">! </span>
<?php
}
?>

Item Type: <input type="text" name="ItemType" value="
<?php 
if($_POST['SubmitB'] == "Submit")
{

echo $_POST['ItemType']?>"/>
<?php
}

if($_POST['SubmitB'] != "Submit")
{
echo $EditThisItemType ?>"/>
<?php
}
?>

<input type="hidden" name="CurItemType" value="
<?php 
if($_POST['SubmitB'] == "Submit")
{

echo $_POST['CurItemType']?>"/>
<?php
}

if($_POST['SubmitB'] != "Submit")
{
echo $EditThisItemType ?>"/>
<?php
}
?>

<input type="submit" name="SubmitB" value="Submit"/>
</form>  

<br>
<br>
<br>
<br>
<a href="display_item_types.php?Action=Edit">Back to Edit Item Types List</a>
</div>

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/83879-solved-mysql-update-query-problem/
Share on other sites

  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Okay I tried to do that but it didn't even bring up any message at all, with or without the If statements surrounding it or moving the code into the <body> tags to see if it made a difference but it hasn't. I removed the require(head.inc) so that I could see if any errors were hiding behind it, but still nothing.

 

<?php
  $Submit = $_POST[submitB];
  $ItemType = $_POST[itemType];
  $EditThisItemType2 = $_POST[CurItemType];
  $NotExec = true;

  if ($_POST['SubmitB'] != "Submit")
   {
      $EditThisItemType = $_GET[EditThisItemType];
   } 

  if ($_POST['SubmitB'] == "Submit")
   {

     if ($ItemType == "")
     {
        ?>

        <div style="position:absolute; top:220px; left:200px; width:550px">   
          <span class="errmsg">Please Enter an Item Type</span>
</div>
      
     <?php    
        $Valid_form = false;
        $Valid_ItemType = false;
     }
     elseif($Edited == false)
     {
     ?>
       <div style="position:absolute; top:250px; left:200px; width:550px">   
       <span class="errmsg"><?php echo "Could not be edited, $ItemType may already exist!";
       ?></span>
       </div>
       <?php
     }  
     
     elseif($ItemType != "")
     {
       $Valid_form = true;
       $Valid_ItemType = true;
     }

   }

?>

<html>
<head>
   <title>Clothing Line</title>
   <link href="stylesheetCL.css" rel="stylesheet">
   <?php require('jscript.inc') ?>
   
   <?php if($NotExec = false)
   {
   ?>
      <meta HTTP-EQUIV="REFRESH" content="0; url=display_item_types.php?Action=Edit&Edited=$Edited&NotExec=$NotExec">
   <?php
   }
   ?>
</head>
<body>

  

  <?php require('menu.inc') ?>

<?php
    if($Valid_ItemType == true && $Valid_form == true) 
    {  
     $conn = mysql_connect('host:port','username','password');

     $db = mysql_select_db('dbname', $conn);

     $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType2'";

     $rsUpdate = mysql_query($sqlUpdate,$conn) or die(mysql_error());	

     if(mysql_affected_rows($conn) == "1")
     {
        $Edited = true;
        $NotExec = false;
     }
     elseif(mysql_affected_rows($conn) =="-1")
     {
        $Edited = false;
        $NotExec = true;
     }

     mysql_close($conn);
   }
?>

<div style="position:absolute; top:75px; left:200px; width:550px">

<?php
if($_POST['SubmitB'] == "Submit")
{
?>
<span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType2 ?></span>
<br>
<br>

<?php
}
if($_POST['SubmitB'] !="Submit")
{
?>
<span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType ?></span>
<br>
<br>

<?php
}
?>

<form method="post" action='edit_item_type_form.php'/>

<?php
if($Valid_ItemType == false and $_POST['SubmitB'] == "Submit")
{
?>
<span class="errmsg">! </span>
<?php
}
?>

Item Type: <input type="text" name="ItemType" value="
<?php 
if($_POST['SubmitB'] == "Submit")
{

echo $_POST['ItemType']?>"/>
<?php
}

if($_POST['SubmitB'] != "Submit")
{
echo $EditThisItemType ?>"/>
<?php
}
?>

<input type="hidden" name="CurItemType" value="
<?php 
if($_POST['SubmitB'] == "Submit")
{

echo $_POST['CurItemType']?>"/>
<?php
}

if($_POST['SubmitB'] != "Submit")
{
echo $EditThisItemType ?>"/>
<?php
}
?>

<input type="submit" name="SubmitB" value="Submit"/>
</form>  

<br>
<br>
<br>
<br>
<a href="display_item_types.php?Action=Edit">Back to Edit Item Types List</a>
</div>

</body>
</html>

 

<?php
  $Submit = $_POST[submitB];
  $ItemType = $_POST[itemType];
  $EditThisItemType2 = $_POST[CurItemType];
  $NotExec = true;

  if ($_POST['SubmitB'] != "Submit")
   {
      $EditThisItemType = $_GET[EditThisItemType];
?>

 

Shouldn't statements like that contain ' ' wrappers like so:

 

<?php
  $Submit = $_POST['SubmitB'];
  $ItemType = $_POST['ItemType'];
  $EditThisItemType2 = $_POST['CurItemType'];
  $NotExec = true;

  if ($_POST['SubmitB'] != "Submit")
   {
      $EditThisItemType = $_GET['EditThisItemType'];
?>

 

This was the previous code:

 

*****        $conn = mysql_connect('host:port',username','password');

 

        $db = mysql_select_db('dbname', $conn);

 

May be the problem is for the statement   

    mysql_connect('host:port',username','password');

here the single quotes for username is not corect ..just change it to  'username' and do check it out

Okay I finally got it to update correctly thanks to kjtocool, however it only works without the if statement which is quite necessary:

 

if($Valid_ItemType == true && $Valid_form == true) 
    {}

 

The only problem now is either rearrangement or change the if statements.

 

<?php
  $Submit = $_POST['SubmitB'];
  $ItemType = $_POST['ItemType'];
  $EditThisItemType2 = $_POST['CurItemType'];

  if ($_POST['SubmitB'] != "Submit")
   {
      $EditThisItemType = $_GET['EditThisItemType'];
   } 

  if ($_POST['SubmitB'] == "Submit")
   {
     $Valid_form = true;
     $Valid_ItemType = true;

     if ($ItemType == "")
     {
     ?>
     <div style="position:absolute; top:220px; left:200px; width:550px">   
          <span class="errmsg">Please Enter an Item Type</span>
     </div>
     
     <?php     
        $Valid_form = false;
        $Valid_ItemType = false;
     }     

  
    if($Valid_form == "true" && Valid_ItemType == "true") 
    { 

     $conn = mysql_connect('host:port','username','password');

     $db = mysql_select_db('dbname', $conn);

     $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType'";

     $rsUpdate = mysql_query($sqlUpdate,$conn) or die(mysql_error());	
     

     if(mysql_affected_rows($conn) == 1)
     {
        $Edited = true;
        $NotExec = false;
     }
     elseif(mysql_affected_rows($conn) ==-1)
     {
        $Edited = false;
        $NotExec = true;
     }

     mysql_close($conn);
     }
     
     if($Edited == false && $NotExec == true)
     {
     ?>

     <div style="position:absolute; top:250px; left:200px; width:550px">   
       <span class="errmsg">Could not be edited, <?php echo "$ItemType";?> may already exist!</span>
     </div>
     <?php     
     } 
   }

?>

<html>
<head>
   <title>Clothing Line</title>
   <link href="stylesheetCL.css" rel="stylesheet">
   <?php require('jscript.inc') ?>
   
   <?php if($NotExec == false && $Edited == true)
   {
   ?>
      <meta HTTP-EQUIV="REFRESH" content="0; url=display_item_types.php?Action=Edit&Edited=$Edited&NotExec=$NotExec">
   <?php
   }
   ?>
</head>
<body>

  
  <?php require('header.inc') ?>
  <?php require('menu.inc') ?>

<div style="position:absolute; top:75px; left:200px; width:550px">

<?php
if($_POST['SubmitB'] == "Submit")
{
?>
<span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType2 ?></span>
<br>
<br>

<?php
}
if($_POST['SubmitB'] !="Submit")
{
?>
<span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType ?></span>
<br>
<br>

<?php
}
?>

<form method="post" action='edit_item_type_form.php'/>

<?php
if($Valid_ItemType == false and $_POST['SubmitB'] == "Submit")
{
?>
<span class="errmsg">! </span>
<?php
}
?>

Item Type: <input type="text" name="ItemType" value="
<?php 
if($_POST['SubmitB'] == "Submit")
{

echo $_POST['ItemType']?>"/>
<?php
}

if($_POST['SubmitB'] != "Submit")
{
echo $EditThisItemType ?>"/>
<?php
}
?>

<input type="hidden" name="CurItemType" value="
<?php 
if($_POST['SubmitB'] == "Submit")
{

echo $_POST['CurItemType']?>"/>
<?php
}

if($_POST['SubmitB'] != "Submit")
{
echo $EditThisItemType ?>"/>
<?php
}
?>

<input type="submit" name="SubmitB" value="Submit"/>
</form>  

<br>
<br>
<br>
<br>
<a href="display_item_types.php?Action=Edit">Back to Edit Item Types List</a>
</div>

</body>
</html>

 

P.S. I already have a working connection.

 

I still haven't solved this problem. Although I have finally got the right syntax for the Update function I still cannot get the program to get through the If statements correctly to run it. Is there any way to do so from the above code without removing any of the validation used?

<?php
  $Submit = $_POST['SubmitB'];
  $ItemType = $_POST['ItemType'];
  $EditThisItemType2 = $_POST['CurItemType'];

if ($_POST['SubmitB'] == "Submit")
{
$Valid_form = true;
$Valid_ItemType = true;
if (empty($ItemType)){
 ?>
 <div style="position:absolute; top:220px; left:200px; width:550px">   
	  <span class="errmsg">Please Enter an Item Type</span>
 </div>
 <?php     
	$Valid_form = false;
	$Valid_ItemType = false;
}     
else{ 
	 $conn = mysql_connect('host:port','username','password');
	 $db = mysql_select_db('dbname', $conn);
	 $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType'";
	 $rsUpdate = mysql_query($sqlUpdate,$conn) or die(mysql_error());	
	 if(mysql_affected_rows($conn) == 1) {
		$Edited = true;
		$NotExec = false;
	 }
	 elseif(mysql_affected_rows($conn) ==-1){
		$Edited = false;
		$NotExec = true;
		?>
                <div style="position:absolute; top:250px; left:200px; width:550px">   
                <span class="errmsg">Could not be edited, <?php echo "$ItemType";?> may already exist!</span>
                </div>
		<?php     

	 }
	 mysql_close($conn);
}
}
else{
 $EditThisItemType = $_GET['EditThisItemType'];
}
?>

 

try that .. just reorder your logic and men you should use tab / indent your code properly whoass!

I tried that but it still isn't playing right. When I press submit the info is sent into ItemType for $_POST[itemType] to colelct and is redisplayed back into the text box, but not error message is displayed or MySQL action taken. I did checked to see if it brought up the validation when the form was empty, that was fine.

Okay I tried it and here is the code with added echoes

 

<?php
  $Submit = $_POST['SubmitB'];
  $ItemType = $_POST['ItemType'];
  $EditThisItemType2 = $_POST['CurItemType'];

if ($_POST['SubmitB'] == "Submit")
{
echo '1';
$Valid_form = true;
$Valid_ItemType = true;

       if (empty($ItemType))
       {
 echo '2';
         ?>
 <div style="position:absolute; top:220px; left:200px; width:550px">   
	  <span class="errmsg">Please Enter an Item Type</span>
 </div>
 <?php     
	$Valid_form = false;
	$Valid_ItemType = false;
}     
else
        { 
             echo '3';
             echo "$EditThisItemType2";
             echo "$ItemType";
              
                 $conn = mysql_connect('host:port','username','clothingline');
                 $db = mysql_select_db('dbname', $conn);
	 $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType2'";
	 $rsUpdate = mysql_query($sqlUpdate,$conn) or die(mysql_error());	

                 if(mysql_affected_rows($conn) == "1") {
	    echo '4';
                        $Edited = true;
		$NotExec = false;
	 }
	 elseif(mysql_affected_rows($conn) =="-1"){
	    echo '5';	
                        $Edited = false;
		$NotExec = true;
		?>
                 <div style="position:absolute; top:250px; left:200px; width:550px">   
                 <span class="errmsg">Could not be edited, <?php echo "$ItemType";?> may already exist!</span>
                 </div>
		<?php     

	 }
	 mysql_close($conn);
}
}
else
{
             echo '6';	 
             $EditThisItemType = $_GET['EditThisItemType'];
}
?>

 

It displays 6 first of all when the page is loaded, fine.

It displays only 1 and 2 when the form is blank, fine.

It displays 1,3, the correct value of $EditThisItemType2 and $ItemType, fine.

However after that it just gives up and 4 and 5 are missed altogether. 

 

<?php
  $Submit = $_POST['SubmitB'];
  $ItemType = $_POST['ItemType'];
  $EditThisItemType2 = $_POST['CurItemType'];

if ($_POST['SubmitB'] == "Submit")
{
echo '1';
$Valid_form = true;
$Valid_ItemType = true;

       if (empty($ItemType))
       {
 echo '2';
         ?>
 <div style="position:absolute; top:220px; left:200px; width:550px">   
	  <span class="errmsg">Please Enter an Item Type</span>
 </div>
 <?php     
	$Valid_form = false;
	$Valid_ItemType = false;
}     
else
        { 
             echo '3';
             echo "$EditThisItemType2";
             echo "$ItemType";
              
                 $conn = mysql_connect('host:port','username','clothingline');
                 $db = mysql_select_db('dbname', $conn);
	 $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType2'";
	 $rsUpdate = mysql_query($sqlUpdate,$conn) or die(mysql_error());	

           if($rsUpdate) {
	    echo '4';
            $Edited = true;
		$NotExec = false;
	 }
	 else{
	 	echo '5';
             $Edited = false;
		$NotExec = true;
		?>
                 <div style="position:absolute; top:250px; left:200px; width:550px">   
                 <span class="errmsg">Could not be edited, <?php echo "$ItemType";?> may already exist!</span>
                 </div>
		<?php     

	 }
	 mysql_close($conn);
}
}
else
{
             echo '6';	 
             $EditThisItemType = $_GET['EditThisItemType'];
}
?>

try and i guess you dont need mysl affected rows simply ask if the query failed or succeed

According to my readings rsUpdate seems to equal "1" every time I run it.

 

Here's the code again (without your previous edits, which made it redirect anyway even if it wasn't right)

 

<?php
  $Submit = $_POST['SubmitB'];
  $ItemType = $_POST['ItemType'];
  $EditThisItemType2 = $_POST['CurItemType'];

if ($_POST['SubmitB'] == "Submit")
{
echo '1';
$Valid_form = true;
$Valid_ItemType = true;

       if (empty($ItemType))
       {
 echo '2';
         ?>
 <div style="position:absolute; top:220px; left:200px; width:550px">   
	  <span class="errmsg">Please Enter an Item Type</span>
 </div>
 <?php     
	$Valid_form = false;
	$Valid_ItemType = false;
}     
else
        { 
             echo '3<br>';
             echo "$EditThisItemType2 is Current Item Type<br>";
             echo "$ItemType is new Item Type<br>";
              
                 $conn = mysql_connect('host:port','username','password');
                 $db = mysql_select_db('dbname', $conn);
	 $sqlUpdate = "UPDATE ItemType SET ItemType = '$ItemType' WHERE ItemType = '$EditThisItemType2'";
	 $rsUpdate = mysql_query($sqlUpdate,$conn);	
	 $affectedrows = mysql_affected_rows($conn);
                 
                 echo "$sqlUpdate is sqlUpdate<br>";
                 echo "$rsUpdate is rsUpdate<br>";

                 echo "$affectedrows is number of affected rows<br>";

                 if(mysql_affected_rows($conn) == "1") {
	    echo '4';
                        $Edited = true;
		$NotExec = false;
	 }
	 elseif(mysql_affected_rows($conn) =="0"){
	    echo '5';	
                        $Edited = false;
		$NotExec = true;
		?>
                 <div style="position:absolute; top:250px; left:200px; width:550px">   
                 <span class="errmsg">Could not be edited, <?php echo "$ItemType";?> may already exist!</span>
                 </div>
		<?php     

	 }
	 mysql_close($conn);
}
}
else
{
             echo '6';	 
             $EditThisItemType = $_GET['EditThisItemType'];
}
?>

 

and the results

 

1

3

"Vests" is Current Item Type

"Vest" is new Item Type

"UPDATE ItemType SET ItemType = 'Vest' WHERE ItemType = ' Vests'" is sqlUpdate

"1" is rsUpdate

"0" is number of affected rows

5

So can you see what is wrong with the update syntax?

 

I've noticed that after posting the code onto the forum and on the site there is a 1 char space between the ' and the $EditThisItemType within the Update query, is this formatting or the real problem? It doesn't have a space on my source code, so it is weird.

 

Edit:

Nevermind it was nothing, didn't fix it.

you still use your old code hmm any ways i dont know what is logic with this

 

if(mysql_affected_rows($conn) == "1") {  your trying to check if it connect or not?

 

i suppose it should be

 

if(mysql_affected_rows($rsUpdate) == "1") 

 

i still suggest use the result form your query instead of affected rows

No, it doesn't like if(mysql_affected_rows($rsUpdate) == "1") as it comes up with

 

Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/www/domain/admin/edit_item_type_form.php on line 40

 

Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/www/domain/admin/edit_item_type_form.php on line 45

5

 

I also kept with the previous code because rsUpdate always seems to be 1 and still does not update the value of ItemType, which means it thinks it has done it but hasn't.

I actually know what is causing the problem and it wasn't anything we thought it was either!

 

Okay, in my main form I am using a Hidden field (CurItemType) so that I can keep track of the Item Type that already exists (EditThisItemType), and allow it to be transferred correctly when the submit is pressed right? Well it was half doing it because I just changed it from a Hidden field to a Text field and it actually made the entire thing work!! The only problem is that I need it to stay hidden or come up with another method for hiding it.

 

Here is the main body of code for the form:

<body>

<div style="position:absolute; top:75px; left:200px; width:550px">

<?php
   if($_POST['SubmitB'] == "Submit")
   {
      ?>
      <span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType2 ?></span>
      <br>
      <br>

      <?php
   }

   if($_POST['SubmitB'] !="Submit")
   {
      ?>
      <span class="head3">Edit Form for Item Type: <?php echo $EditThisItemType ?></span>
      <br>
      <br>

      <?php
   }
?>

<form method="post" action='edit_item_type_form.php'/>

   <?php
      if($Valid_ItemType == false and $_POST['SubmitB'] == "Submit")
      {
         ?>
         <span class="errmsg">! </span>
         <?php
      }
   ?>

   Item Type: <input type="text" name="ItemType" value="
   
   <?php 
      if($_POST['SubmitB'] == "Submit")
      {
         
         echo $_POST['ItemType']?>"/>
         <?php         
      }

      if($_POST['SubmitB'] != "Submit")
      {
         echo $EditThisItemType ?>"/>
         <?php
      }
   ?>

   <input type="hidden" name="CurItemType" value="
   
   <?php 
      if($_POST['SubmitB'] == "Submit")
      {

         echo $_POST['CurItemType']?>"/>
         <?php
      }

      if($_POST['SubmitB'] != "Submit")
      {
         echo $EditThisItemType ?>"/>
         <?php
      }
   ?>

   <input type="submit" name="SubmitB" value="Submit"/>
</form>  

<br>
<br>
<br>
<br>
<a href="display_item_types.php?Action=Edit">Back to Edit Item Types List</a>
</div>

</body>

ok. This is how to set a session

 

<?php
session_start();
// store session data
$_SESSION['views']=1;
?>

 

So when the current type is select create a variable that stores this information. Then set a session to = that variable like below

 

<?php
session_start();

//get current type selected
$a = $_POST['current'];

// store session data
$_SESSION['views']=$a;

?>

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.