f



PHP - using mail() and unicode text - text gets disturbed

I have the following problem. On a website there's a (simple) feedback
form. This is used also by Polish visitors who (of course) type Polish
text using special characters.

However, when I receive the text in my mailbox, all special characters
have been turned into mess......

For example: "wsp�lprace" is turned into "współprace".

It seems PHP is handling the Unicode-8 strings quite well (when I
'echo' the strings on the site, I see the text correctly), until the
point that it is send by using mail().

Is this a server configuration issue? Or something else?

How can I get my text to remain in Unicode?

I have this problem both on my testserver (Apache 1.3.28, PHP 4.3.2 on
Windows XP) as on my providers server (Apache under Linux).


Hope anybody can help.

Many thanks,


Edo.
0
ezouwen (5)
2/1/2004 2:44:52 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

6 Replies
996 Views

Similar Articles

[PageSpeed] 15

> For example: "wsp�lprace" is turned into "wspó�,prace".
>
> It seems PHP is handling the Unicode-8 strings quite well

are you setting up the headers of the email to state something such as

Content-Type: text/html;charset=iso-8859-15


0
2/1/2004 3:33:30 PM
It's an encoding issue. One way to deal with this is to escape the UTF-8
text using imap_8bit() and set the charset in the email header to UTF-8.
Many email clients don't handle this correctly though. I would recommend
sending multipart mails. In the plaintext part, remove the accent marks
(solidarnos'c' -> solidarnosc). In the HTML part, encoding the special
characters as HTML entities (doka,d => dokąd). This will ensure that
everyone see something that's readable. The same strategy is used by Outlook
Express. It'll be helpful if you send yourself a test email and look at the
source.

Here are a couple functions that do what I suggested:

$pl_markless_tr = array(
"\xC4\x85" => "a",
"\xC4\x87" => "c",
"\xC4\x99" => "e",
"\xC5\x82" => "l",
"\xC5\x84" => "n",
"\xC5\x9b" => "s",
"\xC5\xba" => "z",
"\xC5\xbc" => "z");

$pl_uni_entities_tr = array(
"\xC4\x85" => "ą",
"\xC4\x87" => "ć",
"\xC4\x99" => "ę",
"\xC5\x82" => "ł",
"\xC5\x84" => "ń",
"\xC5\x9b" => "ś",
"\xC5\xba" => "ź",
"\xC5\xbc" => "ż");

function remove_polish_marks($s) {
 global $pl_markless_tr;
 return strtr($s, $pl_markless_tr);
}

function escape_polish_marks($s) {
 global $pl_uni_entities_tr;
 return strtr($s, $pl_uni_entities_tr);
}


Uzytkownik "Edo van der Zouwen"
<ezouwen@dithiervoorisdomainenhetisbijdemonkennerswetenwattedoen.nl> napisal
w wiadomosci news:jm3q10dkg5ssdfoj4g5paa7nnu85j3pub4@4ax.com...
> I have the following problem. On a website there's a (simple) feedback
> form. This is used also by Polish visitors who (of course) type Polish
> text using special characters.
>
> However, when I receive the text in my mailbox, all special characters
> have been turned into mess......
>
> For example: "wsp�lprace" is turned into "współprace".
>
> It seems PHP is handling the Unicode-8 strings quite well (when I
> 'echo' the strings on the site, I see the text correctly), until the
> point that it is send by using mail().
>
> Is this a server configuration issue? Or something else?
>
> How can I get my text to remain in Unicode?
>
> I have this problem both on my testserver (Apache 1.3.28, PHP 4.3.2 on
> Windows XP) as on my providers server (Apache under Linux).
>
>
> Hope anybody can help.
>
> Many thanks,
>
>
> Edo.


0
chernyshevsky (2297)
2/1/2004 5:06:26 PM
On Sun, 1 Feb 2004 15:33:30 -0000, "Filth" <p.macdonald@blueyonder.co.uk>
wrote:

>> For example: "wsp�lprace" is turned into "wspó�,prace".
>>
>> It seems PHP is handling the Unicode-8 strings quite well
>
>are you setting up the headers of the email to state something such as
>
>Content-Type: text/html;charset=iso-8859-15

Content-Type: text/plain;charset=utf-8

 ... sounds like the more appropriate header to send in this case.
 
-- 
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
0
andy171 (2271)
2/1/2004 6:20:19 PM
On Sun, 1 Feb 2004 15:33:30 -0000, "Filth"
<p.macdonald@blueyonder.co.uk> wrote:

