php

Pulling an audio file into a PHP script and auto-tuning it?

I want to write a PHP script that can programatically grab a .wav file from a URL, auto-tune it, and then either save it as a new file or output it using an "audio/x-wav" header, but I don't even know where to start. Are there audio manipulation libraries in PHP that can accomplish that? ...

drupal check if checkbox field is checked

I'm trying to see if a CCK checkbox field is checked. Is it something like: if ($node->field_checkbox[0]['value'] = 'checked') ? Thanks. ...

str_ireplace() with keeping of case

Hello! How can I use str_ireplace (or something similar) to replace some text for formatting and then return it with the same caps? Example: $original="The quick red fox jumps over the lazy brown dog."; $find="thE"; print str_ireplace($find,'<b>'.$find.'</b>',$original); That will output: thE quick red fox jumps over the lazy brown...

Use PHP to show Icecast2 statistics

Hi! I have some trouble viewing statistics (viewers, current song playing etc) with PHP and I can't find any information how to do this. There is a couple of XLS files included with Icecast2 and I could include this files with PHP to my site but I wan't to update the DIV that the include is in every 5 seconds and that won't work with X...

How to sort rows of HTML table that are called from MySQL

I know it's such a basic thing, but a google search hasn't shown me how to resort the rows after clicking the 'th' links. I've got this: <table border="1"> <tr> <th>Type:</th> <th>Description:</th> <th>Recorded Date:</th> <th>Added Date:</th> </tr> <?php while($row = mysql_fetch_array($result)){ ?> <tr> ...

Permission problem with apache

started new thread to avoid confusion ...

Getting the time interval

I have two timestamp input one is the current time and another one is future i.e. Future time: 2010-8-17 23:00 Present time: 2010-8-15 11:00 I want to setup notification system which will display the time intervals between the above dates. i.e. 15 minutes before 30 minutes before 1 hour before 2 hour before 3 hour before .... .... ....

PHP GD: Blur for transparent image

Hello world. I am trying to create the silhouette of PNG image with transparencies. Here is my code //file that i am working with $file='http://www.google.com/mapfiles/turkey.png'; $im =imagecreatefrompng($file); imagealphablending($im, false); imagesavealpha($im, true); $imw =imagesx($im); $imh =imagesy($im); //turkey body ...

AJAX + PHP + HTML HELP: AJAX refresh ruining layout of site

Can anyone help me here, when i run this code the page repeats its self. I also need it to refresh which it isnt doing. Like this: EDITED Code Below: <?php include 'config.php' ?> <script language="javascript"> function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = ...

Should someone with no PHP experience use a framework like CakePHP or Symfony?

I have a simple site to develop and would like to learn PHP as I go. I want the site to be secure, scalable, and easy to maintain. Should I learn a framework and PHP simultaneously? If I build off of a framework there will be lots of unfamiliar code in play. Would you say this increases security risks? ...

Doctrine2 NestedSet Extension: Rendering children nodes

i am using DoctrineExtensions\NestedSet i am trying to render children nodes. i used $node->getChildren(); array 0 => object(DoctrineExtensions\NestedSet\NodeWrapper)[218] private 'node' => object(Application\Models\Post)[240] protected 'id' => int 3 protected 'title' => string 'trying to use...

URL structure causing incomplete page to be returned by PHP's file_get_contents()

I've been doing some scraping with PHP and getting some strange results on a particular domain. For example, when I download this page: http://pitchfork.com/reviews/tracks/ It works fine. However if I try to download this page: http://pitchfork.com/reviews/tracks/1/ It returns an incomplete page, even though the content is exactly th...

Advantage of passing by reference opposed to using global?

Hi guys im looking at the MVC pattern, and I can see in one example on phppatterns they're passing the model by reference - any benefit of doing this over a global var? Am I missing something obvious? class MyView extends View { var $model; function __construct(&$model){ $this->model =& $model; } function productTable($...

Multidimential array into string

I have a result set from a DB that returns the following array.... how do I implode this into a comma delimited string? Thanks! Array ( [0] => Array ( [user_id] => 2 ) [1] => Array ( [user_id] => 5 ) [2] => Array ( [user_id] => 11 ) ) ...

Why do table variables work when I execute this query in SQL Server Studio but not via odbc_exec?

The query in the PHP code below works fine when I run it via Microsoft SQL Server Management Studio, but gives Warning: odbc_fetch_into() [function.odbc-fetch-into]: No tuples available at this result index at the odbc_fetch_into call (and does not have any rows). $sql = "DECLARE @ValueList TABLE (CheckValue int) INSERT INTO ...

Can a MYSQLI connection be reopened WITHOUT instantiating a new object.

Hi All, Just a quick question here: If I choose the object oriented style to interact with my database, ie... $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); And I then use $mysqli->close(); to close the connection at some point... Can I reopen that connection by simply initiating another query $mysqli->quer...

Curl: Encoding problem

I grab a webpage that is in Hebrew with the help of curl but do get fancy characters (ie. ЧђЧ§Ч©Чџ) instead of Hebrew. What should I do to receive it all in Hebrew? ...

Is it a good idea to trust BCC to not reveal other people's addresses?

I'm using PHPMailer to send emails with SMTP from my script. The emails in question are actually cell numbers utilizing email-to-SMS gateways. Now, ideally I want to build up a big BCC list to send everything in one batch instead of looping through a big list of addresses and sending them one at a time. Should I completely trust BCC fun...

Multiple arguments on menu callback

I know how to pass one argument to a menu callback $items['someaddress/%'] = array( 'title' => 'title', 'page callback' => 'some_function', 'page arguments' => 1, 'type' => MENU_CALLBACK ); I don't understand why the argument being passed is $_POST['nid'] but this works. It corresponds to page argument 1. function...

how to toggle between incrementing and decrementing rows when echoing HTML from mySQL

I was just kindly helped to get the rows in a table to display using ORDER BY. Then I realized I also want to click the same link to decrement if desired. I tried to set up a conditional, but it's not working as I expected: <?php $orderBy = array('type', 'description', 'recorded_date', 'added_date'); $order = 'type'; if (isset($_GET...