php

Force loaded / displayed image to link to an html ( my post ) page in colorbox

Hello, I'm using custom meta data to display images as a post in wordpress. When I click the image on my main page it opens in colorbox and this is perfect. WHAT IS HAPPENING : now, with the image loaded into the colorbox, when I click on the image it cycles through the images on my home page ( NOT what I would like ). WHAT I WOULD L...

I want to hide the details of record (of database) from user when date will be expired using php

Hi friends , I'm totally new to php & mysql, When I'm creating one trial application using php ,there is problem specify below, I want to hide the details of record (of database) from user when date will be expired using php , When one user logedin & create one record entry that time automatically current date is also entered in data...

Mysql transactions within transactions

In a PHP script working with a mysql database, I recently had the need to use a transaction at a point that happened to be inside another transaction. All my tests seem to indicate this is working out fine, but I can't find any documentation on this usage. I want to be sure - are transactions within transactions valid in mysql? If so,...

Remove composed words

I have a list of words in which some are composed words, in example palanca plato platopalanca I need to remove "plato" and "palanca" and let only "platopalanca". Used array_unique to remove duplicates, but those composed words are tricky... Should I sort the list by word length and compare one by one? A regular expression is the an...

PHP: Get the Latest File Addition in a Directory

How to get the latest file name, or the file path that is added into a directory? ...

FTP download fails on remote virtual server but works perfectly on local setup

Hi, I have developed a recursive FTP-download script, in PHP5, that allows you to select some files and/or directories to download using an AJAX request. The POST-variable that the server receives is just a short pipe-separated string that does not take up any memory at all. The script itself works perfectly on my local Apache setup an...

PHP string concatination using ","?

I just discovered something. If I type this: echo $var1 , " and " , $var2; it is the same as: echo $var1 . " and " . $var2; What is the actual of concatenation operator in php? Using . or ,? ...

Two rapid AJAX calls confuses PHP

I just ran into something weird. I have two JSON arrays which holds different data. Usually I just need data from one of them, but when I try to do a dual ajax call to get data from both arrays, I end up with the exact same data on both calls. Say array 1 holds JSON data on users, and array 2 holds JSON data on houses, and I want to get...

Facebook Page get_stream With Facebook Offline Validation Process?

So I am looking to make a php application similar to the fanbox, but I need to just have the data extracted as json or whatever the FBAPI returns with get_stream. But I don't want it per-user. I just need to grab a single fanpage wall content and put it on the website. Would I have to validate? How do you validate with the offline_ac...

Best practices when an unknown error occurs on a dynamic website?

I have a PHP site which (as every other site) has some hidden errors. The question is what should happen when an error occurs? I see lots of PHP and other sites where in case of an error the page is a bit broken, sometimes even an internal error message is dumped to the page, but usually the site stays partly usable. The other approach...

PHP Magic Constants

I am trying to get the filename of the script that is running (But not the include it is calling). echo basename(__FILE__); # will always output include.php echo basename($_SERVER['SCRIPT_FILENAME']); # This will do what I want (echo myscript.php), but I was wondering if there was # a better way to grab it, as I have had problems with ...

Special Characters not working in link titles.

Hello. Basically, i have a site put together with PHP, HTML and CSS. I had a problem with it not showing special characters (eg. å,ä,ö), so i changed the charset from UTF-8 to ISO-8859-1. That solved the problem for the text on the site, but everything inside a pair of tags still fails to show up correctly. Any thoughts? Edit: I change...

How to reuse methods in ZF views

In my application i have the following classic template on 3 columns ********************************************************* * * * * ********************************************************* * * * * * * * *...

Zend_Db: Adapter suddenly is null!

Hey there, I'm using Zend_Db in one of my projects. Now I have the problem, that suddenly during the code execution, the variable $_db in Zend_Db_Adapter_Abstract is null. (shown by var_dump($this); in my DbTable_xx class). It seems like the adapter is set to null somewhere during the script execution. How can that happen? Unfortuna...

Trying to call a function every 3 minutes using javascript

I have a function that returns an integer (the current reputation score for a user on a community site). That number is often going up or down based on how their comments and submissions are voted on. I'd like to "poll" it every 30 seconds or so to see if it's changed, and if so, update the number that I'm displaying. In another Stack...

PHP escaping error reporting with @

I am currently refactoring some code for work and I have come across some function calls prefixed by the "@" symbol. As I understand it, this is intended to escape PHP error reporting if the call fails. Is this type of thing good practice? I understand the rationale in a development environment but when the site is pushed to production...

Can't upload file in Internet Explorer using JQuery Form plugin

I'm using JQuery Form Plugin to upload a file together with PHP, everything works perfectly in Firefox, but in Internet explorer is does not do anything if I submit the form. My code is below <script type="text/javascript"> <!-- $(document).ready(function() { var options = { target: '#message', url:'../includ...

how to write php function

hi i want to know how i can write php function in c (like strtoupper). if is there any tutorial please put it here thanks ...

How to Ensure, whether message sent or not in APNs

Hi I tried sending the test message $apnsHost = 'gateway.sandbox.push.apple.com'; $apnsMessage = chr(0).chr(0).chr(32) .pack('H*', str_replace(' ', '', $deviceToken)) .chr(0).chr(strlen($payload)) . $payload; fwrite($apns, $apnsMessage); I got the message Connection Establishedsending message :�� d^÷Îå0ZCd%1ÄuwOOYš'ÊÈ}ârðm¾Í�...

Will cron execute php files or only CGI scripts?

Can .php be used in Crontab function on Linux or wil it execute only .CGI scripts? I'm using Plesk Control panel, I did the settings as per the Crontab doc, but i think it's not executing the php files. Does any one have the Idea about what more to do with ...