>
>> For example: "wsp�lprace" is turned into "wspó�,prace".
>>
>> It seems PHP is handling the Unicode-8 strings quite well
>
>are you setting up the headers of the email to state something such as
>
>Content-Type: text/html;charset=iso-8859-15
>


Thanks, this did the trick, except the header should contain:

"Content-Type: text/html; charset=UNICODE-1-1-UTF-8"

Cheers,


Edo.
0
ezouwen (5)
2/1/2004 7:28:54 PM
On Sun, 1 Feb 2004 12:06:26 -0500, "Chung Leong"
<chernyshevsky@hotmail.com> wrote:

>It's an encoding issue. One way to deal with this is to escape the UTF-8
>text using imap_8bit() and set the charset in the email header to UTF-8.
>Many email clients don't handle this correctly though. I would recommend
>sending multipart mails. In the plaintext part, remove the accent marks
>(solidarnos'c' -> solidarnosc). In the HTML part, encoding the special
>characters as HTML entities (doka,d => dok&#261;d). This will ensure that
>everyone see something that's readable. The same strategy is used by Outlook
>Express. It'll be helpful if you send yourself a test email and look at the
>source.
>
>Here are a couple functions that do what I suggested:
>
>$pl_markless_tr = array(
>"\xC4\x85" => "a",
>"\xC4\x87" => "c",
>"\xC4\x99" => "e",
>"\xC5\x82" => "l",
>"\xC5\x84" => "n",
>"\xC5\x9b" => "s",
>"\xC5\xba" => "z",
>"\xC5\xbc" => "z");
>
>$pl_uni_entities_tr = array(
>"\xC4\x85" => "&#261;",
>"\xC4\x87" => "&#263;",
>"\xC4\x99" => "&#281;",
>"\xC5\x82" => "&#322;",
>"\xC5\x84" => "&#324;",
>"\xC5\x9b" => "&#347;",
>"\xC5\xba" => "&#378;",
>"\xC5\xbc" => "&#380;");
>
>function remove_polish_marks($s) {
> global $pl_markless_tr;
> return strtr($s, $pl_markless_tr);
>}
>
>function escape_polish_marks($s) {
> global $pl_uni_entities_tr;
> return strtr($s, $pl_uni_entities_tr);
>}
>
>

Thanks, very interesting method. For the time being, the email client
used by the receiver of the webforms is capable of handling the
unicode text, so I'll stick to just using a header which enables
Unicode text.

However, I'll definiately save and check your method, might be very
useful in the future.

Dziekuje i do wiedzenia :-)


Edo.
0
ezouwen (5)
2/1/2004 7:55:43 PM
On Sun, 01 Feb 2004 18:20:19 +0000, Andy Hassall <andy@andyh.co.uk>
wrote:

>
>Content-Type: text/plain;charset=utf-8
>
> ... sounds like the more appropriate header to send in this case.
> 

Thx, found that out myself, but appreciate your input.

Edo.
0
ezouwen (5)
2/1/2004 8:08:27 PM
Reply:

Similar Artilces:

i am getting the php coding while running the php..
i have information.php file that file contain following coding <?php echo phpinfo(); ?> while i calling the URL ("http://localhost/information.php"). i am getting the coding <?php echo phpinfo(); ?> not show the php information...... i am new to the php can you help me? <mekalai82@gmail.com> wrote in message news:ea7db46d-a03d-497a-b38b-c54d75f266f8@h11g2000prf.googlegroups.com... >i have information.php file that file contain following coding <?php > echo phpinfo(); ?> > while i calling the URL ("http://localhost/information.php"). > > i am getting the coding <?php echo phpinfo(); ?> <?php phpinfo(); ?> -- Richard On Feb 29, 11:30 am, "rf" <r...@invalid.com> wrote: > <mekala...@gmail.com> wrote in message > > news:ea7db46d-a03d-497a-b38b-c54d75f266f8@h11g2000prf.googlegroups.com... > > >i have information.php file that file contain following coding <?php > > echo phpinfo(); ?> > > while i calling the URL ("http://localhost/information.php"). > > > i am getting the coding <?php echo phpinfo(); ?> > > <?php phpinfo(); ?> > > -- > Richard for example i have that coding.......my coding is run in the some other machine. but while i am trying in my system i am getting the whatever i have typed in file.... that content will be displaying......... does not provide the result of that file coding.......

