php

Codeigniter In Wordpress Page

Alright, I have a wordpress site, that I want to have a clientportal built with codeigniter in it. For the sake of continued theme, I would like to have the codeigniter program where the page/text would normally be. Here is the site http://foretruss.com/wordpress/?page%5Fid=8 you can see the error I get when I have php_exec plugin insta...

php warning mysql_fetch_assoc

I am trying to access some information from mysql, but am getting the warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource for the second line of code below, any help would be much appreciated. $musicfiles=getmusicfiles($records['m_id']); $mus=mysql_fetch_assoc($musicfiles); for($j=0;$j<2;$j++) { if(fi...

Zend_Db_Table Using different Connection-Adapter for reading and writing

Hi Folks, In a current ZF project i have to use diffrent DB Connections for reading and writing. My approuch was do this by extending Zend_Db_Table_Abstract (and Zend_Db_Table_Row_Abstract) It looks like this at the moment: class SomeNamespace_Db_Table extends Zend_Db_Table_Abstract { /** * @var Zend_Db */ protected $read = NULL; ...

PHP Sessions and Javascript Callbacks

I am using swf-upload to handle file uploads on a site I am working on. The problem is the catching function, called swf-upload.php. If I visit the URL it is at directly it works fine, it correctly reads starts the session and gets the user rights, but when the web page calls it with the ajax callback it claims the session is empty. I...

Zendframework Routing Issue

I have been setting my routes in my application.ini file which works for all the ones i have setup. The problem is when there are multiple actions within that controller and i try to use the routes in other actions. For instance i have created the following in my application.ini for paging and column sorting resources.router.routes.sea...

Codeigniter form_helper getting database rows to be values in select menu

I know this is going to be really simple once I post it, I am writing a form, which has a select menu in it, I want the values to pulled from the database, so I thought it would be something along these lines, My view <?php echo form_open('admin/save_content'); echo form_fieldset(); echo form_dropdown('categories', $select_o...

Trying to find a PHP5 API-based embeddable CMS

I've been making the rounds for a CMS that I can use as an API, in a sort of "embedded" mode. I mean by this that I don't want the CMS to do any logic or presentation. I want it to be used as an API, which I can then use within an existing site. I don't want to be tied to the architecture of the CMS. A good example of this is NC-CMS (h...

Redirect with Timer in PHP ?

How can I make a redirect with PHP after say 10 seconds... I have read alot about it, seems like it would be better with javascript. But PHP would save me alot of coding. So how can I make a redirect with timer in PHP ? Thanks ...

How to change a value in multidimension array in PHP.

I want to change some values in my multidimension array in PHP. Suppose that I have: $photographer[0]['uid'] = '1001'; $photographer[0]['point'] = '0'; $photographer[1]['uid'] = '1002'; $photographer[1]['point'] = '1'; I want to change point of photographer that have uid = '1001' to 3. How can I do it? ...

String problem in PHP

How do I take off a certain character in a string and put them all together in an array like: "{2} in better that {1} when it comes to blah blah blah" and the output would be: array(0 => "2", 1 => "1"); I have used regular expression but it seems like it doesn't loop throughout the string or maybe I'm missing something? Thanks ...

PHP PDO - migrating to CodeIgniter

Does anyone know if there is a viable library for PDO database access for CodeIgniter? I only ask because I am in the process of migrating over to CI and am having trouble integrating my old Database classes as libraries in the CI framework - can't seem to get them to utilize CI's config constants for database access. Any thoughts? It...

Calculating in which country a coordinate is?

Is there somewhere a base of polylines for download, I need polylines of european countries and a solution in php for calculating in which country a certain coordinate resides. I used google maps api for this till now but it's too slow and I make many requests frequently so I need to do this locally. ...

Silverlight with PHP and MySQL: can I send data from the Silverlight app back to the server?

I'm creating a website using PHP and MySQL, and I'm trying to add some Silverlight stuff to the site. I need the users to be able to do stuff in the Silverlight app, and for that data to be saved in the MySQL database. I'm wondering about how I could do this... Can I get the client side Silverlight app to log in to the server side MySQ...

Regular Expression in PHP: How to create a pattern for tables in html

I am using latest PHP. I want to parse HTML page to get data. HTML: <table class="margin15" style="margin-left: 0pt; margin-right: 0pt;" width="100%" align="left" border="0" cellpadding="0" cellspacing="0"> TRs, TDs, Data </table> <table class="margin15" style="margin-left: 0pt; margin-right: 0pt;" width="100%" align="left" border="0...

Why php imagefill always black?

Hello guys This is driving me mad. I would really appreciate if you told me any idea about why I see this square in red color just in my local xampp installation. If I run the code in the remote server (http://www.arreglaordenador.com/numberimage2.php) I see the square in black color instead of red. Do you have any ideas? <?php $im = i...

Problems with PHP connecting to a Java program using a Port

Hoping someone can shed some light on this. I have a PHP program which opens a port and sends some text to a java program listening on that port. Basically, there could be many instances of this PHP program connecting over this port to this one java program. The java program contacts an API, retrieves the answer, and then sends the ...

How to get a file size of remote file from googlecode with cURL?

I am trying to get a file size of remote file "compiler-latest.zip" (googlecode.com) using cURL without actually downloading it, here is my PHP code: $url = 'http://closure-compiler.googlecode.com/files/compiler-latest.zip'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CUR...

phantom php echo?

im getting this error: Parse error: syntax error, unexpected T_ECHO in /home/labvc/public_html/AT/site/getimages.php on line 26 from this code: <?php echo '<br />'; echo '<div id=gallery>'; function getDirTree($dir,$p=true) { $d = dir($dir);$x=array(); while (false !== ($r = $d->read())) { if($r!="."&&$r!=".."&&(($p...

Portably passing arguments to PHP's ReflectionMethod::invokeArgs by reference

Seemingly something of a misnomer, as pass by reference is deprecated in PHP 5.3... anyway, what I'm trying to do is write a unit test framework using reflection, that allows you to pass arguments to a method which requires a reference. e.g. class Bar { function TestMethod($arg1, &$result) { $result = 'hello'; return...

PHP variable from other file comes back as NULL

In one PHP file, I have this code: require_once $_SERVER['DOCUMENT_ROOT'] . '/custom/functions.php'; global $testVar; var_dump($testVar); In the functions.php file, I have this at the beginning, followed by a few other functions: function pr($s) { echo '<pre>', htmlspecialchars(print_r($s,true)), '</pre>'; } $testVar = 'hello wo...