create a user log in with dreamweaver CS4 with php mysql

Parse error: parse error in C:\wamp\www\login.php on li

Page 1 of 1

7 Replies - 30688 Views - Last Post: 26 January 2012 - 08:23 PM

#1 deschan   User is offline

  • New D.I.C Head

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

create a user log in with dreamweaver CS4 with php mysql

Post icon  Posted 14 June 2009 - 02:31 AM

Dear All,

what is my error? when i run test, show this > Parse error: parse error in C:\wamp\www\login.php on line 2

Following is my code for log in page:

Attached File  login.php (2.67K)
Number of downloads: 537
<?php
@@[email protected]@('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>



** Edit ** :code:

This post has been edited by no2pencil: 14 June 2009 - 03:28 AM


Is This A Good Question/Topic? 0
  • +

Replies To: create a user log in with dreamweaver CS4 with php mysql

#2 noorahmad   User is offline

  • Untitled
  • member icon

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

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 14 June 2009 - 02:50 AM

:code:

and change your this code @@[email protected]@('Connections/inserting.php');
to
include('Connections/inserting.php')
Was This Post Helpful? 0
  • +
  • -

#3 deschan   User is offline

  • New D.I.C Head

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

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 14 June 2009 - 03:17 AM

View Postnoorahmad, on 14 Jun, 2009 - 01:50 AM, said:

:code:

and change your this code @@[email protected]@('Connections/inserting.php');
to
include('Connections/inserting.php')



Dear Noor Ahmad,

Appreciate your advised, after i changed the code you provided me, run test than show anothers error :>Parse error: parse error in C:\wamp\www\login.php on line 5

thanks

Attached File(s)

  • Attached File  login.php (2.67K)
    Number of downloads: 170

Was This Post Helpful? 0
  • +
  • -

#4 ridersonthestorm   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-June 09

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 25 June 2009 - 09:19 PM

Is there a tutorial that goes along with Dreamweaver for creating user accounts (and adding more as more people are given limited access to enter/edit their data). Also a book that might give me a good start at what I'm trying to do. Any other free software that's out there that might also be helpful?

--thanks, Steve.
Was This Post Helpful? 0
  • +
  • -

#5 imacgeek   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-July 09

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 28 July 2009 - 03:20 PM

here it is
require_once("Connection/connection.php") or
include("Connection/connection.php")

There you go

Attached File(s)


This post has been edited by imacgeek: 28 July 2009 - 03:23 PM

Was This Post Helpful? 0
  • +
  • -

#6 John_ZK   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-January 12

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 24 January 2012 - 04:39 PM

View Postimacgeek, on 28 July 2009 - 03:20 PM, said:

here it is
require_once("Connection/connection.php") or
include("Connection/connection.php")

There you go


Hello:

I am a new user, so I hope I post this correctly.

I have the same problem as orginally posted in this chain of emails, that being - @@[email protected]@('Connections/inserting.php');

Changed the line, as suggested, to require_once('../Connections/cosmofarmer.php'); and the page to appear in my localhost. However, how I have the following error.


Notice: Undefined variable: HTTP_SERVER_VARS in C:\xampp\htdocs\CosmoFarmer\admin\TMPbpxzuybtkw.php on line 7.

Any help appreciated.

Thanks
John



Changed it to the suggested code -
Was This Post Helpful? 0
  • +
  • -

#7 John_ZK   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-January 12

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 24 January 2012 - 04:47 PM

View PostJohn_ZK, on 24 January 2012 - 04:39 PM, said:

View Postimacgeek, on 28 July 2009 - 03:20 PM, said:

here it is
require_once("Connection/connection.php") or
include("Connection/connection.php")

There you go


Hello:

I am a new user, so I hope I post this correctly.

I have the same problem as orginally posted in this chain of emails, that being - @@[email protected]@('Connections/inserting.php');

Changed the line, as suggested, to require_once('../Connections/cosmofarmer.php'); and the page to appear in my localhost. However, how I have the following error.


Notice: Undefined variable: HTTP_SERVER_VARS in C:\xampp\htdocs\CosmoFarmer\admin\TMPbpxzuybtkw.php on line 7.

Any help appreciated.

Thanks
John

<?php
require_once('../Connections/cosmofarmer.php');
?><?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['username'])) {
$FF_tmpUsername=$HTTP_POST_VARS['username'];
$FF_tmpPassword=$HTTP_POST_VARS['password'];
$FF_valUsername = (get_magic_quotes_gpc()) ? $FF_tmpUsername : addslashes($FF_tmpUsername);
$FF_valPassword = (get_magic_quotes_gpc()) ? $FF_tmpPassword : addslashes($FF_tmpPassword);
$FF_fldUserAuthorization="acess";
$FF_redirectLoginSuccess="admin.php";
$FF_redirectLoginFailed="denied.html";
$FF_rsUser_Source="SELECT userEmail, password ";
if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
$FF_rsUser_Source .= " FROM users WHERE userEmail='" . $FF_valUsername . "' AND password='" . $FF_valPassword . "'";
mysql_select_db($database_cosmofarmer, $cosmofarmer);
$FF_rsUser=mysql_query($FF_rsUser_Source, $cosmofarmer) 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;
$HTTP_SESSION_VARS['MM_Username'] = $MM_Username;
session_register("MM_Username");
if ($FF_fldUserAuthorization != "") {
$MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization];
} else {
$MM_UserAuthorization="";
}
$HTTP_SESSION_VARS['MM_UserAuthorization'] = $MM_UserAuthorization;
session_register("MM_UserAuthorization");
if (isset($HTTP_SESSION_VARS['priorUrl']) && true) {
$FF_redirectLoginSuccess = $HTTP_SESSION_VARS['priorUrl'];
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = false;
$HTTP_SESSION_VARS['FF_login_failed'] = $FF_login_failed;
header ("Location: $FF_redirectLoginSuccess");
exit;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = true;
$HTTP_SESSION_VARS['FF_login_failed'] = $FF_login_failed;
header ("Location: $FF_redirectLoginFailed");
exit;
}


