RE: Which button clicked?

2003-10-14 Thread Greg Smith
You should name your submit buttons. Everything sent is in name:value pairs.
Without the name all you have is that the submit action took place.


Greg Smith

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 14, 2003 3:36 AM
To: [EMAIL PROTECTED]
Subject: Which button clicked?


Can someone show me how to determine which button the user clicked?

use CGI;

$cgi-param did not contain the action parameter.
I want to determine if the user click the LEFT or RIGHT button:

...
input type=submit value=LEFT
input type=submit value=RIGHT
...

thanks
-rkl



-
eMail solutions by 
http://www.swanmail.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Send mail weirdness

2003-10-02 Thread Greg Smith
It could be that AOL looks at the headers and sees that the message is being
sent by [EMAIL PROTECTED], which is the user of many web servers, which is
different than the from address. It thinks that a forgery is taking place
and that the e-mail is spam and discards it.

Just an idea which I am trying to prove with an ISP in Germany where I have
experienced the same problem.


Greg Smith
 

-Original Message-
From: David Gilden [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 02, 2003 10:41 AM
To: [EMAIL PROTECTED]
Subject: Send mail weirdness 


Greetings,

my client claims he never receives any email from his
contact page! I however have set up a 'BCC'
and am getting email via the script below.

His connection to the 'net is via AOL,
and when I mail him from my email client using

[EMAIL PROTECTED]

he receives it, but not from the script below.
Do you see any errors or problems via AOL?

What could be the issue, I just don't see anything!
Thanks :)

Dave Gilden
---
#!/usr/local/bin/perl 

use CGI qw/:standard/;
use CGI::Carp qw(fatalsToBrowser);
use POSIX 'strftime';
use strict;
my $mailprog = '/usr/lib/sendmail';

my $subject = Jakes's Lawn Care Contact Page;
my $date = strftime('%A, %B %d, %Y %I:%M %p',localtime(time() + (2*60*60)));

my $name = param('First Name') .  . param('Last Name');

my $email= param('email');
$email = lc($email);


# Send E-Mail
send_mail;


# Return HTML Page 
print redirect(/pages/thankyou.html);
exit;

sub send_mail {
my $data;
$email ||= '[EMAIL PROTECTED]';

open(MAIL, |$mailprog -t);
print MAIL TO: [EMAIL PROTECTED];
print MAIL BCC: [EMAIL PROTECTED];
print MAIL From: $name $email\n;
print MAIL Subject: $subject\n\n;

print MAIL $subject: $date\n, '-' x 60, \n ;

foreach my $val (param()){
$data = param($val);
print MAIL $val: $data\n;
} 

close(MAIL);
}

