php

connecting google analytics data api to dojo charts - php backend

I'm looking at feeding dojo charts with data from google analytics, within a Zend Framework app. Has anyone done this or have any overview as to how I would go about it? I see there is a dojox.data.GoogleSearchStore. Does it make sense to have a dojox.data.GoogleAnalyticsStore and is anyone working on something like this? ...

How to call store procedure in MySQL uisng PHP and display the value return by the store procedure?

Hi I got stuck not knowing how to create API in PHP. I have store procedure that I created in the MySQL and want the PHP to call that store procedure and use the value return from the store procedure as return value of the API. There might be many ways to do it and I would like to know all of them and want to know how they are differen...

PHP - if/switch - "if $var is 'a' or is 'b' or is 'c'" etc...

Possible Duplicate: PHP make if shorter I have an if statement that looks like this: if($variable == "one" || $variable == "two" || $variable == "three" || $variable == "four"){ // do something } else { // do something else } the problem is that its getting quite hefty.. its going to be about 20 or 30 different opti...

Identify whether user manually loaded url on browser or generates URL by server in php

Hi Thanks for your time. I am developing application using PHP. In this for some instace I have added logic such that, for certain area matches then redirect to particular url. if(//statement) { redirect to specific URL(e.g. http://www.example.com/testing.php ) } Above is my basic logic. Here I want to Identify that whether use...

Best way to validate an upload form?

Hi there. Which would be the best way to validate an upload form? Using the mime type at the moment, but that's not quite working - can't upload mpegs even though am looking for video in the mime type. Thank you Tom ...

preg_replace conditional replacement with different string

I know there's a if/then in the matching of regular expressions, but is there one in the replace? ie. I want to do in one regex "I have Foo Bars under $5 for sale" to be "Foo Bars~$5" "I have Foo Bars for sale" to become "Foo Bars" and NOT "Foo Bars~" I have an expression a bit like this at the moment: preg_replace("/(([A-Z]...

PHP Array sorting using child nodes?

Ok I have the following array: Array ( [0] => Array ( [id] => 6 [name] => This Course [time] => 1288082700 [description] => blah blah . [link] => http://this.com/?g=5 [course] => 22 ) [1] => Array ( [id] => 2 [name] => Workshop [time] => 1287561600 ...

How to JSON data using $.getJSON from a php file ?

I have a php file that receives data from mySQL table. The mySQL table 'user_spec' has only one field 'options' that it returns. Then I convert returned data into JSON, under is code doing that. <?php $username = "user"; $password = "********"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die...

How unique is PHP's __autoload()?

PHP's __autoload() (documentation) is pretty interesting to me. Here's how it works: You try to use a class, like new Toast_Mitten()(footnote1) The class hasn't been loaded into memory. PHP pulls back its fist to sock you with an error. It pauses. "Wait," it says. "There's an __autoload() function defined." It runs it. In that function...

possible to use CURL to create exact replica of page?

I'm working on a system for our users to position choose the location they want to put their adverts on pages of our website. I want to create a preview of the host-page page inside a div on our Advert Positioning page (which i can then modify). I've already investigated iframes (which works same-domain), but am interested to see wheth...

Using XDebug from terminal (got only SSH access)

When I develop with the server on my workstation I can use XDebug from my IDE and debug variables, etc. Many times the server is on a remote machine where I have only SSH, so I only edit with vi. In that case is there a way to use XDebug? Is there a client I could use from terminal? ...

"The Social Network" movie - how to watch logs in real time via Terminal?

This is a basic question - in the movie "The Social Network" there are several scenes when the young Facebook staff is watching the PHP/Apache server logs on in their TERMINAL in real time. I'm familiar with how to do this in a RUBY/RoR environment - but with a standard LAMP Apache/PHP environment, how to do actively monitor your server...

How do Search Engines find relevant content ?

How does Google find relevant content when its parsing the web? Lets say for instance, Google uses the PHP native DOM Library to parse content, What methods would they be for it to find the most relevant content on a web page. My thoughts would be that it would search for all paragraphs, order by the length of each paragraph and then f...

What database table to alter to have a bestseller product in webshop?

Hello, I do have a little expierence with database tables, but I can't read a db_query I believe to have a query which should enable a product as a bestseller and place it in scroller. I want to fake a bestseller because it looks a little dump when opening a webshop with having a empty bestseller list. I have manually altered the table...

regular expression match php

Hi, I need to do a regular expression match in php . the case is that . 2 digits before decimal and 2 digits after decimal. the problem is that it may and may not have decimal and after decimal digits . how do i write a expression for this ? ...

PHP and Regex Problem

Possible Duplicate: Best way to parse bbcode I need to get the username out of quotes for my forum (PHP). The content I'm searching will be like this: [quote author=username link=topic=1234.msg1234567#1234567 date=1234567890] lorem ipsum dolor [/quote] lorem ipsum dolor sit amet All I need is the 'username'. The big prob...

Kohana 3 How to render module inside application

Hi All, How to integrate module inside application? I have modules having two controllers and two respective views inside module. Now I want to integrate this module inside my application, so that views and actions can be handled by this module only. ...

What is difference between /usr/sbin/sendmail -t -i and /usr/sbin/sendmail in server configuration?

I have upload my joomla project on live server (Linux basd LAMP) in phpinfo file I found the "/usr/sbin/sendmail -t -i" for smtp configuration. and my local WAMP server configuration use "/usr/sbin/sendmail" any please let know why use -t and -i. what is it ? ...

how can i insert the array of id into a single field of data base

hi how can i insert the array of service id into table into a single field like 2,3,4 in database i am confuse please help followingis my code...i am using this but it is inserted only single id.. $service=implode(",",$_POST['service']); $sqlQuery="INSERT INTO ".DBPROMOTION." SET promotion_service_id='".$service."', ...

PHP upload image and file to a specified folder

Hi all i need to create a form to upload two files to a specified folder that is created by the selection of a select and an input on the same page. So the form must have: input type="text" select upload image on the folder "select_value/input_value/random_name_image.jpg" upload file on the folder "select_value/input_value/random_name_fi...