php

Am I charging enough? I think I may have put myself in a weird situation...

Here's my situation with rough numbers. I'd like to know if my thinking (at the bottom) seems sound to you guys. (Side note: I've read many of the related questions on here, and helpful as they were, none seemed to touch on this specific issue.) For 2 years I was a senior developer at Company X. I was full-time, W-2, and making $100k/yr...

PostgreSQL trouble on windows PHP

I'm using WAMP on windows, which installs PHP, Apache and MySQL. I'm now working on something new that requires PostgreSQL. The current install won't do it for me, as I keep getting these errors: Call to undefined function pg_query() Always undefined function I've installed PostgreSQL 8.3.7-1 for windows, added php_pgsql.dl...

Logging in to meetup.com with Curl

Hi all I'm trying to automatically log in to www.meetup.com without much success:- This is my code:- <? $username="[email protected]"; $password="123abc"; $url="http://meetup.com"; $cookie="cookie.txt"; $postdata = "email=". $username ."&password=". $password . "&submitButton=Login"; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,...

PHP Framework with full jQuery integration?

i'm tired of reinventing the wheel on PHP and loving jQuery to death so which framework fits my needs? ...

PHP foreach loop through multidimensional array

I have an array: $arr_nav = array( array( "id" => "apple", "url" => "apple.html", "name" => "My Apple" ), array( "id" => "orange", "url" => "orange/oranges.html", "name" => "View All Oranges", ), array( "id" => "pear", "url" => "pear.html", "name" => "A Pear" ) );...

PHP date time

How can i add second(s) in a date time. ex. I have date time 2009-01-14 06:38:18 I need to add -750 seconds in that date and want result in datetime ...

alpha with space regex in cakephp

I have a user registration form and I only want the user to specify their first and last name (i.e. Donalg Doonsberry). If the user doesn't provide their name in this fashion, the input will be rejected. I thought something like this would work for my regex user validation in cakephp: 'name'=>array('Name has to be comprised of letter...

Put focus inside a textarea with variable name using javascript

I have a site that lists several upcoming events, and each event has a comment button to leave comments. It looks like this (it's in swedish, but I think you can figure out the structure): The div containing the textarea for writing the comment is initially hidden, and when clicking the 'comment'-icon it is displayed using the followi...

Algorithm for analyzing text of words

I want an algorithm which would create all possible phrases in a block of text. For example, in the text: "My username is click upvote. I have 4k rep on stackoverflow" It would create the following combinations: "My username" "My Username is" "username is click" "is click" "is click upvote" "click upvote" "i have" "i have 4k" "have 4...

DOM Manipulation with PHP

I would like to make a simple but non trivial manipulation of DOM Elements with PHP but I am lost. Assume a page like Wikipedia where you have paragraphs and titles (<p>, <h2>). They are siblings. I would like to take both elements, in sequential order. I have tried GetElementbyName but then you have no possibility to organize informa...

accessing an item in array in PHP

In PHP I would like to get the text value of the customer name tag. I write this code but this does not work. Would you please help me with this? Thank you $customerName = $dom->get_elements_by_tagname("item"); $customernameValue = customerName[0]-> first_child()->node_value (); ...

Kohana PHP question

I have a database with a table named shoppingcarts. this table has the following 3 columns: id, sessionid, date I have a function (AddProductToCart) in my controller (ShoppingCart). Inside my function, I have this call: $obj = ORM::factory('shoppingcart')->where('sessionID',session_id())->find(); Now, this statement runs against th...

How to search specific parts of sites with yahoo boss?

I want to to include in my search results only parts of few different sites. eg. yahoo.com/blog/, yahoo.com/groups/ and live.com/developers/ How can I do that? I can't use &sites=yahoo.com/blog/,yahoo.com/groups/,live.com/developers/ because it will display results for whole yahoo and live.com domain. Any suggestions? Thanks! ...

Contingency plan for fopen error in php

I'm writing a PHP app that has a 'control panel' that writes a prefs file with certain variables. On every POST, if the file doesn't exist, it is created. If it does exist, it is unlinked and a new file is touched with the same filename and new variables. This file is then included on another page with displays content based on the varia...

jquery inquiry: passing message without a new pageload

Hi there. Please forgive the awkwardness of this question, I honestly don't know how to phrase a better query... The situation: I have a basic contact form within an xhtml/php page that I'm in the process of upgrading. I recently added a new unrelated jquery plugin on this page, so I would like to use the jquery functionality to help...

How do I write a search query using Kohana PHP?

I have a table (product_shoppingcart) with 4 columns : id, product_id, shoppingcart_id, product_quantity. I'm using Kohana's ORM. I want to write a search query which returns all the rows where the shoppingcart_id column contains 1 (for example). I already tried: $arr = ORM::factory('product_shoppingcart')->where('shoppingcart_id'...

Is this good membership payment database schema?

I'm doing a project to manage membership and other kind of payments, but mainly membership so I created a polymorphic schema. any idea, improvement, for some reason I don't fully convinced about the schema. as you will see, the idea of having month, year NULL-ABLE is allow save record of any other payment CREATE TABLE IF NOT EXISTS `o...

How to determine if a web application has been installed and set up ?

I am not sure to be enough be by my question... Well i'm developping a CMS in PHP with Zend Framework. I would like to have a nice web gui to install and set up the application after unpacked it somewhere... Some CMS or whatever the application is, offer this way to do by simply entering an 'install url' like 'http://localhost/app/instal...

debugging "register_activation_hook" in WordPress [closed]

Originally posted on the WordPress forums but no-one answered... so I'll try my luck here... Hi all, I'm trying to learn to write a WordPress plugin by setting myself a goal of witting a user generated glossary plugin after I asked people on Twitter what would be useful (well I may as well use my learning experience to be useful for mo...

PHP MYSQL Insert/Update

Hi I have a simple table as below. CREATE TABLE `stats` ( `id` int(11) NOT NULL auto_increment, `zones` varchar(100) default NULL, `date` date default NULL, `hits` int(100) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; So just storing simple hits counter per zone per day. But I ...