php5

Is it dangerous thing to view access log without sanitizing via web browser?

Is it dangerous thing to view access log without sanitizing via web browser? I am considering to record access log, and I am considering to view it via wev browser, but if attacker modifies his remote host or user agent or something, can he attack to me? By inserting attacking code into his remote host or user agent or ect. So do I ne...

Object Oriented Programming, extending properties

Ok this is not just a PHP question, but I have this problem in PHP so I will post the example in PHP. Example: I have three classes, say, data_abstract, person, and student. Now, I have one array of data related to each of those objects. class person extends data_abstract { protected $data; //name, gender, etc } class student ex...

How backwards compatible is php 5 with php 4?

Hello everyone, I work on a code base written in php 4. I'd like to go through the process of upgrading the code to php 5 (the latest version my host provides). I'm wondering if anyone else has gone through a similar upgrade experience and can share what gotchas/pitfalls there are, what has to change in my code, what is not backwards co...

webserver crash with exec in php

i am try to convert some file with exec in php and get the return . i do this and this is work so successfully but if i run it for more than 10 times, the webserver (wampserver) get crash and i must restart server to continue ? please let me know what is the problem if you know . System : wampserver version 2.0 on windows xp and 2003 se...

Drawing pies using PHP ImageMagick

Is there a way to get GD's function imagefilledarc()'s result in using PHP ImageMagick? I've looked around but haven't found a satisfying solution so far. I want it to support transparency, and use it to draw pies. ...

PHP object question

Excuse what is probably a really basic question but how do I achieve this. $cache = New Mem; $cache->event($event)->delete; Which is called via the function below. Without the ->delete, it works perfectly fine, but I just need to find a way to call the delete thus inside the function. class Mem { function event($event) { ...

How to avoid call-time pass-by-reference deprecated error in PHP?

I'm trying to reduce the warnings that are sent to my apache server log. One warning is: Call-time pass-by-reference has been deprecated. It is hard for me to imagine why this was deprecated since it is such a useful programming feature, basically I do this: public function takeScriptsWithMarker(&$lines, $marker) { ... } and I c...

Difference between Java and php5 MD5 Hash

Hi everybody, I'm facing kind of a strange issue which is related MD5-Hashes in Java and php5. I figured that unter certain circumstances the following code does not generate correct MD5 hashes: public static String getMD5Hash(String string) { try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(string.getBytes...

How do I use mini login in header of magento?

How do I use mini login in header of magento? I'd also like the login form to be disabled after login. ...

Getting unix timestamp in milliseconds in PHP5 and Actionscript3

In Actionscript, the Unix timestamp in milliseconds is obtainable like this: public static function getTimeStamp():uint { var now:Date = new Date(); return now.getTime(); } The doc clearly states the following: getTime():Number Returns the number of milliseconds since midnight January 1, 1970, universa...

In Php 5.3.0 what is the Function "Use" Identifier ? Should a sane programmer use it?

I'm checking out some php 5.3.0 features and ran across some code on the site that looks quite funny: public function getTotal($tax) { $total = 0.00; $callback = /* This line here: */ function ($quantity, $product) use ($tax, &$total) { $pricePerItem = constant(__CLASS__ . "::PRICE_" . ...

PHP shorthand rewrite

Probably really easy for a pro, but could someone re-write this from it's PHP shorthand form to non-shorthand? ($facebook) ? $fb_active_session = $facebook->fbc_is_session_active() : $fb_active_session = false; Thanks! ...

Installing PDO_MYSQL on PHP 5.1.6 using PECL OS: UBUNTU

I'm having real problems getting PDO_MYSQL working. I started by just trying to install the PDO_MYSQL driver via PECL, however when this didnt work I looked round to see if there where any issues reported. It seems that there may be a conflict between the embedded version of PDO and PDO_MYSQL. To that end i decided to reinstall all it'...

get name of current PHP script in include file

I have files served like so: AJAX request handler -> Include file I would like to retrieve the name of the include file within the include itself. Neither $_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] is suitable for this, as they return the "parent" script name. Thanks. ...

PHP syntax highlighting in Visual Web Developer?

I recently installed PHP 5 on IIS, however, I am unable to find a PHP syntax highlighting plug-in or extension for VWD. Where can I find a plug-in? I thought there was an official one. ...

Atomik MVC - Console plugin

Hi folks! php index.php generate about Atomik 2.1 Console PHP Warning: require(): Filename cannot be empty in /srv/www/vhosts/firedwire.com/httpdocs/atomik/app/plugins/Console.php on line 100 PHP Fatal error: require(): Failed opening required '' (include_path='.:/usr/bin/PEAR:.:/usr/share/php5:/usr/share/php5/PEAR') in /srv/www/vho...

Should I upgrade to PHP 5.3?

PHP version 5.3 has been released, and although it looks great, all my code already works fine. I don't see what this new version offers to justify upgrading and working through possible issues after the upgrade. Should I upgrade anyway just for good practice, or is an upgrade not needed unless I am actually using the new features? ...

Trouble installing PHP 5.3.0 with intl-support

Currently I'm trying to install PHP 5.3.0 on some Linux testing server. As we've urgently waited for ext/intl we want to check out the features it provides. I'm running configure successfully with the following arguments ./configure --with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/php --with-zlib-dir=/usr/local/z...

str_replace &: Converting & to its & character in PHP.

I have some data in a database that I need represented in an XML file, but the data is different for each request, so the XML file is generated through PHP. For example purposes, let's say this is the text in the db: Hello & Goodbye I've tried using the following to get the above (set to the $example variable) to show up as Hello &...

create ftp account in plesk using php

i will create ftp account in plesk using php that ever user register in site can have an ftp account with his username and password . i found many php api for cpanel but in plesk i can't find any thing ? can you help me ? thank you so a lot before ! ...