php

Decoding Java's JSON Unicode values with PHP

I had experienced different JSON encoded value for the same string depending on the language used in the past. Since the APIs were used in closed environment (no 3rd parties allowed), we made a compromise and all our Java applications are manually encoding Unicode characters. LinkedIn's API is returning "corrupted" values, basically the ...

Can use PHP to reboot linux server or restart dhcp?

i have try some command like system(reboot) exec(reboot) and system("/ect/init.d/networking restart"); but not happen something how can i do? ...

adding and removing css classes on href

Hi I have a page with 2 links on it. The page URL is example.com/all Now the 2 links on the page, one goes to example.com/all/list and the other to example.com/all/map What I want is when the user lands on example.com/all, class for the href link needs to be 'current' When I click on example/all/map the map link needs to have the clas...

how can i remove extra last semicolon in csv file?

How can i remove extra last semicolon in csv file.Because it's taking extra blank field. Below is format of csv file. 12/12/2010;vvvvvv;JJJJ;BB;02070;kkkk yyyy tt oooo ;jjj iii;;mm nn nnnn;nnnnn gg bbbbb;xxxx ccc;;63610 iiiiiii;http://google.com;aaa bbb;;06 85 83 38 25;;[email protected];;2010-12-12;T;nnn;bbb-rr;rrr;rrr;3 C;N; please help me...

Custom loop not comparing metavalues properly

Hi so I have a custom loop that is supposed to show upcoming events only it's not taking into account the year so it's displaying future events as being in the past due to just the month and date. <ul class="upcoming"> <?php // Get today's date in the right format $todaysDate = date('m/d/y H:i:s'); ?> <?php query_posts('showposts=2&cat...

java application servers with php and exploded war support

i am looking for a java application server to install on my machine to deploy a project in an EXPLODED war way but i need this server to support php. i tried using tomcat 6 with apache 2.2 but i failed in doing this. ...

Regular expression - any text to URL friendly one

PHP regular expression script to remove anything that is not a alphabetical letter or number 0 to 9 and replace space to a hyphen - change to lowercase make sure there is only one hyphen - between words no -- or --- etc. For example: Example: The quick brown fox jumped Result: the-quick-brown-fox-jumped Example: The quick brown fox ju...

php shift in a hierarchy array

Hello. I have the next array: Array( [id] => 1 [children] => Array( [2] => Array( [id] => 2 [inactive] => true [children] => Array( [4] => Array( [id] => 4 [children] => Array() ) ) ) [3] => array( [id] => 3 ...

PHP/MySQL convert 'while' statements to 'foreach'

Hi, Following on from a previous question, shown here, I was wondering how I would go about changing the code below into 'foreach' statements? Any help greatly appreciated, S. <div id="banner-wrap"> <div id="banner" class="gallery"> <ul class="galleryBar"> <?php ...

What's the best way to connect iPhone app (iOS SDK) to php/MySql backend

Hey guys, New to iPhone dev here. Just wondering what's the best way to connect an iPhone app frontend (based on Cocoa) to a php/MySql based backend? The iPhone application will frequently access and change data stored on our server. Many thanks ...

Incorrect number of active consumers in ActiveMQ

Hi, I'm playing around with ActiveMQ, connecting to it using Zend_Queue (and by extension Stomp). At present, the PHP script I've written, Connects to queueA and receives data from it. The data is then processed into another format. This result is then sent to two other seperate queues, queueB and queueC, for later further processing...

Fault code: soap:Server Fault string: Server was unable to process request. ---> get out!

Hi, I'm doing web service to import data using the API but I cannot import data because there is an error in soap "Fault code: soap:Server Fault string: Server was unable to process request. ---> get out!" What does it mean? Any help is appreciated. Thanks in advance! :) ...

Foreach Just Echoing First Entry

Apologies if I should know better, but I've been struggling for quite a while with this one. I have a mysql db with 300 rows. It contains 4 columns, "eventid", "player1", "player2", "score". In the game, player1 gives various others (player2) a score out of 100. What I'm trying to do is show the logged in user (player1) a table of the...

How well do PHP and Oracle fit together in an enterprise setting?

We use Oracle and PHP together with some success. It seems there are a lot of rough edges as compared to, for instance, Java + Oracle. I am familiar with the Underground PHP + Oracle guide and that there is information scattered around the net. While OCI8 seems to work in most cases, there is noticeably a lack of support for PDO. The...

AJAX database access in PHP. The simplest way.

I'm looking for the simplest possible solution to get mysql database records as XML output using PHP. That means no third party APIs. Just pure php code and as little of it as possible. I posted a similar article for c# in my blog and im looking for an equivalent that will work on any hosting company. Here is the link (i couldn't add ...

help using mod_rewrite on both dynamic and static URL's

I looked at this topic: http://stackoverflow.com/questions/3317580/configuring-search-engine-friendly-url-mod-rewrite and understand how the rewrite rules would apply, but need help understanding how to adopt them for websites that have static and dynamic URL's. From the topic above, the rewrite rules would first look for a file that ex...

php session lost when using paginate

Hi my PHP session is lost when using a pagination script. can someone explain why this would happen? I tried putting session_start() at the top off all the paginate script file but that did not work. session_start(); $_SESSION['user'] = $line['UserName']; $_SESSION['pass'] = $line['Password']; $_SESSION['session_...

Facebook Graph API, pull information anonymously

Hi there, I know that this question could have been asked a million times before, but unfortunately I can't compile all these answers to get it working. I want to write a PHP code that uses facebook graph API, to search for a profile (by name for example) and then grab this information to a local store. I revised facebook graph API but...

Pattern of grey color.

<?php require_once 'Spreadsheet/Excel/Writer.php'; $workbook = new Spreadsheet_Excel_Writer(); $format6 =& $workbook->addFormat(); $format6->setBgColor('green'); $format6->setPattern(6); $worksheet->write(1, 1, 'the bg', $format6); $workbook->send('setBgColor.xls'); $workbook->close(); ?> Can you please tell me the the pattern for ...

WordPress plugins recognition script in PHP

I was trying to write a script that will uncover the plugins a certain WP blog employs... without success... The final output file should include name and version of all plugins, activated and deactivated. (Maybe grabbing all data from WP DB?) Hope that makes sense. Not sure it can be considered as question... ...