how to submit data in Mjform into a different table using

Support. Ask Support Questions Here
olaoluwa
Posts: 2
Joined: Mon 09 Jun 2014 9:45 pm

how to submit data in Mjform into a different table using

Postby olaoluwa » Tue 10 Jun 2014 3:10 am

Here is the code am trying to use in the submission of my data through mjforms (Button Script)

Could anyone help me out???

<?php
if(isset($_POST['add']))
{
$dbhost = 'localhost:3036';
$dbuser = 'root';
$dbpass = '';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}

if(! get_magic_quotes_gpc() )
{
$Number = addslashes ($_POST['data_number']);
$plain = addslashes ($_POST['data_plain']);
$defe = addslashes ($_POST['data_defe']);
$Date = addslashes ($_POST['data_datefilled']);
$entryDate = addslashes ($_POST['data_logtime']);
}
else
{
$Number = $_POST['data_number'];
$entryDate = $_POST['logtime'];
$plain = $_POST['plain'];
$defe = $_POST['defendant'];
$Date = $_POST['datefilled'];
}

$sql = "INSERT INTO info_table ".
"(data_number, data_plain, data_defe, data_datefilled, data_logtime) ".
"VALUES('$Number,',$plain,',$defe','$Date', '$entryDate')";
mysql_select_db('odues');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
}
else
{
?>

admin
Administrator
Posts: 75
Joined: Tue 10 Sep 2013 1:45 am

Re: how to submit data in Mjform into a different table usin

Postby admin » Thu 12 Jun 2014 10:10 pm

You can use javascript change action url to another url
Put you javascript into onClick Script
I think it work but not sure.