Robert Elsdon Posted May 4, 2008 Share Posted May 4, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/ Share on other sites More sharing options...
ady01 Posted May 4, 2008 Share Posted May 4, 2008 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'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532929 Share on other sites More sharing options...
ady01 Posted May 4, 2008 Share Posted May 4, 2008 Sorry, just copies the above from one of my web site config files and did not mentiong you will need to change the bits that say 'AddressBook' to the name of your table. Appologies for confusing you. Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532932 Share on other sites More sharing options...
Robert Elsdon Posted May 4, 2008 Author Share Posted May 4, 2008 Ive been doing PHP a while now so i kinda knew! wish me luck! Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532935 Share on other sites More sharing options...
Robert Elsdon Posted May 4, 2008 Author Share Posted May 4, 2008 Do i have to put ym databse name where it says Please Specify the Database? please let me know Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532940 Share on other sites More sharing options...
Rohan Shenoy Posted May 4, 2008 Share Posted May 4, 2008 The error in in members.php file and you have posted the dbconfig.php file. Please post the members.php file if you have modifed it. Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532942 Share on other sites More sharing options...
ady01 Posted May 4, 2008 Share Posted May 4, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532944 Share on other sites More sharing options...
Rohan Shenoy Posted May 4, 2008 Share Posted May 4, 2008 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! You have to connect to YOUR database using the db name, username , pass etc! Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532945 Share on other sites More sharing options...
Robert Elsdon Posted May 4, 2008 Author Share Posted May 4, 2008 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532946 Share on other sites More sharing options...
rarebit Posted May 4, 2008 Share Posted May 4, 2008 me thinks line 11 is in this section? // Member only content // ... // ... // ... Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532954 Share on other sites More sharing options...
ady01 Posted May 4, 2008 Share Posted May 4, 2008 Think your right, that bit isnt looking correct to me, Can you confirm if // ... would be your line 11 ? Quote Link to comment https://forums.phpfreaks.com/topic/104100-solved-help-me-please/#findComment-532958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.