Ok I dont know where I have done wrong there is a few problems!
I get this error below the form:
Warning: mysql_query(): Access denied for user 'kexol'@'localhost' (using password: NO) in /home2/kexol/public_html/helper/helper.php on line 70
Warning: mysql_query(): A link to the server could not be established in /home2/kexol/public_html/helper/helper.php on line 70
Thank you, I shall reply as soon as I can!
I also dont know how to make the date appear like (date AT day)
Here is my code:
<php
mysql_connect(localhost,kexol,password) or die("Error" . mysql_error());
mysql_select_db(kexol_testing) or die("database cannot be selected!" . mysql_error());
?>
<form name="helper" action="./helper.php" method="post">
<lable for="title">Title: </lable>
<input type="text" name="title" value="<?php echo $company; ?>" size="40" />
<?php echo $title_error; ?><br />
<label for="name">Name: </lable>
<input type="text" name="name" value="<?php echo $name; ?>" size="35"/>
<?php echo $name_error; ?><br />
<label for="email">Eamil: </lable>
<input type="text" name="email" value="<?php echo $email; ?>" size="35"/>
<?php echo $email_error; ?><br />
<label for="problem">Problem: </lable>
<input type="textbox" name="problem" value="<?php echo $problem; ?>" size"3000"/>
<?php echo $problem_error; ?><br />
<input type="hidden" name="ip" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>">
<?php echo $ip_error; ?>
<?php $thedate = "date('d F / g:iA O')" ?>
<input type="text" name="date" value="<?php echo $thedate; ?>" size="50" disabled="disabled" />
<?php echo $date_error; ?>
<br>
<input type="submit" name="submit" value="Submit, thank you!">
<input type="reset" name="reset" value="Reset"
</form>
<?php
$title = $_POST['title'];
if ( empty($title) ) {
$valid = 0;
$title_error = 'You did not enter the title'; }
$name = $_POST['name'];
if ( empty($name) ) {
$valid = 0;
$name_error = 'You did not enter your name'; }
$email = $_POST['email'];
if ( empty($email) ) {
$valid = 0;
$email_error = 'You did not enter your email'; }
$problem = $_POST['problem'];
if ( empty($company) ) {
$valid = 0;
$problem_error = 'You did not enter your problem'; }
$ip = $_POST['ip'];
{
$valid = 0;
$ip_error = 'Cannot find your IP and its crucial so you dont abuse our system! Email jcouperwhite@gmail.com with your problem instead'; }
$date = $_POST['date'];
{
$valid = 0;
$date_error = 'There is a problem with finding the date'; }
?>
<?php
if ( $_POST['submit'] ) {
$valid = 1;}
$sql = mysql_query("INSERT INTO `helper` ( `title` , `name` , `email`, `problem`, `ip`, `date` ) VALUES ('$user', '$avatar', '$title', '$description', '$date', '$ip');");
echo "Thank you, I shall reply as soon as I can!";
?>