Jump to content

stijn0713

Members
  • Posts

    231
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

stijn0713's Achievements

Regular Member

Regular Member (3/5)

3

Reputation

  1. <a> inside <li> makes my list markers float above the <h4>item and <p> that are inside the <li>. Does anybody know why? Update: only in chrome it works (as in the markers are on the correct height)
  2. i want to post a json literal with jquery ajax method. The $_POST array on the server side is empty, thought i see with firebug that the json literal has been send. If i switch to GET method, i do receive the literal but it's not clean formatted. client-side $.ajax({ type: "GET", url: 'ajax/saveInfoAuthenticatedUser.php', data: pic_data, dataType: 'json', success: function (data) { alert(data); } }); server-side $data = $_POST['pic_data']; print_r($_POST); What is the problem? I've read alot of posts on stackexchange where people had the same problem, but nowhere i could find the reason why the post variable is empty. Extra question: What is the clean way to send a json format? should i use stringify(), json_encode or something?
  3. i think you can't post to friends timelines, because you need an access token of the friend, which you cannot obtain via the authenticated person, however i'm not 100% sure
  4. I find contradictory answers when googling. could someone confirm or reject if it is possible to let an authenticated person post to his friend's wall/ timeline without a dialog? If someone know it it's possible, please tell me:
  5. i guess you are right, but i don't understand the solution. I opened the pdf file with notepad, and the problem is that all the html content is included before the actual %PDF-1.3 line. I guess a solution would be to put the intended content with the css in an outputbuffer and write in to a file, and then in that file i make pdf? (is this similiar to what you meant DavidAM?)
  6. Anybody experience with dompdf? i follow the basics to make a pdf from html using $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("factuur.pdf"); It seems i can't open a pdf created with dompdf if i echo something or if there is html besides the html contained by $html. anybody know why?
  7. i want to determine for every function or class method in all the core codeigniter functions, libraries and helpers, how many resources (http://php.net/manual/en/language.types.resource.php) these functions or class methods have. Any idea what is a simple way to do it? So far, i've - include all the desired files (core, libraries, helpers) - list down all the user defined classes and their methods and user-defined functions
  8. yes, with 'i think' i wanted to express that i have not full understanding of the navigation and therefore tried to exit or die() at a place maybe irrelevant. So i cannot say i die or exit() is not the way to go, however, for my understanding it's not the way how to get out of it. i tried to place it there: lass User extends CI_Controller { public function __construct() { parent::__construct(); } public function login(){ $this->load->view('pages/login'); $arr['un'] = $this->input->post('naam'); $arr['pw'] = $this->input->post('paswoord'); if(isset($arr)){ $this->session->set_userdata('logged_in' , TRUE); } die(); // here } }
  9. that's not the problem... The real thing is.. if i just echo something in the method of the hook. it will echo it, go out of the hook and proceed with the next thing in codeigniter.php... HOWEVER, if i redirect within the method of the hook.. i don't know how to get back out of it... exit or die() won't work i think
  10. Thanks for the reply. The point is, i cannot var_dump anything since firefox only alerts that there has been a request that will never terminate.. It's because i don't understand the navigation logic when using hooks in codeigniter. say i request: CI/news it will call the news controller and output what's been set in the index() method . but now before getting to the news controller i want to put a hook to verify if one has logged in already, if not let them log in, and redirect back to the news/index
  11. The hook is called here, in codeigniter.php Is there a "post_controller_constructor" hook? * ------------------------------------------------------ */ $EXT->_call_hook('post_controller_constructor'); My hook: class Auth { private $CI; function __construct(){ $this->CI =& get_instance(); } function authenticate(){ $this->CI->session->set_userdata(array('hook' => $_SERVER['php_self'])); if(!$this->CI->session->userdata("logged_in")) { redirect('user/login', 'location'); } } } i try to redirect in hook to user controller, where i try todisplay login form class User extends CI_Controller { public function __construct() { parent::__construct(); } public function login(){ $this->load->view('pages/login'); $arr['un'] = $this->input->post('naam'); $arr['pw'] = $this->input->post('paswoord'); $this->session->set_userdata(array('logged_in' => $arr)); redirect($this->session->userdata('hook'), 'location'); } } after logging in, it should proceed back in the codeigniter.php file with the requested controller and method
  12. I try to use a post_controller_constructor hook point to create a authentication. My problem is that i always get in an infinite loop. So the flow goes basically like this: in the codeigniter.php file the hook is called. The hook has an authentication method that checks if 'logged_in' is set in the session, else redirects to a login controller, which displays the login view form, and sets the session after. Then i tried to redirect back to the hook. I don't know what or where i have to redirect too after filling the session in. It's just for the purpose of learning about hooks, so please don't suggest an alternative method.
  13. Can someone explain me how APC caching works? What exactly is "the cache"? I clarify myself: if i use the $this->output->cache(30) from codeigniter for example, i know the output is saved in the map application/cache. so the cache is harddiskspace... When i use apc_add(), where is it stored then? thanks in advance
  14. stijn0713

    dl()

    i'm wondering how dl() or enabling extentions in php.ini work exactly. If i enable an extention in the php.ini this code becomes available in all scripts. What about making extentions available throught dl() at runtime? What is the scope of this extention then? Can the PHP dl() function be compared with JAVA import package statement?
×
×
  • 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.