
Rivotti
User
Mar 28, 2000, 3:23 PM
Post #4 of 10
(986 views)
|
It's dificult to me to explain better ( I'm Portuguese, English is not my mother language ), But I'll try: I have this file named "passo4.cgi" that save a temp file, named $user to the server and print out a form that will call "passo5.cgi" ("Passo" means "Step" in portuguese). Hereīs a piece of code of "passo4.cgi": <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl use CGI qw( :standart ); print "Content-type: text/html\n\n"; # This section grab all parameters from the previous form "passo3.cgi" $academicas = new CGI->param("academicas"); $habilitacoes = new CGI->param("habilitacoes"); $profissional = new CGI->param("profissional"); $campoextra1 = new CGI->param("campoextra1"); $campoextra2 = new CGI->param("campoextra2"); $escolha1 = new CGI->param("escolha1"); $escolha2 = new CGI->param("escolha2"); $escolha3 = new CGI->param("escolha3"); $escolha4 = new CGI->param("escolha4"); $template_imagem = new CGI->param("template_imagem"); $template_css = new CGI->param("template_css"); $n="3"; my $j; # This section will create a number that will be temp file name $time= gmtime; $time=~ s/\D//g; if (campoextra1 ne "") { $extra="0" } else { $extra=$campoextra2 } $user= $time.$academicas.$habilitacoes.$profissional.$extra; # now the form is printed out print '<body> <form action="http://www.contifax.com/cgi-bin/curriculum/passo5.cgi?user='.$user.' " method="post"> <div align="center"> <center> <table border="0" cellPadding="0" cellSpacing="0" width="400"> ... # foward the program will create the temp file as "$user.pl" ... </pre><HR></BLOCKQUOTE> Are you still awake? Ok! Now, in "passo5.cgi", I use the following code: <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl use CGI qw( :standart ); print "Content-type: text/html\n\n"; $user = new CGI->param('user'); require "$user.pl"; ... </pre><HR></BLOCKQUOTE> I assume that everything is correct. Can you explain why "passo5.cgi" can't use the variable $user in the browser ? And why it works when a use the same code directly in the commad line ? If you want, you can see the program running in here. This program's language is Portuguese but you just need to push the button "Continuar" at the end of each form. As you will see, whem the browser opens the "passo5.cgi" the url is correct but nothing appears. Thank you for your time and patience. Another thing: When the Browser calls "passo5.cgi" appears, in the command linem something like this: http://www.contifax.com/cgi-bin/curriculum/passo5.cgi?user=2900265920001110 The funny thing is that it works if you push this link now try to add & before the word user. It works. But if I use the same thing in the code of "passo4.cgi" the program doesn't work. It will appear in the command line: http://www.contifax.com/cgi-bin/curriculum/passo5.cgi?&user=2900265920001110 And doesn't work. But if i delete the & it will work again. Argh, maybe I'm gettin perl poisonning... Rivotti [This message has been edited by Rivotti (edited 03-28-2000).]
|