PHP Training Institute In Delhi, Live Projects on PHP. Short Term PHP Courses, PHP Scripts, PHP Training with Live Projects.
Vserve Global offers short term PHP: Hypertext Preprocessor Training Course, which is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and on almost every operating system and platform free of charge.PHP is installed on over 20 million websites and 1 million web servers. TOPICS:- >> Core PHP Language >> HTML, Cascad...

php to php obj
Hi All, Is there any tool to convert the .php files into its object files in deploying the files to other's server like java classes are deployed? Thanks in advance --AR John7481 <arjohn7481@hotmail.com> wrote or quoted: > Is there any tool to convert the .php files into its object files in > deploying the files to other's server like java classes are deployed? To what end? Do you want a PHP obfuscator? They tend not to be needed - since the code remains on the server. Do you want a PHP squeezer? Again - since PHP remains on the server that is of reduced importance. PHP obfuscators and squeezers are out there - but what exactly are you looking for? -- __________ |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply. With total disregard for any kind of safety measures Tim Tyler <tim@tt1lock.org> leapt forth and uttered: > John7481 <arjohn7481@hotmail.com> wrote or quoted: > >> Is there any tool to convert the .php files into its object >> files in deploying the files to other's server like java >> classes are deployed? > > To what end? > > Do you want a PHP obfuscator? They tend not to be needed - > since the code remains on the server. > > Do you want a PHP squeezer? Again - since PHP remains on the > server that is of reduced importance. > > PHP obfuscators and squeezers are out there - but what exactly > are you looking for? I think he'...

Problem with Mail()
In my PHP 5.0 at home, I'm using the following code to successfully write to a database and also send out an email. For some reason, when I take this code to work, it still writes to the database but doesn't send mail so we're (me and the I.T. guy) trying to find out whether it's the difference between PHP 4 or something else with email security. Does anyone here have experience with mail() in PHP 4 to know whether PHP 4 had issues with mail() that were fixed with PHP 5 ???? We've been chasing this from the mail server side at work when perhaps its some nuance between versions of PHP. Appreciate any help... Chris /* > $to = stripslashes($to); */ $to = stripslashes($to)."\r\n"; $subject = stripslashes($subject); $text = stripslashes($text); /* > mail('$to',$subject, $text); */ mail($to, $subject, $text, "From: admin@localhosthome.com"); cover wrote: > $to = stripslashes($to)."\r\n"; > Might or might not be the cause, but you should remove the trailing CRLF here. JW On Mon, 27 Feb 2006 22:33:57 +0100, "Janwillem Borleffs" <jw@jwscripts.com> wrote: >cover wrote: >> $to = stripslashes($to)."\r\n"; >> > >Might or might not be the cause, but you should remove the trailing CRLF >here. Thanks for the reply. I tried it after reading your post and no change... Thanks again, cover wrote: > In my PHP 5.0 at home, I'm using the following co...

PHP within PHP...
I took over the support of a website that is set up something like this inside one of the pages: include_once("header.php"); <?php //to get the content of the page they do this: $content = mysql_query("select content etc...); echo $content; ?> include_once("footer.php"); I am having problems evaluating any php that is used in the mysql content. Is there a way to get the mysql withing the mysql to run? Thank you for your time, Mandragon On Sep 17, 12:56 pm, Mandrago...@gmail.com wrote: > I took over the support of a website that is set up something like > this inside one of the pages: > > include_once("header.php"); > > <?php > //to get the content of the page they do this: > $content = mysql_query("select content etc...); > > echo $content; > ?> > > include_once("footer.php"); > > I am having problems evaluating any php that is used in the mysql > content. Is there a way to get the mysql withing the mysql to run? > > Thank you for your time, > > Mandragon Sorry, The question should read: "Is there a way to get the php withing the echo $htmlcontent to run?" Of course you are, $content is a resource. The MySQL Query resource. try this: $content = mysql_query('bla bla bla'); while ($row = mysql_fetch_assoc($content)) { $result[] = $row; } $content = $result; Now you can use $content ;). In answer to your edit... eval($co...

php outside php (?)
Sounds weird, i know. What i want/wonder is the following: PHP can do the next: <?php if($foo == 'bar') { ?> Ow yeah, foo is bar! <?php }; ?> But how can i do the following: <?php $foo= ?> this is what foo looks like. <?php }; ?> This way i could edit the content of $foo in DW's design-view. I hope it's clear enough for you all to understand... Greetings frizzle. frizzle wrote: > But how can i do the following: > > <?php > > $foo= > > ?> > this is what foo looks like. > <?php > > }; > > ?> > > This way i could edit the content of $foo in DW's design-view. > I hope it's clear enough for you all to understand... <?php ob_start(); ?> this is what foo looks like. <?php $foo=ob_get_clean(); ?> -- Justin Koivisto - justin@koivi.com http://koivi.com Wow, little late on the reply, but i still wanted to thank you for your help. This is exactly what i meant, and it works great! :D Thanks again. ...