-- 
Words are like money; there is nothing so useless, unless when in actual
use.
-Samuel Butler, writer (1835-1902)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perl problem:(

2003-02-14 Thread Greg Smith
First if statement.


$length = length($firstname);
if (!$length)
{
print Not a valid First Name, try again.\n;
next;
---{


Greg Smith


 -Original Message-
 From: t [mailto:[EMAIL PROTECTED]]
 Sent: Friday, February 14, 2003 4:05 PM
 To: [EMAIL PROTECTED]
 Subject: Perl problem:(
 
 
 Hello all:)
 
 You have been greaet helps to me in the past, and im hoping you 
 can help now:) A friend of mine is
 in a class learning perl and her script keeps getting an error 
 that there is a bracket missing on
 line 190. When i looked at it, all i could see was the nested 
 statement problem i had at one time.
 Do you think that is the problem? and if so, what would be the 
 best way to fix it? I want her to
 be able to learn it, not to have it done for her, but i want to 
 give her the best advice possible:
 
 Script:::
 
 #!/usr/bin/perl
 #
 #   lab3.pl
 #
 
 my @scorearray;
 
 sub getinformation()
 {
 
   local $score = 0;
   local $total = 0;
   local $ctr = 0;
   local $rpt_ctr = 0;
   open (OUTFILE, info.txt)
   || die cannot open info.txt $!;
 
   local $var = bad;
   while ($var eq bad)
   {
   print enter student's first name: ;
   $firstname = STDIN;
   chop ($firstname);
   $length = length($firstname);
   if (!$length)
   {
   print Not a valid First Name, try again.\n;
   next;
   {
   if($length  20)
   {
   print Not a valid First Name, try again. \n;
   next;
   }
   if($length)
   {
   $var = good;
   print (OUTFILE $firstname|);
   }
   }   
 
   local $var1 = bad;
   while ($var1 eq bad)
   {
   
   print enter student's last name: ;
   $lastname = STDIN;
   chop ($lastname);
 
   if (!$length1)
   {
   print Not a valid last name, try again. \n;
   next;
   }
   if($length1  20)
   {
   print Not a valid last name, try again. \n;
   next;
   }
   if($length1)
   {
   $var1 = good;
   print(OUTFILE $lastname|);
   }
   }
   
   local $var2 = bad;
   while($var2 = bad)
   
   {
   print enter student's SSN:;
   $ssn = STDIN;
   chop($ssn);
 
   $length2=length($ssn);
   if(!$length2)
   {
   print Not a valid Social Security Number, 
 try again.\n;
   next;
   }
   $ssn =~ s/[^\d]//g;
   if($ssn !~ m/^\d{9}$/)
   {
   print Not a valid Social Security Number, 
 try again.\n;
   next;
   }
   if($ssn =~ m/^\d{9}$/)
   {
   $var2 = good;
   print(OUTFILE $ssn);
   }
   }
 
   
   local $ctr1 = 1;
   while ($ctr  4) 
   {
   
   print enter a test score $ctr1: ;
   $score = STDIN;
   chop ($score);
   
   if ($score eq q)
   {
   last;
   }
   
   local $error = true;
   testscore($score);
 
   if ($error eq false)
   {
   next;
   }
   else
   {
   $total += $score;
   $ctr++;
   $ctr1++;
   $scorearray[$ctr]=$score;
   }
   
   };
 
   while($rpt_ctr = $ctr)
   {
   print (OUTFILE $scorearray[$rpt_ctr]);
 
   if($rpt_ctr  3)
   {
   print(OUTFILE |);
   }
 
   $rpt_ctr++; 
   }
 
   print (OUTFILE \n);
   getscore();
 };
 
 sub getscore()
 {
   local $display = 4 - $ctr;
   local $avg = $total / 4;
   print Score total is $total \n;
   print number of scores entered is $ctr \n;
   print Score Average is $avg \n;
   print $firstname is missing $display tests\n;
   warnings();
 };
 
 sub testscore()
 {
   if ($score  100)
   {
   print invalid score, please make sure the score is 
 less than or equal to 100\n;
   $error = false;
   }
   if ($score  0)
   {
   print invalid score, please make sure the score is 
 greater than or equal to 0\n;
   $error = false

RE: database connection problem

2002-08-30 Thread Greg Smith

Try adding the hostname of the MySQL to your connect string.

my $dth =
DBI-connect(DBI:mysql:database=db_name;host=hostname,user,pass);

Greg


 -Original Message-
 From: aman cgiperl [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 30, 2002 10:46 AM
 To: [EMAIL PROTECTED]
 Subject: database connection problem


 Hello everyone
 I am doing the following

 -
  1  #!/usr/bin/perl
  2
  3  use strict;
  4  use CGI qw(:standard);
  5  use CGI::Carp qw(fatalsToBrowser);
  6  use DBI;
  7
  8  print header;
  9  print start_html();
 10 $s = 'aman';

 12  my $dth = DBI-connect(DBI:mysql:db_name,user,pass);
 26  my $sth_check = dth-prepare(SELECT * FROM mytab WHERE s='$s');
 28  sth_check-execute;
 41  $dth-disconnect;

 137  print end_html;

 ---
 I am getting the following output. What could be wrong ???
 --
 Content-type: text/html
 Software error:
 Can't locate object method prepare via package dth (perhaps
 you forgot to load dth?) at /home/somesite/cgi-bin/script line 26.

 For help, please send mail to the webmaster
 ([EMAIL PROTECTED]), giving this error message and the time
 and date of the error.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Something wrong with my one line code

2001-06-15 Thread Greg Smith

Missing the  at the end of the line

Try this:

print Input type=\button\ Value=\Print This Page\
onClick=\parent.main.print()\\n;

Greg S.

 -Original Message-
 From: Luinrandir Hernson [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 15, 2001 11:02 AM
 To: [EMAIL PROTECTED]
 Subject: Something wrong with my one line code


 This line of code in a perl script comes up with errors.
 What am I missing? problems with the word print?
 Am I missing a / somewhere for a reserved word? maybe the 2nd Print?

 print Input type=\button\ Value=\Print This Page\
 onClick=\parent.main.print()\\n;






RE: So what am I doing incorrectly??

2001-06-14 Thread Greg Smith

Try:

$A == 0 

eq is for string comparisons and $A contains an integer.

Greg S. 

Greg S. 

 -Original Message-
 From: Luinrandir Hernson [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 14, 2001 3:10 PM
 To: [EMAIL PROTECTED]
 Subject: So what am I doing incorrectly??
 
 
 srand;
 $A = int (rand (4))
 if ($A eq '0') {print BODY BACKGROUND=\images/celtknt0.jpg\\n};
 if ($A eq '1') {print BODY BACKGROUND=\images/celtknt1.jpg\\n};
 if ($A eq '2') {print BODY BACKGROUND=\images/celtknt2.jpg\\n};
 if ($A eq '3') {print BODY 
 BACKGROUND=\images/celtknt3.jpg\\n};