php

Why PHP 4.4.9 throws 'Parse error: syntax error, unexpected T_STATIC'?

I just realized the professor Google is unable to present a specific page where I can find out, when static keyword added to PHP 4. Though following the change log for php 4 I can see that it was available since Version 4.0.6 (or before) but why does it throws: Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION ...

Wordpress Custom Options In Admin Area

I would like to create an custom option so that the user in the admin area could be able to select a alternative css that I will provide. I have made a custom page using the add_menu_page function in the functions.php. How could I retrieve all the .css files contained in the directory "/css" to make it easier for the user? ...

Drupal: Duplicate blog tags showing in block

I've got a Druapl-based website with a blog. I'm using a custom view block to list the different tags I've assigned to my posts. Although it lists them just fine (links work fine too), I'm getting alot of duplicates. For example, if I tag 3 differents posts with "sometag", then my block lists "sometag" 3 times in a row. How do I fix ...

Controlling image bandwidth issues on a community site

Hello. I am working on a community photo sharing site, and I need some way of controlling the bandwidth. For example I would like to set a maximum bandwidth allowed, which can be image size x the number of times the image was viewed. Similar to what a site like photobucket does (when they replace an image with a bandwidth exceeded image)...

PHP on a windows machine; Start process in background then Kill process

I'm looking for the best, or any way really to start a process from php in the background so I can kill it later in the script. Right now, I'm using: shell_exec($Command); The problem with this is it waits for the program to close. I want something that will have the same effect as nohup when I execute the shell command. This will allo...

How do I get the difference (in seconds) between 2 dates without using: strtotime, the Zend Framework or a PEAR package?

Hello good people! :) As the title states, I want to get the difference (in seconds) between 2 (specifically between now and a date in the past) dates without using: strtotime, the Zend Framework or a PEAR package. I don't want to get into the details of my reason but the gist of it is that I'm working with very old dates (and I do mea...

live chat: saving directly in database or text file?

im going to use ajax/comet to create a chat. and i want to store the chat conversation. every keypress will trigger an event that sends to backend.php that will store the letter. i wonder if i should store it directly in the database or in the textfile. you dont have to consider the details for exactly how this chat's architecture will...

Simultaneous File Access

Using: fopen fwrite fclose What happens if two users attempt to open the same file at the same time? ...

Debugging PHP on NetBeans 6.8 without Apache

Hi all. Is it possible to debug PHP projects on Glashfish with NetBeans 6.8 without installing Apache server? After I press CTRL+F5 im getting 404 not found error. As ASP.NET developer I have (I think) similiar developer server bundled with Visual Studio, so there is no need to install any other server like IIS. Am I right that Glassfi...

Music Recognition and Signal Processing

I want to build something similar to Tunatic or Midomi (try them out if you're not sure what they do) and I'm wondering what algorithms I'd have to use; The idea I have about the workings of such applications is something like this: have a big database with several songs for each song in 1. reduce quality / bit-rate (to 64kbps for inst...

rename many files automatic one time - ddmmyyyy.file to yyyymmdd.file

Hello I have 1500 files that are named with an incorrectly dateformat. I would like to rename them. Are there a tool that can do that? Otherwise a piece of php code. File names are: ddmmyyyy.xls (e.g. 15012010 for 15.th Jan 2010) and I would like: yyyymmdd.xls (e.g. 20100115.xls) Any clue on how this can be done for 1500 files in one...

PHP Localizing with gettext

I am localizing some PHP/XHTML using the gettext() function in a WordPress plugin. WordPress has 'aliases' for these functions such as __() and _e(), the latter of which automatically echoes the arguments. Now, most of my localization has gone pretty straightforward, such as: <h3><?php _e('Authentication', 'domain'); ?></h3> However,...

How to get thumbnail of youtube video link using youtube api ?

Hi, i want to pass a youtube url to maybe youtube's api and get the video tumbnail using php & curl ? is that possible? Thanks ...

Zend Pdf. Writing Text into a cell. Any MultiCell() function in Zend?

I'm trying to write text to a pdf. But if the text is long enough it overflows from the page. Is there any way to write text into a text box.For fPdf there is a MultiCell() function. Is there any such function in Zend? ...

Uploading multiple files with PHP

This is my HTML markup: <p><input type="file" name="file[]" id="file" /></p> <p><input type="file" name="file[]" id="file" /></p> <p><input type="file" name="file[]" id="file" /></p> <p><input type="file" name="file[]" id="file" /></p> <p><input type="file" name="file[]" id="file" /></p> When I submit the form, the form is submitting ...

jQuery - Trigger Popup w/out Click

I have this at above the body tag in my page -- <script type="text/javascript"> $(document).ready(function() { $('#button').popupWindow({windowURL:'http://something',centerBrowser:1,width:400,height:300}); }); </script> Is there a way to make this popup happen without the user actually clicking a button -- programm...

How can I protect my script from being "free"?

I want to divide my web application into two parts. One part is free, like a demo for people to use. The other part is not; a extension that is paid for but requires authorization and a license to use. My idea is to sell the extension without having it being compromised. Once the extension is sold, the buyer can't upload it to some oth...

PHP uploader for about a thousand images?

I am working on a websitwe and I need a client to send me close to a thousand pictures. There is a bit of a geographical distance between us, so while mailing a CD or SD card is not impossible, it is not preffered. Can I write a PHP uploader to have the client submit the pictures, or is there a better way? I do not want to subscribe to ...

∞ gets converted to ∞ when inserted into MySQL table

The infinity (∞) symbol gets converted to ∞ when it is inserted into my MySQL table by a PHP script, but if I insert it directly from phpMyAdmin, it inserts correctly. The symbol is passed to the PHP script by a GET call with the JavaScript function encodeURIComponent() around the contents. The field in the MySQL database is utf8_swe...

Php reading xml in post request

So, I have perform two steps a) Create a some random xml file in one of the php file. b) Parse the same xml file in second file. Key points are that php file in a) will issue a post request to php file b) with only xml as its request. file b) will have to read the xml file using SImpleXml. I am trying to do something for this htt...