php5

PHP5 ISAPI on Windows 7 (64 bit)..

Anyone running into issues with this setup? I'm getting this message: This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive. However, I've set cgi.force_redirect equal to 0, and have reset IIS. ...

how to invoke terminal.app from a php script?

Hello all, I want to invoke terminal.app from a php script is this possible if not then how do we invoke terminal using applescript/shell script. I want to use php because there is no other option for me. also after invoking terminal i want to navigate to a folder and run xcodebuild command from there. Does someone knows about it? ...

Get child class namespace from superclass in PHP 5.3

Assuming I have the following classes in different files: <?php namespace MyNS; class superclass { public function getNamespace(){ return __NAMESPACE__; } } ?> <?php namespace MyNS\SubNS; class childclass extends superclass { } ?> If I instantiate "childclass" and call getNamespace()...

PHP global keyword and $GLOBALS dont seem to work in version 5.3

Hi, I seem to have this problem after upgrading to PHP 5.3 from 5.2. The site runs off index.php which includes() various other utility functions then includes the correct page based on GET variable value. Now one thing I cannot understand is that in xdebug I dont see $GLOBALS. The other bit is - index.php: include_once('includes/glob...

Hiding PHP's X-Powered-By header

Hi I know in PHP, it sends the X-Powered-By header to have the PHP version. I also know by appending some checksums, you can get access to PHP's credits, and some random images (more info here). I also know in php.ini you can turn expose_php = off. But here is something I have done on a few sites, and that is use header('X-Powered-B...

Possible to turn off E_STRICT for library code but not my code?

Is it possible to change the error reporting level (turn off E_STRICT) for files that my PHP application includes with include or require_once? I'd like to be able to see strict notices that occur in my code, but I'm using PEAR MDB2, and I get pages of warnings from that code when I turn on E_STRICT. I know that it's possible to change...

How to implement this with NestedSet behavior in doctrine?

Task: columns: name: string(100) parent_id: integer relations: Parent: class: Task local: parent_id foreign: id foreignAlias: Subtasks ...

how can i share data between PHP pages?

I have a PHP page and I want to share some data between pages like UserID, password. I'm learning about sessions and I'm not sure if Im using it correctly. <?php require_once('database.inc'); $kUserID = $_POST['kUserID']; $kPassword = $_POST['kPassword']; if (!isset($kUserID) || !isset($kPassword)) { header( "Location: http://dom...

Problem with adding errors to Validation library in Kohana 3

I need to add some errors to the Validation helper in Kohana 3. Here is what I start with: // validate form $post = Validate::factory($_POST) // Trim all fields ->filter(TRUE, 'trim') // Rules for name ->rule('first-name', 'not_empty') ->rule('last-nam...

lazy loading of java script in php

Hi, I am using the Google visualization for drawing graphs into my website. This involves a lod of java script. <script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script type="text/javascript"> google.load('visualization', '1', {packages: ['annotatedtimeline']}); </script> These two lines of scr...

Symfony sfFormExtraPlugin ajax error

I'm getting this error in Firefox javascript console. Does it mean jQuery UI is badly configured or is it programming error, e.g. bad values returned by ajax symfony action? I'm using sfFormExtraPlugin plugin's DoctrineAutocompleter... or trying to use it. Error: jQuery("#autocomplete_table1_table2").autocomplete("http://myurl/fr...

How can i cut an image from bottom using PHP?

I want to take out the text in the bottom of an image. How can i cut it from bottom ...say 10px to cut from bottom. I want do this in php, i have lots of images that have text in the bottom Is there anyway to do it? ...

Revision Changes - Visually showing changes.

Rollback of an article I have deleted a lot of the body of this question because I realised I should rephrase it. Here it the rephrase: How can I implement something with strike throughs? Comparing one revision update to the previous. I don't want revision or version control per se, because I can just handle that in my mySQL database...

How can I get a result from mysql_fetch_row (or mysql_fetch_array)

$sqlQuery = "SELECT * FROM allowedUsers WHERE UserID = '" . $kUserID . "'"; $result=mysql_query($sqlQuery, $db); if(!result) { echo "Error running query <br>" . mysql_error(); exit; } while($row = mysql_fetch_array($result)) { echo $row[2]; } I run the SQLQuery in phpMyAdmin and I am getting a valid result (1 row) the table...

how to bind to an openldap server

I am using the PHP extension. The username is admin password is 111111 I try to bind using ldap_bind($rs,'admin','111111') It gives me an error: Unable to bind to server: Invalid DN syntax in [line of the ldap_bind] I can bind anonymously, what is the correct syntax? ...

mysql_query returns an empty resultset, even when query is valid

Hi! When I execute the following code in a php script. The result set is always empty. However, when I execute the same query in mysql console or in phpmyadmin,it rightfully shows 18 rows in the resultset. What could be going wrong here. $result_set = mysql_query("SELECT * FROM categories WHERE 1 ", $this->database_handle); var_dump($...

How to add curl support to PHP 5 in CentOS

How to add curl support to PHP 5 in CentOS ? After installing curl and curl-devel, what are the things that I need to do to setup curl in PHP 5 ...

Clone object to $this

Dear all, I would like to ask about PHP clone / copy object to $this variable. Currently I am new in MVC, I would like to do something like CodeIgniter. I would like to direct access to the variable. in my __construct(), i always pass the global variable inside to the new controller (class), eg. function __construct($mvc) { $t...

CakePHP 1.2.6 / PHP5.2.12 Error in Array Loop in Assignment by Reference

I'm working on retrieving a stack of data and for some reason some of the data gets corrupted. For instance, I've got some Post models that each are related to Comment models (hasMany), and each of the Comment models belongsTo a User. When retrieving the data, here's what I get from the database for the comments: [Post] => Array ( ) [...

Session cookie not being sent when PHP session.auto_start set true

I been trying to replicate a production setup on my development server but can't get the sessions to work properly. After many frustrating hours I've tracked the problem down to the fact that php.ini directive session.auto_start isn't starting the session. AFAIK, session.auto_start = 1 and a session_start() at the top of a script shoul...