Adding pages

nader exa Posted in Component Development 9 years ago

I'm trying to add a page and keep the logedin user in the same website with the same session informations the user had .. like this

enter image description here

but I'm getting this error :

" Internal server error

This website might have encountered a technical problem and cannot fullfill your request.
Please try again later.

Error code 500 (Internal Server Error) "

as a try from me to keep the session information and the logedin user , the new page I'm trying to add include this code ..

" < ? php
include('system/start.php'); // Includes session

if(isset($SESSION['OSSNUSER'])){
< p > your new page works good.. keep the good work. < /p >
}
else {
redirect('login?error=1');
}
?> "

note: I even tried to install new component like HelloWorld, it didn't work .. I'm working on v1.8

any suggestions and help are appreciated .. thank you

Replies
Indonesian Arsalan Shah Replied 9 years ago

Please see: http://community.opensource-socialnetwork.org/component/view/167/hello-world

Don't create pages with custom php files.

You cannot use 'if(isset($SESSION['OSSNUSER']))' directly in your code, you should use 'if(ossn_isLoggedin())'

Also you are calling $user variable which is not set. You should use ossnloggedinuser() for getting loggedin user data. like ossnloggedinuser()->fullname;

Nader exa Replied 9 years ago

thank you Zet Man for your replay

**I appreciate your help .. the page has no error 500 but I'm facing another problem now **


have a look

the OSSN_USER interpreted as Array "that seem so strange for me" (-_-)

non of the data has been processed .. it gives me so many question marks ??????????

what you think!

about the errorlog file I found no trace to such file any where ... I even looked in ossndata directory .. in case you wondering Error logging is Enable in the Admin's Dashboard basic settings ;)

German Michael Zülsdorff Replied 9 years ago

error 500s are resulting from syntax errors most of time.

no echo before "your page works good" and no ";" ending in this case.

Ossn comes with an error_log file in the root directory. Enable Error logging in the Admin's Dashboard basic settings and simply have a look. :)