Re: CGI::Session with MySQL Driver



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



.



Relevant Pages

  • Re: OleDbDataAdapter.Update and DBase IV
    ... BTW you might avoid changing TABLETYPE as it is unique? ... miha at rthand com ... "mark" wrote in message ... > Param = daATBD.UpdateCommand.Parameters.Add(new ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: well, it worked in sqlserver Insert fails in oledb
    ... Primary Key is typID as an auto Number, I replaced the param with a question ... mark and i get the same problem. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: CGI::Session with MySQL Driver
    ... > Mark Clements a écrit: ... >> Alexandre Jaquet wrote: ... >> Don't use store, use param. ... Show us your code using param. ...
    (comp.lang.perl.misc)