Duplicate:
http://stackoverflow.com/questions/1220855/how-to-remove-cakephps-trailing-timing-benchmark-comment
cakephp stamps execution time as html comment at the bottom of the page, something like
<!-- 4.031 s -->
How can i stop cakephp to output this??
I need to avoid this print because in some ajax queries (that...
I would like to know if it is a good thing to define a function inside another function in PHP. Isn't it better to define it before the function (and not inside) in terms of performances.
...
I have a problem regarding display PHP code (stored in a database) on a website.
This is the text I have in the database:
Blah Blah Blah this is regular text
[code]
<?php
$message = \"<div class=\'code\' style=\\\"NO\\\">\";
echo $message;
?>
[/code]
Blah Blah Blah this is more regular text
Which I want to display as:
Blah Blah ...
How to write this in C #? Can you use Dictionary to this?
$count = 0;
if(count($_SESSION['goods']) > 0) {
$count = count($_SESSION['goods']) -1; // array start on zero.
}
$_SESSION['goods'][$count]["products_id"] = $_POST["products_id"];
$_SESSION['goods'][$count]["price"] = $_POST["price"];
$_SESSION['goods'][$count]["number"] = $_...
Is it better to close the connection after each query is executed or put the connection as is it, then php will automatically close that connection.
Which one is better and why?
...
Hello Everyone,
I have an application in rails (uses authentication via AuthLogic).
I want to login to my PHP application by remotely logging on to my rails app.
I want the PHP app to use my Rails app to perform the authentication and retrieve user details on a successful login else echo error from my rails app.
In shorter words,
Log...
I'm using a simple loop to echo back some numbers
<?php
$inc = 0.25;
$start = 0.25;
$stop = 5.00;
?>
<?php while($start != ($stop + $inc)){ ?>
<option><?php echo $start ?></option>
<?php $start = $start + $inc; ?>
<?php } ?>
However 5.00 appears as 5 and 4.50 appears as 4.5
How would i get this script to display 5.00, 4.00, 3.00, 3...
I've got the following piece of code on a PHP 5.2.4 (no safe_mode) linux server:
mkdir( $path, 0777, true );
when I enter a path like:
'/path/to/create/recur/ively/'
all directories are created axcept for the last one...
when I add another directory like:
'/path/to/create/recur/ively/more/'
again, all paths are created except ...
Using PDO / PHP and MySQL, how can I check if a record was inserted or updated when I use an INSERT ON DUPLICATE KEY UPDATE statement?
I have seen a solution using mysql_affected_rows() for PHP, but I am looking for a way I can use with PDO.
...
I am parsing pages using Simple DOM parser. It is neat, but I would like to get the applied css style for each element. Not only the inline styles, but every style it applies to that element, being it inline, in-page or external.
Is there a class that does that? If not, how would you do it? I do not really care about overriding styles, ...
I was curious, in one doc i read it suggest using limit 1 on all queries if available including indexed and unique columns. Does writing limit 1 actually help queries when using a WHERE uniqueCol = val; ?
...
Ok I have to parse out a SOAP request and in the request some of the values are passed with (or inside) a Anchor tag. Looking for a RegEx (or alt method) to strip the tag and just return the value.
// But item needs to be a RegEx of some sort, it's a field right now
if($sObject->list == 'item') {
// Split on > this should be the end ...
Hi all!
How can I compile Propel Criteria to clear SQL?
I've tried $criteria->toString(); but this is not I expected.
Also I've tried ModelPeer::doSelectStmt($criteria) but it returned raw sql (required parameters substitution)
...
Hello!
I'm working on a url shortner script.
It's located at http://mini.ample.se/
and the short URL will look something like http://mini.ample.se/%5Babc..%5D
my .httaccess file looks like this
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions MaxRedirects=1
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
Rewr...
Maybe I am day-dreaming but I am about to merge the contents of two large tables which represent two companies versions of the same data. I'd like to avoid duplicates (entries with the "title" field from DB 1 being almost the same as the "title" from DB 2. Are there any methods in php or mysql do do close string matches and return a rele...
which one will be better to use default magic quotes or user defined addslash/stripslash in PHP?
I want use the best one. please help me.
...
I'm trying to build a form which submits a URL which contains a lon/lat that has been passed over from Google Maps. I have managed to get it so the lon/lat is passed into input fields in the form, how would I go about using these values dynamically in the post URL, i.e.:
action="search.asp?[lon][lat]
...
I have an issue that seems to be appearing in Firefox 3.5.2. When i view the page it looks find but then a click on one of the links on the page then return to the page either using the back button or clicking a link on the following page that returns to the first page. (if that makes any sense).
I use firebug when i return to the first...
I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to throw the following error when POSTed:
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
It's an HTTP 405 status code. All other forms in the application work, so I believe that the ...
I'm doing a search within list of people. And I want it to show results on the fly and so it does. But there is one link that I need and it should look like this:
chatid=18&userid=45&create=new
but after the results are displayed through this:
$.get('/ajax.php', {sec: 'search_users', ajax: 1, search_for: $(this).val()}, function(data...