php

Code Igniter routes

Hi all, I just moving my first steps with Code Igniter, so please bear with me. I have a application/controller/login.php file containing the following class Login extends Controller { function Login() { parent::Controller(); } function index() { $this->mysmarty->assign('title', 'Login'); $this->mysmarty->ass...

How do I save an array of data in a cookie with Symfony?

First off, I'm not all that familiar with cookies but I know how they work. I've seen quite a few different tutorials with plain PHP code but I'm looking for a solid example of how to store arrays in a cookie using the symfony syntax: $this->getResponse()->setCookie('myCookie', $data); You can't just pass in an array since it expects ...

Why Use PHP OOP over Basic Functions and When?

There are some posts about this matter, but I didn't clearly get when to use Object Oriented coding and when to use programmatic functions in an include. Somebody also mentioned to me that OOP is very heavy to run, and makes more workload. Is this right? Lets say I have a big file with 50 functions, why will I want to call these in a cl...

Anyone has used the Akelos PHP framework?

I was wondering if any of you have experiences to share after using the Akelos PHP framework. Looks like the most Rails-like framework in the PHP space. ...

PHP in_array triggers Internal Server Error

This really shouldn't be this complicated, which suggests I'm doing something wrong, but after checking the docs I can't figure out what. I'm trying to do a simple check to see if the type of a "tag" is in the list of types to be used during this operation, using this piece of code ($level is passed in as a parameter): $filter = $this-...

memcache gzipped content with php ob_gzhandler

I recently implemented gzipping of my content with php's ob_gzhandler function which keeps things really simple. I'm now trying to add this content to my memcache, and was hoping there was a simple way to do that as well, but I haven't been able to find anything online about accomplishing this. I've only used memcache in the past to ...

Do you have any download hit counter per user Module in joomla ?

In my project one download button is there . if user download button click then i will show count of download . is it possiable have any module for download hit counter ? ...

PHP - Storing Text in MySQL Database

I have a textbox on my website and I need to store whatever the user enters into my database, and retrieve it at a later time. I need to store it exactly as the user entered, including special characters, carriage returns, etc. What process should I use in PHP to store this in my database field (which is a 'text' field)? Should I use PH...

What is coming in PHP 6?

What is upcoming in the new release of PHP, and why should I care? What problems will these improvements help to solve? Cheers, Edit: After posting the question I have found these links that also provide some insight. php NEWS - http://cvs.php.net/viewvc.cgi/php-src/NEWS?view=markup IBM - The future of PHP - http://www.ibm.com/develo...

Enter keyword in search box of any website using php script

Hi all I am a beginner and i was wondering can we write a code in PHP by which we can enter keyword in search box of any website and submit. so there will be 2 inputs to this php function: function enter_keyword($website_url, $keyword) { } function enter_keyword($website_url, $keyword) { } It will be a great help thanks in advance...

Pass multiple arrays to javascript via ajax

To pass an array from PHP to javascript via ajax, I am going to use json_encode, and recieve it on the javascript end. However, I will be returning multiple rows from my MySQL database, and need to return multiple JSON-formatted arrays. One way I thought of doing this was to string the JSON arrays together in php with some obscure charac...

Print all variables available in a Smarty template

How do you print all variables available in the context of a Smarty template? Something like the Django debug trace that lists everything being passed. Thanks ...

XML as a Data Layer for a PHP application

I was wondering how i should go about writing an XML data layer for a fairly simple php web site. The reasons for this are: db server is not available. Simple data schema that can be expressed in xml. I like the idea of having a self contained app, without server dependencies. I would possibly want to abstract it to a small framework f...

How to display only one country or a specific area in Google maps using the api?

I am using Google Maps in a project and I want to display only a country map in my map window i.e. I want only the US to show on my map not Canda and Mexico and so on, cutting away the superflous information for the app I am building. I found some stuff where you can restrict the area covered with some javascript however this still giv...

Post MySQL Result Using Alax(Jquery).[SOLVED]

Hi all, Im afraid its another noob question...lol. Being relatively new to javascript/ajax/jquery..programming ingeneral... I am fumbling where blind men drive chariots, so please go easy:). I am wanting to post 3 values to the database, 2 of which are results of a mysql query(Im not sure if I am doing this right, so feel free to correc...

'pass through' php upload to amazon's s3?

I've seen ways to upload files directly to S3 and I've seen ways to upload a file already on the server. I need to modify the file's name before sending it on to S3, but I don't want to store it locally and then upload it, if I can help it. Is there a way to put it in a buffer or something? Thx. ...

Extract everything between <object></object>

I am using CURL to download a page. Now I want to extract this from the page: <object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="640" height="303.33333333333" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" id="object701207571"> <param name="autoPlay" value="false" /> <param na...

Centralized error reporting in PHP

Hi all, is there a way to handle error reporting in a centralized manner in PHP? I'd like to be notified of all errors raised by my application by email. What's the best way to achieve this for a whole application? Thanks ...

Best way to offload heavy processing (like image resizing) out of PHP request

I'm working on a PHP web interface that will receive huge traffic. Some insert/update requests will contain images that will have to be resized to some common sizes to speed up their further retrieval. One way to do it is probably to set up some asynchronous queue on the server. Eg. set up a table in a db with a tasks queue that would ...

Framework updates how long do you wait?

In a development team how long do you think you should wait to implement the latest stable version of Framework? I am asking about different Frameworks we are using Zend Framework, HTMLPurifier, jQuery and jQuery UI. After a release how long do you wait to update your framework(s)? ...