View Single Post
  #13  
Old 02-23-2004, 04:04 AM
 
deniz deniz is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 70
 

Default ok

You have to make index.php under suggestions directory.Because the main rule is for this mod , importing data files html to php bridge with index.php

here is the index.php

Quote:
<?php require_once('Connections/db_connect.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO suggestions (id, suggestion, name) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['suggestions'], "text"),
GetSQLValueString($_POST['name'], "text"));

mysql_select_db($database_db_connect, $db_connect);
$Result1 = mysql_query($insertSQL, $db_connect) or die(mysql_error());

$insertGoTo = "thanks.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor="#EAF4FF"> Your comments can help make our site better for everyone. If you've found
something incorrect, broken, or frustrating on this page, let us know
so that we can improve it. Please note that we are unable to respond
directly to suggestions made via this form.



If you need help with an order, please <a href="http://www.bookglobal.net/xcart/customer/help.php?section=contactus&mode=update">contact
Customer Service </a>.




Which subjects that you can send us about?:

<table cellspacing="2" cellpadding="0">
<tr>
<td rowspan="2"></td>
<td></td>
</tr>
<tr>
<td>Product information is missing important details. </td>
</tr>
<tr>
<td></td>
<td>Product information is incorrect.</td>
</tr>
<tr>
<td></td>
<td>The page contains typographical errors. </td>
</tr>
<tr>
<td></td>
<td>The page takes too long to load. </td>
</tr>
<tr>
<td></td>
<td>The page has a software bug in it. </td>
</tr>
<tr>
<td></td>
<td>Suggestion want to be in page. </td>
</tr>
<tr>
<td></td>
<td>General Suggestions </td>
</tr>
</table>


Comments or Examples:

Examples: Missing information such as dimensions and model number, typos,
inaccuracies, etc.

<form name="form1" method="POST" action="<?php echo $editFormAction; ?>" target="_blank">
<div align="center">
<input type="hidden" name="id">
<textarea name="suggestions" cols="100" rows="5" id="suggestions"></textarea>


<input name="name" type="text" id="name" value="Please enter your name here" size="55">


<input type="submit" name="Submit" value="Submit">
</div>
<input type="hidden" name="MM_insert" value="form1">
</form></td>
</tr>
</table>
</body>
</html>
Reply With Quote