Search Results

Search found 10 results on 1 pages for 'sombe'.

Page 1/1 | 1 

  • How to install Zend Framework on Windows

    - by sombe
    "installing Zend Framework is so easy!!!!" yeah right... Ok I'm working with a beginner's book and the ONE thing that is not excessively detailed is the most important part: Installing the darn thing. After browsing the quickstart guide for hours, all it said was: "download Zend [...] add the include directory (bla bla) and YOU'RE DONE!" right, i'm done using Zend. Ok, not really, not yet anyway. I beg of you people, I wanna go to bed, please tell me how (in simple 6th grade detail) to install the framework. I've got the unzipped folder in my htdocs directory, and I placed zf.bat+zf.php in the htdocs root. What's next? thank you so much. EDIT: Thanks guys for all the answers. Unfortunately I haven't been able to work with this or find a good enough resource to explain it to me in plain english. It seems that this framework adheres more so to programmers than to beginners. I've since yesterday read a little on CakePHP and found that it was incredibly easy to install and tune. As oppose to Zend Framework, where I had to dig in my "environment variables", configure "httpd.conf" and almost tie the knot between my computer driver cables to just get it running, CakePHP has already allowed me to put together a nice newbie application. In conclusion, I very much appreciate all of your help. I hope someone else venturing on ZF will be more successful with it. Thanks!

    Read the article

  • PHP arrays - How to 1-dimensional array into nested multidimensional array?

    - by sombe
    When retrieving a hierarchical structure from MySQL (table with one ID column and one PARENT column signifying the hierarchical relationships), I map the result into an enumerated array as follows (for this example the numbers are arbitrary): Array ( [3] => Array ( [7] => Array () ), [7] => Array ( [8] => Array () ) ) Notice 3 is the parent of 7, and 7 is the parent of 8 (this could go on and on; and any parent could have multiple children). I wanted to shrink this array into a nested multidimensional array as follows: Array ( [3] => Array ( [7] => Array ( [8] => Array () ) ) ) That is, each NEW id is automatically assigned an empty array. Regardless, any ID's children will be pushed into their parent's array. Take a look at the following illustration for further clarification: This will probably result in a complicated recursive operation, since I always have to check whether a parent with any certain ID already exists (and if so, push the value into its array). Is there a built-in php function that can assist me with this? Do you have any idea as to how to go about constructing this? For what it's worth I'm using this to built a navigation bar in wordpress (which can contain categories, subcategories, posts... essentially anything).

    Read the article

  • How to push both value and key into array with php

    - by sombe
    $GET = array(); $key = 'one=1'; $rule = explode('=',$key); /* array_push($GET,$rule[0]=>$rule[1]); */ I'm looking for something like this so that: print_r($GET); /*output:*/ $GET[one=>1,two=>2,...] is there a function to do this (because array_push won't work this way). thanks!

    Read the article

  • Can headers be sent in an AJAX request?

    - by sombe
    Can I call the server to set a new cookie with an AJAX request (that is, after the page has already loaded)? For example, when a visitor hits a link, ajax would open a php file that sets a new cookie like this: setcookie('cookiename', 'true', time()+3000, "/",'...'); But this is done after the html (the page containing the actual <a> tag pressed) was rendered. Is it nevertheless ok to set cookies in ajax? (maybe because the php file loaded is separate from the original html page).

    Read the article

  • How to implement callback methods inside classes (PHP)

    - by sombe
    I need to use a class callback method on an array inside another method (the callback function belongs to the class). class Database { public function escape_string_for_db($string){ return mysql_real_escape_string($string); } public function escape_all_array($array){ return array_filter($array,"$this->escape_string_for_db"); } } Is this the right way to go about that? (I mean, in terms of the second parameter passed to array_filter)

    Read the article

  • PHP: Class extends problem "Call to private method ... from context ..."

    - by sombe
    I have 3 classes in WordPress (the question itself is unrelated to it): class WP_Widget class Theme_Widget extends WP_Widget class Specific_Widget extends Theme_Widget Essentially Theme_Widget contains some extension functions to the basic WP_Widget. Inside Specific_Widget I call one of Theme_Widget's methods: class Specific_Widget { function __construct() { $this->some_method_that_belongs_to_Theme_Widget(); } } When I instantiate Specific_Widget, PHP throws a fatal error as follows: Fatal error: Call to private method Theme_Widget::some_method_that_belongs_to_Theme_Widget() from context 'Specific_Widget' in ... Do you have an idea as to how I can resolve this? This is the first time I've received this error from PHP. Could it be derive from WordPress itself?

    Read the article

  • How to prevent robots from automatically filling up a form?

    - by sombe
    I'm trying to come up with a good enough anti-spamming mechanism to prevent automatically generated input. I've read that techniques like captcha, 1+1=? stuff work well, but they also present an extra step impeding the free quick use of the application. (I'm not looking for anything like that please). I've tried setting some hidden fields in all of my forms, with display: none; However, I'm almost certain a robot (which is essentially a program) can be configured to trace that form field id and simply not fill it. Do you implement/know of a good anti automatic-form-filling-robots method? Is there something that can be done seamlessly with HTML AND/OR server side processing, and be (almost) foolproof? (and please no JS, one could simply disable it, and there goes my anti-spam method). Btw I'm trying not to rely on sessions for this (like, counting how many times a button is clicked to prevent overloads).

    Read the article

  • How to add a method to an existing class in PHP?

    - by sombe
    I'm using WordPress as a CMS, and I want to extend one of its classes without having to inherit from another class; i.e. I simply want to "add" more methods to that class: class A { function do_a() { echo 'a'; } } then: function insert_this_function_into_class_A() { echo 'b'; } (some way of inserting the latter into A class) and: A::insert_this_function_into_class_A(); # b Is this even possible in tenacious PHP?

    Read the article

  • PHP, MySQL - would results-array shuffle be quicker than "select... order by rand()"?

    - by sombe
    I've been reading a lot about the disadvantages of using "order by rand" so I don't need update on that. I was thinking, since I only need a limited amount of rows retrieved from the db to be randomized, maybe I should do: $r = $db->query("select * from table limit 500"); for($i;$i<500;$i++) $arr[$i]=mysqli_fetch_assoc($r); shuffle($arr); (i know this only randomizes the 500 first rows, be it). would that be faster than $r = $db->("select * from table order by rand() limit 500"); let me just mention, say the db tables were packed with more than...10,000 rows. why don't you do it yourself?!? - well, i have, but i'm looking for your experienced opinion. thanks!

    Read the article

  • How to implement callback functions inside classes (PHP)

    - by sombe
    I need to use a class callback method on an array inside another method (the callback function belongs to the class). class Database { public function escape_string_for_db($string){ return mysql_real_escape_string($string); } public function escape_all_array($array){ return array_filter($array,"$this->escape_string_for_db"); } } Is this the right way to go about that? (I mean, in terms of the second parameter passed to array_filter)

    Read the article

1