I am rewriting this kind of urls http://deia.info/category/calendar/10/ To /index.php?task=browse_posts&catid=$2 By this code in the .htaccess RewriteRule ^category/(.+)/(.+) /index.php?task=…
php mysql export excel
This code is working without problem if page doesn’t contain any other content. When i add a html form, it gives only html content to excel. I need to use that form to customize query. How can i make this code working with html content? Answer As mentioned in the comments, combining HTML and CSV is not …
mysql sanitize row name
I’m currently writing a php framework with focus on security. I use a query builder to generate SQL-statements, so that it is not bound to MySQL. (Or SQL in general) I found certain posibilities that user could inject row names, so it has to escape them somehow. Because of how the query builder works, i…
Date and time in Greek
I’m currently using a website to get the time in Athens: $d = new DateTime(“now”, new DateTimeZone(“Europe/Athens”)); echo $d->format(“l, d M Y”); But I would like the date to be displayed in …
Writing Array to File in php And getting the data
I have An array which looks like following after using print_r Now I want to write this array direct to a file, I use the file_put_contents method, but I don’t know how to get the data from the file exactly how they looks like original. Any idea to solve this? Answer Your problem at the moment is basica…
Why does Magento keep only the first 1000 products in a category, after saving the category?
Using Magento’s back-office, after saving a category which was linked to many products, only the first 1000 products (or 2000, or x000, depending on host configuration) are kept. All other category/product links are deleted from the catalog_category_product table in the database. This occurs even though…
Create link in pdf with tcpdf
How can I create a link with TCPDF? When using the writeHTML() function and passing my whole html content, TCPDF doesn’t make my links clickable. They are blue and underlined but I cannot click them. Here is what I did. Answer As per the documentation, you can use the Write() method on your TCPDF object…
Replacing text between two limts
I have been trying to get the text between two symbols to be replaced with preg_replace, but alas still not quite getting it right as I get a null output that is empty string, this is what I have so …
facebook Sharer popup window
The FB sharer popup window displays the data of the page, not the metadata I have inserted in the php link. It seems the to be caused by the javascript How can I display the correct data in the popup window? Answer If you want to add custom metadata, use following code: UPDATE: I wrote a little JS code for
PHP how to detect if image contains color?
I am writing an image search engine, which allows users to search by colour. As part of this, I need to determine whether the image is grayscale (contains only black, white or shades of grey) or …