I current have this .cgi which is used to display to a user the products they've selected for purchase.   I am wondering what is the best and most efficient way to obtain this scenerio:   Right now if someone purchases the first motor it is $18 and that displays in the table below but any additional motor is $12 which is where I'm looking for some guidance.   I know the item is a motor based on it's description obtained from fields[2]   Also - individuals have the ability to enter in a quantity obtained from fields[3] so if …

Member Avatar
+0 forum 0

All in the following code snippet - I have this code working without syntax error if a user accesses the page directly they get the message listed in the else statement "This page cannot be accessed directly " - and when the user accesses the page from a post method it e-mail it to the proper e-mail box. However what doesn't show up in the e-mail is any of the variables - example: $order $subtotal $promo $tax $shipping $total - so I get the e-mail but it doesn't have any of the values from my form - so therefore am …

Member Avatar
Member Avatar
+0 forum 1

All, I am trying to a call a fly program which generates dynamic images on a webpage and I'm geting this error -> malformed header from script. Bad header=/usr/home/gump/bin/fly: The main code is as such and I've tried various varaitions of the Content-Type headers to no avail - the simple-lib.pl code which is referred to - I've included as well for reference: #!/usr/bin/perl5 require 'simple-lib.pl'; &flyprog; $output = `$flyprog -i $flytemp`; print "\n\n"; print "Content-Type: text/html\n\n"; print "Content-Type: image/gif\n\n"; print "$output"; #!/usr/bin/perl5 sub flyprog { $flyprog = "/usr/home/gump/bin/fly"; } 1;

Member Avatar
Member Avatar
+0 forum 3

My ISP - upgraded the Apache servers and in doing so - the CGI/Perl script below that worked before since they didn't require use strict now does not - since I uncommented out the use strict - I'm getting two errors - at first I was getting: Global symbol "@allgifs" requires explicit package name errors for each of my variables - which went away once I added these lines: my allgifs; my row; my col; my imagemap; my item; my topLeftX; my topLeftY; my bottomRightX; my bottomRightY; Now I am getting No such class allgifs for each of my variables …

Member Avatar
Member Avatar
+0 forum 2

