two cookies from one domain

2002-11-01 Thread aman cgiperl
Hi
How do I set two cookies, from two different scripts, same domain?
I tried with different names for cookies as follows and I lose'em

Script1.cgi has the following code:

my $ct = &rnd_num;# random
number generator
use CGI::Cookie;
my $cook = new
CGI::Cookie(-name=>'cok.cart', -value=>$ct, -domain=>'.192.168.0.1');
print header(-cookie=>$cook);

Script2.cgi has the following code:

my $name = &get_mail_id;  # user's email
use CGI::Cookie;
my $cook = new
CGI::Cookie(-name=>'cok.email', -value=>$email, -domain=>'.192.168.0.1');
print header(-cookie=>$cook);


They probably conflict or something. Not sure.
Any ideas?

Thanks
Aman

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




submit form pressing key

2002-10-31 Thread aman cgiperl
I have a search on my webpage.
I put in keyword and press enter - the value in the textbox is not carried
over, though the search.pl is executed.
But if I press the Submit button, it works with the entered keyword.
I want the  to work too - it works on the login page.
I wonder what could be the problem.
Thanks in advance.
Aman

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




cookies

2002-10-02 Thread aman cgiperl

Hi all
I need to set a cookie which expires when the browser is closed.
I am not using CGI.pm
My earlier query for the same for responded by telling that if I am using
CGI.pm, I can do so by omitting the expiry date, but if I do so, when I do

print "Set-Cookie: cart=$cart domain=.domain.com\n";

the cookie does not get set at all.

Thanks for suggestions in advance.
Aman

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




database execute status

2002-08-30 Thread aman cgiperl

Hi All
Is there a way to check the status of $sth->execute; to check if it successfully 
executed.
Also if I pass on a query to a mysql database using perl's DBI, and suppose it runs 
into error, how can I capture that error.
Thank you
Aman



database connection problem

2002-08-30 Thread aman cgiperl

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. 




file read and then write problem

2002-06-10 Thread aman cgiperl

Hi all
I posted this on the CGI list but no response at all. Please have a look at this 
problem.

I am reading from an html file and writing to another.
The while loop terminates before the complete file is read.
The worse part is that it works for some files and doesn't for others. Moreover, it 
varies where it terminates in different files, while it always terminate at the same 
stage for the same file.
For eg,
reading file TMP
writing to FA, FB, FC
each time the program is executed
FA terminates at something like http://www.foo.com/store/images/dpt/S
The files always terminate at same stage each time but there are some others been 
written perfectly.

Any suggestions?
Thanks in advance
aman




Re: file i/o problem

2002-06-08 Thread aman cgiperl

Refering lines 6-9 of code below:
The file is being read and each line printed as it is read. The while loop
is getting terminated before the file is competely read.
Suggestions?
Thnx
Aman

- Original Message -
From: "aman cgiperl" <[EMAIL PROTECTED]>

I have a code that looks like the following

1$pgs = 1000;
2$lks = "Welcome Message";
3for($i=0;$i<$pgs;$i++){
4open PGIN, "/$char/$mn/index_tmp".$i.".html";
5open PGOUT, ">/$char/$mn/index".$i.".html";
6while()   {
7$_ =~ s/##MSG##/$lks/g;
8print PGOUT $_;
9}
10close PGIN;
11close PGOUT;

This code creates index pages from index_tmp pages. The problem is that the
created pages are not complete. I mean the new pages don't have the complete
html written from the index_tmp pages. This results some visible html code
in IE and as expected, due to html error, nothing in Netscape.
Any suggestions?
Thank is advance.
Aman


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




file i/o problem

2002-06-08 Thread aman cgiperl

I have a code that looks like the following

$pgs = 1000;
$lks = "Welcome Message";
for($i=0;$i<$pgs;$i++){
open PGIN, "/$char/$mn/index_tmp".$i.".html";
open PGOUT, ">/$char/$mn/index".$i.".html";
while()   {
$_ =~ s/##MSG##/$lks/g;
print PGOUT $_;
}
close PGIN;
close PGOUT;

This code creates index pages from index_tmp pages. The problem is that the created 
pages are not complete. I mean the new pages don't have the complete html written from 
the index_tmp pages. This results some visible html code in IE and as expected, due to 
html error, nothing in Netscape.
Any suggestions?
Thank is advance.
Aman



Re: Netscape vs. IE Discrepancy FIXED

2002-05-21 Thread aman cgiperl

Hi
As a developer I won't agree that IE is smart because it lets programmers
ignore minor mistakes.
It allows you to be a negligent programmer.
Always use netscape for testing because that's the real test. Then use IE -
that's what the most of the world uses after all!!!
Thanks
Aman

- Original Message -
From: "Phil Fickas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 21, 2002 8:53 AM
Subject: RE: Netscape vs. IE Discrepancy FIXED


> Hi all.
>
> Thanks for the sanity check.  I was printing a line of debugging before
the
> content-type output line.  Commenting that out fixed it.  IE was smart
> enough to ignore it, while Netscape preferred to reject the page.
>
> Thanks again,
>
> Phil

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