Solved

Automatic posting (cold fusion?)

Posted on 1998-08-06
7
340 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
[X]
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
  • 4
  • 3
7 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 100 total points
ID: 1858869
<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
ID: 1858870
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
ID: 1858871
What do you meant about the TARGET="HIDDENFRAME" on the form tag
where do i put it? how does it work?
0
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 
LVL 2

Author Comment

by:jagoodie
ID: 1858872
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
ID: 1858873
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
ID: 1858874
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
ID: 1858875
sorry, nevermind, i got it. (put it in the OriginalPageWithTheFormInIt.html>
thanks again.
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

724 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