Get support from Xavier Media
It is currently Sun Dec 08, 2013 2:34 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Database set up
PostPosted: Sun Oct 02, 2005 10:40 pm 

Points:
Sorry, but I'm not understanding what is necessary to set up the DB for this program. I'm following the readme.html instructions, but it's not at all clear as to what has to be set up via MySQL to get this Cookie protection script to work. Do I need to set up tables that your script is expecting?

Here's where I am WITHOUT a database set up... (Note that I am using "username"as the substitute for the REAL username.)

Warning: mysql_connect(): Access denied for user: 'username_distrib@localhost' (Using password: YES) in /home2/username/public_html/distributors/settings.php on line 72

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home2/username/public_html/distributors/settings.php on line 73

Step 3 of 4
Fatal error: Call to undefined function: mysql_create_db() in /home2/username/public_html/distributors/codelock.php(3) : eval()'d code(1) : eval()'d code on line 56


Here's where I am WITH a database set up....

Fatal error: Call to undefined function: mysql_create_db() in /home2/username/public_html/distributors/codelock.php(3) : eval()'d code(1) : eval()'d code on line 56


Does this script create a database or not? I think not. This needs to be clarified. Please advise what is required.

Thanks for your assistance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 03, 2005 5:09 am 

Points:
Got the script installed... Forget the database issue.

Now...... (and this also happened when I viewed the demo on the Xavier.com site).... After I login to admin, no matter which link I click, I get kicked back to the login screen. Have I missed something?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 03, 2005 2:29 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
Make sure you set these two variables to the correct values:
Code:
// Set this to the directory used by the cookie
$CookiePath = "/";

// Set this to the cookie domain
$CookieDomain = ".sampleaddress.com";

In the above code you should replace sampleaddress.com with your domain name.


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 5:13 am 

Points:
Login issue solved. Domain hadn't propogated (hides self in corner).

One more issue... I assumed that this script would allow me to direct users to a specific page (URL) based on each username/pw. Is there a mod you currently offer (or can offer) that will allow this? Each user on the site I am building needs to login to a page customized for that specific user.

Thanks very much.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 3:07 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
There are no MOD for this since it's just a few simple lines of code you need:
Code:
<?
if (file_exists("$loginname.php"))
    include("$loginname.php");
else if (file_exists("$loginuser.php"))
    include("$loginuser.php");
else
    echo "No user file found! - $loginuser";
?>

It's similar to this topic:
http://www.xavierforum.com/archive/7_1519.php


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 3:11 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
Oh, maybe I should say this too:
You add this code at one page like personal.php or members.php and then all users login at the same page. That way all users will see diffrent information, but they all have to login at the same page.

You can if you like (and I recommend it strongly) put all your member specific pages in a hidden directory like /someplacehidden11838393/ and never tell people about this hidden directory. The code will then look something like this:
Code:
<?
if (file_exists("someplacehidden11838393/$loginname.php"))
    include("someplacehidden11838393/$loginname.php");
else if (file_exists("someplacehidden11838393/$loginuser.php"))
    include("someplacehidden11838393/$loginuser.php");
else
    echo "No user file found! - $loginuser";
?>


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 3:25 am 

Points:
Almost there... Put the code above at the top of members.php page then tried logging in as a user from the members.php page. However, upon logging in with a valid username and password, I get:

Fatal error: Cannot redeclare fileprotect() (previously declared in /home2/accountname/public_html/distributors/codelock.php(3) : eval()'d code(1) : eval()'d code:145) in /home2/accountname/public_html/distributors/codelock.php(3) : eval()'d code(1) : eval()'d code on line 145


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 2:47 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
Do you have the protection code twice in that file?
Code:
<? include("protection.php"); ?>


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 3:08 pm 

Points:
No,

In members.php, this is what the top of the code looks like:

<? include("protection.php"); ?>
<? include("settings.php"); ?>
<?
if (file_exists("$loginname.php"))
include("$loginname.php");
else if (file_exists("$loginuser.php"))
include("$loginuser.php");
else
echo "No user file found! - $loginuser";
?>


The user is set up as username "test" and the test protected page I created is "test.php". On this test page ( test.php) that I'm supposed to go to after successful login, this code is on the first line:

<? include("protection.php"); ?>


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 4:13 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
You shouldn't have
Code:
<? include("protection.php");
in both files. Only add <? include("protection.php"); ?> in the first file, not in test.php.

Instead move test.php to some hidden directory as I suggested above.

settings.php is already included in protection.php so you can remove that line from members.php:
Code:
<? include("protection.php"); ?>
<?
if (file_exists("somehiddendir/$loginname.php"))
include("somehiddendir/$loginname.php");
else if (file_exists("somehiddendir/$loginuser.php"))
include("somehiddendir/$loginuser.php");
else
echo "No user file found! - $loginuser";
?>


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 8:56 pm 

Points:
Okay. That's working. Now... How can I modify this code to work as follows?

Everyone logs in at members.php page...

"user1" accesses his "user1.php" private page after login.
"user2" accesses his "user2.php" private page after login.

Both "user1" and "user2" can access a "group.php" page... which is shared by all users. (So far, so good. I've got all the above working.)

Now.... How do I prevent "user1" from accessing the "user2" page (user2.php) and other users from accessing each other's pages. Tried adding various groups and adding the generated group code to the single page (members.php) but again, it's dependent on the user's login. I need to force a login if users try to access another user's pages.

Thanks for your help.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 06, 2005 3:01 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
bylla wrote:
You can if you like (and I recommend it strongly) put all your member specific pages in a hidden directory like /someplacehidden11838393/ and never tell people about this hidden directory. The code will then look something like this:
Code:
<?
if (file_exists("someplacehidden11838393/$loginname.php"))
    include("someplacehidden11838393/$loginname.php");
else if (file_exists("someplacehidden11838393/$loginuser.php"))
    include("someplacehidden11838393/$loginuser.php");
else
    echo "No user file found! - $loginuser";
?>

bylla wrote:
Instead move test.php to some hidden directory as I suggested above.


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: umm
PostPosted: Fri Dec 16, 2005 9:29 pm 

Points:
bylla wrote:
Do you have the protection code twice in that file?


:D wow interesting way of putting it.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Registered users: xlreariasd


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]