I have following piece of code, which reads text files from a director. I have used a list of stopwords and after removing stopwords from the files when the words of these files along with their positions then there come extra blank characters in place of where stopword exist in the document. For example, a f…
session_start(): Write of lock failed
i’m using memcached in php to handle sessions. But i’m geting a session_start(): Write of lock failed. my php configuration has session.save_handler memcached session.save_path tcp://127.0.0.1:…
How to get Login successful alert to trigger only one time after signing in
When $_Session[‘user’] has been set I want the ‘Login successful’ message to appear only once after signing in. If I refresh the page or click an anchor message will reappear, which is to be expected. If anyone knows a better way of doing this or if it is possible only in php. Answer y…
PHP Laravel – Allow users to use a custom domain name
I’ve looked through pretty much every single page I could find on the topic, but I’m still bit confused. I have a PHP Laravel 4.0 web site, which is at http://www.mywebsite.com When a user signs up, each user gets their own page http://user1.mywebsite.com I have set the above via wildcard sub doma…
Passing title, url and image on share.php of facebook
I want to share title , image and description on facebook without javascript just by passing these to share.php of facebook. I got some code on this site in question Open source alternative to AddThis AddToAny, ShareThis etcfor Social Bookmarking and I have read the question how to pass custom parameter in fa…
json_encode returns NULL, json_last_error_msg gives “Control character error, possibly incorrectly encoded”
The file looks fine when read into my editor. There isn’t much out there on what this error message means. Answer you can remove the control character, PCRE supports the POSIX notation for character classes [:cntrl:]
window.history.pushState refreshing the browser
I am working on some javascript code, and using window.History.pushState to load new HTML pages, instead of using href tags. My code (which is working fine) looks like this. window.History.pushState(…
If cart is empty, the cart page will redirect to shop page in WooCommerce?
In WooCommerce, I want to redirect the cart page to shop page when the cart page is empty otherwise shows the cart page. Can anyone have the solution ? Here is the code I have tried, but it does not …
PHP Port Scanning
This may be a duplicate post, BUT I’ve not seen any answer that correctly resolves this. I’m trying to find a php script that can correctly determine the state of a TCP or UDP port. I’ve tried several of the ones I’ve found online and they all return the wrong results. EG: On my local …
laravel foreach loop in controller
i have a problem about looping data in controller (laravel 4). my code is like this: when i want to use foreach to loop for $product result with code like this: the result is returning error Undefined property: IlluminateDatabaseEloquentCollection::$sku so, i try to improvise a little with this code: the code…