Re: CGI::Session with MySQL Driver
- From: "Mark Clements" <mark.clementsREMOVETHIS@xxxxxxxxxx>
- Date: 30 May 2005 12:23:59 GMT
Alexandre Jaquet wrote:
> Mark Clements a écrit :
>
> > Show us your code using param.
> >
> > Does it work with the File driver?
> >
> > Mark
>
> sub login {
> my $username = param('user_name');
> my $userpassword = param('user_password');
>
> my ($user_name,$user_password)=sqlSelect("nom_utilisateur ,
> mot_de_passe", "personne", "nom_utilisateur = '$username' AND
> mot_de_passe='$userpassword'"); my $dir =
> "C:/indigoperl/apache/htdocs/recordz/"; if ($user_name &&
> $user_password) { $CGI::Session::MySQL::TABLE_NAME = 'session';
> my $SESSION = new CGI::Session( "driver:MySQL", undef, { Handle =>
> $dbh} ); @my_array = ("$username");
> $SESSION->param("user_name", \@my_array);
> open (FILE, "<$dir/myaccount.html") or die "cannot open file
> $dir/myaccount.html"; print "Content-type: text/html\n\n";
> $CGISESSID = $SESSION->id();
> while (<FILE>) {
> s/\$LABEL{'([\w]+)'}/$SERVER{$1}/g;
> s/\$LANG/$lang/g;
> s/\$ERROR{'([\w]+)'}//g;
> s/\$VINYL{'news'}/$string/g;
> s/\$SESSIONID/$CGISESSID/g;
> s/\$VINYL{'search'}//g;
> print $_;
> }
> close (FILE);
>
> }
> else {
> #}}
You need to learn to partition your problem. There is a load of gumpf
here that gets in the way of the issue that you are having and makes it
more difficult for both you and us to find a solution. You've indicated
this works with the File driver, but you haven't shown us the error
message or unexpected behaviour you get with the code above.
Remember to run with strict turned on - I don't think you have with the
code above. Break down the code into the smallest number of lines that
exhibit the behaviour you are trying to demonstrate (you have been
asked to do this on other occasions). I'm not going to write the test
script for you myself.
Mark
.
- Follow-Ups:
- Re: CGI::Session with MySQL Driver
- From: Alexandre Jaquet
- Re: CGI::Session with MySQL Driver
- References:
- CGI::Session with MySQL Driver
- From: Alexandre Jaquet
- Re: CGI::Session with MySQL Driver
- From: Fabian Pilkowski
- Re: CGI::Session with MySQL Driver
- From: Alexandre Jaquet
- Re: CGI::Session with MySQL Driver
- From: A. Sinan Unur
- Re: CGI::Session with MySQL Driver
- From: Alexandre Jaquet
- Re: CGI::Session with MySQL Driver
- From: Mark Clements
- Re: CGI::Session with MySQL Driver
- From: Alexandre Jaquet
- Re: CGI::Session with MySQL Driver
- From: Mark Clements
- Re: CGI::Session with MySQL Driver
- From: Alexandre Jaquet
- CGI::Session with MySQL Driver
- Prev by Date: Re: CGI::Session with MySQL Driver
- Next by Date: Re: Invisible variables in Perl debugger II
- Previous by thread: Re: CGI::Session with MySQL Driver
- Next by thread: Re: CGI::Session with MySQL Driver
- Index(es):
Relevant Pages
|