Hello all,
I’m curious as to why my input form won’t submit data if I’m not using th/tr table forms. The data just won’t submit to the database if I try it any other way. I am wondering if it is something in my php code?
Here is the original (Working/Contains Tables):
[php]<?php
require_once(‘general.php’);
require_once(‘db/db_connection.php’);
if (isset($_POST['submitBtn'])) {
$name = (isset($_POST['name'])) ? htmlentities($_POST['name']) : '' ;
$comment = (isset($_POST['comment'])) ? htmlentities($_POST['comment']) : '' ;
$company = (isset($_POST['company'])) ? htmlentities($_POST['company']) : '' ;
$phone = (isset($_POST['phone'])) ? htmlentities($_POST['phone']) : '' ;
$discipline = (isset($_POST['discipline'])) ? htmlentities($_POST['discipline']) : '' ;
$web = (isset($_POST['web'])) ? htmlentities(str_replace('http://','',$_POST['web'])) : '' ;
$email = (isset($_POST['email'])) ? htmlentities($_POST['email']) : '' ;
$actDate = date("Y-m-d H:i:s");
//Minimum name and comment length.
if ((strlen($name) > 2) && (strlen($comment) > 5)){
$sql = "INSERT INTO distributor (name,text,insertdate,company,phone,discipline,web,email) VALUES (";
$sql .= "'".$name."','".$comment."','".$actDate."','".$company."','".$phone."','".$discipline."','".$web."','".$email."')";
$MyDb->f_ExecuteSql($sql);
}
header("Location: index.php");
}
else {
?>
<!-- PNG FIX for IE6 -->
<!-- http://24ways.org/2007/supersleight-transparent-png-in-ie6 -->
<!--[if lte IE 6]>
<script type="text/javascript" src="login_panel/js/pngfix/supersleight-min.js"></script>
<![endif]-->
<script src="login_panel/js/slide.js" type="text/javascript"></script>
Name: | |
---|---|
Comment: | |
Company: | |
Phone: | |
Discipline: | <?php listDisciplines(); ?> |
Web: | |
Email: |