473,236 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 software developers and data experts.

Problem while submitting FORM data

Hi

am quite new to Javascript and CGI related stuff.

I have following javascript code :

-----------------------------------------------

<html>
<head>
<script language="JavaScript">
</script>
</head>

<H1> Test Tool </H1>
<HR>
<BODY>
<form method ="POST" name="form" action="/usr/local/apache/cgi-bin/test.cgi"

<br>
<b> HPUX Machine List
</br>
</br>
</br>
Select Machine Name:
<select name="hpux_list" size=1>
<option value="one">one
<option value="two">two
<option value="three">three
<option value="four">four
</select>
Install Patch
<Input type="radio" name="hpux_ins" value="Install">
Remove Patch
<Input type="radio" name="hpux_ins" value="Remove">
<input type="submit" value="Go">
</form>
</body>
</html>

-------------------------------------------------------

and following Perl CGI code :

#!/usr/bin/perl -w
#
use strict;
use File::Path;
use File::Copy;
use Time::localtime;
use CGI;

use vars qw($cgi_form $f_hpux_install);

#Autoflush.
$| = 1;

# Make sure CGI version 2.46 or above is installed.
eval("use CGI 2.46 qw(-private_tempfiles :standard);");
(print("Error: $@"), exit(-1)) if $@;

# Create CGI object.
$cgi_form = new CGI;
# Read form values and save
#$f_platform = $cgi_form->param('platform');
$f_hpux_install = $cgi_form->param('hpux_ins');
open (TEM, ">temk");
print TEM "the value is $f_hpux_install\n";
close (TEM);

----------------------------------------------

Upon the submission of form with above javascript file
the CGI code should create a file called temk but its not
doing so ?.

Can someone kindly put a light on this as why its not doing so ?.
Its bit urgent !

Thanks in advance
Kbs.
Jul 23 '05 #1
2 1418
Karuna wrote:
<snip>
I have following javascript code :

-----------------------------------------------

<html>
<head>
<script language="JavaScript">
</script>
Minimal javascript code in that element.
</head> <snip> Upon the submission of form with above javascript file
That is not a javascript file, it is an HTML page that includes
precisely no javascript at all.
the CGI code should create a file called temk
but its not doing so ?.

Can someone kindly put a light on this as why its
not doing so ?. Its bit urgent !


Maybe the question should be asked in a CGI group (or a group related to
the language used). If the form is submitting then the influence of any
javascript on the HTML page (if there was any) would already be over.

Richard.
Jul 23 '05 #2

"Karuna" <ka*****@yahoo.com> wrote in message
news:88**************************@posting.google.c om...
Hi

am quite new to Javascript and CGI related stuff.
<form method ="POST" name="form" action="/usr/local/apache/cgi-bin/test.cgi"

I think that here lies your problem. I suppose that you have
configured a webserver and set up a website and also the CGI.
When you ask a browser for your page: e.g. http://localhost/mypage.html
it runs on the webserver. It has no knowledge of files on other directories
(and it should not, otherwise the security risks could be huge).

So my guess is that you should change the action of the form into:

<form method ="POST" name="form" action="/cgi-bin/test.cgi">

I hope that this helps a bit....
Thanks in advance


You're welcome...

-- Marcel
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeffrey Silverman | last post by:
First of all, I apologize for multiposting. I am now reposting and crossposting in an attempt to reach a broader audience. Here is the original posting... (with some small changes) I am tearing...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
4
by: Rick | last post by:
Hello, I'm having trouble with submitting my form when checking to see if data is present in the user-inputted fields. What I want to happen is for the user to input various pieces of data,...
10
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side...
4
by: Wysiwyg | last post by:
I need to validate a form to ensure that all of the fields add up correctly. I can't do this while the user is entering data since validation needs to be done after the entry is completed. What's...
1
by: gzannd | last post by:
I have a problem with submitting a form to a PHP page through a dynamically created IFRAME in IE7. This code works fine in Firefox. However, IE7 submits an empty form--the correct PHP page is...
7
by: mohammed.naghman | last post by:
Hi, I have 2 submit buttons in a jsp page. One of them takes me to page2.jsp and also passes the values enetered to page2.I have a link in the page2 that does a history.back to come to the...
4
by: Harry | last post by:
Hi, This aspx page (let's call it thispage.aspx) fetches data from a sqldatasource, then performs several things (in code-behind) and, to simplify, passes data from code-behind via a hiddenfield...
7
by: bettor | last post by:
Hi guys, I have some text inputs which I would like to submit to a database via PHP using ajax. What i want to do is when the submit button is pressed I want the forms to disappear and on their...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.