Solved

Automatic posting (cold fusion?)

Posted on 1998-08-06
7
298 Views
Last Modified: 2013-12-25
is there any way to get a page to automaticly post to a database (like for a hit counter) some thing along the line
of <form action="guest.cfm" method="POST"><input type="hidden" name="Date_Entered" value="CurrentDateTime()"><input type="hidden" name="ClientHost" value="CGI.REMOTE_HOST">
0
Comment
Question by:jagoodie
  • 4
  • 3
7 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 100 total points
Comment Utility
<form NAME="AUTOPOST" action="guest.cfm" method="POST"><input type="hidden" name="Date_Entered"
    value="CurrentDateTime()"><input type="hidden" name="ClientHost" value="CGI.REMOTE_HOST">

<SCRIPT LANGUAGE="JavaScript">
document.AUTOPOST.submit();
</SCRIPT>

If you wish the post not to change the current page, either put the form inside frames with an invisible frame and put a TARGET="HIDDENFRAME" on the form tag
or print a 304 Nothing Changed http header from the cgi...

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
PS: if you wish the date to be filled out for you, remove CurrentDateTime() and change the script to read
<SCRIPT LANGUAGE="JavaScript">
    var today = new Date();
    document.AUTOPOST.Date_Entered.value = today.toString();
    document.AUTOPOST.submit();
</SCRIPT>
0
 
LVL 2

Author Comment

by:jagoodie
Comment Utility
What do you meant about the TARGET="HIDDENFRAME" on the form tag
where do i put it? how does it work?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Author Comment

by:jagoodie
Comment Utility
i got it to work but it keeps opening up a new fram for the page. is there a way to get it to not open the frame?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Sorry, I was away all day yesterday...
To target a hidden frame, create the following HTML:
<HTML>
<HEAD>
<TITLE>My title</TITLE>
</HEAD>
<FRAMESET ROWS="100%,*">
<FRAME NAME="VISIBLEFRAME" SRC="OriginalPageWithTheFormInIt.html">
<FRAME NAME="HIDDENFRAME" SRC="javascript:' '">
</FRAMESET>
</HTML>

This will create a frame which is 100% of the screen and another which is the rest (e.g. not there). The javascript:' ' is to initialise it with an empty page.

Hope this helps,

Michel
0
 
LVL 2

Author Comment

by:jagoodie
Comment Utility
I am sorry, i am not very good with this frames thing. Now where do i put the javascript part? in the page named javascript: ?
thank you for your continued help. :)
0
 
LVL 2

Author Comment

by:jagoodie
Comment Utility
sorry, nevermind, i got it. (put it in the OriginalPageWithTheFormInIt.html>
thanks again.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now