php

How can I make two different PDF files appear in the same iframe?

I used the FPDF class to create a multi-page PDF document and then I used an iframe to display the multi-page document. Here is an example of the result: I want to do the same thing on another page, except a bit different. Instead of displaying one multi-page PDF document, I would like to let the user upload two separate PDF's and the...

Searching for multiple words in on field in Lucene index

I'm having problem with Zend_Search_Lucene. I have few documents with field "tags" in index. Documents "tags" have following values: tag1 tag2 tag3 tag1 tag4 I would like to find document only with tag1 AND tag4 so I use query "+tags:tag1 +tags:tag2". I can't figure out why I get 0 hits from index. ...

what is the diffrences between framework and template engine ?

What is the difference between the framework like zendframework and templates engine like smarty? i realy dont understand the difference>> alson i need to know Which Start learning ؟ ...

Using netbeans, xdebug, symfony and phpunit together...

Hi all, I installed xdebug on my Apache and if I define a breakpoint in Netbeans, the execution breaks fine. But if I execute the tests with symfony phpunit:test-all, the execution will not break on the given break point. Any ideas? cowabunga! ...

extract uid from Facebook Connect with php

I'm a novice when it comes to java and not awesome at php, so dont judge me if this is realy easy or impossible... I would like to extract the users facebook-id and put it into a php-variable. How do i do that? The code im using is from a facebook tutorial video, and its working. I just want to be able to use the user id in a php code....

To use, or not to use, session_set_save_handler?

I'm playing around with creating a user login system in php. I have been studying this article (http://www.evolt.org/node/60384) as a way of approaching this. In the above article, the author uses a combination of $_SESSION and his own custom database table for storing user info. However... I have also come across numerous articles t...

PHP ideas specialization for performance

What kind of ideas or tips and tricks do you have in order to boost PHP performance. Something like, I use: $str = 'my string'; if(isset($str[3]) Instead of: if(strlen($str) > 3) Which is a bit faster. Or storing values as keys instead of vars in array, makes searching if key exists much faster. Hence using isset($arr[$key]...

Executing multiple cURL requests

Hi guys, I am trying to sequentially execute multiple curl requests, but I am not really having any luck, here is my code thus far, //upload photo $file= 'photo.jpg'; $args = array( 'message' => 'Photo from application', ); $args[basename($file)] = '@' . realpath($file); $ch = curl_init(); $url = 'https://graph.facebook.com/me/phot...

How to measure PHP script execution in CPU cycles?

How can I measure my PHP script execution in CPU cycles? I do not need execution time, because if script connects to db or to external API , its waiting and do not consume CPU resources. EDIT: PHP<5.3, Windows ...

PHP Random Number

I want to generate a random number in PHP where the digits itself should not repeat in that number. Is that possible? Can you paste sample code here? Ex: 674930, 145289. [i.e Same digit shouldn't come] Thanks ...

how to enable virtual directory in php.ini?

when i do phpinfo() in my localhost it shows "Virtual Directory Support enabled" but when i do this in server it shows "Virtual Directory Support disabled "...how do i enable virtual directory. what do i need to change in php.ini file? ...

PHP: Move file from domain to subdomain

Hi guys, I have a site on a domain, let's call it "mydomain.com", where people can log in. This domain has a subdomain sub.mydomain.com. When the user uploads a file on the main domain, I want to move it to the uploads folder on sub.mydomain.com. The folder I want to move the file to has full write/read privileges. My code that upload...

list of registered shutdown functions

Is there any method to access to list of registered shutdown functions? ...

Zend_Soap_Client request is creating the specified parameters but is not setting the values in the resulting XML that is sent.

I have a Zend_Soap_Client object, and I'm trying to call a method on it: $soapClient = new Zend_SoapClient('my_wsdl'); $params = array( 'Login' => 'username', 'Message' => 'hello' ); $soapClient->GetSoapRequest($params); echo $soapClient->getLastRequest(); I would expect to see: <?xml version="1.0" encoding="UTF-8"?> <env:...

IE6: Large File Uploads fail and a Page Cannot be displayed is returned?!

Hello all, I have a very simple file upload PHP script. I am testing with a 175Mb file at the moment. This works fine on all browsers (firefox, chomre etc) including IE7 and above but it does not work for IE6. When I upload the file, the script should export an access database (that was just uploaded) and all its tables to text files t...

Access function from model class or controller class from helper file with Codeignitor

Hi, I know it is not a good exepireince.But just I want to know it is possible to access a function from model or controller class from a helper file in codeignitor. Thanks ...

Unknown problem with PHP's XML parsing functions

I'm using a PHP4 implementation of SimpleXML, which uses the built-in xml_* functions from PHP 4. I have an odd problem that I'm unable to diagnose due to no error reporting on the server and not being able to turn on error_reporting. I've modified the Parse() function to include this: [stuff here to initialise the parser] echo '<texta...

How to update image src with the local path when user has selected an image file?

Hi, Html <input type="file" name="picture" value="" /> <img id="preview_pic" src="/images/no-image.jpg" alt="" height="100" width="100" /> I can see the "file" input box gets populated with local file path. I want to replace the img src with this new local file path to just give a preview of the image they have selected. If the file...

PHP Cron Job: Including file not working?

i run a cron job every night, but for some reason, it is saying that the file i try to include is inexistant: Warning: require(../includes/common.php): failed to open stream: No such file or directory in /home/fini7463/public_html/cron/journeyNotifications.php on line 2 Fatal error: require(): Failed opening required '../includes/common...

Need an online customisable estore solution which can be integrated - any ideas?

Hi guys, I was looking through different online applications such as freshbooks and like how they have an api to allow for a certain degree of integration so you can use their application for invoicing instead of having to build your own invoicing system from scratch. I'm looking for an online shopping service - is there any such web ap...