SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old July 9th, 2004, 03:28 PM
seahawk seahawk is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 seahawk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing javascript vars to a cgi script

First I get the data from the form on the page via:

$acct_name = document.requests.acct_name.value ;

I know that I have the data by testing:

alert("Account Name: " + $acct_name) ;

So far so good.

Now the menu, which is the javascript including the above, submits the following when the menu item is clicked:

document.write('<tr>');
document.write('<form action="http://www.somewebpage.com/cgi-bin/requests.cgi" method="post">');
document.write('<td align="left" valign="center">');
document.write('<input type="submit" value="File Requests" class="menulinks1"><br></td>');
document.write('<td><input type="hidden" name="acct_name" value=$acct_name></td>');
.
.
.
document.write('</form></tr>');

The above code is only for one of a number of menu items.

Result:

The .cgi gets called ok but the name of the field $acct_name is displayed instead of the value.

I have tried it value="$acct_name", value='$acct_name', value=$acct_name, and even value=document.requests.acct_name.value --- Everytime I get the field name.

The requests.cgi is currently in use and working fine. It is being called by another .cgi which passes the variables via _POST. I have to incorporate this into a new site that is PHP/MySQL, so I just mimic the use of the _POST variables by using the javascript.

I can rewrite the whole thing PHP/MySQL, which will probably happen in the future, but I am just trying to use what is already working for now.

Any suggestions/observations/etc., are gratefully welcomed. I have combed the javascript resources but can not find anything that helps. I had a previous post here trying to do the same thing with _SESSION vars, but no results yet.

Thanks !!!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Passing javascript vars to a cgi script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway