I’m using cUrl in the client side. On my webservice (ws.php), i’ve this simple code : When i call this ws.php page, i still have http_code = 200. Here is my cUrl code is client side : $code = 200 even i put the header code “401”. Answer try this on your ws.php: Let me know if this works or
Invalid or unitialized Zip object
I am getting Warning: ZipArchive::addFile() [function.ZipArchive-addFile]: Invalid or unitialized Zip object. what could be problem? I tried many methods but in vain. I am able to create and initiate download when I select one file. However, I get above error when I select more than one file. Answer The power of indenting correctly! You are closing your zip file inside
How to scrape SERP with PHP (for small project)
I thought this would be fairly simple but it’s proving challenging. Google uses https:// now and bing redirects to remove HTTP://. How can I grab the top 5 URLs for a given search term? I’ve tried several methods (including loading results into an iframe), but keep hitting brick walls with everything I try. I wouldn’t even need a proxy, as
Codeigniter Environment setting
Codeigniter development environment is not setting. I always use this code in index.php. but i don’t understand why i am getting “production” as output while i am working on localhost. Answer That’s strange. It did the exact same thing for me. Could you try something like this?
Multidimensional PHP array – Key exists
I want a function that will return TRUE or FALSE based on if a given key exists in a multidimensional array in PHP. I haven’t been able to figure out a recursive function to perform this action. A sample of what this could do: Answer This is where a recursive function comes in handy. Note that this can take some
How to get page number on dompdf PDF when using “view”
Ok, so I use the following snippet to get “views” of HTML with PHP variables loaded in as $data so that I can do things like fill in tr’s of data from a database call or whatever. function getView ($…
Why can JavaScript handle timestamps beyond 2038?
As we know that all dates using Javascript Date constructor are calculated in milliseconds from 01 January, 1970 00:00:00 Universal Time (UTC) with a day containing 86,400,000 milliseconds. This …
Laravel 4 where in condition with DB::select query
I have next SQL query: How should I execute this using Laravel? I put this query in DB::select function, but how can I place all ids in “WHERE device_id IN (?)” condition? I tried using “array(implode(‘,’, $var))” but it doesnt work. If I have ids like “13, 14” I get results only for id = 13. So the question is
JQuery search box autosuggest – How to select from suggestions with arrow keys whilst still retaining focus on input field
I have a search box that has an autosuggest feature, so it adds suggestions to an unordered list within an absolutely positioned div below the search box. These suggestions are sourced via ajax using …
How to turn off notice reporting in xampp?
On a remote server there is no problem, but in localhost (xampp 3.1.) I cannot turn off reporting notices. result: php.ini Any suggestion ? Answer Try to do a phpinfo(); just before your $Fname = $_POST[“Fname”]; line. What’s the error_reporting property value ? See this or this to understand the value displayed in the table. If it’s not what you