Atari ST fan
Posts: 7
46 credits Members referred : 0
« on: Mar 11, 2007, 01:34:26 pm »
Hi, I am really new to this and trying to do the following: I adjusted the profile table, page, classes etc. so it fits my needs. One field contans a URL with a RSS feed - for this i used field_one (company in example)
So, what do I want to do: There is a page, RSS.php, with a rss parser behind it. A var $rss_url = 'http://.....' holds the RSS url in the php - now i want the rss url to be in the profile table and do someting like this: $rss_url = $filed_one so that logged in users can have their own feed on there news page.
I just don't get it to work - how do I call a var out of the table (so get the rss URL out of the $field_one in PROFILE table into my pass protected rss page)?
Thanks for your help!!
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Mar 12, 2007, 08:44:29 am »
try this:
Code:
$update_profile = new Users_profile(false); // need to be false otherwise the redirect to this page will not work $update_profile->access_page($_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']); // protect this page too. echo $update_profile->field_one;
Atari ST fan
Posts: 7
46 credits Members referred : 0
« Reply #2 on: Mar 12, 2007, 06:15:17 pm »
Thanks, got it to work (didn't delete your output all for error tracking - so i got a lot of messages - but they are caused by my rss parser ;-) Problem now is, 1.) if i hit logout my session ins't deleted - i am still logged in - even though it tells me i'm logged out. 2.) im logged in with remeber feature -> close browser -> open new one -> still logged in but error message: Warning: Missing argument 1 for set_user() in /srv/www/vhosts/wapeins.de/httpdocs/classes/access_user/access_user_class.php on line 119
After hitting refresh everything is ok.
Code:
<?php include($_SERVER['DOCUMENT_ROOT']."/classes/access_user/ext_user_profile.php"); //error_reporting (E_ALL); // I use this only for testing
$update_profile = new Users_profile(false); // need to be false otherwise the redirect to this page will not work $update_profile->access_page($_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']); // protect this page too. $hello_name = ($update_profile->user_full_name != "") ? $update_profile->user_full_name : $update_profile->user;
if (isset($_GET['action']) && $_GET['action'] == "log_out") { $update_profile->log_out(); // the method to log off }
?>
Thanks - did a great job with your script!!
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
Thanks, got it to work (didn't delete your output all for error tracking - so i got a lot of messages - but they are caused by my rss parser ;-) Problem now is, 1.) if i hit logout my session ins't deleted - i am still logged in - even though it tells me i'm logged out. 2.) im logged in with remeber feature -> close browser -> open new one -> still logged in but error message: Warning: Missing argument 1 for set_user() in /srv/www/vhosts/wapeins.de/httpdocs/classes/access_user/access_user_class.php on line 119
After hitting refresh everything is ok.
Code:
<?php include($_SERVER['DOCUMENT_ROOT']."/classes/access_user/ext_user_profile.php"); //error_reporting (E_ALL); // I use this only for testing
$update_profile = new Users_profile(false); // need to be false otherwise the redirect to this page will not work $update_profile->access_page($_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']); // protect this page too. $hello_name = ($update_profile->user_full_name != "") ? $update_profile->user_full_name : $update_profile->user;
if (isset($_GET['action']) && $_GET['action'] == "log_out") { $update_profile->log_out(); // the method to log off }
?>
Thanks - did a great job with your script!!
It's possible that I missed something after a related update, will check this soon.
Atari ST fan
Posts: 7
46 credits Members referred : 0
It's possible that I missed something after a related update, will check this soon.
I checked the code again - happens with user profile class / when working with user profile. Thanks for an update, it's my start-page ;-)
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #5 on: Mar 13, 2007, 07:00:41 am »
try this modified code, and tell me if the problem is gone
Code:
function Users_profile($check_profile = true) { $this->connect_db(); if (empty($_SESSION['logged_in'])) { $this->login_reader(); if ($this->is_cookie) { $this->set_user(); } } if (isset($_SESSION['user'], $_SESSION['pw'])) { $this->user = $_SESSION['user']; $this->user_pw = $_SESSION['pw']; $get_profile = $this->get_profile_data(); if ($check_profile && !$get_profile) { header("Location: ".$this->profile_upd_page); exit; } else { if (empty($_SESSION['user_id'])) $_SESSION['user_id'] = $this->id; } } }
Atari ST fan
Posts: 7
46 credits Members referred : 0
« Reply #6 on: Mar 13, 2007, 09:03:40 pm »
Hi Olaf,
didn't work for me. Still the message: Warning: Missing argument 1 for set_user() in /srv/www/vhosts/xxx/httpdocs/classes/access_user/access_user_class.php on line 119
Warning: Invalid argument supplied for foreach() in /srv/www/vhosts/xxx/httpdocs/classes/access_user/index.php on line 177
I'm trying to find the bug - unf. im totally new to php :-( --> first php project, used to work with asp ;-) Thanks!