php

Parse RDF XML file to get all rdf:about values

I am using php's simple xml and xpath to parse an rdf xml file and am struggling to get a list of all the rdf:about values. Any advice? ...

Pass-by-Reference Error

I have a hook system setup... which is working on localhost... I put it live and get an error saying "Warning: Call-time pass-by-reference has been deprecated". Now, apparently the work around is to remove all "&" from your function calls, ie foo(&$me) to foo($me) and then in foo's function definition do "function foo(&$me)". However, ...

saving information in file in php

hey guys i want to write a tracking system and now i can save in my Mysql database . but saving information about each ip that visits is a huge work for mysql so i think if i could save the information in a file , then there is no discussion about database and its problems . but to begin this : i realy dont know how to save in a ...

Sorting and Pagination does not work after I build a custom keyword search that is build using relational tables

I recently started to build a custom keyword search using Yii 1.1.x The search works 100%. But as soon as I sort the columns and use pagination in the admin view the search gets lost and all results are shown. So with otherwords it's not filtering so that only the search results show. Somehow it resets it. In my controller my code look...

What is the difference betwen Variable in PHP4 and PHP5 ?

the only thing i know about this subject is... in PHP 5, when a variable used without assigned any value, then it a warning will be shown. Is there any other difference between this 2 different version ? ...

PHP debugging or performance Hook

In an interpreted language like PHP it is possible in theory to set up some sort of callback function that would be run indiscriminately after every line of code. I am wondering if such a thing exists in PHP or if such a thing could be accomplished in any way? Such a feature could be useful for diagnostics or performance tests. Does a...

Pulling a timestamp from an XML feed with PHP but seem to be to many digits

I am pulling a timestamp from a feed and it gives 12 digits (1269088723811). When I convert it, it comes out as 1901-12-13 20:45:52, but if I put the timestamp into http://www.epochconverter.com/ it comes out as Sat, 20 Mar 2010 12:38:43 GMT, which is the correct time. epochconverter.com mentions that it maybe in milliseconds so ...

How to make a Multilanguage website in php and Mysql

Hello to All Group Members. Can any body tell me how i make a dynamic multilanguage website in php and mysql.I have no idea abt it.I search on google and do not find good solution. Any one tell me step by step guide if possible made a demo for multilanguage website. Or please refer me any link where tell the detail abt it.How i do it. ...

How to implement search in jqgrid in php controller

I have been playing around recently with jqgrid and am at loss on how to implement search in my controller using PHP (Zend). I came across a post that is quite similar to the answer am looking for but what I need is the PHP version not ASP.NET. ...

Php code not executing - dies out when trying to refer to member of static class - no error displayed

I'm having some problems with this piece of code. I've included a class declaration and trying to create an object of that class but my code dies out. It doesn't seem to be an include issue as all the files are being included even the files called for inclusion within the class file itself. However the object is not created - I tried to...

What is the pro and cons using Heredoc Notation in your PHP?

I've never seen something like this before. So, it's confusing me for a while. But now I understand and use it sometimes. So, after brief experience, can anybody tell me what is the pro and cons using Heredoc Notation in your PHP? $stringval = <<<MYHEREDOC just creating variable here. nothing more. MYHEREDOC; Personally, how do y...

Using PHP Sockets as a "Relay"

Hi! I'm trying to create a left > php socket-server < right relation with php sockets. Let's say that I have a server-daemon on the left side, like a vnc-server that connects to the socket-server. On the right side I've got a client that want to connect to the left server-daemon, but it has to be done through the socket-server. The s...

Best way to sanitize content with PHP?

Which is the best way to "sanitize" content? An example... Example - Before sanitize: Morbi mollis ante vitae massa suscipit a tempus est pellentesque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla mattis iaculis consectetur. Morbi mollis ante vitae est pellentesque. Pellentesque ha...

get_file_contents() PHP

Why have I got trouble with charset on echo? $url = "http://ru.wikipedia.org"; $site=file_get_contents($url); echo $site; ...

Complex regex question, data may or may not be in brackets

I need to extract data from a source that presents it in one of two ways. The data could be formatted like this: Francis (Lab) 18,077 (60.05%); Waller (LD) 4,140 (13.75%); Evans (PC) 3,545 (11.78%); Rees-Mogg (C) 3,064 (10.18%); Wright (Veritas) 768 (2.55%); La Vey (Green) 510 (1.69%) Or like this: Lab 8,994 (33.00%); C 7,924 (29.07%...

Curl loop to fetch multiple pages

I'm trying to fetch all the 'favorited' tweets made by myself. Firstly the API only returns the last 20 favorited tweets via this URL: http://twitter.com/favorites.xml (Must be authenticated to view) I can use a URL like this, to fetch a different page: http://twitter.com/favorites.xml?page=2 Im using this code to work out the num...

Pass encrypted querystring between php and asp.net (c#)

I need to pass a single variable in a querystring from one application (in PHP) to another (in ASP.NET). It's a one way transfer...That is I need to encrypt it in PHP and decrypt it in ASP.NET (c#). I'm barely a newbie on PHP and I'd like not to have to do more than add a tag to the page that needs to do the passing. The data will be...

jQuery not refreshing tabs content in IE

Hi all! I have a page that is using jQuery tabs. Within one of my tabs I have a div that contains a form (initially hidden) that I want to use to add content to the tab. What I have works perfectly in Chrome, Firefox, and Safari. But, in IE 7 the tab will not refresh. The post works and the data gets added to the database, but it si...

Uploading to google Docs - Unknown authorization header Error 401 - PLease Help

Hi guys I'm trying to upload a document to google docs but I'm getting an error namely an Unknown authorization header Error 401 to be exact.. I'm developing for google apps marketplace here - my code for uploading is: $client = getGoogleClient(); $docs = new Zend_Gdata_Docs($client); uploadDocument($docs, true, $FILES['file']['name...

PHP While Loops from Arrays

I have a table that contains members names and a field with multiple ID numbers. I want to create a query that returns results where any values in the ID fields overlap with any values in the array. For example: lastname: Smith firstname: John id: 101, 103 I have Array #1 with the values 101, 102, 103 I want...