OK here goes: This is the the first page of the multipage form. The code on top is used in each part of the multipage form:
<?php
require_once('common_functions.php'); // includes the quote_smart function
if (isset($_POST['submit'])) {
foreach ($_POST as $key=>$val) {
// build the column name list
$_SESSION['cols'] .= $key . ',';
// and the values list
$_SESSION['vals'] .= quote_smart($val) . ',';
}
}
?>
This is common_functions.php
<?php
// Connect to db
include("connect.php");
// I am not showing you my host user and password but I have put them in honest!
$link = mysql_connect('host', 'user', 'password')
OR die(mysql_error());
// Make a safe query
$query = sprintf("SELECT * FROM users WHERE user=%s AND password=%s",
quote_smart($_POST['username']),
quote_smart($_POST['password']));
mysql_query($query);
?>
and this is the formhandler at the end of the multipage form
<?php
session_start();
require_once('common_functions.php'); // includes the quote_smart function
if (isset($_POST['Submit'])) {
foreach ($_POST as $key=>$val) {
// build the column name list
$_SESSION['cols'] .= $key . ',';
// and the values list
$_SESSION['vals'] .= quote_smart($val) . ',';
}
}
include("connect.php");
$strcols = rtrim($_SESSION['cols'], ',');
$strvals = rtrim($_SESSION['vals'], ',');
//now echo them just for debugging
echo $strcols;
echo $strvals;
//remove the echos once it is working
$sql = "INSERT INTO nottsvcs (" . $strcols . ") VALUES (" . $strvals . ")";
echo $sql;
?>
Latest error message reads:
Fatal error: Call to undefined function: quote_smart() in /disk1/home3/mindseye/public_html/common_functions.php on line 11
Also note the previous error messages early on in this posted thread.
If anyone can help I would be grateful. Thx in advance