Changed it to the suggested code -

Was This Post Helpful? 0
  • +
  • -

#8 John_ZK   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 24-January 12

Re: create a user log in with dreamweaver CS4 with php mysql

Posted 26 January 2012 - 08:23 PM

View PostJohn_ZK, on 24 January 2012 - 04:47 PM, said:

View PostJohn_ZK, on 24 January 2012 - 04:39 PM, said:

View Postimacgeek, on 28 July 2009 - 03:20 PM, said:

I changed the code to reflect include and now have another error on line 6 $FF...........

<?php
include('../Connections/CosomoFarmer.php');

// *** Start the session
if (!session_id()) session_start();
// *** Validate request to log in to this site.
$FF_LoginAction = $HTTP_SERVER_VARS['PHP_SELF'];


here it is
require_once("Connection/connection.php") or
include("Connection/connection.php")

There you go


Hello:

I am a new user, so I hope I post this correctly.

I have the same problem as orginally posted in this chain of emails, that being - @@[email protected]@('Connections/inserting.php');

Changed the line, as suggested, to require_once('../Connections/cosmofarmer.php'); and the page to appear in my localhost. However, how I have the following error.


Notice: Undefined variable: HTTP_SERVER_VARS in C:\xampp\htdocs\CosmoFarmer\admin\TMPbpxzuybtkw.php on line 7.

Any help appreciated.

Thanks
John

<?php
require_once('../Connections/cosmofarmer.php');
?><?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['username'])) {
$FF_tmpUsername=$HTTP_POST_VARS['username'];
$FF_tmpPassword=$HTTP_POST_VARS['password'];
$FF_valUsername = (get_magic_quotes_gpc()) ? $FF_tmpUsername : addslashes($FF_tmpUsername);
$FF_valPassword = (get_magic_quotes_gpc()) ? $FF_tmpPassword : addslashes($FF_tmpPassword);
$FF_fldUserAuthorization="acess";
$FF_redirectLoginSuccess="admin.php";
$FF_redirectLoginFailed="denied.html";
$FF_rsUser_Source="SELECT userEmail, password ";
if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
$FF_rsUser_Source .= " FROM users WHERE userEmail='" . $FF_valUsername . "' AND password='" . $FF_valPassword . "'";
mysql_select_db($database_cosmofarmer, $cosmofarmer);
$FF_rsUser=mysql_query($FF_rsUser_Source, $cosmofarmer) 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;
$HTTP_SESSION_VARS['MM_Username'] = $MM_Username;
session_register("MM_Username");
if ($FF_fldUserAuthorization != "") {
$MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization];
} else {
$MM_UserAuthorization="";
}
$HTTP_SESSION_VARS['MM_UserAuthorization'] = $MM_UserAuthorization;
session_register("MM_UserAuthorization");
if (isset($HTTP_SESSION_VARS['priorUrl']) && true) {
$FF_redirectLoginSuccess = $HTTP_SESSION_VARS['priorUrl'];
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = false;
$HTTP_SESSION_VARS['FF_login_failed'] = $FF_login_failed;
header ("Location: $FF_redirectLoginSuccess");
exit;
}
mysql_free_result($FF_rsUser);
session_register("FF_login_failed");
$FF_login_failed = true;
$HTTP_SESSION_VARS['FF_login_failed'] = $FF_login_failed;
header ("Location: $FF_redirectLoginFailed");
exit;
}


Changed it to the suggested code -

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1