CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Locale Question

Print topic Send  topic

Author Message
Adam Marash
Posted: 04/17/2001, 8:28 AM

Where in CC can I place a Session.LCID assignment? I tried manually placing
it in common.asp and in the actual page where I need the assignment, but
there's no proper response.

Is there any way to place text within the <HTML> brackets, as in <HTML
DIR=RTL> without manual coding?

Alexey Alexapolsky
Posted: 04/18/2001, 2:15 AM

1) Staightforward way is to open "Header page" that is included by pages
of your web-app and add you code into Page properties/Events/Open event.
But it's an excessive way, since it will be set again on each page (you can
check if it's
set using IsEmpty() function , though)

2) You can set it Login page/"Page properties"/Events/OnLogin event ,
but suince redefining the whole login event you will need to add a few lines
more
code to complete other login functionality like below :


sLogin = GetParam("Login")
sPassword = GetParam("Password")
bPassed = CLng(DLookUp("employees", "count(*)", "login =" &
ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))

if bPassed > 0 then
' Login and password passed
Session("UserID") = CLng(DLookUp("employees", "employee_id", "login
=" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))

Session("UserRights") = CLng(DLookUp("employees", "security_level",
"login =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword,
"Text")))
sQueryString = GetParam("querystring")
sPage = GetParam("ret_page")
if not(sPage = request.serverVariables("SCRIPT_NAME")) and
not(isEmpty(sPage)) then
response.redirect(sPage & "?" & sQueryString)
end if

response.redirect("Default.asp")
else
sLoginErr = "Login or Password is incorrect."
end if

--
Regards,
Alexey
CodeCharge Support


Adam Marash <adam@interfax.co.il> wrote in message
news:9bhnf3$gal$1@mail.tankhill.com...
> Where in CC can I place a Session.LCID assignment? I tried manually
placing
> it in common.asp and in the actual page where I need the assignment, but
> there's no proper response.
>
> Is there any way to place text within the <HTML> brackets, as in <HTML
> DIR=RTL> without manual coding?
>
>

Adam Marash
Posted: 04/18/2001, 3:48 AM

Assigning a value to Session.LCID in Events|On Open (and in other places)
has no effect at all on dates that are looked up from a database and
displayed. Any thoughts?



"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:9bjluk$65v$1@mail.tankhill.com...
> 1) Staightforward way is to open "Header page" that is included by pages
> of your web-app and add you code into Page properties/Events/Open event.
> But it's an excessive way, since it will be set again on each page (you
can
> check if it's
> set using IsEmpty() function , though)


Jeffrey A. Stuart
Posted: 04/18/2001, 4:08 AM

Can you translate that into either Perl or PHP please? Thx...

