Jump to content

cuongvt

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cuongvt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all I'm using below function to send Japanese mail, mail clients such as outlook etc displayed Japanese text withou problems but if I viewed JP mail via web-based mail such as Gmail, the JP subject is normally displayed, however the JP body still base64 encoded strings, it still was not decoded yet. Could anyone tell me solution to solve this? ======================================= private static function _sendPc( $from, $to, $subject, $body, $contentType, $charSet="shift_jis", $header="", $parameter=""){ Debugger::snap(); //make header $headers = "From: $from\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: $contentType; charset=ISO-2022-JP\n"; //$headers .= "Content-type: $contentType; charset=SHIFT_JIS\n"; //$headers .= "Content-Transfer-Encoding: base64"; $headers .= "Content-Transfer-Encoding: quoted-printable"; // add header to mail if( strlen( $header ) > 0 ){ $headers .= "\n"; $headers .= $header; } //make parameter $parameters = $parameter; //make subject $subject = '=?ISO-2022-JP?B?'.base64_encode(mb_convert_encoding($subject, 'ISO-2022-JP', 'AUTO' )).'?='; //$subject = '=?SHIFT_JIS?B?'.base64_encode($subject).'?='; //$body = base64_encode($body); $body = mb_convert_encoding( $body, 'ISO-2022-JP', "AUTO"); // a,b@mail.com こんなEMAILアドレスがたまにあるための回避策 $pos1 = strpos($to, ","); $pos2 = strpos($to,"<"); if( $pos1 !== FALSE && $pos2 === FALSE ){ $to = "<" . $to .">"; } if( $parameters != null && strlen( $parameters ) > 0 ) mail( $to, $subject, $body, $headers, $parameters ); else mail( $to, $subject, $body, $headers,"-f" . $from ); Debugger::debug( "sended" ); return true; } Thanks and regards,
  2. i checked. As I expected, User is apache, group is apache. Could you give me some other hints? (If I run above php script via shell by another user assigned executing sudo in sudoers, this script ran fine) thanks and regards
  3. ok. I'll check now (your specified path /etc/apache/httpd.conf is not correct). Thanks for the reply. I'm working overtime on this sartuday (and sunday maybe) for solving this so do not leave me alone. I'll report you back
  4. >Check your existing users, the user isn't apache it's iirc wwwrun. Are you sure it is wwwrun, not apache in centos? AFAIK, the user is wwwrun in SUSE, apache in centos/redhat and www-data in debian/ubuntu. anyway I added wwwrun ALL=(ALL) NOPASSWD: ALL into /etc/sudoers but still not works. any idea? thanks and regards
  5. Hi all My server is centos 5.1 with php 5.1.6. In my app I want apache to add user through sudo. My sudoers file is: %apache ALL=(ALL) NOPASSWD: ALL %tony ALL=(ALL) NOPASSWD: ALL My test.php í: <?php $username="hixhix"; system("/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M $username",$returnvalue); echo "return value: $returnvalue"; However, user 'hixhix' not created by apache at all, it always returned 1. how can I make my apache tu add user using sudo? Please help me. I need your help. Thanks and regards.
  6. Hi, Currently I'm reading below page: http://www.imagemagick.org/Usage/api/#php When I tried imagick example of it, php raised error about function : Imagick::readimage() . Fatal error: Non-static method Imagick::readimage() cannot be called statically in /usr/local/www/apache22/data/php/im/imagick_hello.php on line 2 I don't know what is the cause. How can I solve this? I'm running latest IM 6.4.7 with imagick 2.2.1, php 5.2.8 in Freebsd 7.0, all built from ports. Thanks and regards, below is whole example of above site: <?php $handle = imagick_readimage( getcwd() . "image.jpg" ); if ( imagick_iserror( $handle ) ) { $reason = imagick_failedreason( $handle ) ; $description = imagick_faileddescription( $handle ) ; print "Handle Read failed!<BR>\n"; print "Reason: $reason<BR>\n"; print "Description: $description<BR>\n"; exit ; } header( "Content-type: " . imagick_getmimetype( $handle ) ); print imagick_image2blob( $handle ); ?>
  7. technically can I store flash file into Mysql DB using PHP? what point should I pay attention for that? Thank you
  8. Hi all Is there a way to create/read/write to psd file? (photoshop format) I would like to hear opinion form you: Do you recommend gd2 or imageMagick to perform this task? and why thanks in advanced
  9. Recently I installed Zend Studio 5.2 in fedora 5. My fedora have php 5.1.4 installed by yum. But Zend Studio 5.2 have php 5.1.1 (I saw this by phpinfo()). So I upgraded php of Zend to 5.1.4 version as guided in this article: http://www.zend.com/support/knowledgebase.php?kbid=164&v iew_only=1 I not edited php.ini in Zend installation folder. But when I pressed F5 to debug, a error message appeared: "Could not debug internally ...". Shocked I think the different between the environment mentioned in above article with the environment of my fedora is as below: - The above article said that should download and install latest php from source, then copy the compiled one into ZDE's bin folder and replace the old php file. - But my fedora have php 5.1.4 that not installed from source, it was installed by yum update. So could anyone have me to upgrade php of ZDE to php 5.1.4 with php version that I updated by yum? Please help me. I need your help. Many thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.