when receiving the mail(php mail function), the variable's last value is getting converted to $ or # replacing the digit
Below is my code: But when I receive the mail, I don't get the last two digits in the $post_url. I tried displaying the same message on the page and it displayes $post_url properly. But when I receive the mail, I get the value of $post_url as www.32minutesforum.com/post_clicked.php?id$. where as I should get www.32minutesforum.com/post_clicked.php?id<some number>. i.e. www.32minutesforum.com/post_clicked.php?id15 Please help! File: <?php include 'connect.php'; include 'header.php'; echo '<div class="holder_content">'; echo '<section class="group_text">'; echo 'Posted successfully. Check your post <a href="'.$_SESSION['reply_post_id'].'">HERE</a>'; $post_url = $_SESSION['reply_post_id']; $to= $_SESSION['post_email']; $subject="You just got a reply for your post in 32minutesforum.com"; $message=' <html> <head> <title>32 Minutes Forum</title> </head> <body> <p>You got a reply for your post title: '. $_SESSION['post_title'].'.</p> <p>Check your post in:<br/>www.32minutesforum.com/'.$post_url.'.</p> <p>Thanks for using 32minutesforum.com.<br/> Thank you,<br/> 32minutesforum.com Team.</p> </body> </html>'; ...

Getting PHP to read an e-mail
Ok, for the reference, I'm using PHP 4.3, mySQL and sendmail. I have a news content site, and I have an e-mail address dedicated for PHP content automation. What I'm aiming to do here is have PHP grab the e-mail, parse it, and update the database. Parsing and updating the database is no prob. I'm a little clueless on how to get PHP to grab e-mails. I don't need to be hand-held through it, but if anyone knows reference locations (articles, PHP documentation entries, theory, etc), it would be a big help. Thanks in Advance, Robert Rob wrote: > Ok, for the reference, I'm using PHP 4.3, mySQL and sendmail. > > I have a news content site, and I have an e-mail address dedicated for PHP > content automation. > > What I'm aiming to do here is have PHP grab the e-mail, parse it, and > update the database. > > Parsing and updating the database is no prob. I'm a little clueless on > how to get PHP to grab e-mails. A .forward file can be used to pass a file to a pipe. Ian P. Christian Carved in mystic runes upon the very living rock, the last words of Rob of comp.lang.php make plain: > I don't need to be hand-held through it, but if anyone knows reference > locations (articles, PHP documentation entries, theory, etc), it would > be a big help. Well, I can't really give you any references, but I can tell you what I've learned from experience, as I have quite a number of scripts operati...

want to get content of one php file in another php file
i have one php file having content Contents of ex1.php file <body> <?php $content = "c://webserver/www/abc.php"; $handle = fopen($content, "r"); echo fread($handle,filesize($content)); ?> </body> this is reading abc.php file in which i m simply using an echo statement. When i execute ex1.php file i cant see the php statement of abc.php file content of abc.php file is <?php echo "hello";?> sarika wrote: > i have one php file having content > > Contents of ex1.php file > <body> > <?php > $content = "c://webserver/www/abc.php"; > $handle = fopen($content, "r"); > echo fread($handle,filesize($content)); > ?> > </body> > this is reading abc.php file in which i m simply using an echo > statement. When i execute ex1.php file i cant see the php statement of > abc.php file > > content of abc.php file is > <?php echo "hello";?> That's interesting, I've found out that it's the browser that's hiding <?php ?> tags within .phpx pages. Probably to avoid short tags scripts (on a server that doesn't allow them) from getting leaked by visitors who don't know about this browser trick, until the dev' realizes his error. Not a good thing, IMO; dev's should take care, themselves, and it's still not secure since the hidden string is still in the rendered source. And now we don't know how ...

PHP logs not working, and unable to send mail through sendmail via PHP
Hoping someone can help me out with this problem. First problem, is I am unable to view my php error log. In my php.ini I have my log in /var/www/logs/php_error_log. However, it has remained empty. Secondly, my sendmail works fine from command prompt. However, when trying to send mail through a php script (I have tried a couple), it says it is succesfull, but my mail logs show nothing going out. No error messages. Can someone take a look at my snippets below of my logging and my mail options and suggest some things for me to try please? Thanks. :) -Wayne Stevenson [PHP] ;;;;;;;;;;;;;;;;;;; ; About this file ; ;;;;;;;;;;;;;;;;;;; ; ; This is the recommended, PHP 4-style version of the php.ini-dist file. It ; sets some non standard settings, that make PHP more efficient, more secure,........ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; error_reporting is a bit-field. Or each number up to get desired error ; reporting level ; E_ALL - All errors and warnings ; E_ERROR - fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initia...