In article <9bjluk$65v$1@mail.tankhill.com>,alexa@codecharge.com says...
> 1) Staightforward way is to open "Header page" that is included by pages
> of your web-app and add you code into Page properties/Events/Open event.
> But it's an excessive way, since it will be set again on each page (you can
> check if it's
> set using IsEmpty() function , though)
>
> 2) You can set it Login page/"Page properties"/Events/OnLogin event ,
> but suince redefining the whole login event you will need to add a few lines
> more
> code to complete other login functionality like below :
>
>
> sLogin = GetParam("Login")
> sPassword = GetParam("Password")
> bPassed = CLng(DLookUp("employees", "count(*)", "login =" &
> ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
>
> if bPassed > 0 then
> ' Login and password passed
> Session("UserID") = CLng(DLookUp("employees", "employee_id", "login
> =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
>
> Session("UserRights") = CLng(DLookUp("employees", "security_level",
> "login =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword,
> "Text")))
> sQueryString = GetParam("querystring")
> sPage = GetParam("ret_page")
> if not(sPage = request.serverVariables("SCRIPT_NAME")) and
> not(isEmpty(sPage)) then
> response.redirect(sPage & "?" & sQueryString)
> end if
>
> response.redirect("Default.asp")
> else
> sLoginErr = "Login or Password is incorrect."
> end if
>
> --
> Regards,
> Alexey
> CodeCharge Support
>
>
> Adam Marash <adam@interfax.co.il> wrote in message
>news:9bhnf3$gal$1@mail.tankhill.com...
> > Where in CC can I place a Session.LCID assignment? I tried manually
> placing
> > it in common.asp and in the actual page where I need the assignment, but
> > there's no proper response.
> >

--
Jeff Stuart
jstuart@neo.rr.com
Alexey Alexapolsky
Posted: 04/18/2001, 6:21 AM

Now I am not sure this LCID will influence your date output , after all ,
CodeCharge simply outputs strings , and no one tells it to format them, you
need
to apply appropriate function by yourself
Use Form properties/Events/Before show event like this :
(I suppose your field is name CurrentDate ) :

fldCurrentDate = FormatDateTime(Date, 1)



--
Regards,
Alexey
CodeCharge Support



Adam Marash <adam@interfax.co.il> wrote in message
news:9bjre2$gdu$1@mail.tankhill.com...
> Assigning a value to Session.LCID in Events|On Open (and in other places)
> has no effect at all on dates that are looked up from a database and
> displayed. Any thoughts?
>
>
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:9bjluk$65v$1@mail.tankhill.com...
> > 1) Staightforward way is to open "Header page" that is included by pages
> > of your web-app and add you code into Page properties/Events/Open event.
> > But it's an excessive way, since it will be set again on each page (you
> can
> > check if it's
> > set using IsEmpty() function , though)
>
>
>

Alexey Alexapolsky
Posted: 04/18/2001, 6:59 AM

All solutions above and below in the thread are striclty ASP related ,
Perl and PHP have different approaches to this , so I can't just translate
that code ,since it will be useless.
If you describe me what you need in particular, I will help.

--
Regards,
Alexey
CodeCharge Support


Jeffrey A. Stuart <jstuart@neo.rr.com> wrote in message
news:MPG.15473ff498b38295989694@news.codecharge.com...
> Can you translate that into either Perl or PHP please? Thx...
>
> In article <9bjluk$65v$1@mail.tankhill.com>,alexa@codecharge.com says...
> > 1) Staightforward way is to open "Header page" that is included by pages
> > of your web-app and add you code into Page properties/Events/Open event.
> > But it's an excessive way, since it will be set again on each page (you
can
> > check if it's
> > set using IsEmpty() function , though)
> >
> > 2) You can set it Login page/"Page properties"/Events/OnLogin event ,
> > but suince redefining the whole login event you will need to add a few
lines
> > more
> > code to complete other login functionality like below :
> >
> >
> > sLogin = GetParam("Login")
> > sPassword = GetParam("Password")
> > bPassed = CLng(DLookUp("employees", "count(*)", "login =" &
> > ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
> >
> > if bPassed > 0 then
> > ' Login and password passed
> > Session("UserID") = CLng(DLookUp("employees", "employee_id",
"login
> > =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
> >
> > Session("UserRights") = CLng(DLookUp("employees",
"security_level",
> > "login =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword,
> > "Text")))
> > sQueryString = GetParam("querystring")
> > sPage = GetParam("ret_page")
> > if not(sPage = request.serverVariables("SCRIPT_NAME")) and
> > not(isEmpty(sPage)) then
> > response.redirect(sPage & "?" & sQueryString)
> > end if
> >
> > response.redirect("Default.asp")
> > else
> > sLoginErr = "Login or Password is incorrect."
> > end if
> >
> > --
> > Regards,
> > Alexey
> > CodeCharge Support
> >
> >
> > Adam Marash <adam@interfax.co.il> wrote in message
> >news:9bhnf3$gal$1@mail.tankhill.com...
> > > Where in CC can I place a Session.LCID assignment? I tried manually
> > placing
> > > it in common.asp and in the actual page where I need the assignment,
but
> > > there's no proper response.
> > >
>
> --
> Jeff Stuart
>jstuart@neo.rr.com
>

Jeff Stuart
Posted: 04/18/2001, 9:09 AM

I'm sorry, I should have been more specific... can you translate the onlogin
event code into either perl or PHP?

"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:9bk6ke$6n1$1@mail.tankhill.com...
> All solutions above and below in the thread are striclty ASP related ,
> Perl and PHP have different approaches to this , so I can't just translate
> that code ,since it will be useless.
> If you describe me what you need in particular, I will help.
>
> --
> Regards,
> Alexey
> CodeCharge Support
>
>
> > >
> > > sLogin = GetParam("Login")
> > > sPassword = GetParam("Password")
> > > bPassed = CLng(DLookUp("employees", "count(*)", "login =" &
> > > ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
> > >
> > > if bPassed > 0 then
> > > ' Login and password passed
> > > Session("UserID") = CLng(DLookUp("employees", "employee_id",
> "login
> > > =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
> > >
> > > Session("UserRights") = CLng(DLookUp("employees",
> "security_level",
> > > "login =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword,
> > > "Text")))
> > > sQueryString = GetParam("querystring")
> > > sPage = GetParam("ret_page")
> > > if not(sPage = request.serverVariables("SCRIPT_NAME")) and
> > > not(isEmpty(sPage)) then
> > > response.redirect(sPage & "?" & sQueryString)
> > > end if
> > >
> > > response.redirect("Default.asp")
> > > else
> > > sLoginErr = "Login or Password is incorrect."
> > > end if
> > >

--
Jeff Stuart
jstuart@neo.rr.com


Alexey Alexapolsky
Posted: 04/19/2001, 2:22 AM

I made a little mistake - when you want to rewrite Login procedure you
should use
not OnLogin event , but "Custom Login" event (all code for login will be
changed with yours) ,
see code in the end of letter.
As a rule it's located in Login.php , in Login_action function in case
"login" section
of switch operator . Code below is extracted from there. Same way you can
get this code
from Perl script. OnLogin event doens't override but extends Login
functionality , code
for OnLogin is placed after code getting user's login and password , but
before
checking them and setting session variables.

--
Regards,
Alexey
CodeCharge Support


$sLogin = get_param("Login");
$sPassword = get_param("Password");
$db->query("SELECT member_id,member_level FROM members WHERE
member_login =" . tosql($sLogin, "Text") . " AND member_password=" .
tosql($sPassword, "Text"));

if($db->next_record())
{
// Login and password passed
set_session("UserID", $db->f("member_id"));
set_session("UserRights", $db->f("member_level"));
$sPage = get_param("ret_page");
if (strlen($sPage))
header("Location: " . $sPage);
else
header("Location: ShoppingCart.php");
}
else
{
$sLoginErr = "Login or Password is incorrect.";
}

$tpl->parse("FormLogin", false);







Jeff Stuart <jstuart-devel@neo.rr.com> wrote in message
news:9bke81$ljl$1@mail.tankhill.com...
> I'm sorry, I should have been more specific... can you translate the
onlogin
> event code into either perl or PHP?
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:9bk6ke$6n1$1@mail.tankhill.com...
> > All solutions above and below in the thread are striclty ASP related ,
> > Perl and PHP have different approaches to this , so I can't just
translate
> > that code ,since it will be useless.
> > If you describe me what you need in particular, I will help.
> >
> > --
> > Regards,
> > Alexey
> > CodeCharge Support
> >
> >
> > > >
> > > > sLogin = GetParam("Login")
> > > > sPassword = GetParam("Password")
> > > > bPassed = CLng(DLookUp("employees", "count(*)", "login =" &
> > > > ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword, "Text")))
> > > >
> > > > if bPassed > 0 then
> > > > ' Login and password passed
> > > > Session("UserID") = CLng(DLookUp("employees", "employee_id",
> > "login
> > > > =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword,
"Text")))
> > > >
> > > > Session("UserRights") = CLng(DLookUp("employees",
> > "security_level",
> > > > "login =" & ToSQL(sLogin, "Text") & " and pass=" & ToSQL(sPassword,
> > > > "Text")))
> > > > sQueryString = GetParam("querystring")
> > > > sPage = GetParam("ret_page")
> > > > if not(sPage = request.serverVariables("SCRIPT_NAME")) and
> > > > not(isEmpty(sPage)) then
> > > > response.redirect(sPage & "?" & sQueryString)
> > > > end if
> > > >
> > > > response.redirect("Default.asp")
> > > > else
> > > > sLoginErr = "Login or Password is incorrect."
> > > > end if
> > > >
>
> --
> Jeff Stuart
>jstuart@neo.rr.com
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.