Hi,
My contact page has suddnely stopped working. Not sure why this is.
When I try to bring up my contact page I get this error message:
Fatal error: Call to undefined function mysqli_connect() in D:\inetpub\vhosts\web-writer-articles.co.uk\httpdocs\connect\connection.php on line 2
The code is as follows:
<?php require_once("connect/connection.php");
require_once("includes/functions.php");
if(isset($_POST['submit'])){
$errors = array();
$requiredfields = array('first_name'=> 'Please enter your FIRST NAME','surname'=> 'Please enter your SURNAME','email'=> 'Please enter your E Mail ADDRESS','text'=> 'Please enter your current needs');
foreach($requiredfields as $fieldname => $requiredfieldsmessage){
if(!isset($_POST[$fieldname]) || empty($_POST[$fieldname]) || strlen(trim($_POST[$fieldname])) == 0) {
$errors[] = $requiredfieldsmessage;
}
}
if(count($errors) == 0){
$_POST = array_map('mysqli_prep', $_POST);
$first_name = mysqli_prep($_POST['first_name']);
$surname = mysqli_prep($_POST['surname']);
$email = mysqli_prep($_POST['email']);
$text = mysqli_prep($_POST['text']);
$query = "INSERT INTO form (first_name,surname,email,text)Values('{$first_name}','{$surname}','{$email}','{$text}')";
$result = mysqli_query($connection, $query);
$message="A contact form has been completed on web-writer-articles.co.uk";
$subject="Ghostwriter contact form";
$subject2="Nick Cassells: Ghostwriter and copywriter";
$message2="Thank you for contacting me concerning your copywriting or ghostwriting needs. I will get back to you at this email address as soon as possible.<br> With best regards,<br> Nick Cassells";
$email2=$email;
mail('njc27@sky.com',$subject,$message);
mail($email2, $subject2, $message2);
header('Location: brief_return.php');
exit;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>web writer kent, copywriter and SEO kent</title>
<meta name="keywords" content="ghostwriter,ghost-writer, writing services, optinise my web site, help me write my book, professional ghost-writer, ghostwriting, how to get my book published, copywriter, web content, articles " />
<meta name= "description" content= "As a professional web writer I can create text that will make your website fly and get picked up by Google." />
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18301581-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="wrapper">
<div id="header"><div id="headleft"><img src="myimages/copywriter6.gif" alt="Ghost writer, copyriter, internet marketing for you" border="0" usemap="#Map" title="Ghostwriting, Copywriting and internet marketing. Articles for the web at very reasonable prices. Ask me." />
<map name="Map" id="Map"><area shape="rect" coords="775,101,925,132" href="http://www.web-writer-articles.co.uk/contact.php" />
</map>
</div><!--headleft-->
<ul class="menu">
<li><a href="index.php">Home</a></li>
<li><a href="webcontentservices.php">Web Content</a></li>
<li><a href="thisisme.php">About me </a></li>
<li><a href="ghost_writer.php">Ghostwriter</a></li>
<li><a href="http://www.web-writer-articles.co.uk/blog/">SEO Guide</a></li>
<li><a href="contact.php">Contact me</a></li>
</ul>
</div><!--header-->
<div id="mainNav">
<img src="myimages/websitecontent.jpg" alt="Do you need to hire a ghost writer?" width="158" height="789" />
</div><!--mainNav-->
<div id="content">
<div id="mainContent">
<div id="contactform"><?php
if(count($errors) != 0){
echo '<h3>Sorry, please address the following errors:-</h3>';
echo '<ul>';
foreach ($errors as $error) {
echo '<li>' . $error . '</li>';}echo '</ul>';
}
?><h3 class="contacttext">For a consultation about your manuscript or a website review for all internet web content needs please contact me. I look forward to hearing from you!</h3>
<p class="contacttext">Telephone: 0800 014 6013
<a href="mailto:support@web-writer-articles.co.uk">Email</a>
or fill in the form below and I will get back to you as soon as possible:</p>
<form style="padding:15px;" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" >
<p>First Name:<br/> <input type="text" size="30" name="first_name" value="<?php echo htmlspecialchars($_POST['first_name'],ENT_QUOTES); ?>" id="fname" /></p>
<p> Surname:<br/><input type="text" size="30" name="surname" value="<?php echo htmlspecialchars($_POST['surname'],ENT_QUOTES); ?>" id="sname" /></p>
<p>E mail:<br/><input type="text" size="40" name="email" value="<?php echo htmlspecialchars($_POST['email'],ENT_QUOTES); ?>" id="email" /></p>
<p>How Can I help you?<br/>
<textarea rows="10" cols="40" name="text"><?php echo htmlspecialchars($_POST['text'],ENT_QUOTES); ?> </textarea></p><br />
<input type="submit" name="submit" value="Submit " />
</form>
</div>
</div><!--maincontent-->
<div class="secondaryNav">
<a href="webcontentservices.php"><img style="border:0;" src="myimages/content1.jpg" alt="content for web pages, articles, press releases, product descriptions, press releases, blogs and video scripts" title="Whatever your needs, web pages, product descriptions, articles, press releases blogs and video scripts" /></a><h3 align="center" style="padding:5px;"><a class="general" href="webcontentservices.php">Web content to attract search engines and turn interest into sales</a></h3>
</div><!--secondaryNav-->
<div class="secondaryNav">
<a href="ghost_writer.php"><img src="myimages/helpmewritemybook.jpg" alt="Your story and ideas in print!" title="Your book and ideas in print!" /></a><a href="ghost_writer.php"><h3 align="center" style="padding:5px;">Your book and ideas in print!</h3></a>
</div><!--secondaryNav-->
<div class="secondaryNav">
<img src="myimages/direction.jpg" alt="Re-living your life experience can be a cathartic journey" title="Re-living your life experience can be a cathartic journey" /><h3 align="center" style="padding:5px;">Re-living your life can be truly therapeutic</h3>
</div><!--secondaryNav-->
<div class="secondaryNav">
<img src="myimages/trades.jpg" alt="Your skills and unique knowledge in print" title="Your skills and unique knowledge in print" /><h3 align="center" style="padding:5px;">Your skills and in the form of a manual</h3>
</div><!--secondaryNav-->
</div><!--content-->
<div id="footer"> </div><!--footer-->
</div><!--wrapper-->
</body>
</html>
thanks for your help,