Anyone here follows the mailing list php-general@lists.php.net?
I tried posting to it (I am subscribed and have posted to it successfully before, but this time I got this error message: >> This message was created automatically by mail delivery software. >> >> A message that you sent could not be delivered to one or more of its >> recipients. This is a permanent error. The following address(es) >> failed: >> >> php-general@lists.php.net >> SMTP error from remote mail server after end of data: >> host pair1.php.net [76.75.200.58]: 550 we're manly enough already WTH...

Best PHP Training | PHP Development Training | PHP Training Institute
Tops Technologies provides php and mysql certification courses in ahmedabad, baroda, surat, Rajkot, Udaipur, Gujarat, india.PHP Training with MySQL is an introductory course in the PHP and MySQL technology. Mysql and php training course, php for beginners, sql training courses, PHP Training courses, php courses, mysql training courses, php mysql course. For More Details :- http://www.tops-int.com ...

How to get value from drop down box to e-mail with php
I have a form that includes a drop down box. I can get all of the other values to show up in an e-mail except for the drop down box values. Can someone please help? -- I know the HTML isn't the greatest. The website was originally created in FrontPage and the form broke. I'm just trying to help out and fix it for a friend. sendmail.php <? $Name = $_REQUEST['name'] ; $Comments = $_REQUEST['comments'] ; $Email = $_REQUEST['email'] ; $Telephone = $_REQUEST['telephone']; $Fax = $_REQUEST['fax']; $Subject = $_REQUEST['subject']; $SubjectOther = $_REQUEST['subjectother']; $ContactRequested = $_REQUEST['contactrequested']; mail( "kandihumpf@site-seeker.com", "RCI Waterjets Contact Us Form", "Name: $Name \n\nComments: $Comments \n\nEmail: $Email \n\nTelephone: $Telephone \n\nFax: $Fax \n\nSubject: $Subject \n\nSubject Other: $SubjectOther \n\nContact Requested: $ContactRequested", "From: kandihumpf@site-seeker.com" ); header( "Location: http://www.rciwaterjets.com/Thanks.htm" ); ?> ContactUsNEW.htm <form method="post" action="sendmail.php"> <p align="center"> &nbsp;<textarea name="comments" rows="8" cols="66">Please Enter your details here</textarea></p> <dl> <dd> <table width="450"> <tr>...

PHP 4 and PHP 5
What is main difference between PHP 4 and PHP 5? Is possible to use object programming apporach with PHP4? Is possible to use Stored Procedures in Oracle with PHP4? Where I can get more informations? Thanks in advance "ablyplus" <ablyplus@yahoo.com> wrote in message news:cr5n6g$5bp$1@ls219.htnet.hr... > What is main difference between PHP 4 and PHP 5? take a look at http://www.zend.com/php5/ > Is possible to use object programming apporach with PHP4? Yes. The new features in PHP 5 are mainly cosmetic (e.g. visibility). With PHP 4 you can define classes with methods, properties and constructors. You can create objects from these classes at runtime. You do not *need* PHP 5 to write object oriented code with PHP. > Is possible to use Stored Procedures in Oracle with PHP4? Read the manual. take a looki at http://www.php.net/manual/en/ref.oci8.php at scroll down to example 2. > Where I can get more informations? Looking for it might be a start. > Thanks in advance You're welcome. -- Tony Marston http://www.tonymarston.net "ablyplus" <ablyplus@yahoo.com> wrote in message news:cr5n6g$5bp$1@ls219.htnet.hr... > What is main difference between PHP 4 and PHP 5? Much improved OO, and the odd incompatibility. The only noticeble one is that array_merge must be given 2 arrays, you can just chuck in a simple variable and expect it to be merged with an array. It chucks a warning I believe, and still does it...

php notification through php sdk
Hi there I want to build a e-commerce website similar to wish.com and I have chosen opencast as my framework of choice. Now wish has a feature that when you save a product in wish and if you are logged in with Facebook or gmail all of your friends will get a notification that your friends has saved a item on wish. I want a similar feature on my site Now I know Facebook provide a sdk JavaScript and php and wish might be using something similar but I am using open cart can I open home page or product page in the sdk Thanks On 3/20/2015 7:30 AM, apoorv.kanungo@gmail.com wrote: &g...

PHP with Indian PHP Developers
Dear all, If you want to make a PHP web application, or need to <a href="http:// www.virtueinfo.com/php-developers/hire-php-programmers-developers-india.htm">Hire PHP Developer</a>contact a leading <a href="http://www.virtueinfo.com/ php-developers/php-web-development.htm"> PHP Web Development Compnay</ a> <a href="http://www.virtueinfo.com/php-developers/php-web-programming- php-developers-india.htm">Offshore PHP web development India</a> On Thu, 25 Feb 2010 01:37:02 -0800 (PST), Virtue Info wrote: > Dear all, > > > If you want to make a PHP web application, or need to <a href="http:// > www.example.com/php-developers/hire-php-programmers-developers-india.htm">Hire > PHP Developer</a>contact a leading <a href="http://www.example.com/ > php-developers/php-web-development.htm"> PHP Web Development Compnay</ > a> > > ><a href="http://www.example.com/php-developers/php-web-programming- > php-developers-india.htm">Offshore PHP web development India</a> > Third time's the charm? Not exactly a ringing endorsement of the skills you've got available or your testing method reliablity... -- 12. One of my advisors will be an average five-year-old child. Any flaws in my plan that he is able to spot will be corrected before implementation. --Peter Anspach's list of things to do as an ...

PHP games to learn PHP
Hi, I am learning PHP, but it can be kind of boring. Are there any games where you use PHP programming to play the game? This way you learn how to use PHP and it is fun. Does anybody know? Nick "Nick Mudge" wrote > I am learning PHP, but it can be kind of boring. Are there any games where > you use PHP programming to play the game? This way you learn how to use > PHP and it is fun. Does anybody know? Yes. Write something (a game, for example) in PHP. To make it even more entertaining, you could add a touch of javascript. Ivo "Ivo" <no@thank.you> wrote in message news:40cc70fe$0$62706$ee9da40f@news.wanadoo.nl... > "Nick Mudge" wrote > > I am learning PHP, but it can be kind of boring. Are there any games where > > you use PHP programming to play the game? This way you learn how to use > > PHP and it is fun. Does anybody know? > > Yes. Write something (a game, for example) in PHP. To make it even more > entertaining, you could add a touch of javascript. > Ivo Since all games are input, output and state engines, the PHP bit is limited to the latter. You get to do the input/output in something else (browsers, JScript, etc) and practise doing the state engine code in PHP. Something like an old-style play-by-mail is perfect. Witness something like http://www.nationstates.net/cgi-bin/index.cgi for ideas that do that. Garp Garp wrote: > "Ivo" <no@thank.you> wrote in mess...

Send array from php to php
HI every one I' try to send array from web page to php file but no data are show I'm using session to store data and this is my code //////////////////////////////////////////////////////////////////////// $data = $cart_items; session_register('data'); foreach ($cart_items as $cart_item) { echo "<tr>"; echo " <td><span class='style2'>".$cart_item->name."</span></td>"; echo " <td><span class='style2'>".$cart_item->description."</ span></td>"; echo " <td><span class='style2'>".$cart_item->price." S.R.</span></ td>"; echo " <td><span class='style2'>".$cart_item->quantity."</span></ td>"; echo " <td><span class='style2'>".$cart_item->price * $cart_item- >quantity."</span></td>"; echo " <td><span class='style4'><a href='order.php?action=del&id=". $cart_item->object_id."'>[del]</a></span></td>"; echo "</tr>"; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \ and this is my php code to get the data //////////////////////////////////////////////////////// <?php foreach ($data as $item) { echo "<tr>"; print " &l...

php mail( )
This code appears in a mail( ) script that sends me notice of errors. $message .= "User Email: $erruseremail"."?Subject=Blah Blah Blah"."\r\n\n"; When the email arrives it looks like this: User Email: me@example.com?Subject=Blah Blah Blah but with the underlying mailto link of only me@example.com?Subject=Blah (just a part of the Subject string). If I change the code to $message .= "User Email: $erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in the subject string) the email arrives as expected, with the mailto link including the entire subject string. I have tried every combination of the use of double and single quotes I can think of with no joy. Where am I missing the boat? Many thanks, Bill B El 29/12/2010 18:12, Bill Braun escribi�/wrote: > This code appears in a mail( ) script that sends me notice of errors. > > $message .= "User Email: $erruseremail"."?Subject=Blah Blah Blah"."\r\n\n"; > > When the email arrives it looks like this: > > User Email: me@example.com?Subject=Blah Blah Blah but with the > underlying mailto link of only me@example.com?Subject=Blah (just a part > of the Subject string). > > If I change the code to $message .= "User Email: > $erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in > the subject string) the email arrives as expected, with the...

