{kl_php}
$link = mysql_connect('localhost', 'cardinal', 'cardinal')
OR die(mysql_error());
if(array_key_exists('submitted', $_POST)){
$sql = 'INSERT INTO `sublet_guide_records` (`id`, `date`, `name`, `phone`, `email`, `style`, `content`) VALUES (NULL, NOW(), '.quote_smart($_POST['name']).', '.quote_smart($_POST['phone']).', '.quote_smart($_POST['email']).', '.quote_smart($_POST['price']).', '.quote_smart($_POST['description']).')';
$results = mysql_query($sql);
if($results){
echo \Thank you for your submission."";
}
else{
echo $sql;
}
}
else{
echo <<
Your sublet ad text in 50 words or less. |
The following information will be used only for billing and will not be distributed to anyone outside the business managers: |
Name |
Phone Number |
E-Mail Address |
Style of Ad |
Want a special background, font, or color? Email promotions@dailycardinal.com and let us know. We will include anything you like so that you are satisfied with your sublet. Make sure you include any files we may need as well as your name and phone number. |
END;
}
function quote_smart($value)
{
// Stripslashes
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
// Quote if not a number or a numeric string
if (!is_numeric($value)) {
$value = ""'"" . mysql_real_escape_string($value) . ""'"";
}
return $value;
}
{/kl_php}