A Database Error Occurred Error Number: 1146 in codeigniter - codeigniter

I am new to codeigniter where I tried form validation.
Here is my View Code:
<?php echo validation_errors(); ?>
<?php echo form_open('enquiry'); ?>
<table width="580" border="0" cellspacing="0" cellpadding="5">
<tr>
<td height="30" align="right" valign="middle" class="normal-text-style"> *Full Name:<br /></td>
<td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="name" value="<?php echo set_value('name'); ?>" class="textbox-style01" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" class="normal-text-style"> *Company: <span id="mndCompany"> </span><br /></td>
<td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="company" value="<?php echo set_value('company'); ?>" class="textbox-style01" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" class="normal-text-style"> *E-mail:</td>
<td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="email" value="<?php echo set_value('email'); ?>" class="textbox-style01" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" class="normal-text-style"> *Phone: <br /></td>
<td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="phone" value="<?php echo set_value('phone'); ?>" class="textbox-style01" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" class="normal-text-style"> *Fax: <br /></td>
<td height="30" align="left" valign="middle" class="normal-style"><input type="text" name="fax" value="<?php echo set_value('comments'); ?>" class="textbox-style01" /></td>
</tr>
<tr>
<td width="179" height="30" rowspan="2" align="right" valign="top" class="normal-text-style"> *Comments: <br /></td>
<td width="421" height="12" align="left" valign="middle" class="normal-style"><textarea name="comments" class="msgebox-style01"><?php echo set_value('comments'); ?></textarea></td>
</tr>
<tr>
<td height="50" align="left" valign="top" class="normal-style"><input type="image" name="submit" src=" <?php echo base_url(); ?>/public/images/submit01.png" alt="submit" /></td>
</tr>
</table>
</form>
And this is my controller
function index()
{
$this->form_validation->set_rules('name', 'Name', 'trim|required|xss_clean');
$this->form_validation->set_rules('company', 'Company', 'trim|required|xss_clean');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email|is_unique[users.email]');
$this->form_validation->set_rules('phone', 'phone', 'trim|required|xss_clean');
$this->form_validation->set_rules('fax', 'fax', 'trim|required|xss_clean');
$this->form_validation->set_rules('comments', 'comments', 'trim|required|xss_clean');
$data['header_menu']=$this->load->view('header_menu', '', TRUE);
$this->load->view('inner_header',$data);
$data['left_menu']=$this->load->view('left_menu', '', TRUE);
if ($this->form_validation->run() == FALSE)
{
$this->load->view('enquiry',$data);
}
else
{
$this->load->view('enquiry/formsucess',$data);
}
$this->load->view('footer');
//$this->load->view('enquiry',$data);
}
function formsucess()
{
$name = $this->input->post('name');
$company = $this->input->post('company');
$email = $this->input->post('email');
$phone = $this->input->post('phone');
$fax = $this->input->post('fax');
$comments = $this->input->post('comments');
$this->db->query("INSERT INTO `st_enquiry`
(name, company,email,phone,fax,comments,status,created_on)
VALUES
('$name','$company','$email','$phone','$fax','$comments','1',now())");
$data['header_menu']=$this->load->view('header_menu', '', TRUE);
$this->load->view('inner_header',$data);
$data['left_menu']=$this->load->view('left_menu', '', TRUE);
$this->load->view('media',$data);
$this->load->view('footer');
}
After submitting the form I got an error like:
A Database Error Occurred
Error Number: 1146
Table 'table.users' doesn't exist

checkout this link
Here
$data = array(
'title' => 'My title' , // column_name => value
'name' => 'My Name' ,
'date' => 'My date'
);
$this->db->insert('tablename', $data);
must work in any condition.

$this->form_validation->set_rules('email','Email','required|valid_email|is_unique[users.email]');
Here will be some change
is_unique[users.email]
01.here users mean your table name
02. email means email column in your table.
so it will be
$this->form_validation->set_rules('email','Email','required|valid_email|
is_unique[table name.email column in your table]');

A Database Error Occurred
Error Number: 1146
Table 'table.users' doesn't exist
I solved this problem in Codeigniter by changing name of table in phpmyadmin
i hope this can help you

Create a function in Model like:
$this->db->insert($this->table_name,$db_data);
return $this->db->insert_id();
and send data from Controller to Model

Related

how to remove validation message created by validator when reseting form in laravel octobercms

form validation:
Component
public function onContact()
{
$input = post();
//$contact = Contact::create($input);
$rules = [
'name' => 'required|alpha',
'designation' => 'required',
'note' => 'required',
'contactNo' => 'required|numeric|max:10',
'emailIdText' => 'required|email',
'companyName' => 'required'
];
$validator = Validator::make($input, $rules);
if ($validator->fails()) {
throw new ValidationException($validator);
} else {
$contact = new Contact;
$contact->name = $input['name'];
$contact->designation = $input['designation'];
$contact->note = $input['note'];
$contact->inquiry_about = $input['option'];
$contact->email_id = $input['emailIdText'];
$contact->contact_no = $input['contactNo'];
$contact->company_name = $input['companyName'];
$contact->save();
}
}
default.htm
<form id="myform" autocomplete="off" action="{{ 'contactUs'|page }} "
data-request="{{ __SELF__ }}::onContact" data-request-validate data-request-flash
method="post" name="myform" class="contact-form">
<table height="" cellpadding="0" cellspacing="15" class="contactUs">
<tbody>
<tr >
<td class="Fieldname" >Inquiry About : </td>
<td valign="top" >
<select class="comboFieldontact" name="option" id="option" >
<option value="Existing Client" selected>Existing Client</option>
<option value="Prospect">Prospect</option>
<option value="Media">Media</option>
<option value="Investor">Investor</option>
<option value="Association">Association</option>
<option value="Career">Career</option>
</select>
<span class="Error" data-validate-for="inquiry_about" id="optionTextError" ></span>
</td>
</tr>
<tr>
<td valign="top" class="Fieldname">Name :</td>
<td valign="top">
<input type="text" id="name" name="name" class="textFieldContact">
<span class="Error" data-validate-for="name" id="nameTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Email : </td>
<td valign="top">
<input type="text" id="contactemailIdText" name="emailIdText" class="textFieldContact" >
<span class="Error" data-validate-for="emailIdText" id="contactemailIdTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Contact No :
</td>
<td valign="top">
<input type="text" maxlength="15" id="contactNo" name="contactNo" class="textFieldContact"
>
<span class="Error" data-validate-for="contactNo" id="contactNoTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Company Name :</td>
<td valign="top">
<input type="text" id="companyName" name="companyName" class="textFieldContact"
>
<span class="Error" data-validate-for="companyName" id="companyNameTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Designation :</td>
<td valign="top">
<input type="text" id="designation" name="designation" class="textFieldContact" >
<span class="Error" data-validate-for="designation" id="designationTextError" ></span></td>
</tr>
<tr>
<td class="Fieldname"> Note :</td>
<td valign="top">
<textarea class="textarea" name="note" id="note" style="color: #000;" ></textarea>
<span class="Error" data-validate-for="note" id="fromTextError" ></span></td>
</tr>
<tr>
<td class="Fieldname"></td>
<td valign="top">
<input type="submit" class="contactBtn" value="Submit" >
<input type="reset" id="resetbtn" class="contactBtn" value="Reset">
</td>
</tr>
</tbody>
</table>
</form>
form validation is perfectly fine but i want to reset form along with validation error message how can i do this?
when clicking to reset button input in input fields resets but error msgs are still shown......................................................
what should i do
Here, use this JavaScript code to clear out all of your tags that have an error class.
<script>
function clearErrors() {
var form = document.getElementById('myform').querySelectorAll('span.Error');
for (i=0; i<=form.length; i++) {
form[i].innerText = '';
}
}
</script>
<form id="myform" autocomplete="off" action="{{ 'contactUs'|page }} "
data-request="{{ __SELF__ }}::onContact" data-request-validate data-request-flash
method="post" name="myform" class="contact-form">
<table height="" cellpadding="0" cellspacing="15" class="contactUs">
<tbody>
<tr >
<td class="Fieldname" >Inquiry About : </td>
<td valign="top" >
<select class="comboFieldontact" name="option" id="option" >
<option value="Existing Client" selected>Existing Client</option>
<option value="Prospect">Prospect</option>
<option value="Media">Media</option>
<option value="Investor">Investor</option>
<option value="Association">Association</option>
<option value="Career">Career</option>
</select>
<span class="Error" data-validate-for="inquiry_about" id="optionTextError" ></span>
</td>
</tr>
<tr>
<td valign="top" class="Fieldname">Name :</td>
<td valign="top">
<input type="text" id="name" name="name" class="textFieldContact">
<span class="Error" data-validate-for="name" id="nameTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Email : </td>
<td valign="top">
<input type="text" id="contactemailIdText" name="emailIdText" class="textFieldContact" >
<span class="Error" data-validate-for="emailIdText" id="contactemailIdTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Contact No :
</td>
<td valign="top">
<input type="text" maxlength="15" id="contactNo" name="contactNo" class="textFieldContact"
>
<span class="Error" data-validate-for="contactNo" id="contactNoTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Company Name :</td>
<td valign="top">
<input type="text" id="companyName" name="companyName" class="textFieldContact"
>
<span class="Error" data-validate-for="companyName" id="companyNameTextError" ></span></td>
</tr>
<tr>
<td valign="top" class="Fieldname">Designation :</td>
<td valign="top">
<input type="text" id="designation" name="designation" class="textFieldContact" >
<span class="Error" data-validate-for="designation" id="designationTextError" ></span></td>
</tr>
<tr>
<td class="Fieldname"> Note :</td>
<td valign="top">
<textarea class="textarea" name="note" id="note" style="color: #000;" ></textarea>
<span class="Error" data-validate-for="note" id="fromTextError" ></span></td>
</tr>
<tr>
<td class="Fieldname"></td>
<td valign="top">
<input type="submit" class="contactBtn" value="Submit" >
<button type="reset" onclick="clearErrors()">Reset</button>
</td>
</tr>
</tbody>
</table>
</form>
Did you try to hide the elements with the class 'error' with jQuery by clicking on the reset button ?
Another method is to change the reset button with an empty href. By clicking on the button it will refresh the page and the form I guess.

how to update cart quantity in CodeIgniter?

I want to update the quantity of a shopping cart. I've google it a lot but couldn't do it.
Maximum pages are showing which i don't want. Exactly solution i'm not getting. Hopefully i will get here. Please help me to do it. Here is my view page.
**<table class="table table-hover table-bordered table-striped snipcart-details "> <thead>
<tr>
<th style="color:#FF0033; font-weight:bolder; text-align:center;" >Delete Cart</th>
<th style="color:#FF0033; font-weight:bolder; text-align:center;" >Product Name</th>
<th style="color:#FF0033; font-weight:bolder; text-align:center;" >Image</th>
<th style="color:#FF0033; font-weight:bolder; text-align:center;" >Price</th>
<th style="color:#FF0033; font-weight:bolder; text-align:center;" >Quantity</th>
<th colspan="2" style="color:#FF0033; font-weight:bolder; text-align:center;" >Total</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->cart->contents() as $items) { ?>
<tr>
<td style="color:#000000; font-weight:bolder; text-align:center;" >
<a href="#" class="remove_cart" title="delete" row_id="<?php echo $items['rowid']; ?>" rel="1">
<i class="fa fa-times fa-2x" style="color:red;" aria-hidden="true"></i> </a></td>
<td style="color:#000000; font-weight:bolder; text-align:center;" ><?php echo $items['name']; ?></td>
<td align="center"><img src="<?php echo base_url('resource/allproduct/'.$items['productImage']);?>" height="50px;" /></td></td>
<td style="color:#000000; font-weight:bolder; text-align:center;"><?php echo $items['price']; ?></td>
<td align="center"><input type="number" name="qty" id="qty" value="<?php echo $items['qty']; ?>"></td>
<td colspan="2" style="color:#000000; font-weight:bolder; text-align:center;">TK <?php echo $this->cart->format_number($items['subtotal']); ?></td>
</tr>
<?php } ?>
</tbody>
<tbody>
<tr>
<th scope="row"> <input type="button" name="submit" value="Update" class="button" /> </th>
<td align="center"> <input type="button" name="submit" value="Continue Shopping" class="button" /></td>
<td colspan="3" class="button" align="center" >
<?php if(!empty($userid)){?>
<input class="button" type="submit" value="Place Order">
<?php } else {?>
<input class="button" type="submit" value="Place Order">
<?php }?>
</td>
<td align="center" style="color:#000000;" > <h4>Grand Total</h4> </td>
<td style="font-size:24px; font-weight:800; color:green;">TK <?php echo $this->cart->format_number($this->cart->total()); ?></td>
</tr>
</tbody>
</table>**
And here is controler.
public function index()
{
$data['basicinfo'] = $this->M_cloud->basicall('basic_info');
$where = array('status' => 1);
$data['categoryinfo'] = $this->M_cloud->categoryinfo('item_manage', $where);
$data['rows'] = count($this->cart->contents());
$data['userid'] = $this->session->userdata('user_id');
$data['subcategoryinfo'] = $this->M_cloud->findAll2('sub_category', array('status' => 1));
$data['menuinformation'] = $this->M_cloud->findReport('our_service', array('serviceType'=> 2), 'menuname asc');
$data['menuservice'] = $this->M_cloud->findReport('our_service', array('serviceType'=> 1), 'menuname asc');
$data['socialmedia'] = $this->M_cloud->findAll('social_tbl', 'name asc');
$data['newsinfo'] = $this->M_cloud->findAll('news_table', 'newstitle DESC');
$this->load->view('cartPage', $data);
}
public function buy()
{
$proId = $this->input->post('proId');
$Qty = $this->input->post('Qty');
$prosize = $this->input->post('prosize');
$result = $this->M_cloud->find('product_manage', array('proid' => $proId));
$data2 = array(
'id' => $proId,
'qty' => $Qty,
'name' => $result->proName,
'price' => $result->price,
'prosize' => $prosize,
'productImage' => $result->proimg1,
'product_code' => $result->procode
);
$this->cart->insert($data2);
redirect('cart');
}
public function deleteCartItem() {
$row_id = $this->input->post('row_id');
$data = array(
'rowid' => $row_id,
'qty' => 0
);
$this->cart->update($data);
}
Please help me how to update cart quantity. Thanks in Advance.
To update cart Item :
function updateCartItem(){
$data=array(
'rowid'=>$this->input->post('rowid',TRUE),
'qty'=> $this->input->post('quantity',TRUE)
);
if ($this->cart->update($data)) {
echo "Success";
}else{
echo "Faliure";
}
}
To remove the item from cart :
function deleteCartItem(){
$row_id = $this->input->post('row_id',TRUE);
if ($rowid) {
return $this->cart->remove($rowid);
}
}

Edit Pages - Invalid argument supplied for foreach()

I wonder why I still having this error message appearing.
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/editpages.php
Line Number: 48
Backtrace:
File: C:\Program Files (x86)\EasyPHP-DevServer-14.1VC9\data\localweb\masterlinkci2\application\admin\views\editpages.php
Line: 48
Function: _error_handler
controllers/Cpages.php
public function editpagesupdate() {
$data['pagessuccess'] = '';
$pages_id = $this->uri->segment(3);
$data['pages'] = $this->Mpages->update_pages($pages_id);
$this->load->view('editpages', $data);
}
models/Mpages.php
public function update_pages($pages_id)
{
$data = array(
'pages_name' => $this->input->post('pages_name'),
'create_date' => $this->input->post('create_date'),
'pages_order' => $this->input->post('pages_order'),
'pages_content' => $this->input->post('pages_content')
);
$this->db->where('pages_id', $pages_id);
$query = $this->db->update('pages', $data);
//return $query->result_array();
return $query;
}
views/editpages.php
<div class="widget-box">
<div class="widget-title"><h5>Pages</h5></div>
<div class="widget-content">
<?php echo form_open('cpages/editpagesupdate'); ?>
<table border="0" style="width: 100%; height: 90px;">
<tr>
<td>Pages Name</td>
<td><input type="text" name="pages_name" value="<?php echo $pages_item['pages_name']; ?>"></td>
</tr>
<tr>
<td>Create Date</td>
<td><input type="text" name="create_date" value="<?php echo $pages_item['create_date']; ?>"></td>
</tr>
<tr>
<td>Order</td>
<td><input type="text" name="pages_order" value="<?php echo $pages_item['pages_order']; ?>"></td>
</tr>
<tr>
<td>View Content</td>
<td><textarea rows="3" cols="20" name="pages_content"><?php echo $pages_item['pages_content']; ?></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="submit" class="edit" name="submit" value="SUBMIT"></td>
</tr>
</table>
</div>
</div>
<?php endforeach; ?>
controllers/Cpages.php
public function editpagesupdate() {
$data['pagessuccess'] = '';
$pages_id = $this->uri->segment(3);
$update = $this->Mpages->update_pages($pages_id);
$data = array();
/* get updated pages here */
if($update){
$data['pages'] = $this->Mpages->get_pages();
}
$this->load->view('editpages', $data);
}
models/Mpages.php
public function get_pages()
{
$query = $this->db->get('pages');
return $query->result_array();
}
views/editpages.php
<div class="widget-box">
<div class="widget-title"><h5>Pages</h5></div>
<div class="widget-content">
<?php echo form_open('cpages/editpagesupdate'); ?>
<table border="0" style="width: 100%; height: 90px;">
<?php foreach($pages as $pages_item) : ?>
<tr>
<td>Pages Name</td>
<td><input type="text" name="pages_name" value="<?php echo $pages_item['pages_name']; ?>"></td>
</tr>
<tr>
<td>Create Date</td>
<td><input type="text" name="create_date" value="<?php echo $pages_item['create_date']; ?>"></td>
</tr>
<tr>
<td>Order</td>
<td><input type="text" name="pages_order" value="<?php echo $pages_item['pages_order']; ?>"></td>
</tr>
<tr>
<td>View Content</td>
<td><textarea rows="3" cols="20" name="pages_content"><?php echo $pages_item['pages_content']; ?></textarea></td>
</tr>
<?php endforeach; ?>
<tr>
<td></td>
<td><input type="submit" class="edit" name="submit" value="SUBMIT"></td>
</tr>
</table>
</div>
</div>

store session cart to database

Sorry for asking this old questions, and I know that I've read before I ask here, it's can use database for adding more cart without limitation. I already try to use ci_sessions table to store session but still no luck, I only can adding 6 items maximum.
please help me, I looking for some example for this almost two days and result is nothing
EDITED
this is my view
<table id="box-table-a" summary="Employee Pay Sheet">
<thead>
<tr>
<th scope="col">Description</th>
<th scope="col">Price</th>
<th class="centered" scope="col">Options</th>
</tr>
</thead>
<tbody>
<?php foreach ($foto_produk->result() as $key => $value) {?>
<tr>
<td><?php echo $value->description;?></td>
<td><?php echo $value->price;?></td>
<td class="centered"><input type="checkbox" name="produk_foto[]" value="<?php echo $value->id;?>" /></td>
</tr>
<?php }?>
</tbody>
</table>
here's my controller code
if($this->input->post('produk_foto')){
$id_foto = $this->input->post('produk_foto');
foreach ($id_foto as $key => $value) {
$this->db->where('id', $value);
$query = $this->db->get('foto_product');
if($query->num_rows() > 0){
foreach($query->result() as $ids => $rows){
echo $rows->id.'<br />';
$data_produk = array(
'user_data'=> array(
'id' => $rows->id,
'price' => $rows->price,
'name' => $rows->description,
'qty' => $rows->aantal
)
);
$this->cart->insert($data_produk);
}
}
}
}
and this my view code
<?php if(!$this->cart->contents()):?>
<div class="alert-box warning">The regular products are empty.</div>
<div class="clearfix"></div>
<?php else:?>
<hr>
<h4>REGULAR PRODUCTS</h4>
<div class="order_detail" id="Display">
<table>
<thead>
<tr>
<th>DESCRIPTION</th>
<th>QUANTITY</th>
<th>PRICE PER ITEM(S)</th>
<th>TOTAL</th>
<th>REMOVE</th>
</tr>
</thead>
<tbody>
<?php foreach($this->cart->contents() as $rows):?>
<tr>
<td style="font-weight:bold;"><?php echo $rows['name'];?></td>
<td>
<?php echo form_open(current_url());?>
<input type="text" size="3" name="quantity" value="<?php echo $rows['qty'];?>" />
<input type="hidden" size="3" name="rowid" value="<?php echo $rows['rowid'];?>" />
<input type="submit" name="update" value="Update" />
<?php echo form_close();?>
</td>
<td><?php echo $rows['price'];?></td>
<td><?php echo $this->cart->format_number($rows['subtotal']);?></td>
<td>delete</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan="3">Total Products</td>
<td colspan="3">€ <?php echo $this->cart->format_number($this->cart->total());?></td>
</tr>
<tr>
<td colspan="3">Total Shipping</td>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="3"></td>
<td colspan="3" style="padding:0;text-align:center;">
<p>TOTAL :</p>
<span class="tot">€ <?php echo $this->cart->format_number($this->cart->total());?></span>
</td>
</tr>
</tfoot>
</table>
</div>
<?php endif;?>
with this code I want to insert using checkbox with array, and I have more than 6 checkbox
thank you in advance
Ok it's solved by my self..
I don't know that in the name of product there are special characters..
and shame of me..
but thank you anyway

reCAPTCHA keep saying incorrect-captcha-sol

I have this form
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<tr>
<td width="32%" valign="top"> <strong class="main_title">Select Category: </strong></td>
<td width="68%" valign="top" class=""><? $qu="SELECT `id`,`name` FROM `linkvideos_category` WHERE `status` = '1'"; $rs=$Q($qu); ?>
<select name="category" class="blacktext" >
<option>Choose Category</option>
<? while($dis=$F($rs)) { ?>
<option value="<?=$dis['id']?>"> <?=$dis['name'];?></option>
<? } ?>
</select></td>
</tr>
<tr>
<td colspan="2" valign="top" class=""> </td>
</tr>
<tr>
<td valign="top"> <strong class="main_title">Upload Image: </strong></td>
<td valign="top" class=""><input type="file" name="imagefile" /> </td>
</tr>
<tr>
<td colspan="2" valign="top" class=""> </td>
</tr>
<tr>
<td valign="top"> <strong class="main_title"> Your Link : </strong></td>
<td valign="top" class=""><input name="link" type="text" size="50" /></td>
</tr>
<tr>
<td colspan="2" valign="top" class=""> </td>
</tr>
<tr>
<td valign="top"> <strong class="main_title"> Link Title : </strong></td>
<td valign="top" class=""><input name="linkname" type="text" size="50" /></td>
</tr>
<tr>
<td colspan="2" valign="top" class=""> </td>
</tr>
<tr>
<td valign="top"> <strong class="main_title">Description:</strong></td>
<td valign="top"><label>
<textarea name="desc" cols="40" rows="10"></textarea>
</label></td>
</tr>
<tr>
<td valign="top"> <strong class="main_title">Security Code:</strong></td>
<td valign="top">
<? if ($error==3) { ?>
<font color="red">Invalid Code Entered</font>
<?}?>
<?php
require_once('captcha/recaptchalib.php');
echo recaptcha_get_html($public_key);
?></td>
</tr>
<tr>
<td colspan="2" valign="top" class=""> </td>
</tr>
<tr>
<td colspan="2" valign="top" class=""> </td>
</tr>
<tr>
<td colspan="2" align="center" valign="top" class=""><input type="submit" name="Submit" value="Submit" class="btns" onclick="javascript:return check();" /></td>
</tr>
</form>
and i'm verifying the captcha with this
$resp = recaptcha_check_answer ($private_key,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
$error = 3;
echo"<script>window.location='submit_linkvideo.php?error=3';</script>";
}
and every time it's telling me the captchas invalid and saying incorrect-captcha-sol, am I missing something? I've tested it and the recaptcha values arn't being submitted.
Fixed it by ending a table before the form then starting the table again once inside the form.

Resources