Jump to content

Recommended Posts

Hi i am kinda stuck on this part so im realy counting on you guys.. this is my db code and im wondering what else i need to change because my website is keep saying

 

Parse error: syntax error, unexpected '>' in /home/ultimate/public_html/members.php on line 11

 

this is the dbconfig.php code:

 

<?

// Replace the variable values below

// with your specific database information.

$host = "localhost";                                      // Ive filled out this properly

$user = "UserName";                                    // Ive filled out this properly

$pass = "Password";                                    // Ive filled out this properly

$db  = "dbName";                                        // Ive filled out this properly

 

// This part sets up the connection to the

// database (so you don't need to reopen the connection

// again on the same page).

$ms = mysql_pconnect($host, $user, $pass);

if ( !$ms )

{

echo "Error connecting to database.\n";

}

 

// Then you need to make sure the database you want

// is selected.

mysql_select_db($db);               

?>

what else do i have to replace in the script? please help.

 

 

 

This is the full script please look! http://www.trap17.com/index.php/php-simple-login-tutorial_t7887.html

Link to comment
https://forums.phpfreaks.com/topic/104100-solved-help-me-please/
Share on other sites

Try this way for a config file >

 

 

<?php 
$AddressBook_HOST="localhost";
$AddressBook_Username="********";
$AddressBook_Password="********";
$AddressBook_DatabaseName="*********";

if($AddressBook_Username=="[username]"){
die('Please Specify the Username');
}
if($AddressBook_Password=="[pw]"){
die('Please Specify the Password');
}
if($AddressBook_DatabaseName=="[database]"){
die('Please Specify the Database');
}

?>

No, this is just the meassage you would see if it wont work, enabling you to tell where the problem is .

 

Hope what i have shown helps as the code you pasted was only your config file, Looking at your error it may also be a problem in your members.php file. If you dont get any luck changing the config file paste your Members.php in an i will take a look also.

Do i have to put ym databse name where it says

 

Please Specify the Database? please let me know

yes, so you mean you were doing all this without connecting to your db? strange that it did not give some other expected errors! :o

You have to connect to YOUR database using the db name, username , pass etc!

Ady This is the member.php i have not made any modifications to this file.

 

<?php

session_start();

 

if (!$_SESSION["valid_user"])

{

// User not logged in, redirect to login page

Header("Location: login.php");

}

 

// Member only content

// ...

// ...

// ...

 

// Display Member information

echo "<p>User ID: " . $_SESSION["valid_id"];

echo "<p>Username: " . $_SESSION["valid_user"];

echo "<p>Logged in: " . date("m/d/Y", $_SESSION["valid_time"]);

 

// Display logout link

echo "<p><a href=\"logout.php\">Click here to logout!</a></p>";

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.