I asked a question in this link;
Streaming music background
function music(){
$txt = '<object type="application/x-shockwave-flash"
data="http://***.com/slim.swf?&autoplay=true&repeat=true&shuffle=true&song_url=http: //***.com/music.mp3&"
width="200" height="20">
<param name="movie"
value="http://***.com/sl...
Hi everyone,
I've got the following code:
function failureCallback($host, $port) {
print "memcache '$host:$port' failed";
}
$this->memcache = new Memcache;
## bool Memcache::addServer ( string $host [, int $port = 11211 [, bool $persistent [, int $weight [, int $timeout [, int $retry_interval [, bool $status [, ca...
I have a MySQL ISAM table being accessed my multiple php instances. Right now I'm using a WRITE lock to serialize access to this table.
My question is how do I ensure that the PHP instances get served on a First-Come-First-Serve basis? Or is this the default behaviour?
The official MySQL documentation doesn't mention anything about the...
The code below shows nested while loops, but it's not the very efficient. Suppose I wanted to extend the code to include 100 nested while loops. Is there a better way to accomplish this task?
<?php
$count = 1;
$num = 1;
$options=3;
while ( $num <=$options )
{
echo "(".$num . ") ";
$num1 = 1;
$options1=3;
whil...
Guys, could you help me with treating text sent with GET method. How to detect and treat line foldings in text? The text is sent from textarea through AJAX using GET method. How to detect line foldings in text when it is sent in GET method?
And I want to replace all line foldings with special character for example like "|" before sendin...
Hello i have two columns: duration (int) and dateCol (date) in a table.
How should i proceed if i want to know when CURDATE() - dateCol will iqual to duration.
ie: CURDATE() - dateCol (2010-05-08) = duration (14 days), and then send an e-amil?
...
Hello,
I need to make a link that when clicked will run this in php:
session_destroy();
I know how to make a link in html, but I don't know how to make it interact with php. Thanks for any help.
...
Hello,
I've set up a quick little test to understand and debug timezones between mySQL and PHP.
Here's the page: http://dev.feedingo.com/test_dates.php
The dates are being created in mySQL using NOW() in a datetime field. The initial problem I was trying to figure out is what timezone mySQL is using and how to sync it up with PHP. B...
How can i encrypt a function or its contents in a php class ?
e.g. Take a look at below class, i would like to encrypt the function test1() so the code inside will never be revealed but executes as normal
class test
{
var $x;
var $y;
function test1()
{
return $this->x;
}
function test2()
{
return $this->y;
}
}
Than...
I have heard that setting the --prefix=PREFIX option when compiling PHP on linux will allow you to have more than one install of PHP at a time without them clashing. (I think the default if this isn't set is /usr/local). However, I'm not sure what exactly it does or what a good setting to use is. Furthermore, I've also heard that setting...
Hi
I'm looking for a regexp that find all images path in an image tag (src) and transform all images path by cid:filename
<img src="../images/text.jpg" alt="test" />
to
<img src="cid:test" alt="test" />
Thanks for your help
Chris
...
Using an array like this:
$data = array
(
'host' => 1,
'country' => 'fr',
)
I would like to create a MySQL query that uses the values of the array to form its WHERE clause like:
SELECT *
FROM table
WHERE host = 1 and country = 'fr'
How can I generate this query string to use with MySQL?
...
I need to do some additional processing after a Drupal page has been sent.
I know I could fire a background shell command, but I need the current Drupal execution context to be maintained.
I've spent a lot of time looking, but I can't find any documentation in this regard. This is surprising because it must surely be a common requireme...
I'm in the progress of making a shopping cart in PHP. To check if a user has selected multiple products, I put everything in an array ($contents). When I output it, I get something like "14,14,14,11,10". I'd like to have something like "3 x 14, 1 x 11, 1 x 10". What is the easiest way to do that? I really have no clue how to do it.
This...
Hi,
Doctrine (on Ubuntu): What command generate models from database without delete existing models?(I add new tables soo i want update models)
Thanks
...
I have a simple setup of a set of writers and a set of readers working with a MySQL ISAM table. The writers are only inserting rows while the readers are only checking for new rows.
OK, so I know that I don't need a lock in this situation, since I'm not modifying existing rows. However my Writers are accessing one more table that does n...
I have two tables as follows:
I have a RatingsTable that contains a ratingname and a bit whether it is a positive or negative rating:
RatingsTable
----------------------
ratingname ispositive
----------------------
Good 1
Bad 0
Fun 1
Boring 0
And I have a FeedbackTable that contains feedback on things: t...
Hello
I want to build a php based site that (automate) some commands on my Ubuntu Server
first thing I did was going to the file (sudoers) and add the user www-data so I can execute php commands with root privileges!
# running the web apps with root power!!!
www-data ALL=(ALL) NOPASSWD: ALL
then my PHP code was
<?php
$command...
It seems that often I will want to execute some methods from a Class when I call it and choosing which function will depend on some condition. This leads me to write classes like in Case 1 because it allows me to rapidly include their functionality. The alternative would be Case 2 which can take a lot of time if there is a lot of code an...
Hi everyone,
I am trying to create a new array from two current arrays. Tried array_merge, but it will not give me what I want. $array1 is a list of keys that I pass to a function. $array2 holds the results from that function, but doesn't contain any non-available resuls for keys. So, I want to make sure that all requested keys comes ou...