php

PHP Extract audio from video

Hello, I need a way to extract the audio from some video (in PHP). I have the video streaming in from YouTube, so I would really like it if it were on the fly streaming, not I have to save it to a temp directory and process it there (though that is acceptable.) Thanks, Isaac Waller Edit: to be more specific, I have a MP4 and I want it to...

When POSTing an associative array with cURL, do I need to urlencode the contents first?

When I assign an array of data to be POSTed as a cURL option (via CURLOPT_POSTFIELDS), do I need to urlencode that data first or will that be taken care of? ...

Getting CodeIgniter HelloWorld example to work

Guys I'm a newbie to code igniter.. I do not understanding how to use this framework. Its just opening the user guide. Can anyone tell me the steps I need to follow to execute the "hello world" program on code igniter? ...

Apache/PHP closes connection after short time (12 secs)

I am getting a peculiar problem. Apache closes connection after 12 seconds or so. This leads to a "connection reset by peer" message on the browser. I am on Linux Centos 5. Using apache2/php5.x/mod_gzip. (php with eAccelerator) I tested some variations: Usually, I will print all the HTML output as the last step. It always closes conn...

What is the "?" symbol in URL used for in php?

Hi, I am new to PHP. In the path of learning PHP language, I notice that, some website would this kind of URL: www.website.com/profile.php?user=roa3&... My questions: What is the "?" symbol used for? If I were develop a php website, must I use it in my URL? For example, after a user(roa3) successful logged in, I will redirect to "w...

Sharing PHP-CGI between Apache and NGINX

Hi, I've been running most of my PHP apps on my website on a fastcgi backend, served by NGINX. I have a new application which seems pretty well integrated with Apache; it's heavily dependent on dynamically written .htaccess files, for example. I'm working on modifying it to work natively with NGINX, but that's not yet ready. In the mean...

MySQL Great Circle Distance (Haversine formula)

Hello All, I've got a PHP script that gets Longitude and Latitude values...then inputs them into a MySQL query. I'd really like to make it solely MySQL. Live site can be found at http://MotoListr.com Here's my current PHP Code: if ($distance != "Any" && $customer_zip != "") { //get the great circle distance //get the origin zip ...

How to escape strings in MSSQL using PHP?

I'm looking for the alternative of mysql_real_escape_string() for MSSQL. Is addslashes() my best option or there is another alternative function that can be used? Edit: Alternative for mysql_error() would also be useful. ...

Starting a PHP project - getting things right the first time

Hi I am going to start a PHP project soon ... a CMS designed specifically for my clients focusing on simplicity, etc. What I am looking for is a well established project that I can refer to... not plagiarise or copy, merely something to learn from. I want to refer to this project to see what hurdles they had to overcome, how they dealt...

How to get Insert id in MSSQL in PHP?

What the question title says. With a query such as SELECT @@IDENTITY AS ins_id, do I need to supply the table name or any other info to specify which table/database i'm talking about? ...

Is there a interactive debugger for php like ruby's debugger?

I watched the Creating a weblog in 15 minutes with Rails 2 and after 9 minutes in the video he shows ruby's interactive debugger, which allows you to call functions/methods from within a running script. This goes way beyond breakpoints and looks very useful. Is there something for PHP that gives similar functionality? ...

Creating new Iterator from the results of another Iterator

Hi, I'm trying to get my head around using Iterators effectively in PHP 5, and without a lot of decent examples on the net, it's proving to be a little difficult. I'm trying to loop over a directory, and read all the (php) files within to search for defined classes. What I then want to do is have an associative array returned with the ...

How do you populate a radio button or drop down box when editing from a database?

I know this is a similar question to one already asked, but I was hoping for a different answers to a problem. I have a form where you can upload new articles to a database all fine works ace, wonderful, brill. The form uses a drop down menu for the type of article, I have news, gossip, travel, performances and others in my drop down box...

which is the best PHP framework to use for PHP 5?

I want to start using framework to ease my new programming life.but am confuse on which to start using ,because am not that experienced in PHP. any suggestions,i would prefer a framework built on PHP5 ...

How to create/find a Joomla/Community Builder 'Latest Users' module? Playing with dates in MySQL/Joomla...

A few years ago when Joomla first sprung up and I moved over from Mambo I remember finding a great little component called Community Builder (CB) that extends the user-based interface behind Joomla. Over the last couple of years both Joomla and Community Builder have grown and flourished. I find myself remembering a small module I found...

generate scaffolding as code in cakephp

I have a cakephp app with some controllers using scaffolding for the logic and views... How can I make cake actually generate those as files and functions in my project that I can then modify and take ownership of... It's nice to have this stuff as a starting point, but it can't be true that I need to start basically from scratch if I ...

How to run a php script through the command line

Hi I am trying to run a php script on my remote Virtual Private Server through the command line. The process I follow is: Log into the server using PuTTY On the command line prompt, type> php myScript.php The script runs just fine. BUT THE PROBLEM is that the script stops running as soon as I close the PuTTY console window. I need ...

How do i create an email contact form for my website

I'm looking to create a form on my website where users can enter their email address and a message (however long). Then upon clicking on a submit button, the code, sends the message as an email to my mailbox. I was wondering if someone knew what code i could use. I am using PHP as my server-side language. ...

Calling db rows by id but backwards

I am building a Links voting site, the formula works ok after the link is voted the second time, the problem is that when the link just has 1 vote it shows up backwards, from oldest to newest. What I want is for links with one vote to show from newest to oldest. This is the line that calls the links in the front page: $articles = Arti...

PHP Framework for a beginner, expecting a longlasting relationship with it

i have decided to learn a php framework, and learn it well. I have heard codeigniter is very well documented and good for a beginner, but its based on php4, while php6 is in beta and php5 has been around for a while, should i invest on it? im confused (actually lured) by the expectation around Zend framework. any suggestions? ...