All, In the code snippet below - I am trying to only send an e-mail if the page is reached via a POST request - the if statement is not being recognized in the CGI code - as when I access the page this is on directly - I get the print statement but I also receive the print after clearing the cache then going to my web form which calls this code. Is something off that is simple with this if statement: if ($ENV{'REQUEST_METHOD'} eq 'POST') { $to = "admin\@mysite.net"; $date = todays-date; &Email &Thanks; &HTML; } else { …

Member Avatar
Member Avatar
+0 forum 1

i am writing an automation script in Perl which logs into the server and executes various commands and functions.This Perl script mostly uses "send expect statements and for loops " to run the commands. This Perl script is a back end script which i have written. i have to build a GUI kind of thing for the front end. Though we have Perl/Tk for GUI but i seems very difficult to me since i am a beginner in Perl. Please give me suggestions on whether i can implement in perl-CGI ???? should i divide my back end script into separate …

Member Avatar
Member Avatar
+0 forum 2

i am writing an automation script in Perl which logs into the server and executes various commands and functions.This Perl script mostly uses "send expect statements and for loops " to run the commands. This Perl script is a back end script which i have written. i have to build a GUI kind of thing for the front end. Though we have Perl/Tk for GUI but i seems very difficult to me since i am a beginner in Perl. Please give me suggestions on whether i can implement in perl-CGI ???? should i divide my back end script into separate …

Member Avatar
Member Avatar
+0 forum 1

building my first cgi website, here is my problem. The code below works but when the condition is met it outputs both pages on the same screen however when the condition is not met it only outputs the Else: statement like its supposed too. I can't figure out why it prints twice if the condition is met thou/ Thank you guys for your help. if (condition is met): print """Content-type:text/html\r\n\r\n <html> <head> <title>pageA.com</title> else: print """Content-type:text/html\r\n\r\n <html> <head> <title>pageB.com</title>

Member Avatar
Member Avatar
+0 forum 1

hello there im doing this homework assignment and we are making 'facebook' like system now... to sum up, when i press a certain link next to that link has to be printed - liked or sth... the problem is i dont know how to detect when i press the link any ideas? like_link = '<a href="chat.py?like_msg_nr='+str(nr)+'">(Like!)</a>' print(str(nr)+". "+date+' '+link+'<b> '+msg+' </b>'+like_link+' <br> <hr style="border: 1px solid #898989;" >' ) for the web printing i use 2nd line but help me detect when 'like_link' is pressed.

Member Avatar
+0 forum 0

Hi All, I'm a bit of a noobie to Perl, & am working on porting a Perl based web app from an old Sun box to a virtually hosted Windows box. The Windows box is (as far as I know) 2008R1 & running IIS 7.0, the version of Perl is 5.16.2. The particular question I have is regarding the CGI.pm & obtaining the script's URL for the submit function. In the script I have created a form & cgi object with a reset & submit buttons using the submit & reset functions for CGI.pm. My understanding is that those functions …

Member Avatar
Member Avatar
+0 forum 1

i can cobble scripts together and whatnot, but my knowledge of cgi/perl is very limited. i have a simple guestbook script i have been using for years, and it suites me well... i have modified it some to allow people to check a box and add themselves to my mailing list, and i incorporated google recaptcha (thanks to users from daniweb helping me) as well... what i am looking for now, is some code to insert to allow the script not to publish if it contains certain words... i have been blasted with spam, (even with the recaptcha installed)... and …

Member Avatar
Member Avatar
+0 forum 12

Are there any python cgi proxy script out there, i know there are perl and php ones but there any in python, as i want to update the script on http://send2source.net into something i can better understand

Member Avatar
+0 forum 0

Hello, I'm new with Python and running into an error trying to print data I have retrieved from a database. The code works but there are characters being printed with it that are not displayed in the database...here is my current code: con = mysql.connect(host="silo.soic.indiana.edu", port=3306, user="XXXXXXX", passwd="XXXXXX", db="XXXXXXXXX") cursor = con.cursor() group = cursor.execute("select name from people_committees where personid='%s';" % govid) grp = cursor.fetchall() print(grp[0:]) The code is printing this: [(b'House Committee on Armed Services',, (b'House Committee on Armed Services',), (b'House Committee on Armed Services',), (b'House Committee on Oversight and Government Reform',), (b'House Committee on Oversight and Government Reform',)] …

Member Avatar
Member Avatar
+0 forum 5

I have spent the last few days trying to optimize my site for the uploading of large video files. I have changed all the php.ini settings way over the time that it would take to upload the videos but nothing seems to work. It gets to about 30% and then strangely resets to 0% and then restarts and gets to 100% but then a browser error of the connection had been reset page appears. What I don't understand is the fact that it does technically upload but then for some reason it doesn't. I am using IIS 7.5 and so …

Member Avatar
Member Avatar
+0 forum 7

In writing a CGI script, I have come across several errors. As I went through and fixed the errors, I seemed to get all of the syntax errors but as I completed the last ones, a long list of errors came up that I did not understand. In trying to find where the error was coming from, I commented out different portions of the file, eventually commenting out the whole file, and still received errors. Does anyone know what would cause an error like this?

Member Avatar
Member Avatar
+0 forum 8

Hi All, I'm having a bit of a problem with a service I'm developing. I have a CGI script sitting on my server (Ubuntu 10.0.4) which obviously receives it's requests on port 80, and the incoming requests arrive on port 8083 which is out of my control. So I have set up a datapipe-static which forwards all the data to port 80, and the solution is working perfectly for my first script, but somehow no requests are reaching my second script. What I've tried: - Accessing the script through a browser works (even on port 8083) - Tcpdumps on every …

Member Avatar
+0 forum 0

I am working on a project using HTML, PHP, and LINUX shell commands to create a dynamic web page but I seem to be having some trouble figuring out how to run the .cgi file with the shell commands in it using either HTML or PHP (if they are both an option, whichever one is more efficient). This is the code for the .cgi file: [CODE]#!/bin/sh echo -e "Content-type: text/plain\n\n" cal 2011 echo -e "\n" cal 9 1752 echo -e "\n"[/CODE] It is just supposed to display a calendar for the current year and then one for the month of …

Member Avatar
+0 forum 0

Hi, this problem has had me stumped for weeks now. I have written a compiled CGI script in C to rotate my log files each day. The problem is that I don't seem to be able to execute it from inside PHP. It runs fine if I access the file directly though. The CGI doesn't have to return anything to the screen just execute it. I am using a default installation of the MAMP server and I know the Apache server fairly well. I have tried using: [CODE]passthru() system() and exec()[/CODE] to execute my CGI from within PHP. If you …

Member Avatar
Member Avatar
+0 forum 4

I've created a C script that rotates logs on my web server. It needs to receive 2 arguments, one whether the rotated log will be zipped and the other is the location of the log file. This works fine in command line but I cannot get it to execute with the arguments in PHP. Any help would be greatly appreciated. My C script is below, usually compiled into rotate.cgi. [CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> int main( int argc, char *argv[] ) { char file[100]; char file1[100]; strcpy(file, argv[2]); strcpy(file1, argv[2]); char buffer[50]; char comm[50]; char test[2];int i …

Member Avatar
+0 forum 0

Hi, Please see the below one : [CODE]#!c:/perl/bin/perl use CGI qw(:all); print "Content-type:text/html\n\n"; print <<EndOfHTML; <html><head><title>Print Environment</title></head> <body> <FORM action="sample.cgi" method="POST"> First Name: <input type="text" name="first_name"> <br> Last Name: <input type="text" name="last_name"> <input type="submit" value="Submit"> </FORM></body> EndOfHTML[/CODE] From this, i don't know to proceed. There are two text box with [B]First Name[/B] and the [B]Last Name[/B]. When submitting the form by clicking [B]"submit button"[/B], the [B]First Name[/B] and the [B]Last Name[/B] should display on the same page, that is at the bottom of the two text boxes. Please help me out. Thanks in advance

Member Avatar
Member Avatar
+0 forum 6

Hi, i have just transfered to a different host and there servers use CGI Scripts to parse the php code, however the last host didnt and on uploading my site to the new server it is displaying all my code as text after i use include('includes/header.php'); Any help in this matter would be most appreciated.

Member Avatar
Member Avatar
+0 forum 1

im new to cgi scripting...im using python...and ubuntu... i changed apache2's default file to set the cgi directory to /var/www/cgi-bin...and there i i uploaded my simple cgi file...the cgi file runs perfectly fine when run through terminal...which means there is no error...but when i try to access it through a web browser i get "You don't have permission to access /cgi-bin/ on this server." /var/www is my localost directory...and i pass [url]http://localhost/cgi-bin/index.cgi[/url] as the address... i have also checked my permissions ... they're all fine... every file is readable as well as executable by all users... [CODE] #!/usr/bin/env python print …

Member Avatar
Member Avatar
+0 forum 5

I need to keep track of the number of times a user visits a website. I have the code done but I don't think I am counting the correct way as the dynamic web page keeps showing the same number of visits. Any tips would be so helpful! [CODE]#!/usr/bin/perl use CGI qw(:standard -debug); use CGI::Carp qw(fatalsToBrowser); #prevent Perl from creating undeclared variables use strict; #declare variables my ($count, $C_record); #assign input to variable $count = cookie('count'); $count++; #create cookie $C_record = cookie(-name => "count", -value => "$count ", -path => "/cgi-bin/chap11", -expires => "6M"); #send cookie to browser print header(-cookie …

Member Avatar
Member Avatar
+0 forum 3

hello everyone, please i wrote a perl script to run a .bat file using the syntax system 'file.bat'. this works fine when i run it from the command prompt. but i tried saving the script as .cgi and put it inside the cgi-bin so that i can call it from the browser but this is not working i will really appreciate all suggestions on how i can achieve this. i want a perl script that can run the .bat file when called from a browser

Member Avatar
Member Avatar
+0 forum 12

Hi there...... I have received a domain from a customer which is showing me very strange things..... When I tried to login via FTP it showed me empty directory.... The server is apache and when I try to login via cpanel it gives me this error "Not Found The requested URL /cpanel was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. " Can u plz suggest whats the matter here???

Member Avatar
Member Avatar
+0 forum 3

Hi everyone! My first post on daniweb, although I've often been helped by reading. :) I have a CGI script that is driving me batty. CGI is in python. If I put any python code ABOVE the HTML printout of the script except for import statements & varable assignments, Firefox outputs the plain text rather than rendering the page. The page renders in IE just fine, however. Summary: If I keep my python code to setting variables from the form plus import statements such as shown below, all is well in Firefox. [code]#!/usr/bin/python import cgi, smtplib, sys import sap_companydata, sap_admindata, …

Member Avatar
+0 forum 0

Hello, I have built a CGI on Windows Vista. I compiled using Visual C++ Express as follows: cl /Fescript.cgi /EHsc /O2 script.cpp I used Dependency Walker to determine what libraries it depends on. It only depends on kernel32.dll Hypothesis: This CGI should work on any other modern Windows machine by itself i.e. without the need to distribute anything except the CGI itself. Is that a correct assumption?

Member Avatar
+0 forum 0

I have developed a C++ CGI which runs fine on Apache on Win32. I would like to deploy the program onto linux. My plan is to install Wubi (i.e. Ubuntu) and compile the CGI there so that it will work on the linux server. But before I do, I need to know if it is a wise approach to use Ubuntu to compile for a Linux server. I know Ubuntu is based on Linux, but is that sufficient to justify this approach to the problem? Do you have any other suggestions if not? Many thanks (I would rather avoid the …

Member Avatar
Member Avatar
+0 forum 6

Hi, Need to do a project where the data from a HTML form is sent to Python, and then repackaged and sent back out as HTML. Problem is, I'm having issues with Python. When I run the form information with Python, I get this error: [QUOTE]There was an error with your script and it didn't exit properly. This was its output: Content-type: text/html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <title>Receipt</title> </head><body> <p>Name: Kurtis Smejkal </p> <p>Email: Traceback (most recent call last): File "/home/ksmejkal/public_html/assignment3/order.py", line 36, in <module> print "<p>Email:", (form["email"].value), "</p>" AttributeError: 'list' object has no attribute …

Member Avatar
Member Avatar
+0 forum 1

Hi All, I am adding a calendar coded in cgi to my page.As i can use a JS calendar also but it have to do it with cgi only. my present calendar prints current month on the page.Now here the problem comes. I want each & every date to be hyperlinked so that i can select any date of any month and fetch the results for that date accordingly. Please find below the code: [CODE]#!/usr/bin/perl -w ################################################### ## Calendar Script V2 ## This script will display the current Month and ## year, with the current day selected. Also, ## navigation …

Member Avatar
Member Avatar
+0 forum 1

The End.