Solved

Automatic posting (cold fusion?)

Posted on 1998-08-06
7
334 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

740 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