php

Protecting Scripting Language Source Code

I'd like to protect the PHP and JavaScript program source code from the prying eyes of my client. How can I do that? ...

PHP Based Advert Rotation Script (incl. click/impression monitoring etc)

I used a script many years ago that was basically and administrative backend where we could submit advertising banners (etc) and set up parameters (show forever, until x many clicks/impressions). I can't remember for the life of me what it was called though, and I'm needing to use it again. I thought for a second it was phpMyAd, but go...

PHP exec() hangs, Error 500

So, my plan is to make small thumbnails of URL's with PHP and IECapt. IECapt works well, a nice command line tool, gets the full sized image of specified URL in 1 to 4 seconds. But my problem is to execute it trough PHP. This is the code I've trying to get working: exec('IECapt.exe ' . escapeshellarg($URL) . ' ' . escapeshellarg($Filen...

Enable XML-RPC in PHP.ini

Good Afternoon! I have Joomla and a component called MyBlog (azrul.com) installed. To enable pinging of Technorati I must enable xml-rpc. By default this is disabled on my Shared Hosting account and cannot be changed. However, DreamHost says you can create your own custom advanced php5 installation. Instructions here: http://wiki.dre...

Flex and Zend_AMF: How do I get a Flex arrayCollection from Flex into PHP?

I currently have an arrayCollection in Flex and I want to sent it to PHP (Zend_AMF). According to the Zend_AMF wiki, sending an arrayCollection over directly will force Zend_AMF to cast the arrayCollection as an object which is no good. I'd rather have an array of my models. I assume the best way would be to convert the arrayCollection...

best way of xml processing in php

i have a list of xml documents that i want to extract data from and add to my database- which way is the best in php? example documents are http://xml.gamebookers.com/sports/football.xml http://www.bet-at-home.com/oddxml.aspx?lang=en I want to extract the odds of a the soccer teams, the odds of them winning and match them with the fix...

pop array in php

I need to have this output Array ( [id:>] => 0 [isonline] => 0 [userclass_id] => 3 ) and I am getting this output with this code: $pr = array('id:>'=>$id,'isonline'=>'0','userclass_id'=>'3'); print_r($params); This is good. But i want to pop new elements to array one by one. While i am using this code: $params = array(); ...

PHP array with default value for nonexisting indices

I love the Hash implementation of Ruby where you can initialize the Hash object with a default value. At the moment I'm struggling with implementing a similar object in PHP. This is my first (non-working) shot at this. class DefaultArray extends ArrayObject { protected $_defaultValue; public function setDefault($defaultValue) { ...

Passing a function's args straight to another function

In PHP, is there a way to send a function's arguments straight to another function without having to specify them one by one? Is there a way to expand func_get_arg() so that the other function receives the individual arguments and not just a single array? I'd like to send the arguments from foo() straight to bar() like so: function foo...

Return index of highest value in an array

From an array that looks something like the following, how can I get the index of the highest value in the array. For the array below, the desired result would be '11'. Array ( [11] => 14 [10] => 9 [12] => 7 [13] => 7 [14] => 4 [15] => 6 ) ...

abbreviate database output with jquery

I am looking for a way to limit the amount of characters displayed in a heading using jquery. Essentially the heading is retreived from the database but I only want the results to display on one line of a set width so would like to limit the output or abbreviate it to stop the images below being pushed too far down. The following Live e...

PHP Authenticate Playstation Network

Summary of what im trying to accomplish: I play motorstorm on PS3 and for the first game Monument Valley, the leaderboards are not available on the ms website. which means i cant scrape leaderboard data. Now i wiresharked my ps3 and i saw the request that monument valley uses to get the leaderboard data. now i replicated the request head...

Identifying the same user across multiple browsers/ISP connections

I run a film festival website which accepts ratings on films and I'm concerned with stopping people cheating the system (i.e. submitting multiple ratings to fix the top ten list). I've used techniques like IP address and browser stamp checking but I'm aware some people are trying to cheat the system by changing ISP connection or browse...

IIS wont send e-mail with specific FROM header

Can anyone please explain why IIS wont send message from php if FROM header field is in the following format: FROM: "Some Name" <[email protected]>. If I just use [email protected] everything is ok. ...

facebook gift application

hi want to create an application in facebook it simply select the images from the available option and i can send that gift to my frinds like in this apps http://apps.facebook.com/ecardsforallcechefeg/ ...

ie6 - gd and php image outputting

Hi guys, i'm trying to show image with grayscale-filter. Here is my code: $images = glob('gallery/*small*'); shuffle($images); array_splice($images, 3); $imgHandles = array(); $imgBuffered = array(); for( $i = 0; $i < 3; $i++) { $imgHandles[$i] = imagecreatefromstring( file_get_contents($images[$i]) ); imagefilter( $imgHandles...

Trying to find Twitter RT's with Regular Expressions and PHP

I'm trying to find the correct Regular Expression to match all RT scenarios on Twitter (can't wait to Twitter's new retweet API). The way I see it, RT's can be at the beginning, middle, or end of the string returned from Twitter. So, I need something at the beginning and end of this Regular Expression: ([Rr])([Tt]) No matter what I...

How to synchronize local directory with remote ftp directory?

Our website relies on images from one of our manufacturers. The image directories are massive and getting them via FTP is an all day job. Now that we've downloaded the entire directory, we'd like to be able to periodically download files and directories that are new, or have been changed since the last time we downloaded them. We're t...

How do you use Javascript to duplicate form fields?

For instance, I want to have a html form that looks like this: <table> <tr> <td>Field A:</td> <td><input type='text' name='fielda[1]'></td> <td>Field B:</td> <td><textarea name='fieldb[1]'></textarea></td> </tr> </table> What I want is to add a button that duplicates my entire above form, but changes the 1 to a...

PHP $_SERVER['HTTP_HOST'] escaping, does this look acceptable?

I am just learning about escaping things and started reading about how it could be risky to use $_SERVER['HTTP_HOST'] due to XSS attacks. I came up with this and was wondering if I could get some feedback on my attempt. htmlspecialchars( filter_var( $_SERVER[ 'HTTP_HOST' ], FILTER_SANITIZE_URL ), ENT_QUOTES, 'UTF-8' ) Does it...