[PHP] gpg/php problems ....
the code below encrypts a phrase using gpg and sends out via email ... i get the data ok ... but my mail client does not show it ... if i view email sorce i can see the encrypted message ... what am i doing wrong? thanks, jd $username = mohadib; $pgp=/usr/bin/gpg; $user=Zend Commerce [EMAIL PROTECTED]; $recp=[EMAIL PROTECTED]; //$data=$oneOrder; $command = 'echo hello word | '.$pgp.' -a --always-trust --batch --no-secmem-warning -e -u '.$user.' -r '.$recp.''; $oldhome = getEnv(HOME); putenv(HOME=/home/$username); $result = exec($command, $encrypted, $errorcode); putenv(HOME=$oldhome); $subject=Test message; $headers = MIME-Version: 1.0\r\n; $headers .= Content-Type: multipart/encrypted; protocol=\application/pgp-encrypted\; boundary=\=-uc4rTrDFZtVQGtcexwyv\\r\n; $message = --=-uc4rTrDFZtVQGtcexwyv Content-Type: application/pgp-encrypted Content-Transfer-Encoding: 7bit Version: 1 --=-uc4rTrDFZtVQGtcexwyv Content-Type: application/octet-stream; name=encrypted.asc Content-Transfer-Encoding: 7bit\n\n; $message .= implode(\n, $encrypted); $message .= \n\n--=-uc4rTrDFZtVQGtcexwyv--; mail($recp,$subject,$message,$headers); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] count number of occurences of character in a string
what function can I use to count the number of occurences of a certain character in a string? -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.destinia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] count number of occurences of character in a string
Hello Diana, Tuesday, June 8, 2004, 11:11:27 AM, you wrote: DC what function can I use to count the number of occurences of a certain DC character in a string? substr_count or count_chars would work. Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] count number of occurences of character in a string
what function can I use to count the number of occurences of a certain character in a string? substr_count() ...? rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: if/elseif/else v. switch
Hi Chris, oh right and that makes everything better. you're a fantastic person! I don't see how criticising a silly question makes me a bad person in the first place. you should be able to handle a little public humiliation/chastisement since you so easily dish it out. You missed the point. Anyway, stop flogging a dead horse. Stupid questions have stupid answers, unfortunatly mine was one of the stupid answers - in hind site, I agree it was an inapropriate thing to say. Kind Regards, Aidan - Original Message - From: Chris W. Parker [EMAIL PROTECTED] To: Aidan Lister [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 2:25 AM Subject: RE: [PHP] Re: if/elseif/else v. switch Aidan Lister mailto:[EMAIL PROTECTED] on Saturday, June 05, 2004 6:19 AM said: You'll note I did not criticise the poster, merely his seemingly stupid question. oh right and that makes everything better. you're a fantastic person! I suggest you practice what you preach. If you have a comment on my reply to a users post, feel free to contact me personally - [EMAIL PROTECTED] you should be able to handle a little public humiliation/chastisement since you so easily dish it out. c. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with variable handling !
Hi ! I have a Problem with hand over of variables; My Page consists of three files which I have enclosed to demonstrate the problem. test.php: -- html head titletest.php/title /head frameset rows=274,* cols=* framespacing=1 frameborder=yes border=1 bordercolor=#00 frame src=test_oben.php name=topFrame scrolling=YES frame src=test_0.php name=buttom0Frame scrolling=YES /frameset body /body /html -- test_oben.php: -- html head titletest_oben.php/title /head body putest/u/p form action=test_0.php method=post enctype=multipart/form-data name=form1 target=buttom0Frame table width=856 height=30 border=0 tr td width=77 height=26 align=rightString1/td td width=223input name=var1 type=text id=var1 size=25 maxlength=25/td td width=178 align=rightString2/td td width=206input name=var2 type=text id=var2 size=25 maxlength=25 /td td width=150input name=button1 type=submit id=button1 value=Display strings input name=button2 type=submit id=button2 value=Display concatenated strings/td /tr /table /form /body /html -- test_0.php: -- html head titletest_0.php/title /head body ?php if ($button1) { echo Button 1 was pressed\n, ; echo String1=$var1\n, ; echo String2=$var2\n, ; $var3 = $var1$var2; /*echo concatenated string=$var3;*/ } if ($button2) { echo Button 2 was pressed\n, ; /*echo String1=$var1\n, ; echo String2=$var2\n, ;*/ echo concatenated string=$var3; } ? /body /html -- In test_oben.php I want to insert two strings. pressing the Display strings-button will output them in the button frame. Only pressing the Display concatenated strings-button should output the concatenated string, but this does not work, and I do not understand why. Please give me a hint ! best regards chrm
Re: [PHP] Problems with variable handling !
On Tuesday 08 June 2004 18:36, php-general wrote: In test_oben.php I want to insert two strings. pressing the Display strings-button will output them in the button frame. Only pressing the Display concatenated strings-button should output the concatenated string, but this does not work, and I do not understand why. Please give me a hint ! manual Variables Variables from outside PHP -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Radar tends to fail at night and in bad weather, and especially during both -- Murphy's Military Laws n122 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with variable handling !
php-general wrote: Hi ! I have a Problem with hand over of variables; My Page consists of three files which I have enclosed to demonstrate the problem. test.php: -- html head titletest.php/title /head frameset rows=274,* cols=* framespacing=1 frameborder=yes border=1 bordercolor=#00 frame src=test_oben.php name=topFrame scrolling=YES frame src=test_0.php name=buttom0Frame scrolling=YES /frameset body /body /html -- test_oben.php: -- html head titletest_oben.php/title /head body putest/u/p form action=test_0.php method=post enctype=multipart/form-data name=form1 target=buttom0Frame table width=856 height=30 border=0 tr td width=77 height=26 align=rightString1/td td width=223input name=var1 type=text id=var1 size=25 maxlength=25/td td width=178 align=rightString2/td td width=206input name=var2 type=text id=var2 size=25 maxlength=25 /td td width=150input name=button1 type=submit id=button1 value=Display strings input name=button2 type=submit id=button2 value=Display concatenated strings/td /tr /table /form /body /html -- test_0.php: -- html head titletest_0.php/title /head body ?php if ($button1) { echo Button 1 was pressed\n, ; echo String1=$var1\n, ; echo String2=$var2\n, ; $var3 = $var1$var2; /*echo concatenated string=$var3;*/ } if ($button2) { echo Button 2 was pressed\n, ; /*echo String1=$var1\n, ; echo String2=$var2\n, ;*/ echo concatenated string=$var3; } ? /body /html -- In test_oben.php I want to insert two strings. pressing the Display strings-button will output them in the button frame. Only pressing the Display concatenated strings-button should output the concatenated string, but this does not work, and I do not understand why. Please give me a hint ! The hint: register_globals best regards chrm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problems with variable handling !
phpinfo reports that register_globals=On
[PHP] Re: Problems with variable handling !
- Original Message - From: php-general To: [EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 12:36 PM Subject: Problems with variable handling ! Hi ! I have a Problem with hand over of variables; My Page consists of three files which I have enclosed to demonstrate the problem. test.php: -- html head titletest.php/title /head frameset rows=274,* cols=* framespacing=1 frameborder=yes border=1 bordercolor=#00 frame src=test_oben.php name=topFrame scrolling=YES frame src=test_0.php name=buttom0Frame scrolling=YES /frameset body /body /html -- test_oben.php: -- html head titletest_oben.php/title /head body putest/u/p form action=test_0.php method=post enctype=multipart/form-data name=form1 target=buttom0Frame table width=856 height=30 border=0 tr td width=77 height=26 align=rightString1/td td width=223input name=var1 type=text id=var1 size=25 maxlength=25/td td width=178 align=rightString2/td td width=206input name=var2 type=text id=var2 size=25 maxlength=25 /td td width=150input name=button1 type=submit id=button1 value=Display strings input name=button2 type=submit id=button2 value=Display concatenated strings/td /tr /table /form /body /html -- test_0.php: -- html head titletest_0.php/title /head body ?php if ($button1) { echo Button 1 was pressed\n, ; echo String1=$var1\n, ; echo String2=$var2\n, ; $var3 = $var1$var2; /*echo concatenated string=$var3;*/ } if ($button2) { echo Button 2 was pressed\n, ; /*echo String1=$var1\n, ; echo String2=$var2\n, ;*/ echo concatenated string=$var3; } ? /body /html -- In test_oben.php I want to insert two strings. pressing the Display strings-button will output them in the button frame. Only pressing the Display concatenated strings-button should output the concatenated string, but this does not work, and I do not understand why. Please give me a hint ! best regards chrm phpinfo reports that register_globals=On
Re: [PHP] Re: Problems with variable handling !
On Tuesday 08 June 2004 18:50, php-general wrote: Only pressing the Display concatenated strings-button should output the concatenated string, but this does not work, and I do not understand why. $var3 is not defined. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Romance, like alcohol, should be enjoyed, but should not be allowed to become necessary. -- Edgar Friedenberg */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problems with variable handling !
On Tuesday 08 June 2004 18:50, php-general wrote: Only pressing the Display concatenated strings-button should output the concatenated string, but this does not work, and I do not understand why. $var3 is not defined. -- $var3 is defined as $var3 = $var1$var2; in the body of the if ($button1) statement !?
Re: [PHP] Re: Problems with variable handling !
On Tuesday 08 June 2004 19:13, php-general wrote: $var3 is defined as $var3 = $var1$var2; in the body of the if ($button1) statement !? sigh what is button1 supposed to do and what is button2 supposed to do? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A woman, especially if she have the misfortune of knowing anything, should conceal it as well as she can. -- Jane Austen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamically build array from db
I have a class which builds a set of tabs...the class expects an array in this form array(Site Info=siteinfo.php,Contact Us=contactus.php)..where Site Info is a link to siteinfo.php. The build tabs method of the class then loops through the array outputing a set of tabbed links on the page. The problem is I am having trouble generating this array from a database. I need to pull from my query: $sql-query(select title, page from links); while ($sql-nextRecord()){ //build the array } I have tried arraypush but can only get it to work with a standard array...how can I do this? Thanks, Eddie WARNING: The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed. This message may contain information that is privileged, confidential and exempt from disclosure under applicable law. It may also contain trade secrets and other proprietary information for which you and your employer may be held liable for disclosing. You are hereby notified that any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify [EMAIL PROTECTED] by E-Mail and then destroy this communication in a manner appropriate for privileged information. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] count number of occurences of character in a string
substr_count() http://www.php.net/manual/en/function.substr-count.php what function can I use to count the number of occurences of a certain character in a string? -- Diana Castillo Global Reservas, S.L. C/Granvia 22 dcdo 4-dcha 28013 Madrid-Spain Tel : 00-34-913604039 Fax : 00-34-915228673 email: [EMAIL PROTECTED] Web : http://www.hotelkey.com http://www.destinia.com
[PHP] Re: dynamically build array from db
Edward Peloke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a class which builds a set of tabs...the class expects an array in this form array(Site Info=siteinfo.php,Contact Us=contactus.php)..where Site Info is a link to siteinfo.php. The build tabs method of the class then loops through the array outputing a set of tabbed links on the page. The problem is I am having trouble generating this array from a database. I need to pull from my query: $sql-query(select title, page from links); while ($sql-nextRecord()){ file://build the array } I have tried arraypush but can only get it to work with a standard array...how can I do this? $array = array(); while ($sql-nextRecord()){ // figure out how to get $title and $page from your record set (do didn't say which DB layer you are using) $array[$title] = $page; } Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: dynamically build array from db
ah..yes, thanks, works like a charm. -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 08, 2004 8:49 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: dynamically build array from db Edward Peloke [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a class which builds a set of tabs...the class expects an array in this form array(Site Info=siteinfo.php,Contact Us=contactus.php)..where Site Info is a link to siteinfo.php. The build tabs method of the class then loops through the array outputing a set of tabbed links on the page. The problem is I am having trouble generating this array from a database. I need to pull from my query: $sql-query(select title, page from links); while ($sql-nextRecord()){ file://build the array } I have tried arraypush but can only get it to work with a standard array...how can I do this? $array = array(); while ($sql-nextRecord()){ // figure out how to get $title and $page from your record set (do didn't say which DB layer you are using) $array[$title] = $page; } Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] search engine optimization and php
Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Also, is it not a good idea to put all your meta keywords into a header.inc.php script that is then pulled into each page when it is loaded? Thanks, Eddie WARNING: The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed. This message may contain information that is privileged, confidential and exempt from disclosure under applicable law. It may also contain trade secrets and other proprietary information for which you and your employer may be held liable for disclosing. You are hereby notified that any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify [EMAIL PROTECTED] by E-Mail and then destroy this communication in a manner appropriate for privileged information. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] search engine optimization and php
Hi Edward, A few things first: 1) Match keyword to actual words in the file: Not sure what you are talking about but if you are referring to Meta tag keyword data... this has been primarily outdated for several years now. Do SE's read meta data? Yes and no, but rest assured if you are trying to make it into top page indexes, meta data will do nothing to help bolster your rank. It's generally considered useless. 2) Doesn't the bots need to crawl the static pages: Bots can crawl dynamic pages with query strings in the URL. However, how deep they spider is still in question. If you can create static looking pages from dynamic content with URL re-writing you're much better off. Example: after a client came to me to help with their search engine marketing, we discovered only 200 of their 1500 products were being indexed. With url-writing we were able to get all 1500 into Google and Google continually spiders on a daily basis. 3) If you are concerned about search engine optimization for yourself, or a client, you need to either A) learn the ins and outs yourself (a lot of time and research) or work with a consultant to help you optimize code, pages, copy, links, etc. Good luck. Aaron -Original Message- From: Edward Peloke [mailto:[EMAIL PROTECTED] Sent: June 8, 2004 10:20 AM To: Php-General Subject: [PHP] search engine optimization and php Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Also, is it not a good idea to put all your meta keywords into a header.inc.php script that is then pulled into each page when it is loaded? Thanks, Eddie WARNING: The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed. This message may contain information that is privileged, confidential and exempt from disclosure under applicable law. It may also contain trade secrets and other proprietary information for which you and your employer may be held liable for disclosing. You are hereby notified that any unauthorized dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify [EMAIL PROTECTED] by E-Mail and then destroy this communication in a manner appropriate for privileged information. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] search engine optimization and php
Edward Peloke wrote: Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? All pages are static once you load them, the letters are not moving around ;-) Also, is it not a good idea to put all your meta keywords into a header.inc.php script that is then pulled into each page when it is loaded? Does not hurt. Even better, use meta keyword and description based on the main content of the page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: search engine optimization and php
Hello, On 06/08/2004 11:20 AM, Edward Peloke wrote: Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Practically, only Google matters these days as most sites get over 70% of leads from Google. For Google, it matters that your pages are served as fast as possible. If your pages are taking too long to be served, Google assumes it is causing too much load to your site and slows down giving more time between crawls. There is a myth regarding the interpretation of this explanation for Google not indexing dynamic as many site pages because of the use of URL with query parameters (?some=thingthis=too). http://www.google.com/webmasters/2.html#A1 Query parameters is is not the reason why Google does not index so many pages. I can demonstrate that just by let you see that Google indexes for 700.000 pages of php.net, many of which have many query parameters: http://www.google.com/search?q=site%3Aphp.net So, do not bother with all those bogus advices telling you to use URL rewriting because that is not what matters. What matters is that your pages are served as fast as possible cause as less load to your server as possible. If your pages are generated with content taken from a database, you would better use some content caching to avoid spending too much time making repetitive database queries which is usually your site's bottleneck. You may want to try caching whole pages or just parts using for instance this class. It is very robust as it uses file locking to prevent cache file corruption during updates that may happen during surges of many simultaneous users accesses: http://www.phpclasses.org/filecache If you can, also use some PHP script caching engine, like for instance Turck, which is free and provides great PHP execution speed up by avoiding the implicit PHP script compilation step: http://turck-mmcache.sourceforge.net/ -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to disable output buffer per script
I wrote an importer script in PHP that outputs the percentage of items finished in 5% chunks. When I run the script however (web or command line) I don¹t get incremental output .. I get it all in one fell swoop. I have a feeling PHP is buffering it or something. It there any command I can use to disable such buffering for just this script so I can see some useful feedback. Thanks! ~ Mike - Mike Zornek Web Designer, Media Developer, Programmer and Geek Personal site: http://MikeZornek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: search engine optimization and php
-Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED] Sent: June 8, 2004 10:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: search engine optimization and php Hello, On 06/08/2004 11:20 AM, Edward Peloke wrote: Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Practically, only Google matters these days as most sites get over 70% of leads from Google. Since Yahoo! Dropped their affiliation with Google, many, including myself and my client, have seen a significant increase in Y! refers. 70% is not the case anymore. Keeping all your eggs in one basket is a bad decision at best. For Google, it matters that your pages are served as fast as possible. If your pages are taking too long to be served, Google assumes it is causing too much load to your site and slows down giving more time between crawls. There is a myth regarding the interpretation of this explanation for Google not indexing dynamic as many site pages because of the use of URL with query parameters (?some=thingthis=too). http://www.google.com/webmasters/2.html#A1 Query parameters is is not the reason why Google does not index so many pages. I can demonstrate that just by let you see that Google indexes for 700.000 pages of php.net, many of which have many query parameters: http://www.google.com/search?q=site%3Aphp.net So, do not bother with all those bogus advices telling you to use URL rewriting because that is not what matters. What matters is that your pages are served as fast as possible cause as less load to your server as possible. Speed is a factor, page size is a factor but the number of query strings within a URL is why Google (and other bots) only go so deep into a site 0 for fear of getting caught in a endless loop. They are getting better, however. It's definitely not bogus information. I can get a site's pages indexed a lot quicker with URL rewriting than I can without. If your pages are generated with content taken from a database, you would better use some content caching to avoid spending too much time making repetitive database queries which is usually your site's bottleneck. Agreed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to disable output buffer per script
Mike Zornek wrote: I wrote an importer script in PHP that outputs the percentage of items finished in 5% chunks. When I run the script however (web or command line) I don¹t get incremental output .. I get it all in one fell swoop. I have a feeling PHP is buffering it or something. It there any command I can use to disable such buffering for just this script so I can see some useful feedback. Thanks! Try calling ob_end_flush() at the top of your script. Although I believe some browsers will still buffer a portion of the output before displaying. But if you're running from the command line it should display in real time. HTH... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
Hi! I had MySQL up and running. One glaring problem is that the hostname in the 'user' table of 'mysql' database show it as 'localhost'. I thought it would look better if I change it to '127.0.0.1' instead. I haven't got that connection to work with IP address, so mysql_connect() doesn't work. What is your thought on this? Thanks, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
[snip] I had MySQL up and running. One glaring problem is that the hostname in the 'user' table of 'mysql' database show it as 'localhost'. I thought it would look better if I change it to '127.0.0.1' instead. I haven't got that connection to work with IP address, so mysql_connect() doesn't work. What is your thought on this? [/snip] Look better? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: search engine optimization and php
Hello, On 06/08/2004 12:04 PM, Aaron Wolski wrote: Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Practically, only Google matters these days as most sites get over 70% of leads from Google. Since Yahoo! Dropped their affiliation with Google, many, including myself and my client, have seen a significant increase in Y! refers. 70% is not the case anymore. Keeping all your eggs in one basket is a bad decision at best. Yes, but if you just keep optimizing for Google you will be optimizing for most of the others that have significant share because Google always been the most successful in providing relevant results for the users and others tend to imitate Google. For Google, it matters that your pages are served as fast as possible. If your pages are taking too long to be served, Google assumes it is causing too much load to your site and slows down giving more time between crawls. There is a myth regarding the interpretation of this explanation for Google not indexing dynamic as many site pages because of the use of URL with query parameters (?some=thingthis=too). http://www.google.com/webmasters/2.html#A1 Query parameters is is not the reason why Google does not index so many pages. I can demonstrate that just by let you see that Google indexes for 700.000 pages of php.net, many of which have many query parameters: http://www.google.com/search?q=site%3Aphp.net So, do not bother with all those bogus advices telling you to use URL rewriting because that is not what matters. What matters is that your pages are served as fast as possible cause as less load to your server as possible. Speed is a factor, page size is a factor but the number of query strings within a URL is why Google (and other bots) only go so deep into a site 0 for fear of getting caught in a endless loop. They are getting better, however. It's definitely not bogus information. I can get a site's pages indexed a lot quicker with URL rewriting than I can without. My point is that if your pages are served slowly, URL rewriting does not matter and only a subset of your pages will be indexed. OTOH, if you make your pages be served very fast, URL rewriting is not necessary, at least for Google. I know that for experience. I have seen it several times Google crawling thousands of pages with no URL rewriting. As for other search engines, I don't know because it is possible that they try to copy Google crawling logic the way they understand it, which may not be the actual way it works as Google does not disclose it . -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
Scott Fletcher wrote: Hi! I had MySQL up and running. If it's not broken don't fix it. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bug in utf8_encode (bit operations)?
Hi! I'm currently developing a nice script that generates OpenOffice SXW files by filling the content.xml (which is UTF-8 encoded) with database content. While trying to do this I found out that utf8_encode('') (charcode 147) returns 'Â'. But when I checked the whole result in OffenOffice '' is displayed as square (character unknown?!). So I made some tests with UTF-8 conversion (even mb_* functions) and recognized that characters between 128 and 160 returned by utf8_encode() don't seem to match the standard. As mentioned above '' is returned as 'Â' but should be 'â?T' (as you will get it using UltraEdit for conversion). Does anyone can give me some explanations here? I'm not familiar with this UTF-8 / bit-conversion stuff, but I don't think PHP does what it's supposed to do here. For a first workaround I simply coded a custom_utf8_encode() that uses an own char map to override this misbehaviour (see below). Can someone help my out with this strange bug?! Regards Bjoern Kraus function custom_utf8_encode($str) { $chrMap = array(128 = 'â,¬', 129 = 'Â', 130 = 'â?s', 131 = 'Æ'', 132 = 'â?z', 133 = 'â?¦', 134 = 'â? ', 135 = 'â?¡', 136 = 'Ë?', 137 = 'â?°', 138 = 'Å ', 139 = 'â?¹', 140 = 'Å'', 141 = 'Â', 142 = 'Ž', 143 = 'Â', 144 = 'Â', 145 = 'â?~', 146 = 'â?T', 147 = 'â?o', 148 = 'â?', 149 = 'â?¢', 150 = 'â?', 151 = 'â?', 152 = 'Ëo', 153 = 'â¢', 154 = 'Å¡', 155 = 'â?º', 156 = 'Å', 157 = 'Â', 158 = 'ž', 159 = 'Ÿ'); $newStr = ''; for ($i = 0; $i strlen($str); $i++) { $chrVal = ord($str[$i]); if ($chrVal 127 $chrVal 160) { $newStr .= $chrMap[$chrVal]; } else { $newStr .= utf8_encode($str[$i]); } } return $newStr; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running Arbitrary PHP Code
I'm trying to take arbitrary PHP code from within C++. I've noted the PHP embed module, but haven't found any sample code or directions as to how to use it. The other idea is to call functions directly from the DLL. A dumpbin has given me a function list, but attempts to call php_execute_script( .. ) fails to link within VS 6.0. Has anyone successfully done something similar? Is there an exported function that simply takes a string rather then the zend_file_handle? Does anyone have sample code? Nathan Schmitz Software Developer Biap Systems, Inc. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
Security rank higher than this Raditha Dissanayake [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Scott Fletcher wrote: Hi! I had MySQL up and running. If it's not broken don't fix it. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to disable output buffer per script
* Thus wrote Mike Zornek ([EMAIL PROTECTED]): I wrote an importer script in PHP that outputs the percentage of items finished in 5% chunks. When I run the script however (web or command line) I don¹t get incremental output .. I get it all in one fell swoop. I have a feeling PHP is buffering it or something. It there any command I can use to disable such buffering for just this script so I can see some useful feedback. Thanks! Use this at the top of the script: ini_set('output_buffer', 0); Or, as I usually set up for my cli environment (since they ususally desire no buffering), create a php-cli.ini file that has output_buffering turned off. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
Scott Fletcher wrote: Security rank higher than this How can connecting to localhost be more or less secure than connecting to 127.0.0.x ? Hi! I had MySQL up and running. If it's not broken don't fix it. -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
Scott Fletcher wrote: Security rank higher than this Use mysql socket and you are safe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can someone explain this?
$dec = -71788; echo $dec.\n; $hex = dechex($dec).\n; $dec2 = hexdec($hex).\n; echo $dec2.\n; -= PRODUCES: =- -71788 3961595508 Is this something about signed versus unsigned integers? What I really would like to do is convert that negative number (-71788), which I suppose is unsigned to a signed integer (3961595508) without having to convert it to hex, then back to decimal. Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR - Oracle10g connection failure
Hi there, we are developing application for users with different database environment. I ve tested it with MySQL and SQL. Now I am stuck on Oracle 10g. I am trying php and PEAR. I have the following parameters: Windows Server 2000 PHP 4.3.6 PEAR 1.8 APACHE 2.0.49 Oracle 10g - ORACLE_HOME = C:\oracle\product\10.1.0\db_1 in ...Oracle\KEY_OraDb10g_home1 in Registry ORACLE_SID = webEvalOracle (same variables in ...Oracle\SYSMAN\OracleDBConsolewebEvalOracle in Registry) - WEBEVALO = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = tonya)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = webEvalO) ) ) in TNSnames.ora - php.ini: extension=php_oci8.dll extension=php_oracle.dll errors are: 1. for PEAR: [nativecode=ORA-12154: TNS:could not resolve the connect identifier specified] /*php code: $dbms=oci8; $dbhost=tonya; //localhost or tonya $dbuser=root; // schema name $dbpass=my_pass; $dbname=webevalo; //or webevaloracle for the full name $connectionObj=new connectionClass($dns); */ 2. in PHP can't connect either( $dbconnect=OCILogon($dbuser, $dbpass, $dbname)) So I was wandering if you can help me - either give me some advises or may be point to the source where I can retrieve the info I need. really appreciate your time and help Tonya www.one45.com
Re: [PHP] Running Arbitrary PHP Code
* Thus wrote Nathan Schmitz ([EMAIL PROTECTED]): I'm trying to take arbitrary PHP code from within C++. I've noted the PHP embed module, but haven't found any sample code or directions as to how to use it. A little old but might work.. http://www.zend.com/lists/php-dev/200209/msg01063.html GIYF, Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone explain this?
Forgive me if my math is askew, but doesn't the negative imply the number is signed? If I remember from my C++ days, a declaration of: unsigned int blah; Meant you could not store negative numbers in that variable. Hence, negatives would be signed. No? On Tue, 2004-06-08 at 12:52, René Fournier wrote: $dec = -71788; echo $dec.\n; $hex = dechex($dec).\n; $dec2 = hexdec($hex).\n; echo $dec2.\n; -= PRODUCES: =- -71788 3961595508 Is this something about signed versus unsigned integers? What I really would like to do is convert that negative number (-71788), which I suppose is unsigned to a signed integer (3961595508) without having to convert it to hex, then back to decimal. Rene -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone explain this?
* Thus wrote Ren Fournier ([EMAIL PROTECTED]): -= PRODUCES: =- -71788 3961595508 Is this something about signed versus unsigned integers? What I really would like to do is convert that negative number (-71788), which I suppose is unsigned to a signed integer (3961595508) without having to convert it to hex, then back to decimal. You have it backwords.. -71788 is signed and the 3961595508 is unsigned. But... ?php $dec = -71788; $unsigned = sprintf(%ul, $dec); print $unsigned; // == 3961595508 Do note that php doesn't have native unsigned numbers so doing something like this wont work right: printf(%d, $unsigned); // == 2147483647 So to convert it back you have to do something like: printf(%d, $unsigned+0); // == -71788 Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone explain this?
Forgive me if my math is askew, but doesn't the negative imply the number is signed? If I remember from my C++ days, a declaration of: unsigned int blah; Meant you could not store negative numbers in that variable. Hence, negatives would be signed. No? Yes, but once it become a hex string (after dechex()), all that info is gone. I think the way to handle this situation is to use pack unpack. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL -- mysql_connect(), possible to use IP Address instead of localhost???
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]): Scott Fletcher wrote: Security rank higher than this Use mysql socket and you are safe. iirc, by default mysql uses the socket if you connect via localhost/127.0.0.1 and tcp any other way. Although a mysql list probably would be more appropriate for this whole topic. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone explain this?
OK, that makes sense. But here's the problem: I receive binary data from SuperSPARC (big-endian), which I need to unpack according to certain documented type definitions. For example, let's say that $msg has the value 3961595508 and is packed as an unsigned long integer (on the remote SPARC). But when I receive it, and unpack it... $unpacked = unpack('Nval', $msg); // N for unsigned long integer, big-endian (SPARC) echo $unpacked[val]; ...the output value is -71788. (???) Which tells me that PHP is NOT unpacking $msg as an unsigned long integer, but rather as a signed integer (since unsigned integers cannot be negative). Now, thanks to your suggestions, I can convert that number back to an unsigned integeror at least make it positive. But I shouldn't have to convert it, should I? ...Rene On Tuesday, June 8, 2004, at 11:29 AM, Curt Zirzow wrote: * Thus wrote Ren Fournier ([EMAIL PROTECTED]): -= PRODUCES: =- -71788 3961595508 Is this something about signed versus unsigned integers? What I really would like to do is convert that negative number (-71788), which I suppose is unsigned to a signed integer (3961595508) without having to convert it to hex, then back to decimal. You have it backwords.. -71788 is signed and the 3961595508 is unsigned. But... ?php $dec = -71788; $unsigned = sprintf(%ul, $dec); print $unsigned; // == 3961595508 Do note that php doesn't have native unsigned numbers so doing something like this wont work right: printf(%d, $unsigned); // == 2147483647 So to convert it back you have to do something like: printf(%d, $unsigned+0); // == -71788 Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to disable output buffer per script
Curt Zirzow wrote: I have a feeling PHP is buffering it or something. It there any command I can use to disable such buffering for just this script so I can see some useful feedback. Thanks! Use this at the top of the script: ini_set('output_buffer', 0); The output_buffering setting cannot be controlled via ini_set(), at least according to the manual. I want to say that I confirmed this a long time ago but I can't recall for sure. Or, as I usually set up for my cli environment (since they ususally desire no buffering), create a php-cli.ini file that has output_buffering turned off. That's a good idea. But to do it on a per script basis (where it's undesirable to alter the global buffering setting) I think the only way is to call ob_end_flush() at the top of the script... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to disable output buffer per script
* Thus wrote Michael Sims ([EMAIL PROTECTED]): Curt Zirzow wrote: Use this at the top of the script: ini_set('output_buffer', 0); The output_buffering setting cannot be controlled via ini_set(), at least according to the manual. I want to say that I confirmed this a long time ago but I can't recall for sure. You're right. Or, as I usually set up for my cli environment (since they ususally desire no buffering), create a php-cli.ini file that has output_buffering turned off. That's a good idea. But to do it on a per script basis (where it's undesirable to alter the global buffering setting) I think the only way is to call ob_end_flush() at the top of the script... Another alternative is to change settings with shbang: #!/usr/local/bin/php -d output_buffering=0 ?php // continue on with no output_buffering. Of course this will only work when the script is set executable and is ran like a any other program, instead of 'php script.php` Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone explain this?
* Thus wrote Ren Fournier ([EMAIL PROTECTED]): Now, thanks to your suggestions, I can convert that number back to an unsigned integeror at least make it positive. But I shouldn't have to convert it, should I? Not necessarily, it mostly due to the limitation that php doesn't have unsigned integers. I have a patch for php that will return a unsigned integer as a string, but I havn't gotten it put into php yet. http://www.phpbuilder.com/lists/php-general/2003121/0526.php Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone explain this?
Thanks. The fact that this behaviour is a bug somehow makes me feel better. At least I'm not crazyor, not as crazy as I thought. ...Rene On Tuesday, June 8, 2004, at 12:57 PM, Curt Zirzow wrote: * Thus wrote Ren Fournier ([EMAIL PROTECTED]): Now, thanks to your suggestions, I can convert that number back to an unsigned integeror at least make it positive. But I shouldn't have to convert it, should I? Not necessarily, it mostly due to the limitation that php doesn't have unsigned integers. I have a patch for php that will return a unsigned integer as a string, but I havn't gotten it put into php yet. http://www.phpbuilder.com/lists/php-general/2003121/0526.php Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to disable output buffer per script
On 6/8/04 11:15 AM, Michael Sims [EMAIL PROTECTED] wrote: Try calling ob_end_flush() at the top of your script. Although I believe some browsers will still buffer a portion of the output before displaying. But if you're running from the command line it should display in real time. I did this and it works well. I saw some of the other responses and they seem useful as well. Thanks to all for your help. ~ Mike - Mike Zornek Web Designer, Media Developer, Programmer and Geek Personal site: http://MikeZornek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] info@astralsecurityandfinancebv.com emails every time I post
I'm sorry to be 0t but I couldn't find anyone specific to contact on the web or in the email source. Every time I post to this (and the PEAR list if I recall) I get an email from Information Desk [EMAIL PROTECTED] Thanks for contacting Astral Security and Finance BV. Your request is being processed, we will get back to you shortly. Information Desk Best Google knows they are a fraud/scam thing: http://www.google.com/search?q=Astral+Security+and+Finance+BVie=UTF-8oe=UT F-8 Can someone who has admin access PLEASE look into it. Thanks. ~ Mike - Mike Zornek Web Designer, Media Developer, Programmer and Geek Personal site: http://MikeZornek.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Empty Variable Values Between Scripts
Hello: I am just starting to learn php and have been reading tutorials that I have found on the Internet. The one I am reading now is: http://www.freewebmasterhelp.com/tutorials/phpmysql/1 The problem I am having is with these two scripts. Script 1: (This script displays some forms to type in Contact information.) form action=insert.php method=post First Name: input type=text name=firstbr Last Name: input type=text name=lastbr Phone: input type=text name=phonebr Mobile: input type=text name=mobilebr Fax: input type=text name=faxbr E-mail: input type=text name=emailbr Web: input type=text name=webbr input type=Submit /form Script 2: (This script (saved as insert.php) is called by Script 1 after information has been typed into the above form.) ? $username=localuser; $password=unknown; $database=Contacts; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( Unable to select database); $query=SELECT * FROM Contacts; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo bcenterDatabase Output/center/bbrbr; $i=0; while ($i $num) { $first=mysql_result($result,$i,first); $last=mysql_result($result,$i,last); $phone=mysql_result($result,$i,phone); $mobile=mysql_result($result,$i,mobile); $fax=mysql_result($result,$i,fax); $email=mysql_result($result,$i,email); $web=mysql_result($result,$i,web); echo b$first $last/bbrPhone: $phonebrMobile: $mobilebrFax: $faxbrE- mail: $emailbrWeb: $webbrhrbr; ++$i; } ? I have created the database Contacts. It is a MySQL database. I open the first script and enter my contact data, press Submit, and I believe the second script is then called. I go and check my Contacts database and a new record has been added, but it is empty. I am guessing that the values assigned in the first script are not being seen by the second script and that the empty variables are being written to the database. Is there something that has to be done to php so that it sees these variables? Is this an operating system issue? Anything else I should be looking at? Other data: Server Machine: Sun Sparc 20 with Solaris 2.6, Apache 2.0.49, MySQL 4.0.17, PHP 4.3.7. Remote Machine: Homebuilt running MS Windows 2000, Mozilla Firebird 0.7 browser If there is a better list for beginner questions, please let me know. Thanks. -- Frank Hahn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Empty Variable Values Between Scripts
[snip] Is there something that has to be done to php so that it sees these variables? Is this an operating system issue? Anything else I should be looking at? [/snip] register globals is off, so all of your variables are in the POST array $_POST['first'] $_POST['last'] etc. Replace all your variable references with the appropriate array references and you'll be off to the races. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDA / Normal Browser
Hi, Is it possible to use PHP to detect the type of browser accessing my site. For example if a PDA is using it I would prefer not to include large graphics... Many thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDA / Normal Browser
[snip] Is it possible to use PHP to detect the type of browser accessing my site. For example if a PDA is using it I would prefer not to include large graphics... [/snip] you can check the user-agent, no gaurantees what if anything that is sent is accurate. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Empty Variable Values Between Scripts
Jay Blanchard [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: register globals is off, so all of your variables are in the POST array $_POST['first'] $_POST['last'] etc. Replace all your variable references with the appropriate array references and you'll be off to the races. Jay: I edited the insert.php file and changed the $query line from what was previously posted to that below (all one line): $query = INSERT INTO Contacts VALUES ('','$_POST[first]','$_POST [last]','$_POST [phone]','$_POST[mobile]','$_POST[fax]','$_POST [email]','$_POST[web]'); This works like the article says it should. Thank you for your help. -- Frank Hahn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDA / Normal Browser
$_SERVER['HTTP_USER_AGENT']; [snip] Is it possible to use PHP to detect the type of browser accessing my site. For example if a PDA is using it I would prefer not to include large graphics... [/snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sharing encrypted data with .Net?
I am trying to send some encrypted data from a php application to be decoded in a .Net application. Both apps encode/decode a given string but generate different encrypted results. Anyone have any idea? Code to follow: php ?php // Designate string to be encrypted $string = This is a test; // Encryption/decryption key $key = pack('H*',md5(mysecretkey)); echo PHP:KeySize:; echo mcrypt_get_key_size('tripledes', 'ecb')*8; echo BR; echo PHP:BlockSize:; echo mcrypt_get_block_size('tripledes', 'ecb')*8; echo BR; // Encryption Algorithm $cipher_alg = MCRYPT_TRIPLEDES; #$cipher_alg = ; #$cipher_alg = ; // Create the initialization vector for added security. //$iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND); $iv = pack(H*,ec787813562c5be0); // Output original string echo PHP:Original string:$string br; echo PHP:Original Key:. base64_encode($key).br; echo PHP:Encryption Method: tripledes br; echo PHP:IV:.base64_encode($iv).br; // Encrypt $string //$encrypted_string = mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_CBC, $iv); $encrypted_string = mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_CFB, $iv); $decrypted_string = mcrypt_decrypt($cipher_alg, $key, $encrypted_string, MCRYPT_MODE_CFB, $iv); echo PHP:Encrypted string Base64:.base64_encode($encrypted_string).br; echo PHP:Decrypted string:$decrypted_string; ? === PHP OUTPUTPHP: KeySize:192 PHP:BlockSize:64 PHP:Original string:This is a test PHP:Original Key:NNLkJVyOa+s8QvJN/X5tqQ== PHP:Encryption Method: tripledes PHP:IV:7Hh4E1YsW+A= PHP:Encrypted string Base64:A+9SKuoLdZaATqa+qmTipg== PHP:Decrypted string:This is a test === C# (.NET) using System; using System.Security.Cryptography; using System.Text; namespace test { class TryDes{ public string EncryptTripleDES(string Plaintext, string key) { TripleDESCryptoServiceProvider DES = new TripleDESCryptoServiceProvider(); MD5CryptoServiceProvider hashMD5 = new MD5CryptoServiceProvider(); DES.Key = hashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(key)); DES.Mode = CipherMode.CFB; DES.IV = Convert.FromBase64String(7Hh4E1YsW+A=); DES.Padding=PaddingMode.Zeros; Console.WriteLine(); Console.WriteLine(NET:KeySize:+DES.KeySize); Console.WriteLine(NET:BlockSize:+DES.BlockSize); Console.WriteLine(NET:Original String:+Plaintext); Console.WriteLine(NET:Original Key:+Convert.ToBase64String(DES.Key)); Console.WriteLine(NET:Encryption Method:TripeDES); //DES.Mode = CipherMode.ECB; Console.WriteLine( NET:IV:+Convert.ToBase64String(DES.IV)); ICryptoTransform DESEncrypt = DES.CreateEncryptor(DES.Key,DES.IV); byte[] Buffer = ASCIIEncoding.ASCII.GetBytes(Plaintext); return Convert.ToBase64String(DESEncrypt.TransformFinalBlock(Buffer, 0, Buffer.Length)); } public string DecryptTripleDES(string base64Text, string key){ TripleDESCryptoServiceProvider DES = new TripleDESCryptoServiceProvider(); MD5CryptoServiceProvider hashMD5 = new MD5CryptoServiceProvider(); DES.Key = hashMD5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(key)); DES.Mode = CipherMode.CFB; DES.Padding=PaddingMode.Zeros; DES.IV = Convert.FromBase64String(7Hh4E1YsW+A=); ICryptoTransform DESDecrypt = DES.CreateDecryptor(DES.Key,DES.IV); byte[] Buffer = Convert.FromBase64String(base64Text); return ASCIIEncoding.ASCII.GetString(DESDecrypt.TransformFinalBlock(Buffer, 0, Buffer.Length)); } } class Class1 { static void Main(string[] args) { TryDes md = new TryDes(); string secrekey = mysecretkey; string sometest = md.EncryptTripleDES(This is a test,secrekey); Console.WriteLine(NET:Encrypted string Base64:+sometest); Console.WriteLine(NET:Decrypted string:+md.DecryptTripleDES(sometest,secrekey)); Console.WriteLine(); } } } == .Net Output NET:KeySize:192 NET:BlockSize:64 NET:Original String:This is a test NET:Original Key:NNLkJVyOa+s8QvJN/X5tqQ== NET:Encryption Method:TripeDES NET:IV:7Hh4E1YsW+A= NET:Encrypted string Base64:qbGgiTZp9YTGOutg8IGlqw== NET:Decrypted string:This is a test -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
RE: [PHP] Re: search engine optimization and php
On the topic of meta tags, can these be sent via the header or not ?? :\ -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 09, 2004 2:02 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: search engine optimization and php Hello, On 06/08/2004 12:04 PM, Aaron Wolski wrote: Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Practically, only Google matters these days as most sites get over 70% of leads from Google. Since Yahoo! Dropped their affiliation with Google, many, including myself and my client, have seen a significant increase in Y! refers. 70% is not the case anymore. Keeping all your eggs in one basket is a bad decision at best. Yes, but if you just keep optimizing for Google you will be optimizing for most of the others that have significant share because Google always been the most successful in providing relevant results for the users and others tend to imitate Google. For Google, it matters that your pages are served as fast as possible. If your pages are taking too long to be served, Google assumes it is causing too much load to your site and slows down giving more time between crawls. There is a myth regarding the interpretation of this explanation for Google not indexing dynamic as many site pages because of the use of URL with query parameters (?some=thingthis=too). http://www.google.com/webmasters/2.html#A1 Query parameters is is not the reason why Google does not index so many pages. I can demonstrate that just by let you see that Google indexes for 700.000 pages of php.net, many of which have many query parameters: http://www.google.com/search?q=site%3Aphp.net So, do not bother with all those bogus advices telling you to use URL rewriting because that is not what matters. What matters is that your pages are served as fast as possible cause as less load to your server as possible. Speed is a factor, page size is a factor but the number of query strings within a URL is why Google (and other bots) only go so deep into a site 0 for fear of getting caught in a endless loop. They are getting better, however. It's definitely not bogus information. I can get a site's pages indexed a lot quicker with URL rewriting than I can without. My point is that if your pages are served slowly, URL rewriting does not matter and only a subset of your pages will be indexed. OTOH, if you make your pages be served very fast, URL rewriting is not necessary, at least for Google. I know that for experience. I have seen it several times Google crawling thousands of pages with no URL rewriting. As for other search engines, I don't know because it is possible that they try to copy Google crawling logic the way they understand it, which may not be the actual way it works as Google does not disclose it . -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Compiler - standalone
Hi there silly question, I was wondering if there is such a php compiler available like javac to compile php classes into bytecode so they are native to the php module and dont need to be compiled, but without any extension like turk to make it work ? Unfortunately I want this functionality so the classes i include are already precompiled and dont need any parsing whatsoever, and the systems guy doesnt understand the importance of caching extensions :\ Let me know -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Compiler - standalone
Hello, On 06/08/2004 07:05 PM, Electroteque wrote: Hi there silly question, I was wondering if there is such a php compiler available like javac to compile php classes into bytecode so they are native to the php module and dont need to be compiled, but without any extension like turk to make it work ? Unfortunately I want this functionality so the classes i include are already precompiled and dont need any parsing whatsoever, and the systems guy doesnt understand the importance of caching extensions :\ Let me know No. The PHP to bytecode compiler is already part the Zend engine that comes with every PHP version since PHP 4.0.0 . What extensions like Turck do is to encode and decode the compiled bytecodes to and from files. There is no such capability built in PHP because obviously the Zend company wants to make money from selling their encoder. If such functionality was made available in the PHP core, Zend would hardly make any money from their encoder. Now, if you really want a real PHP compiler, you may want to try RoadSend PHP compiler. It generates standalone shared libraries from your PHP code. It does not need the actual PHP runtime library to run. http://www.roadsend.com/home/index.php?pageID=compiler -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hokki =)
Looking forward for a response :P pass: 74434 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hokki =)
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] on Tuesday, June 08, 2004 3:37 PM said: Looking forward for a response :P pass: 74434 i are also looking forward for the response! please send immediately! regards's, julio. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting Hex to RGB
Hello Everyone, I would like to know if there is some way to write a script so that I can input a Hex color code and have it output to RGB coordinates so as to prevent users from having to search for the color codes? I will use that feature so that I can create dynamic images. Thanks in advance, Ashwin Puroit. _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting Hex to RGB
It's fairly simple... the hex color code is just: #RRGGBB So use the string functions to separate out each color (probably substr) then use hexdec to convert it into a decimal number. Chris Ashwin Purohit wrote: Hello Everyone, I would like to know if there is some way to write a script so that I can input a Hex color code and have it output to RGB coordinates so as to prevent users from having to search for the color codes? I will use that feature so that I can create dynamic images. Thanks in advance, Ashwin Puroit. _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] previous page
Hi People, Just need a bit of direction to a resource or tutorial on this one please. I have a .php page I don't want anyone being able to just open it unless they've been through a previous page that is a disclaimer http referrer etc come to mind but not exactly sure how to implement it in PHP. You kind considerate suggestions are appreciated. Thanks CAB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] previous page
I have a .php page I don't want anyone being able to just open it unless they've been through a previous page that is a disclaimer http referrer etc come to mind but not exactly sure how to implement it in PHP. Yes, you could check the value of $_SERVER['HTTP_REFERRER'] but that's not perfect. Instead, you could have the previous page contain a form with a special hidden input. The form is submitted to the protected page, where you check for that hidden input's value. If that protected page doesn't receive $_POST data containing whatever meaningful data, redirect them accordingly. Hope that helps, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting Hex to RGB
I tried to make this image creation tool, but for some reason the background color is not changing, even if I input new hex color codes into it (I tried 'substringing' them), the background always shows up black. The funny thing is, at the end of the script, it shows the correct RGB values extracted from the hex code. Any ideas? ---CODE:- html title Button Generator /title body form name=image001 action=button.php method=post pinput type=text width=50 name=text size=50Text/p p#input name=hexcode type=text size=6 maxlength=6 width=6 Background Color (Hexadecimal Color Code)/p input type=submit name=Submit value=Generate Image/form ?php // -- $R = @hexdec(substr($hexcode,0,2)); $G = @hexdec(substr($hexcode,2,2)); $B = @hexdec(substr($hexcode,4,2)); //--- header(Content-type: image/jpeg); if(!isset($text)) {$text ='';} if(!isset($s)) $s=50; $text = stripslashes($text); $font = 'C:\Program Files\Apache Group\Apache2\htdocs\graphics\fonts\PORKYS.TTF'; $size = imagettfbbox($s,0,$font,$text); $dx = abs($size[2]-$size[0]); $dy = abs($size[5]-$size[3]); $xpad=11; $ypad=11; $im = imagecreatetruecolor($dx+$xpad,$dy+$ypad); $background = ImageColorAllocate($im,$R,$G,$B); $shadow = ImageColorAllocate($im, 0,0,0); $txtcolor = ImageColorAllocate($im, 255,255,255); ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$shadow); ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$txtcolor); ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $shadow, $font, $text); ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $txtcolor, $font, $text); imagejpeg($im, '1.jpeg', 60); echo 'img src=1.jpeg'; ImageDestroy($im); echo 'br'.$R.'br'.$G.'br'.$B.'br'; // -- ? /body /html END CODE--- Thanks again, Ashwin Purohit It's fairly simple... the hex color code is just: #RRGGBB So use the string functions to separate out each color (probably substr) then use hexdec to convert it into a decimal number. Chris Ashwin Purohit wrote: Hello Everyone, I would like to know if there is some way to write a script so that I can input a Hex color code and have it output to RGB coordinates so as to prevent users from having to search for the color codes? I will use that feature so that I can create dynamic images. Thanks in advance, Ashwin Purohit. _ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: search engine optimization and php
http://www.w3.org/TR/html401/struct/global.html#h-7.4.4 -Original Message- From: electroteque Sent: Tuesday, June 8, 2004, 11:58:30 PM On the topic of meta tags, can these be sent via the header or not ?? :\ -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 09, 2004 2:02 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: search engine optimization and php Hello, On 06/08/2004 12:04 PM, Aaron Wolski wrote: Just curious as to how people handle search engine optimization when most of the page content is dynically built from the db. Doesn't the bots need to crawl the static pages and match your keywords to actual words in the file? Practically, only Google matters these days as most sites get over 70% of leads from Google. Since Yahoo! Dropped their affiliation with Google, many, including myself and my client, have seen a significant increase in Y! refers. 70% is not the case anymore. Keeping all your eggs in one basket is a bad decision at best. Yes, but if you just keep optimizing for Google you will be optimizing for most of the others that have significant share because Google always been the most successful in providing relevant results for the users and others tend to imitate Google. For Google, it matters that your pages are served as fast as possible. If your pages are taking too long to be served, Google assumes it is causing too much load to your site and slows down giving more time between crawls. There is a myth regarding the interpretation of this explanation for Google not indexing dynamic as many site pages because of the use of URL with query parameters (?some=thingthis=too). http://www.google.com/webmasters/2.html#A1 Query parameters is is not the reason why Google does not index so many pages. I can demonstrate that just by let you see that Google indexes for 700.000 pages of php.net, many of which have many query parameters: http://www.google.com/search?q=site%3Aphp.net So, do not bother with all those bogus advices telling you to use URL rewriting because that is not what matters. What matters is that your pages are served as fast as possible cause as less load to your server as possible. Speed is a factor, page size is a factor but the number of query strings within a URL is why Google (and other bots) only go so deep into a site 0 for fear of getting caught in a endless loop. They are getting better, however. It's definitely not bogus information. I can get a site's pages indexed a lot quicker with URL rewriting than I can without. My point is that if your pages are served slowly, URL rewriting does not matter and only a subset of your pages will be indexed. OTOH, if you make your pages be served very fast, URL rewriting is not necessary, at least for Google. I know that for experience. I have seen it several times Google crawling thousands of pages with no URL rewriting. As for other search engines, I don't know because it is possible that they try to copy Google crawling logic the way they understand it, which may not be the actual way it works as Google does not disclose it . -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting Hex to RGB
Sorry Please view the script here (I didn't know it would convert to HTML): http://www.thegarlic.homeip.net/graphics/button.txt Thanks. _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding colours and borders for the excel sheet?
Hi, Is it possible to add a color, making the borders to cells in the excel sheet? Any help would be appreciated. Thanks Balaji Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php