| | |
Newbie Needs Help
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Fareen,
The code is almost done, actually. There are 2 issues, left however, that I am working on resolving. One of those is setting a session cookie, which shouldn't be any kind of problem, but I still need to code that peice. The other, is having the links to the files work to download them. I can fix that issue also, but I'll need a little bit more time. Also, have you modified the password file to contain the business code at the end of the passfile?
Also, the page is very very plain, that will require your HTML touches to make it work for you and your company, but right now this is what I have:
http://www.aftermath.net/~coma/cgi-bin/business.pl
Username, Password: test test
The code is almost done, actually. There are 2 issues, left however, that I am working on resolving. One of those is setting a session cookie, which shouldn't be any kind of problem, but I still need to code that peice. The other, is having the links to the files work to download them. I can fix that issue also, but I'll need a little bit more time. Also, have you modified the password file to contain the business code at the end of the passfile?
Also, the page is very very plain, that will require your HTML touches to make it work for you and your company, but right now this is what I have:
http://www.aftermath.net/~coma/cgi-bin/business.pl
Username, Password: test test
alright, it's done. I'm attaching the perl source code. There is 1 spot that you need to focus some attention to... I have my aliases set up to default over-write anything that I try to copy. So, if I try to copy a file to say /home/coma, and the same filename already exists there, my linux setup will automatically over-write the one that's already there. You need to setup your box's alias for whomever the account is that will be running this script to automatically over-write should the file exist. Anyway, I've attached the mock passfile, and the perl file in a .zip file. Let me know how it goes.
•
•
Join Date: May 2005
Posts: 12
Reputation:
Solved Threads: 0
Hi Comatose,
I get this error:
[Thu May 12 03:20:21 2005] [error] [client 127.0.0.1] Prototype mismatch: sub main::head vs ($) at /var/www/bank/cgi-bin/business.pl line 5
[Thu May 12 03:20:21 2005] [error] [client 127.0.0.1] Died at /var/www/bank/cgi-bin/business.pl line 319.
[Thu May 12 03:20:23 2005] [error] [client 127.0.0.1] Prototype mismatch: sub main::head vs ($) at /var/www/bank/cgi-bin/business.pl line 5, referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] Prototype mismatch: sub main::head vs ($) at /var/www/bank/cgi-bin/business.pl line 5, referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] sh: line 1: ffile: Permission denied, referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] I suck at /var/www/bank/cgi-bin/business.pl line 260., referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] Premature end of script headers: business.pl, referer: http://www.mysite.com/cgi-bin/business.pl
I installed the
perl -MCPAN -e'install LWP:
imple'
but still i get above error. Please help.
fareen
I get this error:
[Thu May 12 03:20:21 2005] [error] [client 127.0.0.1] Prototype mismatch: sub main::head vs ($) at /var/www/bank/cgi-bin/business.pl line 5
[Thu May 12 03:20:21 2005] [error] [client 127.0.0.1] Died at /var/www/bank/cgi-bin/business.pl line 319.
[Thu May 12 03:20:23 2005] [error] [client 127.0.0.1] Prototype mismatch: sub main::head vs ($) at /var/www/bank/cgi-bin/business.pl line 5, referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] Prototype mismatch: sub main::head vs ($) at /var/www/bank/cgi-bin/business.pl line 5, referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] sh: line 1: ffile: Permission denied, referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] I suck at /var/www/bank/cgi-bin/business.pl line 260., referer: http://www.mysite.com/cgi-bin/business.pl
[Thu May 12 03:20:25 2005] [error] [client 127.0.0.1] Premature end of script headers: business.pl, referer: http://www.mysite.com/cgi-bin/business.pl
I installed the
perl -MCPAN -e'install LWP:
imple'but still i get above error. Please help.
fareen
I'm willing to bet that the protocol mismatch is because you are supposed to be using https, and you are using http, I could be mistaken, so give it a shot and let me know.
Also, you don't need LWP, and if you don't want to have it installed (thought it is extremely handy) you can remove that from your server, along with the line of: use LWP, because it's not required. In fact, make sure that you take out the use LWP:
imple, because not only is not needed, I think it's causing problems on your system.
Also, did you make sure to change all the variables at the top of the script, so that they point to your folders, and https paths? Make those changes, and if there is still problems, attach the .pl file in an e-mail to me.
Also, you don't need LWP, and if you don't want to have it installed (thought it is extremely handy) you can remove that from your server, along with the line of: use LWP, because it's not required. In fact, make sure that you take out the use LWP:
imple, because not only is not needed, I think it's causing problems on your system.Also, did you make sure to change all the variables at the top of the script, so that they point to your folders, and https paths? Make those changes, and if there is still problems, attach the .pl file in an e-mail to me.
•
•
Join Date: May 2005
Posts: 12
Reputation:
Solved Threads: 0
Hi Comatose,
I beg your pardon.
I have realised my mistake and your script is perfect. Its PERFECT
One more ?
When (text) files are open in the browser and clicked the data is displayed in the browser , but when right clicked to Save Link Target As it does not download and save the file. Please this is very important. When the branches wants to download the particular file they will just right click and save the file on their machine.
I will be highly thankfull for this.
Hoping for a favourable reply.
Thanking you in advance.
I beg your pardon.
I have realised my mistake and your script is perfect. Its PERFECT
One more ?
When (text) files are open in the browser and clicked the data is displayed in the browser , but when right clicked to Save Link Target As it does not download and save the file. Please this is very important. When the branches wants to download the particular file they will just right click and save the file on their machine.
I will be highly thankfull for this.
Hoping for a favourable reply.
Thanking you in advance.
*Yikes*
I'll see what I can do.... let me give you the breakdown of WHY it is this way. The decision then will be yours to make regarding the use of such. The files that the people of the branches want to download (those are in some other folder... like: /var/www/bank/reports/*) Those paths, as far as I know, are NOT accessible to someone surfing the web. In order to make those files accessible, the program copies the file from it's original location, and saves it onto the root of the webserver, but it only does so, AFTER they click the link (the actual HREF of the link, points to the CGI, with the filename as a parameter). When the CGI see's this, (the person clicked a filename) it copies the file to the web server directories, and then redirects the browser to the newly copied file. This was made to aid in security and privacy of those files. However, It is entirely too possible for me to copy all the files to the webserver folders when the links are created, and simply HREF those.... that choice is yours...
I'll see what I can do.... let me give you the breakdown of WHY it is this way. The decision then will be yours to make regarding the use of such. The files that the people of the branches want to download (those are in some other folder... like: /var/www/bank/reports/*) Those paths, as far as I know, are NOT accessible to someone surfing the web. In order to make those files accessible, the program copies the file from it's original location, and saves it onto the root of the webserver, but it only does so, AFTER they click the link (the actual HREF of the link, points to the CGI, with the filename as a parameter). When the CGI see's this, (the person clicked a filename) it copies the file to the web server directories, and then redirects the browser to the newly copied file. This was made to aid in security and privacy of those files. However, It is entirely too possible for me to copy all the files to the webserver folders when the links are created, and simply HREF those.... that choice is yours...
![]() |
Similar Threads
- As a newbie, where i should start from in linux? (Getting Started and Choosing a Distro)
- Questions about building a system (was: newbie) (Troubleshooting Dead Machines)
- Best free C/C++ compiler for a newbie? (C++)
- help newbie alert needs help with login page (ASP.NET)
- newbie needs help, basic mfc stuff (C++)
- Hello, newbie here... (Geeks' Lounge)
- Book For Newbie (C++)
- Newbie - how do I start C++ programming? (C++)
- PHP newbie, project feasibility (PHP)
- How to network two Win98 machines (Networking Hardware Configuration)
Other Threads in the Perl Forum
- Previous Thread: Using passwd in a perl file to automate user creation
- Next Thread: Guestbook help. Post in two different spots.
Views: 5730 | Replies: 21
| Thread Tools | Search this Thread |
Tag cloud for Perl






