php5

in my localhost crypt function not working php

Hi in my localhost (WAMP-WINDOWS-VISTA) echo substr($pwd,0,2); --> executing fine echo crypt($pwd,substr($pwd,0,2));--> WHILE EXECUTING System gets hang But this snippet working fine in my live. How to fix this issue... ...

How can I parse flashvars from string

How can I parse the flash vars from a string like this? <script type="text/javascript"> flashvars.added = "2010-07-18"; flashvars.name = "testing+purposes"; flashvars.user = "jhon+doe"; </script> I am using curl to get the string. ...

php try... else

is there something similar in php to the try... else in python? I need to know if the try block executed correctly as when the block executed correctly, a message will be printed. ...

safe html filtering with php ?

function validCleanHtml( $unclosedString ) { preg_match_all( "/<([^\/]\w*)>/", $closedString = $unclosedString, $tags ); for ( $i = count( $tags[1] ) - 1; $i >= 0; $i-- ) { $tag = $tags[1][$i]; if ( substr_count( $closedString, "</$tag>" ) < substr_count( $closedString, "<$tag>" ) ) $closedString ....

PHP function for parsing xml into array that doesn't strip nodes with namespaces

I am trying to parse an rss feed that is using the well formed web comment api and having some issues pulling in parts of the XML that contain namespaces. I checked here: http://stackoverflow.com/questions/2483887/php-parsing-xml-file-with-and-without-namespaces but it seems his solution was more for just one specific namespace. Here ...

curl_init missing after Macports php5 install

I have a Macports installed version of php5, that is missing the curl extension. phpinfo shows /opt/local/etc/php5/php.ini as the location for php.ini, with one of the additional .ini files listed as /opt/local/var/db/php5/curl.ini The contents of curl.ini: extension=curl.so If I do a locate curl.so I get /opt/local/lib/php/extensions...

Adding mysql module to php as nonroot

The php on the server is compiled without mysql module so I cannot run mysql_connect in php. I do not have root access. Is there a way for me to solve this problem, perhaps parsing in some files during runtime? Thanks in advance. ...

convert unix timestmp to date

how to I convert a unix timestamp 1280214000 to human readable date? thanks ...

Skip SSL Check in Zend_HTTP_Client

All, I am using Zend_HTTP_Client to send HTTP requests to a server and get response back. The server which I am sending the requests to is an HTTPS web server. Currently, one round trip request takes around 10-12 seconds. I understand the overhead might be because of the slow processing of the web server to which the requests go. Is i...

Imagick (Imagemagick on PHP): serve a file without saving to disk first?

I'm trying to use Imagemagick (actually PHP's Imagick) to create and output (serve) an image without saving it to disk first. Currently I'm having to save the file and then use verot upload class to serve the image. I'm hoping there's something simple that I'm missing. Any suggestions/advice will be much appreciated. (Apache 2 server...

[CakePHP] Timezone and more problems with Cakephp 1.3 and PHP 5.3.2

hi all, on server i have php 5.3.2, and cakephp 1.3. when i run cakephp application, it gives me following errors: Warning (2): strtotime() [http://php.net/function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In c...

How to find time difference between two dates using PHP

Hi all, How to find time difference between two dates using PHP. For example i am having two dates: start Date : 2010-07-30 00:00:00 end Date : 2010-07-30 00:00:00 In this case how shall i find the time difference using PHP. Thanks in advance ...

ZipArchive php class extract files as root. Why?

I have a php script: $extract_dir = "./"; $extract_file = "extractME.zip"; $zip = new ZipArchive; $res = $zip->open($extract_file); if ($res === TRUE) { $zip->extractTo($extract_dir); $zip->close(); echo "ok"; } else { echo "failed"; } But when I execute this script, via http://www.mywebsite.com/extract.php All the f...

PHP : imploding array and storing the result back to same variable

Are there any pit falls in the below code . Is it safe to use this way. I will not be using the array again $records_msg = implode(" ",$records_msg); ...

PHP and file attributes accros operating systems

Can comebody tell me how to determine if a file is marked as hidden using only PHP functions? This applies especially on Windows and Linux. ...

PHP - strip URL to get tag name

Hi all, I need to strip a URL using PHP to add a class to a link if it matches. The URL would look like this: http://domain.com/tag/tagname/ How can I strip the URL so I'm only left with "tagname"? So basically it takes out the final "/" and the start "http://domain.com/tag/" Many thanks, James ...

compiling cURL with SSL support - Fedora 11

Hi All! I'm new to Linux/Fedora (and I'm using Fedora 11 because I need PHP 5.2 and don't know how to "downgrade" on later versions of the OS) so keep that in mind while you read. I'm currently trying to enable cURL on my Fedora 11 install in order to use an NTLM authentication payment gateway from my machine. I've seen it work on box...

set default on webpage

Dear all, I have an issue with url direction here. I have used mod_rewrite in apache to rewrite the url from domain.com/page.php to domain.com/path/page.php. I have some link in the webpage for example href="newpage.php" will automatically go to domain.com/path/newpage.php instead of domain.com/newpage.php. May I know is there any php ...

when to use MVC on PHP ?

ok i think i am pushing my self to far here, im createing a project in my own mvc even i dont know what mvc its self, <?php class init { function __construct() { $this->enviroment(); $this->start(); } function enviroment() { /* Required Classes */ ...

[Fri Jul 30 20:53:33 2010] [error] [client {IP}] Premature end of script headers: /home/siteroot/public_html/power/fckeditor/test.php

Hi Guys, A problem has been reported to me that uploading through fckEditor will not work. After messing about with some settings it turns out that running php files in the fckEditor folder will not work and an Error 500 is returned. When I checked the log files the message in the subject was returned. The script is simple: <?php echo ...