Executing a file ON SUBMIT - displaying the results in a table

Guys
Its late in the evening and I want to ask a simple question but I need a quick answer.
I need a form or somesort of interface that contains a submit button. When the button is selected it executes a CF file, the file runs a parse and i need those results to be displayed on a table on the interface when the file has run.

Thanks in advance
VHSBAsked:
Who is Participating?
 
Renante EnteraConnect With a Mentor Senior PHP DeveloperCommented:
Hi VHSB!

Take a look at this simple example :

:: Main Form ::
<form name="form1" action="actionpage.cfm" method="post" enctype="multipart/form-data">
  <input type="file" name="filename"><br>
  <input type="submit" name="submit" value="Submit">
</form>

:: Action Page ::
<cfif IsDefined('form.submit') and trim(form.filename) neq ''>
  <cffile action="read" file="#form.filename#" variable="theContent">
  <table border="1">
    <cfloop index="i" list="#theContent#" delimiters="#chr(13)#">
      <tr>
      <cfoutput>
        <cfloop index="x" list="#i#" delimiters="#chr(9)#">
          <td>#x#</td>
        </cfloop>
      </cfoutput>
      </tr>
    </cfloop>
  </table>
</cfif>

* Reminder : Take note that delimiters will vary depending on the format of the file being processed.

If you need some explanations then just let me know.

Hope this helps you.  Just try it.


Goodluck!
eNTRANCE2002 :-)
0
 
mrichmonCommented:
Is there a reason you can't do this:

User hits submit
Page does a cflocation to CF file to run.  That page takes care of posting the results.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.