php

Sending BCC emails using a SMTP server?

I've had this noted down on some of my code for a while: /** * Add a BCC. * * Note that according to the conventions of the SMTP protocol all * addresses, including BCC addresses, are included in every email as it * is sent over the Internet. The BCC addresses are stripped off blind * copy email only at the destination email serve...

Php/ODBC encoding problem

I use ODBC to connect to SQL Server from PHP. In PHP I read some string (nvarchar column) data from SQL Server and then want to insert it to mysql database. When I try to insert such value to mysql database table I get this mysql error: Incorrect string value: '\xB3\xB9ow...' for column 'name' at row 1 For string with all ASCII chara...

A way to make md5_file() faster?

I currently use md5_file(); to run through about 15 URLs and verify their MD5. Is there a way I can make this faster? It takes far too long to run through all of them. Sorry if this isn't a good question, I just realized its only three (four if you count this one) sentences long. ...

selecting more than 1 table to get content from [php/Mysql]

Hi There i want to get the latest threads/messages i made my code then i made function that calls the code to show last messages in specific board it works great now i want to get latest messages from 2 boards or more in the same function this is the part that chooses the board AND b.id_board = t.id_board' . (empty($vars) ? '' : '...

TinyMCE: experiences, options

Hi I am considering using TinyMCE to handle the textboxes on sites I develop. I have the production version downloaded. At first I will be using it for the backend of a client's site on a deadline and I need it to work out of the box initally. In the future I also like the customisation options. Basically, does TinyMCE work, is it sta...

Help with PHP simplehtmldom - Modifiying a form.

Ive gotten some great help here and I am so close to solving my problem that I can taste it. But I seem to be stuck. I need to scrape a simple form from a local webserver and only return the lines that match a users local email (i.e. onemyndseye@localhost). simplehtmldom makes easy work of extracting the correct form element: forea...

PHP cron detect via php?

Is there a way to find out if Cron Jobs are available on the server? I mean I want to detect this in a PHP script.. ...

How to find the php.ini file used by the command line?

I need to enable pdo_mysql in my EasyPhp environment, so I went to php.ini file and uncommented the following line: extension=php_pdo_mysql.dll Unfortunately I still have the same problem. I'm using the CLI so I suppose I need to locate the php.ini file used by the CLI. How can I find it? ...

Get calling user ID in PHP setuid script

I have a PHP script on Linux in which the sticky bit is set, so it gets executed as the file owner. How can I get the user id of the calling process, for authorization purposes? Context: I have two applications on a server, and want one to request some info from the other. For this reason the other offers a script with setuid, but I wan...

c# video equivalent to image.fromstream? Or changing the scope of the following script to allow video too

The following is a part of an upload class in a c# script. I'm a php programmer, I've never messed with c# much but I'm trying to learn. This upload script will not handle anything except images, I need to adapt this class to handle other types of media also, or rewrite it all together. If I'm correct, I realize that using (Image image...

Checking server load with PHP and taking appropriate action

Hi, I'm creating a project in which a server receives operations from clients to apply to a local server document. The server and client both share the same document and therefore each message the client sends contains an MD5 hash, which the server compares to after generating its own hash to ensure the server and client documents are sy...

case insensitive highlighting in php

i'm using this function to highlight the results from mysql query: function highlightWords($string, $word) { $string = str_replace($word, "<span class='highlight'>".$word."</span>", $string); /*** return the highlighted string ***/ return $string; } .... $cQuote = highlightWords(htmlspecialchars($row['cQuotes'...

Form Submitting Incorrect Information to MySQL Database

I've created a form that submits data to a MySQL database but the Date, Time, Year and Month fields constantly revert to the exact same date (1st January 1970) despite the fact that when I submit the information to the database the form displays the current date, time etc to me. I've already set it so that the time and date fields automa...

Finding part of a string that a user has sent via POST

My users can send links from popular file hosts like Rapidshare, Megaupload, Hotfile and FileFactory. I need to somehow find out what filehost they sent the link from and use the correct class for it appropriately. For example, if I sent a Rapidshare link in a form on my web page, I need to somehow cycle through each file host that I al...

ImagickDraw::setFont has no effect on my system; suggestions?

Running on Ubuntu LTS 8.04, PHP 5.2.8, ImageMagick 6.6.1-5 installed from source, and Imagick 2.3.0 installed from pecl. ImageMagick's 'convert' command sets fonts properly, and ImagickDraw::setFont properly complains if an invalid path to a font has been specified. However, specifying a valid font has no effect in changing the appeara...

Integrating Smarty into Zend Framework 1.10

Hello, I searched through Google and there was little to no information about how to integrate Smarty 2.x into Zend Framework 1.10. Can anyone teach me how to do so? ...

WHERE id IN doesn't work in UPDATE

UPDATE statistics' SET money = money + '$money' WHERE member_id IN ((SELECT member_id FROM races WHERE l_id = '$mem_id'), $other_id) What's wrong with that? I want to retrieve all member_ids from races and also include to member_id $other_id. Without $other_id it works. By the way, it gives me "Subquery returns more than 1 row" error....

My web page is not detecting user's preferred language set in web browser.

I'm testing the code by changing an option in Firefox's options: "Options -> Choose your preferred language for displaying pages" This is the code: lang.php: <?php function dlang($Var) { if(empty($GLOBALS[$Var])) { $GLOBALS[$Var]=(!empty($GLOBALS['_SERVER'][$Var]))? $GLOBALS['_SERVER'][$Var]: (!emp...

PHP escape $ sign and echo a string my fetching database

Hello, I want to know how to echo a string that have a $ sign from a database. At this time, the value on database 'Buy one for $5.00' converts to 'Buy one for .00'. Let's say the name of the field is title and the value is Buy one for $5.00 <?php $body_tpl = file_get_contents('tpl.html'); //Title is: %title% blah blah %title% $row ...

PHP include path (Linux)

Say a php file has include_once("$CONF/blah.inc") in it. Where is this $CONF and the default location? ...