php5

How to find out programmatically if a web server instance supports url rewrite.

Hello, This would be my first question on SO, so please be gentle with me. What I want to ask is if there is a way to find out if a web-server instance has URL Rewriting enabled. I need this in order to be able to instantiate the correct type of URL handler. Theoretically you know in advance if you have it enabled or not and can us...

Using PHP date to display weekly dates

I'm not really sure what to call this. But basically I want to be able to have a user click on "Popular Stories from This Week", and it will take them to a page that will have other stuff but mainly the dates. For example, July 10-17. I'm currently using this code: $seven_days_ago = date('j') - 7; $time_span = date('F ' . $se...

Strange behaviour migrating sessions with callbacks from php4 to php5

I have to migrate a php4 app that uses session_set_save_handler() to php5. In php4 everything was fine, but in php5 the callback functions cannot access the global vars anymore, which were set on the page before session_set_save_handler() was called. In the example below the global var $g1 cannot be accessed in the session_writer() (wh...

how to install php and javabridge on Tomcat

how to set the environment variables of javabridge.what are the setting can be change for installing JavaBridge and php on Tomcat ...

Assigning the return value of new by reference is deprecated

Hello, I've just got an error. When I try to assign an object like this: $obj_md = new MDB2(); The error I get is "Assigning the return value of new by reference is deprecated". Actually I've been looking for a solution but the only one I've seen is just turn down the politicy of php.ini (error_reporting). I've tried it too, but it ...

How to send an email with inline images using zend framework?

The documentation specifies how to add inline attachement, but what is the correct way of referencing it from the html part? Is it possible to include images automatically as it is in other libraries? Maybe someone has written a little snippet and is willing to share? ...

How can I use and access an SQLite DB using PHP and Wamp Server?

I know PHP 5 already supports SQLite but for some reason I can't get it to work. I followed the instructions from http://www.scriptol.com/sql/sqlite-getting-started.php. I also made sure that the following are not commented out from php.ini: extension=php_pdo_sqlite.dll and extension=php_sqlite.dll. But when I open the PHP file from loc...

How do I install/use the phpize command?

I am intending to use SQLite 3 with PHP 5. I found this: http://packages.debian.org/etch/web/php5-sqlite3 but I am having problems with installation: unzip & untar the package run "phpize" run "./configure --with-sqlite3=/path/to/your/sqlite3/install make && make install (optionally) copy DB/sqlite3.php to /path/to/php/lib/php/DB/sqlit...

imageshack api problems. Will not upload my image

Hi all, I was just wondering if anyone has used the imageshack api as i am trying to use it and i am having some issues as it just fails and will no upload my image. the php library for image shack can be found here http://elliottback.com/wp/using-the-imageshack-xml-api/ i pass the for file element to the upload function but it just d...

Parse Error in PHP

The following code: <?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $self = $_SERVER['PHP_SELF']; ?> Generates this error: Parse error: syntax error, unexpected $end in /home/idghosti/public_html/testground/mma/include/header.php on line 26 What is wrong with my code? ...

Another PHP Syntax Error

This is the error Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line 9 This is the code: <?php } else { error_reporting(0); if (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n")) //Message sent! ...

Ajax with in Ajax. Is this possible

I have a php page. This has multiple images which looks like tabs. With in this php page i have a div which will load different PHP pages on click of different images i mentioned before. This is done using Ajax. This much of it works fine with no page reload. This is done to simulate the tab operation without page reload. This much of it...

PHP and FFMPEG - Performing intelligent video conversion

I have an oddly difficult task to perform. I thought it would be easy, but all my efforts have been fruitless. I'm converting videos uploaded to a php script from various formats (.avi, .mpg, .wmv, .mov, etc.) to a single .flv format. The conversion is working great but what I'm having trouble with is the resolution of the videos. Th...

Custom PHP Event Calendar Help

Hi, I'm making a custom event calendar with PHP. I am trying to get the current day box to show up white, to let the user know that's the current day. I have all the <td> boxes with an id of row-calendar-cell and I want a way to detect that the certain box is the current day and to change the id to current-day. Any help on that? Also,...

Display c++ code in php

I am trying to display the contents of a .cpp file in php. I am loading it using fread when I print it out it comes out formatted incorrectly. How can I keep the format without escaping each character? ...

php5 and mysql5 on windows server

Hi I have installed php5 and mysql5 on my server , I can login to mysql from command, but when I try to connect using php I got this error message: Access denied for user 'root'@'localhost' (using password: YES)PHP Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\Hosting...

Unexpected duplication in mysqli/php

I'm using MySQLi with PHP(5.2.4) MySQL(5.0.51a) on Ubuntu 8.04 LAMP. The relevant Db tables are below: Questions +----+------------------------------------------------------------------------------------------------------------+ | id | question ...

Smoothing Data Array PHP

I have an array: Array ( [1] => 25 [2] => 50 [3] => 25 ) I would like to make it into: Array ( [1] => 50 [2] => 50 ) To do this I split the middle value between 1 and 3. This is the simplest example, where the split is 50,50. I would like to be able to take a 15 element array down to 6 elements. Any ideas? Add...

Capture FFMPEG output in PHP

I need to read the output from ffmpeg in order to even try the solution to my question from yesterday. This is a separate issue from my problem there, so I made a new question. How the heck do I get the output from an ffmpeg -i command in PHP? This is what I've been trying: <?PHP error_reporting(E_ALL); $src = "/var/videos/vi...

How to change default version of PHP from 4 to 5?

My server have default php version of 4, so when I run some script saved as .php I have PHP 4. I want to change it, so I don't must use .php5 extension, I heared that there are something in .htacess. I want to run eyeOS on my server, but I don't want to change every line from .php to .php5 Help? ...