RE: [PHP] PhP and Java login trouble (can someone help a brother out whom is truely trying to understand?)

2007-05-11 Thread Brad Sumrall
I have these to independently working scripts. 1 is php, the other is
javascript. For obvious reason, to separate logins are not appropriate.
It has been recommended to make a separate function, not sure how to do
this
Common sense says, carry the variable from php to javascripting. I am
clueless on where to look on this common sense solution.

I am 2.5 weeks into this madness. I know when I find the solution, it will
be the one that was biting me on the nose.

I want to learn and understand this, but desperately need help from friends!

I will post the 2 complete code pages below..

Input, suggestion or solutions would truly be appreciated.

The first will be the original code that is javascripting friendly.
The second will be my own php working code.

Number one works fine for loging into a FCKEditor application, but is
failing with phpbb.

Number two works perfectly with phpbb applications and outside php pages
requiring phpbb related session controls, but fails sessions with the
javascripting based FCKEditor.

Sincerely,

Brad

#1  Working php/phpbb code:

?php
if(!isset($_SESSION[userid]))
{
?
form action=/phpbb/login.php method=post target=_top
table width=200 cellpadding=4 cellspacing=1 border=0
class=forumline align=center
tr
th background=images/login_top2.jpg height=30
class=thHead nowrap=nowrap/th
/tr
tr
td class=row1table border=0 cellpadding=3
cellspacing=1 width=100%
tr
td width=11% align=rightdiv
align=leftspan class=genUsername:/span/div/td
/tr
tr
td align=rightinput type=text class=post
name=username size=25 maxlength=40 value= //td
/tr
tr
td align=rightdiv align=leftspan
class=genPassword/span/div/td
/tr
tr
td align=rightspan class=gen
input type=password class=post name=password size=25 maxlength=32
/
:/span/td
/tr
tr align=center
td colspan=2span class=genLog me on
automatically: 
input type=checkbox name=autologin //span/td
/tr
tr align=center
td colspan=2input type=hidden name=redirect
value= /input type=submit name=login class=mainoption value=Log
in //td
/tr
tr align=center
td colspan=2span class=gensmalla
href=forgot_password.php class=gensmallI forgot my
password/a/span/td
/tr
/table
/td
/tr
?php
}else{
?
tr
  td width=207 height=32 background=images/login_top2.jpg
class=headerlogout align=center
table width=100%
tr
td width=30 height=27/td
td align=lefta href=javascript:logout()
class=link1Log out/a/td
/tr
/table
/td
/tr
tr
td align=center class=logincenterbg
table width=88% border=0 cellspacing=0 cellpadding=0
tr
td height=10 align=left class=bluetext/td
/tr
tr
td align=left class=link2Welcome : ?php echo
$_SESSION[userid] ?/td
/tr
tr
td height=22 align=left class=bluetext/td
/tr
 tr
td height=20 align=lefta class=link1
href=editaccount.phpManage Account/a/td
/tr
tr
td height=20 align=lefta class=link1
href=editprofile.phpManage Profile/a/td
/tr
/table
/td
/tr
tr
td align=left valign=topimg
src=images/login_bottom.jpg width=200 height=8 alt= //td
/tr   
/table
/form
?php
}
? 
/table/td
/tr
tr
td height=5/td
/tr
tr
td align=center valign=toptable width=211
border=0 cellspacing=0 cellpadding=0
tr
tdimg src=images/contest_top.jpg width=211 height=36
alt= //td
/tr
tr
tda href=contest.phpimg src=images/contest_middle.jpg
width=211 height=169 border=0 alt= //a/td
/tr
/table/td
/tr
tr
td height=5/td
/tr
  tr
td align=center valign=toptable width=211
border=0 cellspacing=0 cellpadding=0
  tr
tdimg src=images/review_head.jpg width=211 height=36
alt= //td
  /tr
  tr
td height=89 align=center class=reviewbgtable
width=85% border=0 

Re: [PHP] PhP and Java login trouble

2007-05-09 Thread Lester Caine

Brad Sumrall wrote:

I have been hunting all around that website you referred me too looking for
javascripting information and can find nothing. I know a little bit of php
but little to nothing about javascripting.

I have been beating my head against the wall on this one for weeks now, I am
so close!
Not sure what link Chris gave you, but it looks like you are 'borrowing' code 
without understanding how it works. Never a good idea


http://www.webreference.com/programming/javascript/diaries/1/ is worth a read 
but I could not find a quick - validate form - example at short notice.
Actually http://www.webdevelopersjournal.com/articles/jscript_forms1.html just 
popped up

Just google for 'javascript validate form'


