php

how many dojo fliteringselect can I have on a form?

I have a quick question How many dojo filteringselects can I have on a form? I have a form with 2 filteringselects on it, both getting data from different json datastores to populate the values. However only the first filteringselect is being populated, the other grabs no data. I am using Zend Framework and Zend_Dojo_Form to create ...

Updating Twitter background via API

I'm having a little trouble updating backgrounds via Twitter's API. $target_url = "http://www.google.com/logos/11th_birthday.gif"; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_FAILONERROR, tr...

Want to create a facebook likenews and updates ...

Hi guys, I'm wokring on a simple social network site and I would like to build a simple news update feed. Feed not in the actual sense but you know like those little reports you get on facebook eg when someone posts a picture you get a simple report saying in your main page that - so and so added a picture, or so and so added a comment. ...

Ecommerce diferent cart items DB & models design

Hello, I have a ecommerce site that has 2 types of products: books & seminars participations. They are different, and have different attributes. I am curious how would you model this in the DB and as models (since you cannot inherit multiple classes) Right now i have something like: DB products (id, name ....) seminars (id, title, da...

How to put string in array, split by new line?

Hi, I have a string, with line breaks in my database. I want to put that string in an array, and for every new line, jump one index place in the array. If the string is: "My text1(here is a line break)My text2(here is a line break)My text3" The result I want is this: array[0] = "My text1" array[1] = "My text2" array[2] = "My text...

Php, how to make a parent object

I would like to know if there is anyway I can make a parent object with php, I have tried this: new parent::__construct($var); but it doesn't work and I get the following error in the php logs: (..)PHP Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$'(..) ...

datetime function in php

I want to store the data and time in my MYSQL db.I have a datetime field in my db I want to store current datatime in my db How shold i get the current date time?How to pass it to db via a sql query How can i then retriev an print it in correct yyyy--dd--mm format or any other format What wil be format of time? wil it be 23 hrs etc? H...

phpdoc datatype and namespaces

What is the current status of using namespaces in phpdocs datatypes. eg: * @param string|Vendor\SomeClass $parameter ...

Reducing size of user avatars? - creating thumbnails.

Hi, User of my site upload images which are used as avatars. I have set a upload limit size of 2 MB. At most places I only require thumbnails. But users upload images with far bigger resolutions. I store these files on my file-system. How can i create thumbnails and store them instead of large sized files? ...

Installing Zend Server on Production Server/Machine

Hello i was wondering if anyone had to install/or is working with Zend Server. My Question is: If i install Zend Server on a production server will it mess up my existing PHP configuration? Will i have to bring my application offline first or will Zend Server install without problems? The application must run 24/7 and i need a reliabl...

Install two different versions of PHP in Mac OS X

Is it possible to install two different versions of PHP in the same computer? I am using Mac OS X, and I need it because the PHP OpenId library does not work with PHP 5.3... ...

How do I get linux server to use local PHP.ini in a shared environment?

I'm on shared server environment (Dreamhost.com uses Linux/Debian). I followed their instructions @ http://wiki.dreamhost.com/Advanced%5FPHP%5Fconfiguration on setting up a local PHP5 instance on my user account so that I could use APC (php5 accelerator) A couple of caveats is that I dont have php5 installed on the root directory "/ho...

SQL database issue

I have a select statement showing the following results: On_loan barcode Y 12345 Y 12345 N 12345 N 12344 Y 12344 Each barcode for a book can have more than one copy. Users can place a book on hold. E.g user '1' has reserved book 12345 and 12344. The above results show: that the two books with barcode 1234...

Parsing XML with PHP and SimpleXML where items are named <long>, <float> or <int>

I'm trying to parse data from Archive.org's search functionality. The data looks like this: <doc> <float name="avg_rating">5.0</float> <arr name="collection"><str>U-Melt</str><str>etree</str></arr> <arr name="format"><str>Checksums</str><str>Flac</str><str>Flac FingerPrint</str> <str>Metadata</str><str>Ogg Vorbis</str><st...

[PHP]Setting variables on Constructor VS on the class definition

Lately I've been wondering if there's a difference between initializing the variables that have a default value on the Constructor VS on the class definition. Which one is better, taking into consideration the optimization: class TestClass { private $test_var = 'Default Value'; function __construct() { } } class TestClass2 { priv...

Finding record in mysql table that has the highest value

Hi, I want to be able to seach in my table named "map" to see which record has the highest value for "positionV". For example if I had 5 records in "map" table and under "positionV" the values for each were, "3, 8, 9, 2, 10" I would wont it to output 10. I am using PHP also by the way. ...

Use Ivy to manage directories instead of jar files?

Is it possible to use Ivy, or some other dependency-management tool, if your dependencies are directories instead of files? I'm creating a PHP web site, so my shared "libraries" aren't jar files or any other archive format. I'm aware of .phar files in PHP 5.3, but I really would prefer these to be directories, so the web server can serv...

How to get a user's friends info on Twitter without breaking the Rate Limit

I am trying to do something that appears to be simple, but I can't figure out a way around it without breaking the rate limit. The first API call I'm making is the get a user's friend's IDs. $friends = $to->OAuthRequest('http://twitter.com/friends/ids.json', array(), 'GET'); That returns a huge string with IDs. In my case, I'm follow...

Using PHP, how do you store credentials in a cookie with basic authentication?

This seems simple, but I am stuck. I am trying to use basic authentication using an API. I can use curl from the command line, but I can't figure out how to convert this to PHP and cookies. Please help! ...

Debug simple php while code

I am getting this error: "Fatal error: Can't use function return value in write context in D:\Programas\wamp\www\away\index.php on line 18". Line 18 being the if statement. Can anyone help me out on this? Thanks. $vars = array("first_date_month", "first_date_day", "last_date_month", "last_date_day", "resume_date_month", "resume_date_da...