Jump to content

php members area - NEED HELP!!


dr.maju

Recommended Posts

Hey, i am new to php and after following some great tutorials i have managed to create a login system ;D but now im stuck. Basically, i have a client.php page that is protected via the login system etc...on this page i have an iFrame and in the iFrame i want to load different content based on what user is logged in. (can i do this by using their user id that is created in the database?)

 

Thanks, any help will be greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/115016-php-members-area-need-help/
Share on other sites

Here is the code that is now in the inline frame. It dosn't seem to load the new pages when a different member id logs in. It always goes to the first1. (btw in the sql connect bit all the details are filled in correctly ;D)

 

 

<?php

 

$dbh=mysql_connect ("hostname", "username",

"password") or die('Cannot connect to the database because: ' . mysql_error());

mysql_select_db ("databasename");

 

$id = $_GET['member_id'];

 

if($id == 1)

{

echo "clients/client1.php";

}

 

if($id == 2)

{

echo "clients/client2.php";

}

 

if($id == 3)

{

echo "clients/client3.php";

}

 

if($id == 4)

{

echo "clients/client4.php";

}

?>

ahh ok, soz, yer

you would have

 

<iframe all the code src=

"

<?php

 

  $dbh=mysql_connect ("hostname", "username",

  "password") or die('Cannot connect to the database because: ' . mysql_error());

  mysql_select_db ("databasename");

 

  $id = $_GET['member_id'];

 

  if($id == 1)

{

echo "clients/client1.php";

}

 

  if($id == 2)

{

echo "clients/client2.php";

}

 

  if($id == 3)

{

echo "clients/client3.php";

}

 

  if($id == 4)

{

echo "clients/client4.php";

}

?>

"></iframe>

do you plan to have differente pages for different clients??

so if you have 100 users you will have 100 pages?

 

or am i getting this terribly wrong.. i think you should have only one page and put the logic to display something or not in the if or switch conditions.

 

PS: OR having different pages depending on type of users ( like admin, user etc) makes more sense to me.

ha, sounds stupid when u put it that way. But yeah...each user needs their own page. so having different pages for just admin and user wouldn't help much. And as i am a complete rookie at php i dont really know any other way of doing it. Thanks for ure comment though. If anyone knows of a simpler way please let me know.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.