By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,347 Members | 1,389 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,347 IT Pros & Developers. It's quick & easy.

pls help convert

P: n/a


<!-- Begin
function Login(){
var done=0;
var username=document.login.username.value;
var password=document.login.password.value;
if (username=="edna" && password=="guytoi")
{window.location="viewfood.html"; done==1; }
if (username=="tony" && password=="food") {
window.location="editfood.html"; done=1; }
if (username=="arlene" && password=="manitoulin") {
window.location="viewfood.html"; done=1; }
if (done==0) { window.location="failed.html"; }
// End -->
Pls tell me how or if i need to convert the above to php. Eventually i
would like to open a file with the usernames/passwords--put data in an
array(s) then valadate them but thats down the road.


Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Tom Thackrey" <to***> wrote in news:CtU2b.6725

I didn't run this, but it should be pretty close:
$username = strtolower($_POST['username']);
$password = strtolower($_POST['password']);
if ($username == 'edna' && $password=='guytoi')
header('location: viewfood.html');
else if ($username == 'tony' && $password=='food')
header('location: editfood.html');
else if ($username == 'arlene' && $password=='manitoulin')
header('location: viewfood.html');
header('location: failed.html');


Thanks and yes I know that php runs on the server side & javascript runs
on the client side. I have seen posts on php & javascript and I wasnt
sure about if you could mix the 2 or a total convert was best.

Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.