user log in page (urgently)

using dreamweaver + mysql

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 1851 Views - Last Post: 16 June 2009 - 07:26 AM Rate Topic: -----

#1 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

user log in page (urgently)

Post icon  Posted 14 June 2009 - 05:02 AM

Dear All,

There is Parse error: parse error in C:\wamp\www\login.php on line 5, which i highlight in orange colour.

This is my members login page, appreciate anybody who can help me.

thanks


<?php
include('Connections/inserting.php')

// *** Start the session
if (!session_id()) session_start();
// *** Validate request to log in to this site.
$FF_LoginAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!="") $FF_LoginAction .= "?".htmlentities($HTTP_SERVER_VARS['QUERY_STRING']);
if (isset($HTTP_POST_VARS['textfield'])) {
$FF_valUsername=$HTTP_POST_VARS['textfield'];
$FF_valPassword=$HTTP_POST_VARS['textfield2'];
$FF_fldUserAuthorization="";
$FF_redirectLoginSuccess="welcome.html";
$FF_redirectLoginFailed="noway.html";
$FF_rsUser_Source="SELECT username, password ";
if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
$FF_rsUser_Source .= " FROM members WHERE username='" . $FF_valUsername . "' AND password='" . $FF_valPassword . "'";
mysql_select_db($database_inserting, $inserting);
$FF_rsUser=mysql_query($FF_rsUser_Source, $inserting) or die(mysql_error());
$row_FF_rsUser = mysql_fetch_assoc($FF_rsUser);
if(mysql_num_rows($FF_rsUser) > 0) {
// username and password match - this is a valid user
$MM_Username=$FF_valUsername;
session_register("MM_Username");
if ($FF_fldUserAuthorization != "") {
$MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization];
} else {
$MM_UserAuthorization="";
}
session_register("MM_UserAuthorization");
if (isset($accessdenied) && false) {
$FF_redirectLoginSuccess = $accessdenied;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = false;
header ("Location: $FF_redirectLoginSuccess");
exit;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = true;
header ("Location: $FF_redirectLoginFailed");
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body><form action="<?php echo $FF_LoginAction?>" METHOD="POST" name="logthemin" id="logthemin">

<table width="250" border="1" cellspacing="4" cellpadding="4">
<tr>
<td width="90">Username:</td>
<td width="126"><label>
<input type="text" name="textfield" />
</label></td>
</tr>
<tr>
<td>Password:</td>
<td><label>
<input type="text" name="textfield2" />
</label></td>
</tr>
<tr>
<td colspan="2"><label>
<input type="submit" name="Submit" value="Login" />
</label></td>
</tr>
</table>

</form>

</body>
</html>


Dear All,
ps note: Parse error: parse error in C:\wamp\www\login.php on line 5

This is my members login page.

thanks

This post has been edited by deschan: 14 June 2009 - 09:02 AM


Is This A Good Question/Topic? 0
  • +

Replies To: user log in page (urgently)

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: user log in page (urgently)

Posted 14 June 2009 - 05:36 AM

Posted Image

You missed a ; from your first line:
include('Connections/inserting.php')

This post has been edited by MageUK: 14 June 2009 - 05:36 AM

Was This Post Helpful? 0
  • +
  • -

#3 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 14 June 2009 - 05:49 AM

View PostMageUK, on 14 Jun, 2009 - 04:36 AM, said:

Posted Image

You missed a ; from your first line:
include('Connections/inserting.php')



DearMagaUK,

After i added ; there are anothers error

Notice: Undefined variable: HTTP_SERVER_VARS in C:\wamp\www\login.php on line 7

how i slove it?

thanks,
desmond
Was This Post Helpful? 0
  • +
  • -

#4 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: user log in page (urgently)

Posted 14 June 2009 - 05:58 AM

HTTP_SERVER_VARS has been deprecated for several years, use $_SERVER instead.
Was This Post Helpful? 0
  • +
  • -

#5 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 14 June 2009 - 06:16 AM

View PostMageUK, on 14 Jun, 2009 - 04:58 AM, said:

HTTP_SERVER_VARS has been deprecated for several years, use $_SERVER instead.



Dear Sir,

after i changed to $_SERVER , it look ok...

than i key in user name and password, than click login. the page not jump to welcome.html and remain login.php

what is the problem i made, appreciate your help.

thanks
desmond
Was This Post Helpful? 0
  • +
  • -

#6 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: user log in page (urgently)

Posted 14 June 2009 - 06:23 AM

Well I just read through all your code... I'd change this:
if (!session_id()) session_start();

to
session_start();


Secondly I'd also change all
$HTTP_POST_VARS

to
$_POST


I'm not sure it will solve your problem, but it will definitely make your code alot more readable.
Was This Post Helpful? 1
  • +
  • -

#7 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 14 June 2009 - 06:53 AM

View PostMageUK, on 14 Jun, 2009 - 05:23 AM, said:

Well I just read through all your code... I'd change this:
if (!session_id()) session_start();

to
session_start();


Secondly I'd also change all
$HTTP_POST_VARS

to
$_POST


I'm not sure it will solve your problem, but it will definitely make your code alot more readable.



Dear Sir,

after i changed 2 code u given me, it look better but still cannot.

There are 2 sistuation:-

1. if i key in correct username and password, the page will jump to this page> The requested URL /noway.html was not found on this server.


2. if i key in uncorrect username and password, the page will will also jump to this page >The requested URL /noway.html was not found on this server.


The username and password i double checked was correct, and the noway.html is exist under same directory with login.php

I checked mysql database there is a members record found of all data inserting from register02.php

would appreciate your help

thanks,
desmond

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#8 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 15 June 2009 - 07:29 AM

View Postdeschan, on 14 Jun, 2009 - 05:53 AM, said:

View PostMageUK, on 14 Jun, 2009 - 05:23 AM, said:

Well I just read through all your code... I'd change this:
if (!session_id()) session_start();

to
session_start();


Secondly I'd also change all
$HTTP_POST_VARS

to
$_POST


I'm not sure it will solve your problem, but it will definitely make your code alot more readable.



Dear Sir,

after i changed 2 code u given me, it look better but still cannot.

There are 2 sistuation:-

1. if i key in correct username and password, the page will jump to this page> The requested URL /noway.html was not found on this server.


2. if i key in uncorrect username and password, the page will will also jump to this page >The requested URL /noway.html was not found on this server.


The username and password i double checked was correct, and the noway.html is exist under same directory with login.php

I checked mysql database there is a members record found of all data inserting from register02.php

would appreciate your help

thanks,
desmond


Dear All,

Finally i found if i key in correct password and user name the oage will go to welcome.html, but the IE will show The requested URL /welcome.html was not found on this server. & the address was http://localhost/welcome.html

If i key i wrong username and password, the IE will show The requested URL /noway.html was not found on this server. & the address was http://localhost/noway.html

I think the coding are correct just the server cannot link to welcome.html or noway.html.

Any body know How I slove this?

thanks,
desmond
Was This Post Helpful? 0
  • +
  • -

#9 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: user log in page (urgently)

Posted 15 June 2009 - 10:31 PM

this is no welcome page in your directory or you are redirecting your page to a wrong path i mean ma bey your welcome.html page is in a directory,
try to collect your all pages in one directory such us www/mywebsite/
or http://localhost/mywebsite/
Was This Post Helpful? 1
  • +
  • -

#10 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 16 June 2009 - 05:02 AM

View Postnoorahmad, on 15 Jun, 2009 - 09:31 PM, said:

this is no welcome page in your directory or you are redirecting your page to a wrong path i mean ma bey your welcome.html page is in a directory,
try to collect your all pages in one directory such us www/mywebsite/
or http://localhost/mywebsite/


Dear Noor,

Currently now i face a new error.

1) my login page if run test itself, it was successful. And register page was also run tested successful.

2) If i create a link in between index.html to my login.php, the problem appear. On my index.html there is a hyper link ( <area shape="rect" coords="576,50,642,63" href="../../Documents/Unnamed Site 5/login.php" target="_parent" /> ) for members click and login.

