php5

Update JQuery Progressbar with JSON Response in an ajax Request

All, I have an AJAX request, which makes a JSON request to a server, to get the sync status. The JSON Request and responses are as under: I want to display a JQuery UI progressbar and update the progressbar status, as per the percentage returned in the getStatus JSON response. If the status is "insync", then the progressbar should not a...

[PHP Array] - how to save a few lines for matching a long list of characters

Hi all, I got a question when I was doing some Array in PHP. I don't know how to write the code for the following case: $arrs = array("a@c", "cr", "exd", "hello", "gg%j", "hwa", "@", "8"); foreach ($arrs as $arr){ // if $arr does not belong to any characters from a to z, // then there must be some special character in it. // Say for ...

[PHP Array] - Sorting data and print out in alphabetic order

Hi all, I got an array which contains some data like this: $arrs = Array("ABC_efg", "@@zzAG", "@$abc", "ABC_abc") I was trying to print the data out in this way (Printing in alphabetic order): [String begins with character A] ABC_abc ABC_efg [String begins with character other than A to Z] @$abc @@zzAG I don't know how to do it. ...

PHP/MySQL - Working with two databases, one shared and one local to an instance of application

The situation: Using a off-the-shelf PHP application, I have to add in a new module for extra functionality. Today, it is made known that eventually four different instances of the application are to be deployed, but the data from the new functionality is to be shared among those 4 instances. Each instance should still have their own dat...

PHP SOAP problems with response

Hello everybody, since a few days I am experiencing problems with my developed php soap (php soap extension, NOT nusoap) search interface to the PubMed literature service using their eutils wsdl service (Entrez Utils). Before the problems arised I used the returned array from the low level function __soapcall(), it worked well, extrac...

CakePHP - Route configuration

Hello I am working on cakephp and totally a newbie to php/cakephp. Can you please tell me what is wrong with my route configuration here? Router::connect( '/news/:q/:page', array('controller' => 'news', 'action' => 'onDemand', 'mode'=>'news', 'page'=>1), array('pass'=>array('q','mode','page'), 'page' => ...

PHP Strange error "0:". Possible Object syntax problem?

I'm trying to transfer a site from one hosting company to another. I was using 000webhost until the client had hosting and a domain. Now that the client has their domain and hosting, using FatCow.com, I can not for the life of me, debug my PHP code. I'm not getting any errors. I have a successful DB connection. If you procedurally displa...

asXML() Problem

Hello, I wrote this code to quickly edit an existing XML file and save changes to the file. However, it doesn't seem to be writing my data to the xml file. Am I using asXML() wrong? Thanks for your help. <?php $xml = simplexml_load_file("../xml/emp.xml"); $xml->employee[0]['empID'] = $_POST['empID']; $xml->employee[0]->empFN =...

When does a PHP <5.3.0 daemon script receive signals?

I've got a PHP script in the works that is a job worker; its main task is to check a database table for new jobs, and if there are any, to act on them. But jobs will be coming in in bursts, with long gaps in between, so I devised a sleep cycle like: while(true) { if ($jobs = get_new_jobs()) { // Act upon the jobs } else { //...

$this->Session->setFlash displays in wrong timings

Hi, I am using $this->Session->setFlash to flash the error messages to the browser and its working fine. But, unfortunately, it is displaying the messages when it shouldn't display also. It is seems like, its getting the information's from cache and displaying. Please let me know, is there any way to solve it? ...

ajax in zend frame work

Hi, I am new to Zend Frame Work. I am using $ajaxContext = $this->_helper->getHelper('AjaxContext'); for adding action contexts. I have one Index.phtml page and all other views are ajax.phtml pages. I have to do some java script methods in the ajax.phtml pages. But i didn't find a way to refer the js files in the ajax.phtml pages. I have...

mysql query the latest date

I am running this query SELECT sh.*, u.initials AS initals FROM database1.table1 AS sh JOIN database2.user AS u ON u.userID = sh.userid WHERE id = 123456 AND dts = ( SELECT MAX(dts) from database1.table1 ) ORDER BY sort_by, category In the table1 I have records like this dts status ...

apc.cache_by_default with CodeIgniter

I'm trying to use APC (Alternative PHP Cache) on my localhost with wamp 2, PHP 5.3 and CodeIgniter 1.7.2, however If I turn on cache_by_default and enable apc.stat the server will crash and I get the following error: [apc-error] Cannot redeclare class ci_benchmark in C:\wamp\www\k\mvc\codeigniter\Common.php on line 127. What ...

Why are my \n not working in PHP?

I'm playing with SAX and noticed it's not line breaking properly. I have no iea why. function flush_data() { global $level, $char_data; $char_data = trim($char_data); if( strlen( $char_data ) > 0 ) { print "\n"; $data = split("\n", wordwrap($char_data, 76 - ($level*2))); foreach($data as $line) ...

In PHP what is .=?

What is .= in PHP? Also, I know in JavaScript, you can use += to add strings together, but can you do that in PHP? ...

Problem in implementing the Url Rewritting for a Zend Application

Hello everyone, I am doing my first Zend Applicaition and I am finally done with the coding side. But the problem which I have is Client has asked to rewrite the Url's which follows the SEO and as I don't have much knowledge of the Zend Router,I am finding myself helpless this time. Please helo me out.The current Url which I have is... ...

How do I get require_login()-like functionality using the new PHP Client Library for Facebook?

Howdy. I've been tasked with making a Facebook game, but I'm new to Facebook development, so I'm just getting started. Apologies in advance if this is a no-brainer to people. I'm having trouble following all the examples I see on sites, and I keep running into missing pages in the Facebook documentation when I am trying to read up. I...

php not showing all images

I a writing a gallery app in php. The images are dynamically displayed through php. On each load of the page, not all images are showing. it does this randomly, on each load. I have not had this problem before, as I am new to php. My previous apps where all in perl, and I had no dynamic image display problems when using that language. ...

dynamically load PHP code from external file

code is in a static class in an external file eg. /home/test/public_html/fg2/templatecode/RecordMOD/photoslide.mod how do I load this into my script on demand, and be able to call its functions ? I am a novice at php , so please explain your code. help is appreciated. Jer ...

Customized User Registration Form

Hey Guys, i have made user-register.tpl.php file. And i have set many text field in that. But now i need that.... i want to store the users information to the database. bcz i have created the customized registration page, so i need that my text field values should be store in the database. like this....... Username: <input type="te...