php://memory and php://temp
http://php.net/manual/en/wrappers.php.php per the documentation: php://memory and php://temp are both listed under "Allows Appending" what am I missing / what's the point? They only seem to work with read/write modes such as fopen('php://memory','rw'); closing the handle, or trying to open another handle without closing the first essentially erase the contents... so what's the point of fopen('php://memory','a') ? you'll a) be appending nothing, b) no way to read what you just wrote? sure would be nice if you could $fh = fopen('php://memory', 'w'); fwrite($fh, 'test string'); fclose($fh); $fh = fopen('php://memory', 'r'); $result = fgets($fh,2048); fclose($fh); echo $result; On 10/12/2010 9:44 PM, BKDotCom wrote: > http://php.net/manual/en/wrappers.php.php > per the documentation: php://memory and php://temp are both listed > under "Allows Appending" > > what am I missing / what's the point? > > They only seem to work with read/write modes such as > fopen('php://memory','rw'); > > closing the handle, or trying to open another handle without closing > the first essentially erase the contents... so what's the point of > fopen('php://memory','a') ? > you'll > a) be appending nothing, > b) no way to read what you just wrote? > > sure would be nice if you could > > $fh = ...

Does PHP need the .php extension ?
Hi guys, When I use PHP I give my file the .php extension. I always wondered if it could be an .htm page with a <script> block that the PHP resides in, the same way you would do JavaScript. If you can do it that way are there any benifits to that method ? Take care, Cyrus "Cyrus D." <satan@invalid.org> writes: > Hi guys, > > When I use PHP I give my file the .php extension. I always wondered if it > could be an .htm page with a <script> block that the PHP resides in, the > same way you would do JavaScript. If you can do it that way are there any > benifits to that method ? > > Take care, > Cyrus > > Right now you probably have a directive like this in your httpd.conf file (or your ISP does). AddType application/x-httpd-php .php4 .php .php3 .inc .inf .phtml It identifies the extensions which should be processed by the php interpreter before output is sent to the browser. I believe you can also include this directive in a .htaccess file in your area and add .htm to the list. This would send all your files throught the interpreter and those that do not contain PHP code would just be passed through.... You mention Javascript, but that is a bit different. The interpretation of that happens at your browser -- all the PHP work is done at the server. Hope this helps. -- John __________________________________________________________________...

