homepage Welcome to WebmasterWorld Guest from 54.198.157.6
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
CGI problem - What should I do
SOS - urgent help with CGI
contentmaster




msg:429949
 11:14 am on Sep 28, 2003 (gmt 0)

Hi!
I need some urgent help! I am totally new to cgi...a designer with very limited knowledge of scripting...

I have a unique problem...there are a number of forms on my site...and on clicking the submit button it calls the cgi file located in the cgi bin on the server!(this has been done by someone else for me)

Now my problem is: I have made a new form and i tried to give its action as one of the cgi files already existing...and on submitting, the data is coming to me like i wanted it to in my inbox(with all the right fields)....but since i have linked it to an already existing cgi the subject shows the name of that file.
So i downloaded one of the cgi files..and changed its subject and uploaded it after renaming it. Then i mentioned it as my form action:
Now when i submit it shows internal server error.....what is wrong! am i supposed to change something else in the cgi file.

I don't know cgi well and so cannot make out what more i am supposed to do or how one cgi file works and the other does'nt!
Any views on what i should do.....have a certain deadline and need to solve this problem soon!

 

netcommr




msg:429950
 11:30 am on Sep 28, 2003 (gmt 0)

make sure the new script is allowed to execute, (chmod to 0755)

if that doesn't fix it, post here code snippets of the changes you made (before and after)

contentmaster




msg:429951
 1:01 pm on Sep 28, 2003 (gmt 0)

Thanks for the quick response

I am using Ws_ftp to upload my pages to the server. The chmod of the file is 766 right now. ie,
Owner: Read write Execute - all 3 checked
Group : Read write - both checked
Other : Read Write - both checked

How do i change it to 0755?
Please instruct what changes i need to make to change the chmod....from what it already shows?

What does this do exactly?

Thanks
contentmaster

amoore




msg:429952
 1:27 pm on Sep 28, 2003 (gmt 0)

755 means:
owner: read, write, and execute.
group: read and execute
other: read and execute.

The reason is that your webserver runs as a user that is not you, and (probably) not in the group that owns the file, so it's an "other" user. It needs to execute the file, so it needs to be able to read and execute it.

Now that you have it fixed, here's how the permissions work. The first digit is for "user" that owns the file (also called owner, but that's confusing. The second is for the group that owns the file, and the last digit is for everyone else. The way you get the number that goes in each spot is that "read" permissions are worth 4, write is worth 2, and execute is worth 1. You add up the permissions you want to get the number.

There's a lot more in the manual page for "chmod".

contentmaster




msg:429953
 1:58 pm on Sep 28, 2003 (gmt 0)

Hi Thanks so much amoore

I think i have solved the problem Thanks to you and netcommr!
I want to learn more about chmod and cgi scripting!
will appreciate any tips or tutorials!
Thanks again

claus




msg:429954
 2:12 pm on Sep 28, 2003 (gmt 0)

>> tutorials
This search will show you a few, and the category link on top is also good:
[google.com...]

/claus

contentmaster




msg:429955
 12:31 pm on Sep 29, 2003 (gmt 0)

I have been able to cross one hurdle and now on submitting the form data, the details are coming to me like I wanted it to with the correct subject.

In an attempt to move ahead!, if I now want to split my form into two parts..ie, once he fills a certain number of fields, I want him to click on continue, a new page opens saying please fill in the following details to confirm your order,how do I do this?

Do I create a new form in the next page, or do I mention the same form name as my main form and then mention the same cgi file name in the action element.

Will this submit data from both forms in the same cgi? Please advice!

Thanks in advance

claus




msg:429956
 4:03 pm on Sep 29, 2003 (gmt 0)

You've got a problem here. Page 2 will not know what has been entered on page 1, so if you submit on page 2, only the data entered on page 2 will be included.

If you submit on page 1 as well as on page 2, you will get two submits for the same order, and that is not what you want.

You need a procedure for storing what is input on page 1, plus storing what is input on page 2 as well, and then submit both.

/claus

contentmaster




msg:429957
 5:14 pm on Sep 29, 2003 (gmt 0)

You need a procedure for storing what is input on page 1, plus storing what is input on page 2 as well, and then submit both.

yes that's precisely what I'm looking for so that information from both the forms come to me at one go!
Any ideas on how I can do it!

amoore




msg:429958
 4:38 am on Sep 30, 2003 (gmt 0)

A common method is to take all of the inputs from the first form and store them as hidden variables in your second form. For instance, if the first for asks for name, then the second form would have a hidden input called name with the value already filled in from the first form.

This is achived by making the output of the first CGI script be the HTML page with the form on it for the second CGI script. In practice, they can be the same script if you want.

Another option, which is more complex, but flexible, is to give the user a cookie or something so that you can uniquely identify them (a session identifier) and them remember all of their answers to the first form in a database. When the second form is submitted, take the input from it plus the stuff you pull out of the database (that they submitted a few moments ago) and do whatever processing you need to.

I have just described a huge field in 3 paragraphs. You will naturally not find all of the answers here. It should give you a gist and a direction for research.

Good luck!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved