php

Google Reader - > create tweets, push to mysql database

Hi All, I need to be able to create tweets from shared items on google reader (like reader2twitter does) and then push them for storage in a MySQL database. I know that the shared feed from reader is an atom feed, but beyond that, not even sure where to start. Can someone please point me to some resources, or tips on how I would eve...

OpenID Discovery Methods - Yadis VS HTML

Recently, I've begun writing my own PHP OpenID consumer class in order to better understand openID. As a guide, I've been referencing the [LightOpenID Class][1]. For the most part, I understand the code and how OpenID works. My confusion comes when looking at the author's discover function: function discover($url) { if(!$url) throw ...

misleading usage of square bracket in SimpleXMLElement object

I found the [] operator is sometimes confusing when it is used agains SimpleXMLElement object. $level_a = $xml->children(); $level_a['name']; # this returns the 'name' attribute of level_a (SimpleXmlElement object) $level_a[0]; # this returns $level_a itself! $level_a[1]; # this returns the second SimpleXmlElement obj...

MySQL: Get data from other table matching the ids.

I have table named 'company' and 'user'. The user table contains the id of company. Like for example: A. User table user_id | name | company_id |status 1 | john | 1 | active B. Company table company_id | name | status 1 | ABC | active How to get the name of the company by their id in single sql query. such;...

Best PHP Webserver for Development

I'm starting to work with PHP more these days and I've been wondering what the best PHP webserver might be for a dev environment. Ideally, it would be easy to build, live only in the project deps directory and be easy to configure. Also, decent performance would be a plus. In python land, werkzeug would be an equivalent of the type of ...

Displaying Calendar in Hourly format inside a Table tag

I have a database holding events in the form of a start_time and an end_time which are timestamps. I am trying to make a calendar that has 24 rows, and 7 columns. A normal calendar would be easier for me to create because my SQL results would be in order of lowest to highest. I am not quite sure how I would run through my SQL table, ...

PHP includes instead of iFrames?

What's the best way to use PHP includes instead of iFrames? Edit: Instead of using iFrames, I want to use includes to show my content. ...

PHP encoding problem with Pound Sign

Hey guys, I am retrieving a variable that contains a £ sign from another page. I want to remove this and I have tried using str_replace but I am left with the following: �100. $amount = str_replace('£', '', $amount); Any ideas? ...

Whats the most efficient way to store an array of integers in a MySQL column?

I've got two tables A: plant_ID | name. 1 | tree 2 | shrubbery 20 | notashrubbery B: area_ID | name | plants 1 | forrest | *needhelphere* now I want the area to store any number of plants, in a specific order and some plants might show up a number of times: e.g 2,20,1,2,2,20,1 Whats the most effic...

Executing GPGPU program through WAMP

Hi, I have a program that uses the GPU for performing certain computations. I can get the program to run correctly using the command line. But when i try to execute the same statement through PHP, i run into trouble. I'm using wamp 2.0, and I've tried the exec and proc_open functions to try to get the program to run, but even though th...

Screen Scraping of Image Links in PHP

I have a website that contains many different pages of products and each page has a certain amount of images in the same format across all pages. I want to be able to screen scrap each page's url so I can retrieve the url of each image from each page. The idea is to make a gallery for each page made up of hotlinked images. I know this c...

URL Encoding in Flex and PHP

I have got a simple flex client requesting some data from a php script. I am using URLLoader to pass the parameters to the php and wait for the response. Since the value of the parameter can contain any character, I was using escape function on the flex side to pass the value to the php script. I figured out that flex escape does not wor...

What is the Index - Normal - FullText - Unique

Same the title : What is the Index - Normal - FullText - Unique ? ...

Save value in PHP Session variable.

Hi, I have an html table which contains records, comes from mysql db. Each row also contains id (PK) wrt db table record. Now I want to save record id in PHP Session variable, when I click on a row. To do this I used onclick property for each row & call a javascript function with record id as function parameter & it works fine but how co...

Executing .jar file from PHP through cmd prompt and capturing output

Hi, I have a jar file of my application which has more than one class. The jar file is called by PHP through the command prompt. I am using the following PHP snippet to call the jar file. <?php $result=popen('java -jar D:\\Development\\Filehandler\\dist\\Filehandler.jar getConfigLang', "r"); while(!feof($result)){ print fread($result,...

echo image url with tags in php

I have previously asked a question on how to echo the url of images from an html page. I can do this successfully but how can I narrow this down further so only images urls beginning with a certain phrase are shown, furthermore how can I add an image tag around them so the images are displayed as images and not just text? e.g I only wan...

How to I check to see if the browser supports flash?

hello all, I have a flash banner that I want to replace with a static image if the clients browser doesn't have flash enabled. I was wondering if I can do this with php - or if anyone knows of a good method Thanks ...

Is it possible to unit test View's in CodeIgniter?

I'm using TOAST and it's doing a great job testing models... but what about views? ...

stream_socket_server: Client browser randomly aborting?

Below is partial code to an experimental http server app I'm building from scratch from a PHP CLI script (Why? Because I have too much time on my hands). The example below more closely matches PHP's manual page on this function. The problem I'm getting is when connecting to this server app via a browser (Firefox or IE8 from two separat...

How can I restrict / authorize access to PHP script ?

There is this PHP script on my website which I don't want people to be able to run by just typing its name in the browser. Ideally I would like this script to be run only by registered users and only from within a Windows app (which I will have to provide). Can this be done ? Alternatively, how can I protect this script so that it can ...