php

Can I have two apps under same (custom)Tab

As I am stumbling through Facebook App Dev. I am getting more and more close to a bit sophisticated questions, bu still I am at newbie level. Can I have custom Tab and inside that tab two different apps ? ex. (the slideshow and top 5 news(RSS feed)) ...

php count rss entries since a specific date/time

can anyone tell me why this code don't work: $q = $_GET['q']; // Load and parse the XML document $rss = simplexml_load_file("http://search.twitter.com/search.atom?lang=en&q=$q&rpp=100&page=1"); $Count1 = 0; while(strtotime($rss->entry->published)>1270833600){ foreach ($rss->entry as $item) { $Count1++; } } ...

Accessing Apache's Mime-Type to Extension Mapping

Does PHP expose Apache's Mime-Type to extension mapping in any way shape or form. That is, Apache typically has a list of files extensions (.gif, .pdf) that it maps to a list of Mime-Types (image/gif, application/pdf, etc.) in a file typically called mime.types. Is there anyway to get a list of these mapings for the current running apa...

Arrays become null after passing to function in PHP

So when I pass my filled arrays to the function createform the form is created with $max_avatars options, but they have no name or value. Why are my arrays becoming null? <?php $avatar_image_name = array('hacker','samurai','cool','happy','thatsnice','angry','tv','bang'); $avatar_name = array('Hacker','Samurai','Cool','Happy'...

Does CakePHP have support for APC, XCache and others

Any ideas please? Thanks. ...

File Handler returning garbled files.

For the past 3 months my site has been using a PHP file handler in combination with htaccess. Users accessing the uploads folder of the site would be redirected to the handler as such: RewriteRule ^(.+)\.*$ downloader.php?f=%{REQUEST_FILENAME} [L] The purpose of the file handler is pseudo coded below, followed by actual code. //Chec...

can't upload greater 50MB

i want to upload two files. here is the script <? ini_set('memory_limit', "400M"); ini_set('file_uploads', "5"); ini_set('max_execution_time', "900"); ini_set('upload_max_filesize', "400M"); ini_set('post_max_size', "400M"); ?> <form action="form.php" method="post" enctype="multipart/form-data" /> <input type="file" ...

OOP Design Question - Where/When do you Validate properties?

I have read a few books on OOP DDD/PoEAA/Gang of Four and none of them seem to cover the topic of validation - it seems to be always assumed that data is valid. I gather from the answers to this post ( http://stackoverflow.com/questions/1651964/oop-design-question-validating-properties ) that a client should only attempt to set a valid ...

PHP update kerning problem with imagettftext() and imagefttext() functions

Hello, Our dev server was recently upgraded to PHP v5.2.13. With that upgrade we have found that our png images are having kerning (letter spacing) problems. We've tried numerous fonts and haven't found a solution yet. We are creating images using the GD library and writing text to the images using font files and the imagettftext() ...

Using PHP retrieved variables in Javascript

Hi, I will use the following javascript to display a Google Map Window in a webpage. <script language = 'javascript'"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(35.904173, 14.433396), 16); map...

Custom Template and Layered Navigation

I created a custom template for the category view that displays all subcategories for current category. When i set the current category as is_anchor = yes in the admin, the layered navigation filters show up in the side bar. The Sub categories is one of the filters are there as well, but when i click on one them the page still displays...

Kohana 2.3.4 ORM pivot table query

I'm trying to query a pivot table with Kohana's ORM and I'm wondering if there is a built in function I'm missing. Currently I only have 2 models setup for the tables "categories" and "products". There is a pivot table "categories_products", but I don't need a model for it when inserting data with this: $product = ORM::factory('product'...

Performance of tokenizing CSS in PHP

This is a noob question from someone who hasn't written a parser/lexer ever before. I'm writing a tokenizer/parser for CSS in PHP (please don't repeat with 'OMG, why in PHP?'). The syntax is written down by the W3C neatly here (CSS2.1) and here (CSS3, draft). It's a list of 21 possible tokens, that all (but two) cannot be represented a...

PHP include by name

Hello, I have "content" folder which is full of other sub-directories named in the following way: "id1_1","id1_2", "id1_3" and other "id2_1", "id2_2" etc. Each of these folders contains a file "template.php", same name in all sub-directories. The number of folders is dynamic so I need to find a way to import in "index.php" only the "te...

is there any php solution for caching management ? especially for image caching ?

i just want to know a general information about this particular information. Any good reference will be helpful. ...

Trouble setting up php Zend include path

Hello, I am trying to set up a PHP path to my Zend Framework. I am very confused on how to do this. My Zend Framework is located at the following location on my server: amazon/ZendFramework-1.10.3-minimal I am going to be creating a couple of php files in the amazon/ directory that will require the Zend Framework. My include path is: ...

Replace html text in javascript include

Hi, i've got this: <script type="text/javascript" src="http://xy.com/something.js"&gt;&lt;/script&gt; in my php/html file. It includes the whole something.js file. In this file, there are lines like with "document.write..." that are writing some text on my page. Is it possible to replace a string that is included from this js file in...

How do I populate these fields from existing data?

I'm not sure how to make a few parts of my form to populate from data from an array I'm passing from the database. First is this <select> object. The key estimate_lead_id in the database holds the value, and I want the dropdown to auto-select based on the value from the database. <select name="estimate_lead_id"> <? foreach($leads->...

Why turning magic_quotes_gpc on in PHP is considered a bad practice?

Why turning magic_quotes_gpc on in PHP is considered a bad practice? ...

Facebook updates posted to wordpress blog.

I am trying to set up a page on a wordpress site that displays the feed for a facebook fan page. I can't seem to locate the RSS link and it seems tons of people are having the same problem. Anyone know of a way to approach this problem? ...