Form Error - Help?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: July 29, 2011   (RSS)

Hi... I created this form (below).. and this is the error I am receiving. Not sure what I'm doing wrong. Any help would be appreciated.


ERRORS:

Warning: mysql_query() [function.mysql-query]: Access denied for user 'illumema'@'localhost' (using password: NO) in /home/illumema/public_html/zine/journo.php on line 23

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/illumema/public_html/zine/journo.php on line 23
MySQL Error Creating Record:


CODE

<?php
// load viewer library
// load viewer library
$libraryPath = '../cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/illumema/public_html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }



?>
<!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=UTF-8" />
<title>Untitled Document</title>
</head>

<body>
<?php

//config
$adminURL = "../cmsAdmin/admin.php";
$moderatorEmail = "comments@illumemagazine.com";





// add record
if (@$_REQUEST['formSubmit']) {
mysql_query("INSERT INTO `{$TABLE_PREFIX}journo` SET

name = 'name',
email = 'email',
description = 'description',
uploaded_file = 'uploaded_file',

createdDate = NOW(),
updatedDate = NOW(),
createdByUserNum = '0',
updatedByUserNum = '0'")
or die("MySQL Error Creating Record:<br/>\n");



}


?>





<form method="post" action="journo.php">
<input type="hidden" name="formSubmit" value="1">
<div class="form">

<div class="left">
<p>
<label>Name </label>
<input name="name" type="text" value="name" class="field">
</p>
<p>
<label>Email </label>
<input name="email" type="text" value="email" class="field">
</p>
<p>
<label>Description </label>
<textarea name="comment" rows="10" cols="20" wrap="VIRTUAL" value="descripton"></textarea> </p><p>
<label for='uploaded_file'>Select A File To Upload:</label>
<input type="file" name="uploaded_file">


<input type="submit" class="submit" value="" src="images/submit-comment.jpg"/>





</p>
</div>
</div>




</form>
</body>
</html>

Re: [Illume Magazine] Form Error - Help?

By Jason - July 28, 2011

Hi,

Are you receiving errors on any other pages? Does this error only occur when you submit the form?

This error is saying that you were unable to connect to your mysql database. Are you able to run a getRecords() query on this page?

Let me know and we can look into this further.
Thanks,
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Form Error - Help?

Yes. Its only on this page I see the error. I just copied a comments submission form Ross had created a while back and modified it. Took out existing code and added a file upload field.