Adobe Dreamweaver Forums



Last 10 THreads :         Final Resolution to the FW CS4 Install Problem (Last Post : jukkako - Replies : 2 - Views : 3 )           »          cfif (Last Post : Ian Skinner - Replies : 3 - Views : 4 )           »          Help posting folder to server (Last Post : Dawgswrestler - Replies : 2 - Views : 3 )           »          Problems producing W3C-valid template-built pages (Last Post : hen3ry - Replies : 0 - Views : 1 )           »          PHP Server lets Cookies work but not Sessions! (Last Post : Rickideeuk - Replies : 8 - Views : 9 )           »          Question about filtering commas (Last Post : Ian Skinner - Replies : 1 - Views : 2 )           »          Error: ModuleManager.as:671 (Last Post : Amy Blankenship - Replies : 10 - Views : 11 )           »          Flickering tooltip in bottom right corner (Last Post : Amy Blankenship - Replies : 5 - Views : 6 )           »          Visited Link appears as default (Last Post : Mark A. Boyd - Replies : 6 - Views : 7 )           »          Can't uninstall dreamweamweaver cs4 beta (Last Post : Mark A. Boyd - Replies : 7 - Views : 29 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags: , , , ,



Reply
  #1 (permalink)  
Old 04-13-2008, 02:51 AM
radhababu
 
Posts: n/a
Diggs:
Default Login php page not working in dw cs3

:sad;
Hi!

I am new to php. I created a login (php5.2.5) page using dreamweaver cs3 with
mysql database. I have added

the login user server behaviour. When I preview, the login page opens, i enter
the username and password, but

the username and password is not validated and page not redirected, remains as
it is. I get the following error

in the localhost.error.log:

PHP Warning: Cannot modify header information - headers already sent by
(output started at C:\\Program

Files\\Apache Software Foundation\\Apache2.2\\htdocs\\PHPCLI\\main.php:1) in
C:\\Program

Files\\Apache Software Foundation\\Apache2.2\\htdocs\\PHPCLI\\main.php on line
68, referer:

http://localhost/main.php

The page worked fine before adding login server behaviour.
Here is the code from main.php(created thru dw cs3). mysql database created
thru phpmyadmin.

<?php virtual('/Connections/js.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) :

mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) :

mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

