php

Replacing IFrame with div

I have a IFrame where I load in a custom search, and display the results within the iframe. The search results I obtain by calling an external url, that returns a value. I need to implement the same thing for a mobi site that works on mobile devices, and thus I need to replace the IFrame with something else. Will this be possible using a...

Php mkdir( ) exception handling

mkdir() is working correctly this question is more about catching an error. Instead of printing this when the directory exists I would just like to have it write to a message to me in a custom log. How do I create this exception. Warning: mkdir() [function.mkdir]: File exists ...

possible to make text messaging with php have a constant "telephone number" value?

hello, i have an iphone 3g and can successfully send text messages using the PHP mail() function. My issue is that for each message i receive, the "telephone number" associated with the incoming text message changes each time. If possible, I would like to somehow make this number constant so that I can take advantage of iphone's abilit...

Is there a way to pass another parameter in the preg_replace_callback callback function?

mmmh guys, i really hope my english is good enaught to explain what i need. Lets take this example (that is just an example!) of code: class Something(){ public function Lower($string){ return strtolower($string); } } class Foo{ public $something; public $reg; public $string; public function __construct(...

How do I configure and use PHPunit with Hudson?

How do I configure CI hudson with PHPunit and how do I run phpunit using hudson? ...

Check system security

Is there any system to check that a php script is secure or not? Thanks in advance ...

PDO and SQL IN statements

Im using a sequel for search like this using PDOs $states = "'SC','SD'"; $sql = "select * from mytable where states in (:states)"; $params = array(':states'=>$states); and I use my function $result = $this->selectArrayAssoc($sql, $params); where my selectArrayAssoc function as following public function selectArrayAssoc($sql, $params...

PHP voting system with sessions?

Hi guys, I've been reading up on stackoverflow about creating voting systems in PHP that minimize abuse/multiple voting from the same user, but I haven't come across the answer to my question. I've got an application where users don't need to register to vote or "like" an entry. Obviously, I want to minimize abuse and I don't want to l...

Is there any library out there for c# that has the equivalent to "Unpack" in PHP and what is "Unpack"

I just want to convert a piece of PHP code to C# so I need it's equivalent. And what does unpack really do? I'm very interested in this function. ...

how wordpress can un-slug a title

i still , don't understand , how wordpress can understand what is this url refer to : www.mysite.com/about-me/ they are using no identifier if they using slug functions so how they can retain story information or in other word , how they change back the slugged title to select from database ...

XDebugClient won't inspect function scope

Hi, I am trying to debug my PHP script. To do so, I use a Windows GUI called "XDebugClient". It's a little clunky but I've been able to manage so far, given that to date I only have a collection of very noddy little PHP scripts. On the global level, I can inspect all variables and it works just fine. Yesterday, I wrote my first PHP f...

Client / Server application for Video BroadCasting on LAN

I m much of a newbie to client/server applications and networking.I am currently starting up a project in which we are planning to create an application or something like a website accessible only to clients in that LAN network.We want the server to upload videos so that the clients can view them whenever they want.Also the clients can u...

w3c validator: local installation on windows

i am trying to install w3c validator locally on windows xp with apache server. I am following this document http://validator.w3.org/docs/install_win.html but when i validate some site i am getting this error SGML::Parser::OpenSP version 0.991 required--this is only version 0.99 at C:/www/validator/httpd/cgi-bin/check line 60. BEGIN fai...

Find Month difference in php?

Is there anyway to find the month difference in php? I have the input of from date 2003-10-17 and todate 2004-03-24. I need the results how many month is there within these two days. Say if 6 months, i need the output in months only. Thanks for guide me for day difference. I find the solution through mysql but i need in php. Anyone hel...

Advice on handling widgets for different types of data (MVC)

Hello, I have a few widgets I need to show on a site - they are all relating to different types of data (e.g user, house). Each type of data and its relations is represented in specific models, but as far as a controller or helper is concerned, is it an ok plan to have a generic Widget controller/helper which generates the necessary widg...

Facebook failing on XFBML call using Yii Framework

I have used this same call in other IFRAME Facebook apps, but it gives me nothing at all in terms of output. I am trying it on Yii and getting nothing. <script type="text/javascript"> window.onload = function() { FB_RequireFeatures(["XFBML"], function() { FB.init('xxxxxx', 'xd_receiver.htm'); FB.XFBML.Host.get_are...

how to update two input boxes in jquery

hey guys i create two input text fields , one for title and another for permanent link i need to update the second filed automatically when user is typing the tilte how can i do such a thing in jquery /php somehow im looking for a way to simulate wordpress creation of permanent link in post section ...

PHP Sum Array - sum only elemants of an array

Hi all, I have have an array as follows: $row when I output the entire array it produces the following: 1. I like crisps (38) 37% 55% 8% 0% When I echo one part of the array I get the 4 figures I am interested in. echo "<td class='set1'>". number_format($row[6], 0) ."%</td>"; The above code outputs the following 4 numbers: ...

Filename of script that instantiates an object

In PHP, is it possible to get the file name of the script that instantiated an object? For example I have a script called file.php that creates a new instance of class Class. The class has an Error object that, when triggered, returns some error information. I would like to show that file.php triggered the error. ...

PHP Postgres constraint violation - can I get the constraint name somehow?

We have a web application talking to a Postgres SQL database at work - I've set up many constraints on the server to keep data consistent but we have problems with reporting nicely what it is that prevents the user from entering his (invalid) data at a given moment. The only thing we can get is "Constraint violation" but that isn't very...