php

netbeans: how can i add an included directory for code completion in php

Hi. i'm using Zend Framework classes and i don't get code completion for them because the library directory of Zend Framework in not inside my project. is there a way to tell netbeans to recognize the zend framework directory in order for the code completion to work? thanks ...

FCKeditor Upload feature not working, no error

Using FCKeditor (2.6.5) When I use the upload feature it acts as if it has worked (no errors) but does not upload a file. I can view other files in the upload folder with the file manager that I ftp in and can also create folders with fck. Any thoughts? ...

how to replace special characters with the ones they're based on in PHP?

How do I replace: "ã" with "a" "é" with "e" in PHP? Is this possible? I've read somewhere I could do some math with the ascii value of the base character and the ascii value of the accent, but I can't find any references now. thanks ...

Error in PHP soap client to .NET soap Server

PHP soap client in attempting to interact with a .NET soap server results in the following error: [soap:Receiver] Server was unable to process request. ---> Invalid length for a Base-64 char array. $credentials = array( 'RequestorUID'=> 'xxxx', 'RequestorPassword'=> 'xxxx' ); $param = array('pmPropertyManagerID'=>'xxxx'); $clien...

php & jquery: progressive enchancement

I have several php pages that have forms used to submit data. My typical setup is to have the page post to itself so that I can validate the input and if necessary reload the page with the user submitted data (and markup to show where the error is). If everything is OK I redirect to a thank you page. I would like to start using ajax (j...

XAMPP on Win7 too slow

I'm running XAMPP 1.7.1 on Windows 7 Ultimate. Everything (Apache & MySQL) is working fine except for speed. When I open http://localhost/, I must wait probably 1-3 seconds for view a webpage. In my opinion, it should be at most some hundreds miliseconds. Basic facts: while waiting to load a localhost webpage, status bar says "Waitin...

Is htmlentities() bullet proof?

I was asking myself about the security of using the php function htmlentities() against XSS attacks, and maybe of related functions such as htmlspecialchars. thanks a lot :) ...

Parsing flat-file database information into a multidimensional array

I want to make a class for parsing flat-file database information into one large analogous multidimensional array. I had the idea of formatting the database in a sort of python-esque format as follows: "tree #1": "key" "value" "sub-tree #1": "key" "value" "key #2" "value" "key #3" "value" I am trying to make it ...

securely dealing with client 'sessions' in PHP

I've (so far) been handling user sessions with client-side cookies and database entries. When the user logs in, I generate a guid and place it in a cookie on the client's computer. Then I create an entry in a 'sessions' MySQL table, and add there the guid, ip address, the username, privileges, etc. Then when the user accesses the page, ...

Zend_Db and Date Based Queries

I'm using Zend_Db to query a table. I have some WHERE clauses that need to be dates and it's not clear (at first glance) how to do this "the right way". Does Zend_Db provide an abstraction so I don't need to concern myself with how the backend (Oracle, MySQL, etc.) expects its dates? Or do I need to format things in the way my backend ...

PHP, MySQL - would results-array shuffle be quicker than "select... order by rand()"?

I've been reading a lot about the disadvantages of using "order by rand" so I don't need update on that. I was thinking, since I only need a limited amount of rows retrieved from the db to be randomized, maybe I should do: $r = $db->query("select * from table limit 500"); for($i;$i<500;$i++) $arr[$i]=mysqli_fetch_assoc($r); shuffle($arr...

PHP - Highligh selected link

How do I "highlight" (turn to a different color, make bold, whatever..) a link that has been clicked on? Example is here: http://www.celebrything.com/ Trying to get the Today, Week, and Month links in the right sidebar to turn a different color once clicked. Here's the code I'm using to show the results in the right sidebar: <div id...

Parse error help, PHP unexpected T_STRING (probably something simple)

It's probably something simple I am not seeing because I've stared at it too long. Any ideas? It's throwing on line 119, I've indicated it below Parse error: syntax error, unexpected T_STRING in /home6/cleanai4/public_html/act.php on line 119 I'm just trying to format a phone number. Thanks for the help in advance. if(isset($s...

Validating html with php

Something is wrong with my print "<option value..."; line of php code. It keeps generating error messages: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified <option value = Addition>Addition</option> <and so on...> Okay, so how do i fix this line of code: //foreach loop to cycle t...

Does using a function in foreach loop caches the result, or calls the function each time?

In the following code: function a(){ echo 'a'; return array(1,2,3,4); } foreach(a() as $t){ echo $t; } We can see a() is called only once, and it seems the returned value is cached... But then I got to see this debate (see comments on the question) am I missing something? ...

PHP headers already sent error

Hello all, I'm getting a Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent error even though the first line of my file looks like: <?php session_start(); all the answers I saw on other sites said it was from sending info to the server before starting the session. Why...

Fatal error: Class 'Zend_Controller_Action' not found

I've found some answers that are closely related to this problem, but I still can't get it resolved. I believe folks are saying that something is not correct with my include path, but I've tried all resolutions I could find to no avail. Here's the error: Fatal error: Class 'Zend_Controller_Action' not found in /Users/*me*/Sites/*site*/...

Css classes in CakePHP?

How can I get a different css class for each table header? ...

Create a copy of a result row

How can I copy an array that has other associative arrays in it? I am talking about a result set returned from a mysql_fetch_assoc. So say I have a structure like this... connect $result = query; while ($row = mysql_fetch_assoc($result)) { array_push($static_row, $row); // here lies the problem } I would like to get that $stat...

Can anyone please explain to me what max_input_nesting_level is used for and what is nesting depth?

Hi all, Can anyone please explain to me what max_input_nesting_level is used for and what is nesting depth with a detailed example. Because as i am a newbie i need to know in depth. Thanks n advance ...