Below i upload errorlogin.html, is totally what going to happened regard the error after member click login hyperlink.

For more details explaination: after members click login.php (hyperlink) in my index.html, will go to login.php and apprear this code 0) { // username and password match - this is a valid user $MM_Username=$FF_valUsername; session_register("MM_Username"); if ($FF_fldUserAuthorization != "") { $MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization]; } else { $MM_UserAuthorization=""; } session_register("MM_UserAuthorization"); if (isset($accessdenied) && false) { $FF_redirectLoginSuccess = $accessdenied; } mysql_free_result($FF_rsUser); session_register("FF_login_failed"); $FF_login_failed = false; header ("Location: $FF_redirectLoginSuccess"); exit; } mysql_free_result($FF_rsUser); session_register("FF_login_failed"); $FF_login_failed = true; header ("Location: $FF_redirectLoginFailed"); exit; } ?>

after this code is the login box, if i key in user name and password, if cannot log in. Like nothing.

3) However, register.php was link successful in index.html. Members can click register hyperlink and jump to register.php page for key in details and register. And what members key in, it go to mysql.


Attachment login.php (original page)


any one can help me on this?

thanks,
desmond

Attached File(s)


This post has been edited by deschan: 16 June 2009 - 05:04 AM

Was This Post Helpful? 0
  • +
  • -

#11 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: user log in page (urgently)

Posted 16 June 2009 - 05:12 AM

save your errorlogin.html file to errorlogin.php file and also change then link name in index.file, php script is not running in html file it must be php file.
Was This Post Helpful? 0
  • +
  • -

#12 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 16 June 2009 - 05:19 AM

View Postnoorahmad, on 16 Jun, 2009 - 04:12 AM, said:

save your errorlogin.html file to errorlogin.php file and also change then link name in index.file, php script is not running in html file it must be php file.


The errorlogin.htm is not the original file, sorry, forget the errorlogin, it confused you.

The login.php is original file, and there is a hyper link in index.html for login.php.

after i click the login.php hyperlink thn will go to the login.php page with the error code which i highlight above in colour, aftet the error code, is login box. But the login box was not working properly.

u mean change my index.html to index.php? but i try it also not run. how come?

thanks
Was This Post Helpful? 0
  • +
  • -

#13 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: user log in page (urgently)

Posted 16 June 2009 - 06:03 AM

It seems PHP has stopped responding on your server, can you create a page consisting of simply:
<?php
phpinfo();
?>


Save it as a .php file and see what output you get when you visit it.
Was This Post Helpful? 0
  • +
  • -

#14 deschan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-June 09

Re: user log in page (urgently)

Posted 16 June 2009 - 06:48 AM

View PostMageUK, on 16 Jun, 2009 - 05:03 AM, said:

It seems PHP has stopped responding on your server, can you create a page consisting of simply:
<?php
phpinfo();
?>


Save it as a .php file and see what output you get when you visit it.



Dear MageUK,

Attachment is the output, pls help advise.

thanks,
desmond

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#15 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1003
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: user log in page (urgently)

Posted 16 June 2009 - 06:52 AM

Okay so PHP is working, does register.php work?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2