php5

PHP How to create real hex values from a string

Hi, I have a string with hexvalues that I use with sha1() echo sha1("\x23\x9A\xB9\xCB\x28\x2D\xAF\x66\x23\x1D\xC5\xA4\xDF\x6B\xFB\xAE\x00\x00\x00\x01"); ab94fcedf2664edfb9b291f85d7f77f27f2f4a9d now I have another string with the same value only not hex. $string2=strtoupper("239ab9cb282daf66231dc5a4df6bfbae00000001"); I want to co...

\w in PHP preg_replace covers only second byte of UTF-8 chars

we have this code: $value = preg_replace("/[^\w]/", '', $value); where $value is in utf-8. After this transformation first byte of multibyte characters is stripped. How to make \w cover UTF-8 chars completely? Sorry, i am not very well in PHP ...

Different Soap Envelopes - One Works, The Other Fails

I'm making an identical SOAP Request, one using the Zend Framework and the other not. The Zend one is not working and the only difference seems to be the envelope namespace. How is the envelope set and why would one of them fail? Zend Soap Call <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://wsapi...

Automatic file transfer (daily)

Is it possible to automaticly download xml files from one server to another server on a daily basis with PHP? The goal is to create a webapplication in CakePHP which makes use of an xml report that comes from a online accountingserver. So it can be done using a cronjob? But is cron supported with PHP? Where can i configure that cronjo...

Automatic file transfer (daily)

Is it possible to automaticly download xml files from one server to another server on a daily basis with PHP? The goal is to create a webapplication in CakePHP which makes use of an xml report that comes from a online accountingserver. So it can be done using a cronjob? But is cron supported with PHP? Where can i configure that cronjo...

Best possible PHP error class

I am looking for some coding ideas on the following task I am trying to achive. I have a list of Error Numbers, Description, and User Friendly Description in a document. Ex: Error Number, Description, User Friendly Description ----------------------------------------------------- 1, Internal Error, "An Internal Error has occurred. Ple...

PHP - Is possible to find if user is browsing from beind a Router and get Router Info

Hello guys. I think it isn't possible just using PHP, but just to be sure. Is it possible for PHP to know if the user is accessing the web from behind a Router? And if yes, how can i get some information about that router, like: Router Name, Brand, Serial Number, ... Users connected in the same network. Can PHP also find the Local I...

How to regex match text with different endings?

This is what I have at the moment. <h2>Information</h2>\n +<p>(.*)<br />|</p> ^ that is a tab space, didn't know if there was a better way to represent one or more (it seems to work) Im trying to match the 'bla bla.' text, but my current regex doesn't quite work, it will match most of the line, but I want it to mat...

Is it possible to delay variable implement(?)/recognize(?) in PHP?

For example: A.php (the config file): <?php $a = array('name'=>'wine[$index][name]', 'value'=>'wine[$index][value]' ) ?> B.php: include_once(a.php) ... //for simple $index = 0; $b = $a; //actual code like foreach($data as $index=>$value) $b += $a I know this example won't work, just for explaination, i wan...

PHP fetch all Twitter Followers and compare them to friends

Hi, I am looking for scalable way to do the following: User login Fetch all Friends from Twitter Fetch all Followers from Twitter Display all Friends wich aren't Followers The Problem: How can this be done in a scalable way? An user can have up to 2 million friends or followers. Currently I'm storing both inside an SQLite table and ...

how to know whether file is downloaded by user or not?

hi all, I have a functionality where a user is given file to download. It works fine. BUT - 1. How to know whether user has downloaded a file or cancelled it? 2. After downloading I wat to redirect current page to another one that is also not happening. Please let me know if any one of you have any idea about it. (I am doing it in Joom...

How can I convert input to HTML Characters correctly

Let's say I'm including a file which contains html. The html have characters as exclamation symbols, Spanish accents (á, ó). The parsed included text gets processed as symbols instead of their correct value. This happens on FF but not on IE (8). I have tried the following functions: htmlspecialchars, htmlentities, utf8_encode include ...

Moving from php4 to php5

I tried moving to php5, I am getting into lot of issues. This class gives error : Class DatabaseConnection { // error here private $connection; private $result; // public function __construct() { $this->databaseName = $GLOBALS['configuration']['db']; } // ot...

PHP5 and SOAP/WSDL?

I have a big problem right now, i need to create my own webservices but i really don't know how, can sombody help me? maybe link to easy way to make WSDL/SOAP code? i have try NuSoap but i can't get final whit this code, please help me. :) ...

Site doesn't show up. Instead a bunch of weird characters?

‹�����혱jÃ0†w=Å=AÜ ÂЃ)ÅKGÅ:¢En%¹©ß¾²Ý 7xèpußøãŸ~ÝöÇ®Ömót¨•îŸû®©îao‚½‘Í:ºR†æk@´huõÃ(]­;z:¼•Íö¾þ{¥•‚¾ímwi£_±Ä1)–ÄÇ�‡‘,‰%Ž#YKF²Ä²Ä8ŒèKF²$–88ŒdI,qpÉ’Xâà0’%±Ä1Àaþe–TïÆOŒ@ 2^ßÇh"ù¦`Î!뜄yœ"Dü˜0e°Ó:ËË>e„ñʈfp.à(U®<œv¿ì;xñhRY3˜‹¡�ÞdŒ;Uºõ×R°WkÑ^Z÷¥¯Wß.Ò¤·�� That's exactly what shows up instead of my website in the web browser. Though on local...

Ideas Needed for a Base Code System

I've developed a PHP web application that is currently in need of a strategic restructuring. Currently when we setup new clients we give them the entire code base on a subdomain of our main domain and create a new table for them in the database. This results in each client having the entire codebase, meaning when we make bug changes, f...

How to use soap in javascript

Hi guys, I am trying to use SOAP in javascript but i am not getting how to start it. Here is the code sample i write in PHP and it works fine. I want to write this code in Javascript. In following code i call one api from a www.example.com and for calling certain api we require to pass some parameters. $soapClient = new SoapClien...

Zend Server with xampp MySQL

I am running Zend Server,Zend Studio (Trial versions) on Ubuntu 9.10. I am also using xampp to do most of my development. I plan to use Zend Server only to do URL profiling to know function level performance of my code. Is it possible to configure Zend Server to use XAMPP's MySQL database instead of installing a new mysql instance for Ze...

curl multipart/form-data help

Hi am trying to post some data on a website using CURL. The posting process has 3 steps. 1. enter a URL, submit and get to the 2nd step with some fields already completed 2. submit again, after you entered some more data and preview the form. 3. submit the final data. The problem is that after the second step, the form data looks like ...

php-curl script that saves images---actually captcha images

I have a curl class, called Curl. Let's presume i have this code: $url = 'http://www.google.com' $fields = array('q'=>'search term'); //maybe some other arguments. but let's keep it simple. $curl = new Curl(); $page = $curl->post($url,$fields); $page will have some images wich curl doesn't load them by default. I need to know how i c...