php

php: get variables visible in function

is there any way to get list of variables that were defined in function, or list of all accessible variables in a function? ...

Output image(chart) to browser

Hi. I'm currently trying to output an image (chart generated with PHP). After I get all the data I need I just output the image to disk with: imagepng($img, "img/graf.png", 0); imagedestroy($img); Then I call the image on the page, but the browser uses always the cached image instead of the newly generated image. So I am trying to o...

Zend Lucene is under processing now... crashed my website

{Zend_Search_Lucene_Exception} Index is under processing now This is what i get in my error log which makes crash the 50% of my website. What should i do to fix that please ? Thanks ...

How to detect the number of <p> elements stored in my db?

Hi Let's say that I have this text my db. <P>word1</P> <P>word2</P> <P>word3</P> <P>word4</P> How I can detect the number of <p> elements after I get my text from my db? Thanks ...

Accessing the rewritten URI in a php script

So I have a .htaccess file which is performing a rewrite from /testscript1.php/testvar1/testvar2 to /testscript2.php/testvar3/testvar4 (this is an over simplification but you get the idea). Now though in my testscript2.php script when i access the $_SERVER['REQUEST_URI'] variable i see /testscript1.php/testvar1/testvar2 rather than /t...

mysqli_real_escape_string() expects parameter 1 to be mysqli

Here is my complete code.... Connect.php $connect = @mysql_connect ($host, $username, $password, $db_name) or die ('error'); $select = @mysql_select_db($db_name, $connect) or die('check'); password .php //forgot password update include('C:\wamp\www\header.html'); //check if form has been submitted include('C:\wamp\www\connect...

Error in PHP code

The error: Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in PSubscriptionFile.php on line 90; I think that public static _fromJSON should be public static function _fromJSON but that give Fatal error: Declaration of PSubscriptionFile::__construct() must be compatible with that of PuSHSubscriptionInter...

How to detect client disconnection on PHP socket listener?

Hi all, I've been testing PHP socket listening, and ran into the aforementioned problem. My test listener works otherwise fine, but if a client disconnects without telling the server, the script goes into and infinite loop until a new client connects. The problem seems to be on line $ready = socket_select($read, $write = NULL, $except =...

Providing Links for Download to Password Protected FTP

I have a FTP with some file which I want give it to the users for Downloading. But the FTP is password protected and I want to authenticate the FTP using PHP and make the links available in a php page so as that when the User clicks on any of the FTP links in that page, the download should start. Please help. ...

PHPCrawl sometimes returns empty handed

I'm using the PHPCrawl class to spider websites and build a list of links. It all works well, if slowly, and I then use the links to perform other tasks. I'm encountering a problem where the first time I run the script it completes with no result, then the next time I run it it works as expected. It's failing about 30% of the time. I t...

Escape input data in SQL queries when using ODBC + Access

I've tried odbc_prepare() + odbc_execute() to update a record in an Access file but I always get an SQL state 07001 error message about incorrect column count (actually, the message is in Spanglish and doesn't make much sense): <?php $items = array(); $items[100] = 'Foo'; $items[200] = 'Bar'; $sql = 'UPDATE street SET name=? WHE...

xml:lang parse in PHP

Hi, everyone. XML: <?xml version="1.0" encoding="UTF-8"?> <answer> <describe data="aircompany"> <data> <code xml:lang="ru">FW</code> <code xml:lang="en">FW</code> </data> <data> <code xml:lang="ru">UT</code> <code xml:lang="en">ЮТ</code> </data> </describe> </answer> ...

creating configuration file in php

hi, i want to create the configuration file , which will have the application id and update path two variable , when i will pass the application id in the api it will return the update path of that application id . how i will achieve this making of configuration file. regards rahul ...

insert multiple values using a query as array

Hello, i'm trying to insert multiple data using a query, i've tried the implode function, the while loop, for loop, but still can't be done.. can u help plz well i've a combobox box for selecting course name, created a function to get its ID and assign a variable. supose i'm a manager of a department and need to assign all staff below ...

MySQL syntax error

Hello, I get the following syntax error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* ,MATCH(city) AGAINST ('""' IN BOOLEAN MODE) FROM `` WHERE MATCH(city) AGAINST ' at line 1 The corresponding code for this error is the following...

CakePHP: URL Routing Advice

Hi folks, I have a website that I want to modify the routing on. My problem is that in this specific scenario I'm not sure that what I want is even possible. I have a projects controller with an index action/view and a view action/view. When I go to projects/ i see a list of projects. when I go to projects/view/project-slug I see that ...

PHP soap ComplexTypes

By default, XML Schema complexTypes are mapped to StdObjects. You can make ext/soap map them to specific PHP classes like this $server = new SoapClient("books.wsdl", array('classmap' => array('MyBook' => "MyBook"))); My problems is that the MyBook object has one of the properties an array of MyPage objects and even if i defined thi...

Is there an is_iterable or similar function for PHP?

Hello, I am passing a JSON'd feed from Twitter into my application, and sometimes Twitters API returns empty or incomplete feeds. This is causing a problem when I try to iterate the feeds using foreach - does anyone know of a suitable test to find out if an object or array is iterable? Could this be done with isarray($obj) || $obj inst...

How to match junk characters in mysql database with arabic letters with PHP and MYSQL.

Hi all, My question in brief here: The site is developed with PHP as front end and mysql as backend. I am registering in my site by entering the arabic letters. And the value also inserted in mysql database. But it is not in the format what i entered. It looks like junk words. Now my problem is when i try to login i can't able to mat...

what is the best solution for php xml based content management solution with flex?

The application needs versioning of the xml documents along with managing. The best java solution close to my requirement is Nuxeo. I need a solution specific to PHP. Please suggest a good open source Enterprise level content management system which should have a API through which I can communicate even from flex. ...