php

codeigniter redirect

My redirect is not working, I can see no reason why it is not working thouhg, can anyone see a reason, function createCookie() { $this->load->helper('url') // Function gets called when the user clicks yes on the firstTime menu. // The purpose of this function is to create a cookie for the user. // First we'll gi...

Can we count how many times an item has been shared in Google Reader?

This is related to recent "Google Buzz Count" feature on famous blog Mashable - http://mashable.com/2010/02/12/google-buzz-buttons-count/ While trying to dig into logic they are using for "Google Buzz Count", I somehow reached to the conclusion that, essentially, they are counting how many times an item has been shared in Google Reader?...

automatic validations of form fields (server side)

Hello everyone, Recently I tried zend framework (the quickstart project) :) and I really liked it. All the frameworks (zend, cakephp) implements a very nice way of form fields validation. Moreover these validations are so easy to implement that you only have to give the name of the validation that you want to apply. Like this: ...

phpbb - Allow guests to view topics but NOT posts

I would like to allow guests to view the forum topics but not view the posts however if i provide read access they can read both. Is there a way i can stop them viewing the posts? Thanks ...

regular expression for pick the work from the group

Hi How to pick the work using RegEx |=|3|=|5|=|5|=|3|=|Yes|=|gdfsgsdf i want to pick yes from the |=|3|=|5|=|5|=|3|=|Yes|=|gdfsgsdf Can u tell me the preg match regular expression for the above collection ? ...

Problem with mysql query

How can I optimize this mysql query: SELECT * FROM messages WHERE toid='".$mid."' AND fromid='".$fid."' OR (toid='".$fid."' AND fromid='".$mid."') AND subject != 'something' order by id ASC LIMIT 0,5 I need to get messages between users in one page. This query id taking to much time and server resources. Can it be done in...

Sending an E-mail with attachment with PHP from Flex

Hey, I've made a custom compontent wich mails your own drawings to you. But I have a problem to send an e-mail with attachment. I use the HttpService to send the data to the php-file, but I always get the Fault message (form phpFault()). This is my code in Flex: <mx:Script> <![CDATA[ import mx.rpc.events.FaultEvent...

php notification

how to make a notification code in php? when user make a booking request how to notify admin that there were incoming booking request? ...

open one php page from other.

i am trying to develop a website and i want that after entering correct username and password desired page should open. how i can achieve this. ...

How to use PEAR behind proxy?

Initially I used the following with no success; export http_proxy=http://username@password:host:port Worth noting I don't get a connection error directly, instead; [root@pal ~]# sudo pear info PHP_CodeSniffer-1.2.1 No information found for `PHP_CodeSniffer-1.2.1' ...

PHP MVC general question

I'm building a small MVC framewrok for a specific PHP application - using Doctrine as ORM. I'd like to know what it would be the best practice to manage the frontend Menu. My application has 3 menus (horizontal menu, left menu, bottom/footer menu) that can be edited by the site Admin (the menu is stored in a Doctrine NestedSet). Where ...

Select last insert id

Hello! I am inserting a record and i want to use the id of the last record inserted. This is what i have tried: $sql = 'INSERT INTO customer (first_name, last_name, email, password, date_created, dob, gender, customer_type) VALUES(:first_name, :last_name, :email, :password, :date_created, :dob, :gender, :customer_type)' . ...

jquery chain search filter in joomla /php

hi i want to create a multi-field chain search module in joomla using jquery like in this site left corner. If is there any tutorial please put the link here Thanks ...

Help with MySQL query clause in CodeIgniter

I need some help solving a problem with mySQL, is it possible to pass an array to a function and then run a match agains the array values? I have this query function getMenu($cookieId) { $this->db->select('*'); $this->db->from('categoryTable'); $this->db->join('userMenuTable', 'categoryTable.categoryId = userMenuTable.categ...

str_ireplace will not work with single quote

I want to replace single quote (') in a string. Apparently this will not work...: $patterns = array(); $replacements = array(); $patterns[0] = "'"; $patterns[1] = '\''; $replacements[0] = 'Something'; $replacements[2] = 'Same thing just in a other way'; ...

PHP: Get class name of passed var?

I have a function that gets a class passed to it as a parameter. I would like to get the class name of the passed class as a string. I tried putting this method in the passed class: function getClassName() { return __CLASS__; } but if the class is extended I assumed this would return the name of the subclass but it st...

Datagrid for Symfony?

I want to use a datagrid in one of my modules (Symfony 1.3, Propel ORM). I have spent a while searching the web, but everything I found expects a direct connection to teh db (mySQL) or is otherwise unsuitable. I found the datagrid plugin (http://symfony.swisscenter.com/datagrid/exemples), but the documentation/examples are in French - a...

What are the performance implications of using design patterns in PHP?

Hi I know that design-patterns are very useful in creating of big projects. Does anyone have experience in both creating project with normal (OO, procedural ) and using design patterns in respect to performance(speed of execution)? I want to create some big project and I am afraid that using design patterns my scripts would run slower. ...

Merge string with common middle part

Hello ! I have two strings: $a = '/srv/http/projects/name'; $b = '/projects/name/some/dir'; And I would like to get a merged string with not repeated common part: $c = '/srv/http/projects/name/some/dir'; Is there any effective way to get it ? ...

How assign names for every key

i have array $fullname = $_POST['fullname']; $company_name = $_POST['company_name']; $email = $_POST['email']; $address = $_POST['address']; $telephone = $_POST['telephone']; $comment = $_POST['comment']; $data = array ( "Full Name :" => $fullname, "Company :" => $company_name, "email :" =...