php

How do I get a PHP variable in these single quotes?

How can I get the value of $fbAppPath into the PHP statement below? <? print json_encode(array(array('text' => 'Become A Fan', 'href' => '$fbAppPath'))); ?> ...

PHP Mysql query, No Error, Wont Insert Row.

The form submits correctly and it sends me an email. No error is reported and the SQL it creates works fine, I tested it at phpMyAdmin. mysql_error() raises nothing, it just doesn't add a row. Can anyone see what's going on? <?PHP $to = "[email protected]"; $subject = "New Lead"; $date = date ("l, F jS, Y"); $time = date ("h:i A"); $mysq...

How can I tell if a request is made with AJAX in Kohana 3?

I've tried these request::is_ajax() Request::instance()->is_ajax To no avail. I've noticed in the request class there is a public property $is_ajax but I can't seem to be able to access the property. What am I doing wrong? UPDATE I ended up getting it to work with Request::$is_ajax ...

XPath Query using contains with multiple values

I need an XPath that will elect all parent nodes a child with anattribute that constains at least one of a list of values. Example XML <mynodes> <theParentNode> <theChildNode name="one two" /> </theParentNode> <theParentNode> <theChildNode name="one all" /> </theParentNode> <theParentNode> <theChildNode name="...

Unicode setlocale and strftime fails at windows

I have one page and it's encoding is UTF-8 and If i try to run that code in unix system everythings looks fine but when i try to run in windows(7) some chracters looks question mark(�). How can run the code fine both of two system(without using iconv). header('Content-Type: text/html; charset=UTF-8'); setlocale(LC_ALL, 'turkish'); echo ...

how to install posix in php

posix does not appear when I run php -m cmd, however, I see it from the phpinfo() –enable-posix=shared on Linux with Plesk 9. Basically, I can't use posix_*() functions as described at http://www.php.net/manual/en/ref.posix.php this shows doesn't exists: if (function_exists(‘posix_getuid’)) { echo “posix_getuid available”; } else { e...

Deleting Non-Alpha Chars Regular Expressions

Hi, i want to delete all characters except a-zA-Z0-9 and _ chracter. How can do that in php ? ...

Can anybody recommend a program that generates a graph the lines of code count?

I've found a lot of programs and scripts for counting the number of lines of code using Google, but what I'm looking for is something that graphs it in real time. I'm hoping this will motivate myself and other programmers. Any ideas? ...

Pulling $_POST array elements into sequential variables with a common prefix

I have a $_POST array that results from selecting (in this case) 3 rows from a displayed HTML table in which each row has a checkbox. The IDs are unique identifiers for each row. Array ( [checkbox] => Array ( [0] => 001403166 [1] => 001407509 [2] => 001407541 ) ) I want to gathe...

How does one start using a PHP framework?

This may sound like a really stupid question but I'm a noob so excuse that please. But how does one use a PHP framework like Zend or CakePHP. I know they are code libraries that can be used to speed up the development process but how to implement it in the first place. I downloaded Zend framework but what do I do with it. All the documen...

PHP Syntax Question

I'm drawing a blank for some reason on how to access this information in an object (It's a Zend_Db_Table_Row, but I think that's beside the point). Here's the print_r, I'd like to get just the array assigned to [_data:protected] MyClassName Object ( [_data:protected] => Array ( [param1] => 1 [param2] => Some info ...

yii form question

in the yii documentation it says: foreach($_POST['LoginForm'] as $name=>$value) { if($name is a safe attribute) $model->$name=$value; } what does the array LoginForm come from? which attribute is it coupled to? ...

How do I get a value from PHP's defualt session when a custom session handler is in use?

I have a non CMS page in which a session value is stored using PHP's default session handler. ie: session_start(); $_SESSION['MyVar'] = true; On another page, which is part of the CMS, I need to test whether the variable is true or not. But, the CMS uses it's own session handler, so when I try to read the variable, it's undefined, bec...

Portable version control?

Currently I do all of my work off of a flash drive. Keeps things portable, and I'm able to learn web development while I'm at work. Currently I run Portableapps with XAMPP, Notepad++, and Chrome installed on it. My question is, does anyone know of a version control system that would work portably on a flash drive? I just learned about t...

drupal: getting nodeautoterm node ids from taxonomy ids

I'm using drupal's NAT module and need to get the nid from the term id. Here's what I tried: foreach ( (array)nat_get_nids($termid) as $natid ) { $NatName = $natid->name; } print $natid; This does not work. Node auto term's get nid function is like this: function nat_get_nids($tids, $get_nodes = FALSE) { static $nid_cache = N...

How do I echo the session name in a foreach loop in PHP?

I am looping through my session variables. I have been able to echo the session values, but I would also like to echo the session name that corresponds with that value. How do I echo out the session variable name each time it loops? This is the code I currently have: foreach($_SESSION as $value) { echo 'Current session variable i...

loading process with javascript

hy i have a index.php with a form, after i submit the form with a iframe to a page.php, a loading process appears in page.php when execute the first function i want javascript to execute a function in index.php, the page who is visualized! when execute the second function i want javascript to execute another function in index.php how ...

Function list of php file

How to get list of functions that are declared in a php file ...

Lists wordpress posts by category and tag

I would like to generate all posts that has say a category name of X and a tag name of Y with in wordpress. query_posts('cat=X List&tag=Y'); I above works to an extent but not fully since I need to repeat this list and just echo the_title(). The problem is very similar to the one found here http://bit.ly/ba4Zot ,the solutions provide...

php email confirm code algo ?

Hi, I saw a 'confirm_code' column in a db table, and property of the column is varchar(100), can you guys give me idea of a nice algo for a confirmation code ? Basically, it should consist of a random characters. The simplest things in my mind is just encrypting a string through md5 or sha1 but it won't fit because of the current colum...