Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Spot The Errors And Help Me!

Posted on 2003-11-03
Medium Priority
Last Modified: 2013-12-24
Hi Everyone!

it's been well over 5 months since I last developed a ColdFusion site and I'm slowly getting back into it.
I have some errors that are dragging me down and it's late and i'm tired and I cannot for the life of me find out where they are.  After pressing the 'submit' button i get a HTTP500 error and the page is not displayed due to a server error.

Im not sure if its an error with my action page or with my form page.  The database I am using is a Microsoft access one!

HELP!!  Once i get this going then I will be on my way!

Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<title>Add New Advertisement</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<p><strong>ADD NEW ADVERTISEMENT</strong></p>

<CFFORM ACTION="processadvert.cfm" METHOD="post">
<table width="465" border="1">
    <td width="96">Name</td>
    <td width="353"><cfinput type="text" required="yes" name="username" size="20" validate="REGULAR_EXPRESSION" pattern="[A-Za-z0-9]" message="Please enter User Name"></td>
    <td><cfinput type="text" required="yes" name="email" size="20" validate="REGULAR_EXPRESSION" pattern="[A-Za-z0-9]" message="Please enter email">&nbsp;</td>
    <td>Date Added</td>
    <td><cfinput type="text" name="current_date" value="#DateFormat(now(), 'dd/mm/yyyy')#"></td>
    <td>Expiry Date </td>
    <td><select name="expiry_date">
   <option value="#DateFormat(DateAdd("d", 7, now()), 'dd/mm/yyyy')#">
      #DateFormat(DateAdd("d", 7, now()), 'dd/mm/yyyy')#
   <option value="#DateFormat(DateAdd("d", 14, now()), 'dd/mm/yyyy')#">
      #DateFormat(DateAdd("d", 14, now()), 'dd/mm/yyyy')#
    <td>Ad Details </td>
    <td><textarea rows="3" cols="30"></textarea></td>
<INPUT TYPE="submit" VALUE="Submit Advert">


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<title>Add New Advert Process Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<CFPARAM NAME="Form.username" DEFAULT="">
<CFPARAM NAME="Form.current_date" DEFAULT="">
<CFPARAM NAME="Form.expiry_date" DEFAULT="">
<cfparam name="form.advertdetails" default="">

<CFQUERY NAME="qInsAdvert" DATASOURCE="advertisements">
    INSERT INTO ads(SellerName,EmailAddress,
<cflocation url="addnewadvert.cfm">

Question by:martywire
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Accepted Solution

procept earned 120 total points
ID: 9669998

try to view the page with a different browser thanMS IE. E.g. Netscape will show much better error msgs! (No kidding!)

Could be that either CF can not find the page addnewadvert.cfm (or that there is an error in there) or that there is a problem with the query.

Try to comment out the query. If the error still occurs, change the date fields like this:
INSERT INTO ads(SellerName,EmailAddress, DateEntered,ExpiryDate,advertisementcontents)
    VALUES('#FORM.username#', '', #CreateODBCDate(FORM.currentdate)#, #CreateODBCDate(FORM.expiry_date)#, '#FORM.advertdetails#')

If the error still persists, check for
- datasource name
- table name
- field names
- field datatypes
- allowed null values

If you have an error msg. let us know, will be a lot easier then. ;-))


LVL 25

Expert Comment

by:James Rodgers
ID: 9670403
there is something else you might want to chaeck, specificly a browser setting

in IE under tools|intenet options

select the advanced tab and make sure the show friendly http errors is not checked, im had a similar problem and there was no error in the code but i kept getting the 500 error, making this chenge fixed it, no idea why it happens you would need to ask M$

Author Comment

ID: 9673942
Thank you for the browser setting changing tip!  I can now see what the error is in the coldfusion code and I have fixed it accordingly and it is going beautifully.

Just another query - I have a 'textarea' field:

<textarea rows="3" cols="30"></textarea>

where the user can write a description and when the submit button is pressed all the other data entered into the other text boxes is loaded into the database except for what is in the textarea box.

Does anyone have any ideas as to why the stuff in the textarea box is not being loaded into the database?  I tried giving the textarea a name and that made no difference
LVL 25

Expert Comment

by:James Rodgers
ID: 9674004
whats the new insert code?

Expert Comment

ID: 9676683
you need to give it a name, else you can't refer to it in the action page:
form page:
<textarea name="myArea" rows="3" cols="30"></textarea>

action page:
INSERT INTO myTable (myColumn)
VALUES ('#form.myArea#')



Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA:…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question