PHP does not parse .PHP files
I have this problem with PHP that someone might be able to help. With CLI, I am able to execute my .php files. For example, if I type "php phpinfo.php" , this works fine on my system. If I put the phpinfo.php file is in /var/www/html and I try to access it through the browser, I get the content of the file and not the execution of the file. Instead of display the info of PHP, I got the text of the file as: <?php phpinfo(); ?> Why? Thanks Phong Ho wrote: >I have this problem with PHP that someone might be able to help. > >With CLI, I am able to execute my .php files. For example, if I type >"php phpinfo.php" , this works fine on my system. > >If I put the phpinfo.php file is in /var/www/html and I try to access >it through the browser, I get the content of the file and not the >execution of the file. Instead of display the info of PHP, I got the >text of the file as: > ><?php > phpinfo(); >?> > > >Why? >Thanks Do you have a webserver such as Apache running on the machine where you expect this to happen? Because it's the webserver, not the browser, that needs to know about php. The browser only does html. Margaret -- (To mail me, please change .not.invalid to .net, first. Apologies for the inconvenience.) "Phong Ho" wrote: > I have this problem with PHP that someone might be able to help. > > With CLI, I am able to execute my .php files. For exam...

PHP + Unicode
Hi all, I have saved some data in a MySQL database as UTF-8 format. But when I tried to read the data using PHP, the webpage gave me all the "?"s. How to read it multilingual data correctly in PHP? I believe there must be a way since I can see the words in UTF-8 in the phpmyadmin interface. phpmyadmin is also coded in PHP and if it can do it, there must be a way to read multilingual data properly. Anyone knows how to do it? Thanks a lot! --Dan *** willwudan@gmail.com wrote/escribi� (25 Aug 2005 22:27:20 -0700): > I have saved some data in a MySQL database as UTF-8 format. But when I > tried > to read the data using PHP, the webpage gave me all the "?"s. How to > read it > multilingual data correctly in PHP? Have you set the appropriate headers to tell browser what charset it should use to decode? It may not be the solution but it's a necessary step. Rather than: Content-Type: text/html; charset=ISO-8859-1 tell it's UTF-8. -- -- �lvaro G. Vicario - Burgos, Spain -- http://bits.demogracia.com - Mi sitio sobre programaci�n web -- Don't e-mail me your questions, post them to the group -- Yes, I set the appropriate headers to tell the browser it is UTF-8. But it does not help! Alvaro G Vicario wrote: > > Have you set the appropriate headers to tell browser what charset it shou= ld > use to decode? It may not be the solution but it's a necessary step. Rath= er > than: > > Content-Type: text/html...

