php

Validate AJAX generated form field.

I have a form with select Field A. This field can be dynamically populated based on the URL or it can be selected as usual. Once a value has been selected in Field A either way, select Field B is populated and exposed with JQuery AJAX. Here is the problem. If Field A is left untouched, and is dynamically populated by the URL, Field B w...

Routing problem with Kohana 3.0

Hi, in my current project ive a controller tree like this: Controller - ------Admin - ------------user.php ------otherClass.php Where controller and admin are folder and user and otherClass are the classes. If i want to call any otherClass method the url would be this one: example.com/otherClass But when i try to call the use...

PHP Sessions & Forms

Edit How can I rewrite this PHP code for POST[ 'phrase' ] == session[ 'phrase' ] ? psuedo-code //process_form.php PHP session_start() IF POST SUBMIT IF empty text1 && empty text2 echo error msg, include HTML FORM ELSE IF empty radiobtn echo error msg, include HTML FORM ELSE IF isset POST[phr...

Validate email with database

I have created a form and have validated everything using PHP, but can't figure out how to validate email from database. If I have the entered username in the database, I want it to display an error. I have connect.php and just for an example - here's how i validate password - if(!empty($_POST['password'])) { if($_POST['password'] !...

How do I post to a form and populate a select multiple?

I'm doing something a bit strange here, I'm querying data out of my local database and posintg it to Salesforce form using cURL. The data posts correctly to Salesforce. However, the select multiple is not getting the correct values selected. See $sd["location"] below in my code: //init curl $ch = curl_init(); //setup the p...

Backend shared between sites - best method

I have a php backend which is to be used by multiple sites on a server I control. Now rather than having an individual copy in each web root, what is the best method to have each site work from 1 shared backend? (For easy updating of the backend, etc) ...

MySQL PHP: WHERE everything except..

How can in a query, SELECT * WHERE type = is everything except "news"? Or should i check that later in the while()? ...

Using Recursion to Flatten a PHP Array with Subitems Based on Values (Wasted an Hour on This!)

I'm trying to build a navigation menu. I am receiving an array with a structure like this: [ [ Title = A Sub items = [ Title = B Sub items = [ Title = C ] ] ], [ Title = A Sub items = [ Title = B Sub items = [ Title = D ] ] ], ] I need to take it and ...

USPS API Returning 501 NOT IMPLEMENTED

I am attempting to utilize the USPS API to do some address verification/validation. I'm sending this XML to http://testing.shippingapis.com/ShippingAPITest.dll: <AddressValidateRequest%20USERID="xxxxx"><Address ID="0"><Address1></Address1><Address2>6406 Ivy Lane</Address2><City>Greenbelt</City><State>MD</State><Zip5></Zip5><Zip4></Zip4...

problem with SimpleXML and inclosed arrays

I'm having a problem with SIMPLE XML. I seem to have an array with dumping the whole object. However, when I try to access the array, I get a single element of the array back. Here is the full dump: SimpleXMLElement Object ( [@attributes] => Array ( [type] => array ) [person] => Array ( ...

php regex to get string inside href tag

I need a regex that will give me the string inside an href tag and inside the quotes also. For example i need to extract theurltoget.com in the following: <a href="theurltoget.com">URL</a> Additionally, I only want the base url part. I.e. from http://www.mydomain.com/page.html i only want http://www.mydomain.com/ ...

Could someone please tweak this php code for me? Drupal code.

I found this code to work on my Drupal site. It outputs the taxonomy terms in a comma separated list. It successfully builds my taxonomy list to look like this: Business, Entertainment, Leisure While that's great, its using the same names to link itself in the url and so I get this: www.yourdomain.com/category/Business How can I make...

PHP Asset Packaging Library

anyone know a great asset management/packaging library for PHP making asset (images, css, js) deployment and optimization super easy much like Jammit for Rails. ...

Can php URLs have numeric parameters?

Is this valid?: http://www.SomeURL.com/Index.php?123=xyz Will I be able to access the value 'xyz' under the key '123' the same ways as usual? ...

Compile PHP with GD for iPhone OS 4.1

The Goal: have a working version of PHP with the GD library working on an iPod Touch 4th Gen. The Status: PHP is working on the iPod (lighttpd + PHP 5.2.8 + sqlite3) without GD. When trying to compile PHP on the iPod I get this error: http://pastebin.com/kUmgq70G The Proposed Solution: Can anyone point me in the direction of how to...

Sum of a field with hasMany in cakephp

I have two models in cakephp, Link and Vote. I want to have the sum of the votes for every link in my Link model. Here is a print of my findAll function : [1] => Array ( [Link] => Array ( [id] => 1 [url] => http://www.google.com [date_added] => 2010-08-19 11:36:56 ...

Retrieving comment count from fb:comments widget (Facebook)

I've tried using both the JavaScript and PHP SDKs, but I can't solve this simple problem. My FQL looks like: SELECT count FROM comments_info WHERE xid="..." When I attempt the request through PHP, I get the following error: Uncaught Exception: 604: No valid app_id PHP: $facebook = new Facebook(array( 'appId' => '...', 'se...

PHP: Calling a class method from another class..

Hi all, basically I have two classes Inventory and Character. During the construct of the inventory I am trying to determine the characters gender however this just doesn't seem to be working for me at all.. I haven't really used static functions before so if somebody could point out what I'm doing wrong it would be much appreciated.. F...

UPDATE CakePHP - The requested URL was not found on this server

INSTALLING CAKEPHP FOR DUMMIES If you are like me, you are frustrated with these frameworks like Ruby on Rails and CakePHP, which promise rapid development, despite sluggish start - simply spending hours on install. To get CakePHP running, throw out the tutorials and don't even bother buying the books or reading the documentation. None...

taking the user back to the intial page after login?

im using php, i wanted to know if a user lands on a certain page, and they have to login or signup to be able to do actions like commenting or rating etc. i wanted to able to take the user back to that same page after they login. i was thinking to use the php get function and pass the url, im not sure thats the best way to do it, thanks...