Firstly always CC the list - others can provide help and suggestions too.
Brad - You have to remember that 'reply' on some email lists will only give 
you the sender - not the list ;) Yep it's a pain when every other list works 
differently - but that is another pointless discussion :(

Bottom posting helps as well - this bit should be first.

--
Lester Caine - G8HFL
-
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PhP and Java login trouble

2007-05-09 Thread Brad Sumrall
I have been hunting all around that website you referred me too looking for
javascripting information and can find nothing. I know a little bit of php
but little to nothing about javascripting.

I have been beating my head against the wall on this one for weeks now, I am
so close!

Brad

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 08, 2007 10:58 PM
To: Brad Sumrall
Cc: 'php-general@lists.php.net'
Subject: Re: [PHP] PhP and Java login trouble

Firstly always CC the list - others can provide help and suggestions too.

Brad Sumrall wrote:
 Any chance you can tell me what I am doing wrong?
 
 Brad
 
 
 ?php
   if(!isset($_SESSION[userid]))
   {
 ?
 form action=/phpbb/login.php method=post target=_top 
 onsubmit=return BBValidateLogin();

You don't have a javascript function called 'BBValidateLogin'.


You have one called validateLogin which references completely different 
form fields.

-- 
Postgresql  php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PhP and Java login trouble

2007-05-09 Thread Chris

Brad Sumrall wrote:

I have been hunting all around that website you referred me too looking for
javascripting information and can find nothing. I know a little bit of php
but little to nothing about javascripting.


Eh? I never sent you to a website.

See this code:

function validatelogin()
{
if(document.frmlogin.txtusername.value==)
{
alert(Please Enter Username.);
document.frmlogin.txtusername.focus();
return false;
}
if(document.frmlogin.txtpwd.value==)
{
alert(Please Enter Password.);
document.frmlogin.txtpwd.focus();
return false;
}
document.frmlogin.login.value=Success;
document.frmlogin.action=operation.php?mode=login;
return true;
}


You need to create a *similar* function (eg 'BBValidateLogin()') to 
check different html field names.



For example:

function BBValidateLogin()
{
  var f = document.forms[0];
  alert('username is ' + f.username.value);
}

The username.value comes from this:

input type=text class=post
name=username size=25 maxlength=40 value= /

where you have name=username

So take the name=... and put a .value on the end.

Rinse, repeat until you have checked all of the fields you need to.

Return true for the form to submit.

Return false for it to NOT submit.

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PhP and Java login trouble

2007-05-09 Thread itoctopus
I agree with Chris, if you can do it this way, then it's much better. 
Working with FCKEditor's code was not one of the easiest things I did in my 
life.

-- 
itoctopus - http://www.itoctopus.com
Chris [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Brad Sumrall wrote:
 I am trying to create a commonlogin.php which would perform a duel login 
 for
 phpbb and a java based FCKEditor combined

 I have working code for each as an individual but not a clue how to 
 combine
 them.

  Does anyone have any suggestion on where I can go for information about
 this?

 Firstly that's javaSCRIPT not java. Java is an entirely different beast.


 Why not just copy the validateLogin javascript functionality and put it 
 in a new function and then:

 form action=/phpbb/login.php method=post target=_top 
 onsubmit=return BBValidateLogin();

 -- 
 Postgresql  php tutorials
 http://www.designmagick.com/ 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PhP and Java login trouble

2007-05-09 Thread Brad Sumrall
I have a question about your suggestion.
Would it not be easier to simply carry the sessionid from the php session
validation to the javascript?
Instead of: if(document.frmlogin.txtusername.value==)
{
alert(Please Enter Username.);
document.frmlogin.txtusername.focus();
return false;

Why would I want to re-enter the user name?
My common sense which maybe completely wrong say, YOU ARE VALIDATED IN
PHPBB via issetid, now post to (document.frmlogin.userid.value==)

This is why I am not catching your angle.

PhP makes so much more sense. This javascript integration is really giving
me a headache!

Suggestions?

Brad




-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 09, 2007 2:16 AM
To: Brad Sumrall
Cc: php-general@lists.php.net
Subject: Re: [PHP] PhP and Java login trouble

Brad Sumrall wrote:
 I have been hunting all around that website you referred me too looking
for
 javascripting information and can find nothing. I know a little bit of php
 but little to nothing about javascripting.

Eh? I never sent you to a website.

See this code:

function validatelogin()
{
if(document.frmlogin.txtusername.value==)
{
alert(Please Enter Username.);
document.frmlogin.txtusername.focus();
return false;
}
if(document.frmlogin.txtpwd.value==)
{
alert(Please Enter Password.);
document.frmlogin.txtpwd.focus();
return false;
}
document.frmlogin.login.value=Success;
document.frmlogin.action=operation.php?mode=login;
return true;
}


You need to create a *similar* function (eg 'BBValidateLogin()') to 
check different html field names.


For example:

function BBValidateLogin()
{
   var f = document.forms[0];
   alert('username is ' + f.username.value);
}

The username.value comes from this:

input type=text class=post
name=username size=25 maxlength=40 value= /

where you have name=username

So take the name=... and put a .value on the end.

Rinse, repeat until you have checked all of the fields you need to.

Return true for the form to submit.

Return false for it to NOT submit.

-- 
Postgresql  php tutorials
http://www.designmagick.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PhP and Java login trouble

2007-05-08 Thread Chris

Brad Sumrall wrote:

I am trying to create a commonlogin.php which would perform a duel login for
phpbb and a java based FCKEditor combined

I have working code for each as an individual but not a clue how to combine
them.

 


Does anyone have any suggestion on where I can go for information about
this?


Firstly that's javaSCRIPT not java. Java is an entirely different beast.


Why not just copy the validateLogin javascript functionality and put 
it in a new function and then:


form action=/phpbb/login.php method=post target=_top 
onsubmit=return BBValidateLogin();


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PhP and Java login trouble

2007-05-08 Thread Chris

Firstly always CC the list - others can provide help and suggestions too.

Brad Sumrall wrote:

Any chance you can tell me what I am doing wrong?

Brad


?php
if(!isset($_SESSION[userid]))
{
?
form action=/phpbb/login.php method=post target=_top 
onsubmit=return BBValidateLogin();


You don't have a javascript function called 'BBValidateLogin'.


You have one called validateLogin which references completely different 
form fields.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php