Php constants in php.ini
I am trying to set user_agent = PHP_VERSION in php.ini. In my php.ini the instructions say that you can use constants in the php.ini file. The only constants I can get to work, though, are the error level constants like E_ALL, E_ERROR, E_WARNING, etc., ... Is anyone aware of some sort of trick to getting others to work? (I was thinking it would be nice to have the user agent string used by my Php scripts to use PHP_VERSION in the string.) -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Integrity is obvious. The lack of it is common. ***************************** ...

Mailing from PHP
I have a Google apps account, that I would like to use to email (extracting information from a MySQL table). The Google apps account allows me to use it as an SMTP mailer. Are there any recommendations by those who have experience in this space (including using an alternative to Google), for mailings (not spam, just managing an event), from a MySQL table, and PHP? Hello, on 01/14/2010 04:51 PM JustWondering said the following: > I have a Google apps account, that I would like to use to email > (extracting information from a MySQL table). The Google apps account > allows me to use it as an SMTP mailer. Are there any recommendations > by those who have experience in this space (including using an > alternative to Google), for mailings (not spam, just managing an > event), from a MySQL table, and PHP? You may want to try the MIME e-mail message class that has support for SMTP delivery and SMTP authentication that Google requires. http://www.phpclasses.org/mimemessage There is an article here precisely about sending e-mail from PHP applications via Gmail (Google Apps), Hotmail and Yahoo SMTP servers. http://www.phpclasses.org/blog/package/9/post/1-Sending-email-using-SMTP-servers-of-Gmail-Hotmail-or-Yahoo-with-PHP.html You will also need these classes: http://www.phpclasses.org/smtpclass http://www.phpclasses.org/sasl -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components wri...

Web resources about - PHP - using mail() and unicode text - text gets disturbed - comp.lang.php

Another Way to Die (Disturbed song) - Wikipedia, the free encyclopedia
" Another Way to Die " is a song by American heavy metal band Disturbed , released as the first single from their fifth studio album, Asylum ...

Disturbed - #RollingStone HOW FAR THE MIGHTY HAVE FALLEN,... - Facebook
#RollingStone HOW FAR THE MIGHTY HAVE FALLEN, I USED TO DREAM OF MAKING THE COVER OF ROLLING STONE MAGAZINE, AS IT USED TO BE THE ULTIMATE STATEMENT ...

Disturbed (@Disturbed) on Twitter
Log in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Disturbed - Another Way To Die [Official Music Video] - YouTube
Chicago, Illinois metal band Disturbed has successful mixed aggressive riffs and vocals with a melodic approach to form a winning formula that ...

Jake Bilardi's father says his son was a disturbed child
The father of teen jihadist Jake Bilardi has revealed his son was an aggressive and psychologically disturbed child.

Jake Bilardi's father says his son was a disturbed child
The father of teen jihadist Jake Bilardi has revealed his son was an aggressive and psychologically disturbed child.

Shatner: Takei is a ‘disturbed individual’
... pair have a long-running feud that stems from Takei claiming Shatner was difficult to work with on the 1960s TV series. “He is a very disturbed ...

Labor 'disturbed' by super opt-out report
The government is reportedly considering allowing low-income earners to opt out of compulsory super.

Roosters disturbed by blood results
Sydney Roosters general manager Brian Canavan said on Wednesday that his players were tested for human growth hormone without the consent of ...

Jake Bilardi's father says his son was a disturbed child
The father of teen jihadist Jake Bilardi has revealed his son was an aggressive and psychologically disturbed child.

Resources last updated: 3/24/2016 5:19:03 AM