mysql_select_db($database_js, $js);
$query_jsrecord = "SELECT * FROM matrimony";
$jsrecord = mysql_query($query_jsrecord, $js) or die(mysql_error());
$row_jsrecord = mysql_fetch_assoc($jsrecord);
$totalRows_jsrecord = mysql_num_rows($jsrecord);
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['profileid'])) {
$loginUsername=$_POST['profileid'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "/jsdirectory.php";
$MM_redirectLoginFailed = "/errorlogin.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_js, $js);

$LoginRS__query=sprintf("SELECT profileid, password FROM matrimony WHERE
profileid=%s AND

password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password,
"text"));

$LoginRS = mysql_query($LoginRS__query, $js) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!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>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
-->
</style></head>

<body>
<div id="main">
<div align="center">
<p>&nbsp;</p>
<form action="<?php echo $loginFormAction; ?>" method="POST"
name="jsloginform" id="jsloginform">
<table width="100" border="1">
<tr>
<td><label for="profileid">profile id</label>
<input type="text" name="profileid" id="profileid" /></td>
</tr>
<tr>
<td><label for="password">password</label>
<input type="password" name="password" id="password" /></td>
</tr>
<tr>
<td><label for="submit"></label>
<input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</table>
</form>
<p>&nbsp;</p>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($jsrecord);
?>


Kindly help...




Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-13-2008, 02:51 AM
David Powers
 
Posts: n/a
Diggs:
Default Re: Login php page not working in dw cs3

radhababu wrote:
> PHP Warning: Cannot modify header information - headers already sent by
> (output started at C:\\Program
>
> Files\\Apache Software Foundation\\Apache2.2\\htdocs\\PHPCLI\\main.php:1) in
> C:\\Program
>
> Files\\Apache Software Foundation\\Apache2.2\\htdocs\\PHPCLI\\main.php on line
> 68, referer:


"Headers already sent" is a common problem encountered by PHP beginners.
The DW Log In User server behavior uses the PHP header() function to
redirect the page after checking the username and password. There must
be no output to the browser before the call to header(). What confuses
beginners is that "output" includes even a single space or new line
character.

The error message suggests the problem is on line 68. Are you using echo
or anything like that? If so, that's the cause of your problem.

Another common cause is an extra line at the end of the connections
file. Open Connections/js.php, and make sure there are no extra lines
after the closing PHP tag. You can do this by looking at the line
numbers. Click as far down on the page as you can, and use backspace
until your cursor is directly to the right of the closing PHP tag.

One other possible cause is the use of links relative to the site root.
When you set that preference in your site definition, Dreamweaver uses
virtual() to include the connections file like this:

> <?php virtual('/Connections/js.php'); ?>


Try changing that to this:

<?php require_once('Connections/js.php'); ?>

Make sure the relative path to the file is correct.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Reply With Quote
  #3 (permalink)  
Old 04-13-2008, 02:51 AM
radhababu
 
Posts: n/a
Diggs:
Default Re: Login php page not working in dw cs3

It worked! Thanks a lot for the help. I have been breaking my head over this,
did not get a proper response from anyone.

The last option you had mentioned solved the problem. The problem was with
the preference I set in the site definition. When I changed to the document
option, virtual connection changed to require_once in the script and it worked!

Does this mean I have to work always with this setting?

Thanks once again!


Reply With Quote


  #4 (permalink)  
Old 04-13-2008, 02:51 AM
David Powers
 
Posts: n/a
Diggs:
Default Re: Login php page not working in dw cs3

radhababu wrote:
> Does this mean I have to work always with this setting?


I don't know. Using virtual() seems to cause problems for some people.
In theory, it shouldn't, as long as the server runs PHP as an Apache
module. However, require_once always works, so it's the preferred option.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Reply With Quote
  #5 (permalink)  
Old 06-24-2008, 06:40 PM
albert-ss
 
Posts: n/a
Diggs:
Default Re: Login php page not working in dw cs3

Hi
I have the same similar problem.
My site worked well on a server with Apache Fedora.
In local server with Windows Vista and IIS works well
Now I have moved on Windows 2003 and procedure of login is not working
There is created the MM_Username session.



<?php require_once('../Connections/cnnSardadesign.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" :
"NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['Username'])) {
$loginUsername=$_POST['Username'];
$password=$_POST['Password'];
$MM_fldUserAuthorization = "livello";
$MM_redirectLoginSuccess = "login_si2.php";
$MM_redirectLoginFailed = "login_no.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_cnnSardadesign, $cnnSardadesign);

$LoginRS__query=sprintf("SELECT Username, Password, livello FROM ******
WHERE Username=%s AND Password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password,
"text"));

$LoginRS = mysql_query($LoginRS__query, $cnnSardadesign) or
die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {

$loginStrGroup = mysql_result($LoginRS,0,'livello');

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>

Reply With Quote
  #6 (permalink)  
Old 07-01-2008, 01:33 PM
Jonbon999
 
Posts: n/a
Diggs:
Default Re: Login php page not working in dw cs3

Why did you delete lol
Reply With Quote


  #7 (permalink)  
Old 07-17-2008, 08:38 PM
gecyHevaamume gecyHevaamume is offline
Junior Member
 
Join Date: Jul 2008
Posts: 1
Diggs: 0
Default friendsofed cheap tablets

The best prices for pills. ativan online , 189
cheap levitra , 6257
tramadol cod , 72839
cheap soma 9442
tenuate dospan
Reply With Quote
  #8 (permalink)  
Old 07-28-2008, 02:15 PM
ArefUnrerma ArefUnrerma is offline
Junior Member
 
Join Date: Jul 2008
Posts: 1
Diggs: 0
Default the luxe invis pharms ku

comment6, <a href=http://forums.invisionpower.com/index.php?sho wuser=134192>buy adipex</a>, buy adipex, buy adipex cheap - Viewing Profile buy adipex, pjcad,<a href=http://forums.invisionpower.com/index.php?sho wuser=134193>buy amoxicillin</a>, buy amoxicillin, Buy amoxicillin online - Viewing Profile buy amoxicillin, fdicv,<a href=http://forums.invisionpower.com/index.php?sho wuser=134194>buy diazepam</a>, buy diazepam, buy cheap diazepam - Viewing Profile buy diazepam, mloek,<a href=http://forums.invisionpower.com/index.php?sho wuser=134195>buy klonopin</a>,
buy klonopin, Buy klonopin online - Viewing Profile buy klonopin, volzp,<a href=http://forums.invisionpower.com/index.php?sho wuser=134196>xanax without prescription</a>, xanax without prescription, Xanax w o prescription - Viewing Profile xanax without prescription, inuys
Reply With Quote
  #9 (permalink)  
Old 07-31-2008, 10:16 PM
Gaidofainee Gaidofainee is offline
Junior Member
 
Join Date: Jul 2008
Posts: 1
Diggs: 0
Default invis cheap pharm now irb

post99, <a href=http://forums.invisionpower.com/index.php?sho wuser=134427>buy sildenafil</a>, ), buy sildenafil, )), Buy sildenafil online - Viewing Profile buy sildenafil, qyfuy, <a href=http://forums.invisionpower.com/index.php?sho wuser=134430>viagra no prescription</a>, ), viagra no prescription, )), V i a g r a no prescr - Viewing Profile viagra no prescription, shmtf
Reply With Quote


  #10 (permalink)  
Old 08-02-2008, 04:13 PM
cymnbomma cymnbomma is offline
Junior Member
 
Join Date: Aug 2008
Posts: 1
Diggs: 0
Default invis medic now tan

comment09, <a href=http://forums.invisionpower.com/index.php?sho wuser=134506>buy viagra</a>, , cheap viagra, ;]]], Online Pharmacy - Viewing Profile buy viagra, anbeb
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 09:04 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk