Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
go to your php.ini file and change "display_errors = Off"

to

"display_errors = On"

if you are using mamp then the php.ini file is in MAMP/conf/

there is a big chance that there are some errors in your code but i believe mamp turns display_errors = off by default, which is really where it should be online, but since this is just for testing. leave it on locally. if display_errors is set to off then you will just get a blank screen... no fun.
 
This is the error i get:

Parse error: syntax error, unexpected '<' in /Applications/MAMP/htdocs/login.php on line 67

And here are lines 66-72:

$_POST['passwd'] = stripslashes($_POST['passwd']);
$info['password'] = stripslashes($info['password']);</body>
$_POST['passwd'] = md5($_POST['passwd']);

if ($_POST['passwd'] != $info['password']) {
die('Incorrect password, please try again.');
}

Im still non the wiser.
 
This is the error i get:

Parse error: syntax error, unexpected '<' in /Applications/MAMP/htdocs/login.php on line 67

And here are lines 66-72:

$_POST['passwd'] = stripslashes($_POST['passwd']);
$info['password'] = stripslashes($info['password']);</body>
$_POST['passwd'] = md5($_POST['passwd']);

if ($_POST['passwd'] != $info['password']) {
die('Incorrect password, please try again.');
}

I'm still none the wiser.

It's that </body> that is messing you up. Delete it.
 
ok this is what i have now
the error

Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/db_connect.php on line 5

Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/db_connect.php on line 5

the code(lines 1-12)
<?php

// database connect script.

require 'db_connect.php';

if($logged_in == 1) {
die('You are already logged in, '.$_SESSION['username'].'.');

}

?>

does anybody know of a better tutorial, this one seems to be causing lots of problems.
 
Is DB.php in the same folder as db_connect.php? With your current include path settings that is the way it would need to be.
 
just make a new db.php then, its just a file with your database connection info. if its a mysql database itll be something like this:

PHP:
<?php // db.php

$dbhost = 'localhost';
$dbuser = 'user';
$dbpass = 'password';

function dbConnect($db='mysite') {
    global $dbhost, $dbuser, $dbpass;
    
    $dbcnx = @mysql_connect($dbhost, $dbuser, $dbpass)
        or die('The site database appears to be down.');

    if ($db!='' and !@mysql_select_db($db))
        die('The site database is unavailable.');
    
    return $dbcnx;
}
?>
 
Ok this is the error i am getting now

Fatal error: Class 'DB' not found in /Applications/MAMP/htdocs/db_connect.php on line 19

This is the code i have in the db_connect.php


<?php

//require the PEAR::DB classes.

require_once 'db.php';

$db_engine = 'mysql';
$db_user = 'root';
$db_pass = 'root';
$db_host = 'localhost';
$db_name = 'sunflower';

$datasource = $db_engine.'://'.
$db_user.':'.
$db_pass.'@'.
$db_host.'/'.
$db_name;

$db_object = DB::connect($datasource, TRUE);

/* assign database object in $db_object,

if the connection fails $db_object will contain

the error message. */

// If $db_object contains an error:

// error and exit.

if(DB::isError($db_object)) {
die($db_object->getMessage());
}

$db_object->setFetchMode(DB_FETCHMODE_ASSOC);

// we write this later on, ignore for now.

include('check_login.php');

?>

sorry for all the problems this is causing, i am learning from it though so the help is appreciated
 
Check if you have the DB file, it'll be located at /Applications/MAMP/bin/php5/lib/php/PEAR/DB.php

My Mamp install doesn't have it. I've noticed Mamp is missing some of the PEAR library files. I've located some of them from a XAMP install.
 
moved the dp.php file to that location and its still coming up with the same error.arggggh
 
Hi everyone,
This is the error i am getting at the moment.

Warning: include(functions.php) [function.include]: failed to open stream: No such file or directory in /Applications/MAMP/htdocs/login.php on line 3

Warning: include() [function.include]: Failed opening 'functions.php' for inclusion (include_path='.:/Applications/MAMP/bin/php5/lib/php') in /Applications/MAMP/htdocs/login.php on line 3

i presume MAMP is missing files. anyone know where to get the missing files such as functions.php etc or am i totally missing the point.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.