php

Is it worth learning C to get a deeper understanding of OS'es and computers in general?

I'm currently working as a Actionscript 3 and Php developer. I started out learning Php then moved on to Actionscript 3 and now I'm learning Python. These 3 languages are high level languages which in none of them you have to worry about low level memory management and things like knowing which data type to use for different numbers. I...

How can I produce a small stamp on each image on my site

i work in lamp environment . i search script that know to take a image , that user upload to my site. and make from this image , new image that contain the real image with small stamp on the top corner. thanks ...

What are the absolute and relative costs of different operations in PHP?

I'm looking for a elaborate list comparing different operations in PHP. For example: echo vs. printf, ++$i vs $i++, a direct function call vs. object function call, array access vs. direct data access, global vs. local variables, mysql_fetch_assoc vs. mysql_fetch_row etc. Of course these figures probably highly depend on the used version...

Synchronization with master database

I have a 2 databases hosted on the different server. What the best thing do, to copy all the contents of master table database to the table of slave database? I am not the owner of the master database but they are willing to give an access. Before the data from master database is outputted via RSS and my PHP script parse it to insert int...

Session_set_save_handler close/gc

I need to perform an action after a session times out. However I have no clue how to trigger that action without an incoming request. An event handler/a listener/a timer would suit perfect but since PHP does not support such a thing it is really difficult to accomplish what I want. After lot of searching I bumped into session_set_save_h...

Make string that starts with http:// clickable

Looking to make a string that starts with either http:// or www clickable. str_replace("http://", "$string", "<a href='$string'>"); str_replace("www", "$string", "<a href='$string'>"); shouldnt it be something like that? ...

How to code a Download/Upload Speed Monitor in PHP,Python, or Java?

Hi everybody. I have to code a up/download speed monitor. It will obtain the current download and upload transfer speed of the computer which it has been installed and post it to another server periodically. c But I don't have an idea about how to catch instant transfer rates of a computer. As you know some of network monitoring program...

how to get a cookie value from javascript and set it by PHP?

I'm new to cookie operations ...

How can I get a hex dump of a string in PHP?

I'm investigating encodings in PHP5. Is there some way to get a raw hex dump of a string? i.e. a hex representation of each of the bytes (not characters) in a string? ...

dot in variable name...

I am passing the variable with dot in query string.Php is replacing the dot with under score. So how can i retain the variable name which is having dot in the name http://localhost/sample.php?one.txt=on&amp;two.txt=on sample.php $ret=$_REQUEST['one.txt'];//Not working ...

ORM and DAO in PHP

I am a PHP developer and I am familiar with ORM (Doctrine and Propel), but I seldom heard about DAO. What are the differences and relationship between ORM and DAO from PHP development perspective? If I use Symfony to develop very large and complex projects, will that be better if I use DAO? (ORM is somehow heavy I think, but I know lit...

how to log which page was "not found"? (Trying custom error page with htaccess, php, http_referer)

Hi I was just wondering how to get the link of the webpage which was not found on my website. With following .htaccess code, when a non-existing page is requested, user is redirected to my_404.php. Options -Indexes ErrorDocument 404 http://mysite.com/my_404.php If I have to track down what was the link of the page, which was not ...

Restriction on the number of webservice call per minute

Is there a limitation of the number of webservice call per minute? If yes, where can I set the parameter? What is governing the limit of number of call per minute? It's the Apache, or the application itself? OK, maybe I should express myself clearer. I have two PHP applications. One is calling another one via webservice. And for the fir...

How to clear previously echoed items in PHP

In php, is there any way to clear/remove all previously echoed or printed items? For example: <?php echo 'a'; print 'b'; // some statement that removes all printed/echoed items echo 'c'; // the final output should be equal to 'c', not 'abc' ?> My script uses the include function. The included files are not supposed to echo anyth...

How to use cache in cakephp

I want to use cache in CakePHP. How do I use it? ...

giving javascript/the server time to process

Hello all, I've got a confusing problem. I'm working on a music catalog/playlist/player. When a user drags a song into the playlist a request is sent to php (via javascript/ajax) which finds the song in the database and returns song information which is then organized and displayed in the playlist. This works great. The problem I'm havin...

Cannot unserialize object after storing it serialized in database!

I'm trying to store a complex object here and am doing that by serialising the object running a mysql_real_escape_string on it and inserting it into a mysql database. However when I retrieve it running a sql query - I'm using Zend frameworks Zend_DB_Table here but anyway - and when I try to stripslashes and unserialize I dont get my obj...

Accessing parent properties and overridden methods in PHP

I have parent and child classes as follows: abstract class ParentObj { private $data; public function __construct(){ $this->data = array(1,2,3); var_dump($this->data); $this->method(); } public function method(){ echo "ParentObj::method()"; } } class ChildObj extends ParentObj { p...

Need to find out of a table has certain columns before running alter table

I am writing a plugin for wordpress. When the plugin is initialised I need to find out if the users table contains the columns I am trying to insert to ensure I am not overwriting anything. Can someone provide me with the syntax that does this; I think it looks something like this: SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA...

How to send mails through php script?

Hello everyone. How can i send mails through the php script?? I am trying to do somthing like this: for($k=0;$k<=$x->length-1;$k++) { for($l=0;$l<=$j-1;$l++) { if($y->item($k)->nodeValue==$JobNoArr[$l] && $AcceptanceDateArr[$l]=='0000-00-00') { //echo $v->item($k)->nodeValue ; $email =...