What is RSS?
PHP web-programming
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > PHP web-programmingGo to page: « previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:
Friday, 26 January 2007
Send Email to Mobiles Marcelo Ferrufino Murillo 12:42:28
 Hi guys, I need to send a email to mobiles I don t know if I have to use the
function "mail( )" or if I have to use other one. Thanks your help
comment 2 answer | Add comment
php from address Chantal Rosmuller 12:07:30
 Hi everyone,

In November I sent a mail to this list asking how to get the mail From header
right, I solved that but I still have a problem. The solution was using
the -f option like this:

$frommail = "user@domain.com";
mail("$to", "$subject", "$message", "$headers","-f$from­mail");

The from address is correct now but the displayed name is still www-data (or
apache, depends on the server configuration). The header looks like this:

From: user@domain.com (www-data)

Is there anyway to change this?
Thanks, regards Chantal

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 2 answer | Add comment
PHP 5.2.0 + qmail problem Bc. Radek Krejca 11:01:25
 Hello,

I had to change my mailserver from sendmail to qmail. After it I saw
that the mail generated by function mail() has 2 newlines in body except 1.
I have this konfiguration on server with php4xx and no problem is
there. Also if I change back sendmail so it is working too.

The output with this problem is:
-------------------­--------------------­--------------------­-------------------
Content-Type: text/plain; charset="utf-8"
Content-Transfer-En­coding: base64
X-Qmail-Scanner-1.2­5: added fake MIME-Version header
MIME-Version: 1.0

SVA6IDEwLjQuMjQuMjQ­yClRhcmlmOiBBS0NFIC0­gSU5URVJORVQgMTAyNDA­vMTAyNDAgLSAyMDQ4

TUIgRlVQIDM4NApVxb5­pdmF0ZWw6IEphbiBMVUv­DgcWgCkZpcm1hOiBKYW4­gTFVLw4HFoApBZHJl

c2E6IEouQmVuZHkgMjg­KMzcwIDA1IMSMZXNrw6k­gQnVkxJtqb3ZpY2UKQnJ­hbmE6IDEyCkJvZDog
-------------------­--------------------­--------------------­-------------------

but should be
-------------------­--------------------­--------------------­-------------------
Content-Type: text/plain; charset="utf-8"
Content-Transfer-En­coding: base64
X-Qmail-Scanner-1.2­5: added fake MIME-Version header
MIME-Version: 1.0

SVA6IDEwLjQuMjQuMjQ­yClRhcmlmOiBBS0NFIC0­gSU5URVJORVQgMTAyNDA­vMTAyNDAgLSAyMDQ4
TUIgRlVQIDM4NApVxb5­pdmF0ZWw6IEphbiBMVUv­DgcWgCkZpcm1hOiBKYW4­gTFVLw4HFoApBZHJl
c2E6IEouQmVuZHkgMjg­KMzcwIDA1IMSMZXNrw6k­gQnVkxJtqb3ZpY2UKQnJ­hbmE6IDEyCkJvZDog
-------------------­--------------------­--------------------­-------------------

It makes me problem if I use Content-Transfer-En­coding: 8bit.

My idea is that qmail doesn't trim body of message and newer PHP
too bud I don't know if I am right.

Where could be a problem?

--
S pozdravem,
Bc. Radek Krejca
ICQ: 65895541

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
how to delete all entries on the address book Angel 10:45:17
 

Is that possible?

How... ?Sent from the phpGroupWare forums @ http://forums.phpGr­oupWare.org
comment 3 answer | Add comment
Validating a link in php Guest 08:47:03
 Hi all,

I'm hoping y'all can help me with a bit of a php code problem I'm having.

What I'm trying to do is link to YouTube videos (more than one in a single
webpage). However, because I'm worried about the videos going away and the
links going bad, I'd like to use PHP to check if the link is good; if it's
good, display the video link, else display a static image that I have on my
servers.

Where I'm having troubles is in the checking of whether the url is good. I
think part of the problem is YouTube itself. I've tried file() and
fsockopen(), but neither seem to work.

Below is an example of the block of code I'm trying to write.

<?
error_reporting(E_A­LL ^ E_NOTICE);
if (the "http://www.youtube­.com/v/JqO8ZevPJNk" url is valid) <-- ???
{
echo " <object height=\"400\" width=\"475\">\n";
echo " <param name=\"movie\" value=\"http://www.­youtube.com/v/JqO8Ze­vPJNk\">\n";
echo " <embed src=\"http://www.yo­utube.com/v/JqO8ZevP­JNk\"\n";
echo " type=\"application/­x-shockwave-flash\" height=\"400\" width=\"475\">\n";
echo " </object>\n";
}
else
{
echo " <a href=\"10538overtur­evideo.jpg\"><img SRC=\"10538overture­video.jpg\" height=\"130\"></a>­\n";
}
?>

Many thanks for any assistance you can provide.

Robert Porter

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 6 answers | Add comment
Parsing AJAX post data -- The Way M5 08:02:31
 Just wondering what smart people do for parsing data sent by the
Javascript XMLHTTP object--e.g., http.send("post",ur­l,true)...

In a normal form submit, the $_POST global nicely allocates form
elements as array elements automatically. But with the AJAX way, the
data get stuffed inside $HTTP_RAW_POST_DATA­ as a string, thereby
making extraction more tedious.

Any ideas?

...Rene

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 9 answers | Add comment
how to use odbc??? Bedul 07:55:56
 can u give me url to have odbc example..

or i give the problem..

i want to connect to this odbc.. u may click
http://indoupload.n­et/files/view/803/od­bc%20problem.jpg

how to connect to the odbc and then execute sql.
any question about the problem.. i will gladly answer

--
PHP Windows Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
JPEG info needed Gerry D 04:19:03
 I need PHP to find out if a jpeg file uses progressive encoding. None
of the standard exif or image functions seem to be able to tell me
that. (please correct me if I'm wrong)

Can anybody help me?

TIA

Gerry

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 6 answers | Add comment
preg_match problem Chris N 00:41:04
 Ok heres the situation, I have a string like this

$this->_item["title"] = "28.09.02 - Some silly Text (First) (Second)";

Im trying to do a preg_match on it to check it to make sure its in a certian
format. Heres my preg_match

preg_match("/^(\d+)­\.(\d+)\.(\d+)\s+\-\­s+(.+)\s+\((.+)\)$",­
$this->_item["title"], $matches);
list($all, $one, $two, $three, $four, $five) = $matches;

What Im getting returned in this

$one = 28
$two = 09
$three = 02
$four = Some silly Text
$five = First) (Second

What I want is

$four = Some silly Text (First)
$five = Second

Can anyone see where Im going wrong? The match may be really crude, Im still
pretty new to regular expressions. But it works just fine as long as there
is only one set of ().

Chris N.



--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 34 answer | Add comment
Version Info David Jenzen 00:41:04
 How can I tell what versions of phpGroupware I really have installed? This
may be a stupid question, but you never know until you ask. I have or think
I have upgraded to 0.9.14.RC3 via tar ball, but when I login it shows
"Powered by phpGroupware version 0.9.13.018 on the screens. I also have:
Would you like phpGroupware to check for a new version
when admins login ?: Yes
Would you like to show each application's upgrade status ?: Yes

in my Admin setup. When I login as an administrator it shows:

The API is current
This application is current

on the screens. I have run the cvs -z3 update -dP also and still have the
same version numbers. Shouldn't I show something like "Powered by
phpGroupWare version 0.9.14.RC3" on my screens?

Thanks
comment 3 answer | Add comment
most powerful php editor Vinicius C Silva 00:41:04
 hi everyone!

i'd like to ask something maybe commonly asked here. what is the most
powerful php editor?
comment 53 answer | Add comment
Thursday, 25 January 2007
[PHP-DEV] PHP 5.2.1RC3 Released Ilia Alshanetsky 22:14:00
 -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The 2nd release candidate for PHP 5.2.1 is now available for
download. The tarballs can be found here:

http://downloads.ph­p.net/ilia/php-5.2.1­RC3.tar.bz2
(d3889eda8c3471ce7c­f2adb35a4de736)
http://downloads.ph­p.net/ilia/php-5.2.1­RC3.tar.gz
(c5b3e5540d1951d4c4­b976b8a39c09ab)

and the Win32 binaries will be available in short order.

Since the last release, there are over 20 different bug fixes
resolving some annoying engine issues such as the tempval leak inside
foreach(). We do not anticipate any regressions to be introduced by
this RC, but I would still like to ask everyone to take a few minutes
and test it against their code base. If you come across any issues
please report them at http://bugs.php.net­/.

Depending on the stability of this release it may either be followed
by a final release or another RC, therefor your feedback is critical
to determining whether or not the code is stable enough to warrant
the 5.2.1 final.

Ilia Alshanetsky
5.2 Release Master


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFsBJOLKekh38­1/CERAq/MAKCKg7buIpB­9hXWrtnfHN7hQPB6akgC­eJy8q
Q/HBl5G15afjTjebEaI­LHlE=
=tsFU
-----END PGP SIGNATURE-----

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 24 answer | Add comment
[PHP-DEV] COM extension defects: Possible patch for defect 35464 Andy Wharmby 20:10:59
 Hi Internals
Attached is a suggested patch for COM defect 35464
(http://bugs.php.ne­t/bug.php?id=34564) Any comments; good or bad welcome.
Regards
Andy

Andy Wharmby
IBM United Kingdom Limited
Winchester, England SO21 2JN
E-mail: andy_wharmby@uk.ibm­.com

COM defect 35464
================

The following details 2 reasons why in/out parameters don't work; one
caused by a problem with tetscase another a defect in COM extension code.
The testcase supplied by the raiser implements the DWebBrowserEvents2
interface to register an handler for the BeforeNaviagte2 event. This
handler is passed just one in/out parameter; a VARIANT_BOOL which can
be set to TRUE by the handler to cancel the navigation operation.
Doing so in PHP currently has no affect, for the 2 reasons I will
describe below, so the navigation completes and the specified page is
displayed by IE.

Issue 1
======
The users code is attempting to modify the variant directly in PHP code
as follows:

$cancel = true;

rather than using the COM method variant_set as follows:

variant_set($cancel­, true);

With this correction to the PHP script in place the variant for $cancel
is correctly changed to TRUE but IE still navigates to the requested page
so the modification is having no effect. The reason for this is the
subject of issue 2 below.

Issue 2
======
When an event notification is received by the COM extension
disp_invokeex() processes the incoming parameters (variants) by taking
each one
and wrapping it in a php_com_dotnet_obje­ct object. At this time a COPY
of the incoming variant is embedded into the php_com_dotnet_obje­ct so we
immediately have 2 copies of the variant and it is this copy in the
php_com_dotnet_obje­ct which is processed (get and set) by the PHP code.
I see no code that checks for modification to our copy in the
php_com_dotnet_obje­ct before returning to the caller (in this case IE)
so modification
to in/out parameters by the PHP code has no affect.

Given that the code copies an incoming variant in php_com_wrap_varian­t()
I would have expected to see some code prior to return in disp_invokeex()
which checks for modifications to in/out parameters and copies any
modified values back to the callers copy of the variant.

I have hacked some code as follows:
com_wrapper.c: http://www.pastebin­.ca/328026
com_variant.c: http://www.pastebin­.ca/328022
com_misc.c: http://www.pastebin­.ca/328025
php_com_dotnet_inte­rnal.h: http://www.pastebin­.ca/328027

The new code works as follows:
(1) When a variant is modified by a call to variant_set() in
com_variant.c a new flag (obj->modified) is set in the
php_com_dotnet_obje­ct.

(2) After a successful call to a event handler new code in
com_wrapper.c function disp_invokeex() checks each of the event
handlers arguments
(php_com_dotnet_obj­ect's ) to see if any of their embedded variants
have been modified. If so and the argument passed into the event handler was
passed by reference then the value in the embedded variant is copied to
the callers copy by a call to a new function php_com_copy_varian­t()
defined in com_variant.c.

With this patch applied when the supplied testcase is run the navigation
is now cancelled as expected.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 1 answer | Add comment
sortind arrays William Stokes 17:54:28
 Hello,

How can I sort an array like this so that it would be ASC ordered by the [1]
key in subarrays? I need to maintain only the subarray key - value pairs.
(Do I make sense?)

Array
(
[0] => Array
(
[0] => Logo
[1] => NameC
[2] => Home
[3] => url
)

[1] => Array
(
[0] => Logo
[1] => NameA
[2] => Home
[3] => url
)

[2] => Array
(
[0] => Logo
[1] => NameG
[2] => Home
[3] => url
)
}

Cheers!
-Will

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 5 answers | Add comment
Unserialize problem (and or bug) Sancar Saran 11:57:37
 Hi,

After updating company test server to dotdeb 5.2.0 it star to give memory
problems (even 32mb session). I tought it was because of suhosin. And I
cannot update that server to vanilla debian php5 package because it was a
sarge so today my company gives me another debian etch (like my home pc). I
setup latest php 5.2.0.8 for debian etch.

Then unserialize gives another problem

Message: unserialize(): Error at offset 1384 of 3177 bytes
Code: 8
Line: 419

My pc uses debian etch and have php 5.1.6-5 my scripts working normally.

Is there any suggestion for handle this ?

Regards

Sancar

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 5 answers | Add comment
[PHP-DEV] OWASP Spring of Code 2007 - tentative call for PHP security proposals Andrew van der Stock 08:58:57
 Hi there,

OWASP has just concluded the Autumn of Code 2006, which was very successful
in getting some great security projects matured or completed, including the
Testing Guide, which is a great resource for penetration testers.

http://www.owasp.or­g/index.php/Owasp_Au­tumn_Of_Code_2006

It was so successful, we are about to launch OWASP's Spring of Code 2007. We
will be funding approximately 10-15 projects with approximately $80-100k USD
between them. We are trying to increase both the number and dollars by
gaining corporate sponsorships (see last paragraph if you can help with
that), but we will spend at least $80k USD this time around.

As PHP applications make a large percentage of CVE entries (for whatever
reason), I'd like to invite those active in PHP security to consider working
on ways to improve the PHP security story for all PHP apps, regardless of
the skill / knowledge of the devs pumping out PHP apps.

Some ideas - please take these as a starting point, not an end point:

* Hack on, mature and hopefully ship open source projects already someway
along the security path, (such as Zend Framework or CodeIgnitor or your
project here) which plug known webappsec gaps, like input and output
validation, prevent SQL injection by default, and provide robust logging and
authC/authZ services etc.

* Research root causes of "typical" PHP application security issues, and
develop materials, new / improved API's, recommend deprecation or attack
surface reduction for certain interfaces or features and so on to *actually*
eliminate these issues once and for all

* ... Your idea here ...

We are looking at funding ideas / projects with concrete deliverables over a
three-four month time frame starting around the beginning of the northern
hemisphere spring. We look favorably upon submissions which completely
remediate webappsec issues for a wide swathe of PHP apps, but we will also
be looking at assisting those who wish to pursue basic research to make PHP
safer in the medium to long term.

The only restriction is that the work has to be released under an
acknowledged open source license, which goes for documentation, too. We
cannot fund closed source or proprietary projects. We can provide incubator
space if you have nowhere else to work (CVS or SVN, mail lists, web space,
blogs, forum, etc).

We will be providing access to security mentors so you can bounce ideas or
collaborate as you see fit. Why a webappsec specialist? We simply want to
provide you with enough information and a way to bounce your ideas to avoid
things like safe mode or similar which aren't actually that secure.

The SoC effort has not kicked off yet as we have not finalized many details
- including some really interesting ones. We will be accepting submissions
starting sometime in February for at least a month. Please discuss amongst
yourselves as appropriate, and if at all possible, consider submitting a
proposal or three when the OWASP SoC opens up.

If you are in a position to help fund any submission (outright or dollar for
dollar, etc) or just wish to help the OWASP Spring of Code program, please
contact owasp@owasp.org for more details. The typical commitment to a
particular project is $2.5 to $10k USD, depending on how many folks are
being funded / complexity of effort. This is your chance to get your
favorite PHP security project matured / finished!

Andrew van der Stock
Executive Director, OWASP

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/­unsub.php


Add comment
where match question Don 03:56:00
 I have a db field that contains zip codes separated by comas.

I am trying to get php to return all of the rows that contain a particular
zip code.



$query = "SELECT * FROM info WHERE MATCH (partialZIP) AGAINST ('$zip')";

$result = mysql_query($query)­

or die ("could not connect to db");

$row = mysql_fetch_row($re­sult);





this works if there is only one row that contains that zip code.



If there is more than one row that contains the zip, it returns 0 rows.
('It' being MYSQL that returns 0 rows. I checked this by running the query
directly to the DB)



Any ideas are very much appreciated.



Thanks,



Don





comment 17 answers | Add comment
How to make Browse Folder Dialog Aslam Bari 03:45:10
 
Dear All,
I m new in this Forum. I m making a project in which i need to show user a
Browse Folder Dialog Box, In which he can select a folder and after this i
will do some manipulation on that folder's content. So the problem is that i
could not found any sample on Web , how to show "Folder Dialog" in any way
(HTML, JavaScript, PHP etc). Plz has anybody some idea how to do some work
around this.

Thanks...
--
View this message in context: http://www.nabble.c­om/How-to-make-Brows­e-Folder-Dialog-tf30­79100.html#a8554729
Sent from the PHP - General mailing list archive at Nabble.com.

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 6 answers | Add comment
Regular Expression Problem Martin Clifford 00:39:13
 Hey all!

I'm trying to get this darn eregi_replace() to work, but it doesn't produce any results at all.

I want it to find all occurances of PHP variables. Here is the regexp

$output = eregi_replace("^[\$]{1,­2}[a-zA-Z][0-9]+$", "<b>\\1</b>", $var);

As you might guess this is for a syntax highlighting function I am trying to write. Anyone have any ideas why it's not working? Please copy me directly, as I'm on the digest. Thanks!

Martin


--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 21 answer | Add comment
[PHP-DEV] technical question Oliver Block 00:39:13
 Hello,

As far as I understood, php loads requires modules at startup. Which impact
does that have on which function a developer can call from within an
extension. I mean, is it possible to call functions from other extensions
besides ext/standard? And how?

Regards,

Oliver

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 1 answer | Add comment
Debugging itpc Skip Evans 00:39:13
 Hey all,

I'm working on a site that allows users to build
libraries of podcasts, and one of the calls to a
PHP file is itpc, not http.

Hence I don't have the ability to echo data for
debugging, and I also don't have write access to
any dirs to fopen and fwrite data.

Any suggestions for other ways to debug this
script file?
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypengui­n.com
=-=-=-=-=-=-=-=-=-=­
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bi­gskypenguin.com/

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 4 answer | Add comment
Package php code Peter Lauri 00:39:13
 Hi,



Is there any similar way to package PHP software as Java with a jar file or
similar? I have never seen it, because then would probably Smarty for
example be packaged already :-)­ This question came out of the blue when I
was thinking about how to deliver some plugins to a customer.



Best regards,

Peter Lauri



<http://www.dwsasia­.com/> www.dwsasia.com - company web site

<http://www.lauri.s­e/> www.lauri.se - personal web site

<http://www.carbonf­ree.org.uk/> www.carbonfree.org.­uk - become Carbon Free



comment 3 answer | Add comment
Wednesday, 24 January 2007
To many connections error message Kevin Murphy 22:13:51
 I'm working with my host to resolve why I am getting these error
messages, but in the meantime, I am getting this message on the website:

Warning: mysql_connect(): Too many connections in /path/number/user/
code/connect.php on line 10
Sorry: Could not connect to database. Please contact the webmaster at
murphy63@wncc.edu

Where my connection code is:

$con = mysql_connect($host­, $dbuser, $pw)
or die("Sorry: Could not connect to database. Please contact the
webmaster at murphy63@wncc.edu")­;
@mysql_select_db($d­b,$con);

The questions is, since I don't have error reporting turned on, why
am I getting an error message that includes the complete path to my
connect script.... something I would like to not be telling the
general public? Is there a way to suppress that?

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326


comment 4 answer | Add comment
[PHP-DEV] [Patch] mysql_set_charset for mysql ext Scott MacVicar 20:51:37
 Hi,

Attached is a patch that adds a mysql_set_charset function to the MySQL
extension, its for all branches at the moment and ideally it should be
applied to all.

Before anyone starts advocating that everyone upgrades to PHP5 and use
MySQLi its not always realistic for some and other people are just stubborn.

The reason for the patch is that the mysql_set_character­_set function
provided by the MySQL API sets the internal MySQL character set for the
connection which is referenced by functions such as
mysql_real_escape_s­tring.

Without the ability to change the character set on the connection users
use the SET NAMES 'charset' query which lacks the ability to update the
internal character set.

In certain cases this can lead to an SQL Injection. I'll simply refer
everyone to a blog entry by Ilia
http://ilia.ws/arch­ives/103-mysql_real_­escape_string-versus­-Prepared-Statements­.html

I'd like this consider this a security issue and get it applied to the
PHP 4 branch even though active development is more or less finished.

Cheers,
Scott


Index: ext/mysql/php_mysql­.c
===================­====================­====================­========
RCS file: /repository/php-src­/ext/mysql/php_mysql­.c,v
retrieving revision 1.226
diff -u -r1.226 php_mysql.c
--- ext/mysql/php_mysql­.c8 Oct 2006 13:34:22 -00001.226
+++ ext/mysql/php_mysql­.c18 Oct 2006 12:09:40 -0000
@@ -94,6 +94,10 @@
#define MYSQL_HAS_YEAR
#endif

+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+#define MYSQL_HAS_SET_CHARS­ET
+#endif
+
#define MYSQL_ASSOC1<<0
#define MYSQL_NUM1<<1
#define MYSQL_BOTH(MYSQL_AS­SOC|MYSQL_NUM)
@@ -166,6 +170,9 @@
PHP_FE(mysql_thread­_id,NULL)
PHP_FE(mysql_client­_encoding,NULL)
PHP_FE(mysql_ping,N­ULL)
+#ifdef MYSQL_HAS_SET_CHARS­ET
+PHP_FE(mysql_set_c­harset,NULL)
+#endif
#ifdef HAVE_GETINFO_FUNCS
PHP_FE(mysql_get_cl­ient_info,NULL)
PHP_FE(mysql_get_ho­st_info,NULL)
@@ -1119,6 +1126,48 @@
/* }}} */
#endif

+#ifdef MYSQL_HAS_SET_CHARS­ET
+/* {{{ proto bool mysql_set_charset(s­tring csname [, int link_identifier])
+ sets client character set */
+PHP_FUNCTION(mysql­_set_charset)
+{
+zval **cs_name, **mysql_link;
+int id;
+php_mysql_conn *mysql;
+
+switch(ZEND_NUM_AR­GS()) {
+case 1:
+if (zend_get_parameter­s_ex(1, &cs_name)==FAILURE)­ {
+RETURN_FALSE;
+}
+id = php_mysql_get_defau­lt_link(INTERNAL_FUN­CTION_PARAM_PASSTHRU­);
+CHECK_LINK(id);
+break;
+case 2:
+if (zend_get_parameter­s_ex(2, &cs_name, &mysql_link)==FAILU­RE) {
+RETURN_FALSE;
+}
+id = -1;
+break;
+default:
+WRONG_PARAM_COUNT;­
+break;
+}
+
+
+ZEND_FETCH_RESOURC­E2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
+
+convert_to_string_­ex(cs_name);
+
+if (!mysql_set_charact­er_set(&mysql->conn,­ Z_STRVAL_PP(cs_name­))) {
+RETURN_TRUE;
+} else {
+RETURN_FALSE;
+}
+}
+/* }}} */
+#endif
+
#ifndef NETWARE/* The below two functions not supported on NetWare */
#if MYSQL_VERSION_ID < 40000
/* {{{ proto bool mysql_create_db(str­ing database_name [, int link_identifier])
Index: ext/mysql/php_mysql­.h
===================­====================­====================­========
RCS file: /repository/php-src­/ext/mysql/php_mysql­.h,v
retrieving revision 1.38
diff -u -r1.38 php_mysql.h
--- ext/mysql/php_mysql­.h1 Jan 2006 13:09:52 -00001.38
+++ ext/mysql/php_mysql­.h18 Oct 2006 12:10:02 -0000
@@ -91,6 +91,9 @@
PHP_FUNCTION(mysql_­thread_id);
PHP_FUNCTION(mysql_­client_encoding);
PHP_FUNCTION(mysql_­ping);
+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+PHP_FUNCTION(mysql­_set_charset);
+#endif

ZEND_BEGIN_MODULE_G­LOBALS(mysql)
long default_link;


Index: ext/mysql/php_mysql­.c
===================­====================­====================­========
RCS file: /repository/php-src­/ext/mysql/php_mysql­.c,v
retrieving revision 1.174.2.29.2.2
diff -u -r1.174.2.29.2.2 php_mysql.c
--- ext/mysql/php_mysql­.c1 Jan 2006 13:46:55 -00001.174.2.29.2.2­
+++ ext/mysql/php_mysql­.c18 Oct 2006 11:54:02 -0000
@@ -93,6 +93,10 @@
#define MYSQL_HAS_YEAR
#endif

+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+#define MYSQL_HAS_SET_CHARS­ET
+#endif
+
#define MYSQL_ASSOC1<<0
#define MYSQL_NUM1<<1
#define MYSQL_BOTH(MYSQL_AS­SOC|MYSQL_NUM)
@@ -162,6 +166,9 @@
PHP_FE(mysql_thread­_id,NULL)
PHP_FE(mysql_client­_encoding,NULL)
PHP_FE(mysql_ping,N­ULL)
+#ifdef MYSQL_HAS_SET_CHARS­ET
+PHP_FE(mysql_set_c­harset,NULL)
+#endif
#ifdef HAVE_GETINFO_FUNCS
PHP_FE(mysql_get_cl­ient_info,NULL)
PHP_FE(mysql_get_ho­st_info,NULL)
@@ -1123,6 +1130,48 @@
/* }}} */
#endif

+#ifdef MYSQL_HAS_SET_CHARS­ET
+/* {{{ proto bool mysql_set_charset(s­tring csname [, int link_identifier])
+ sets client character set */
+PHP_FUNCTION(mysql­_set_charset)
+{
+zval **cs_name, **mysql_link;
+int id;
+php_mysql_conn *mysql;
+
+switch(ZEND_NUM_AR­GS()) {
+case 1:
+if (zend_get_parameter­s_ex(1, &cs_name)==FAILURE)­ {
+RETURN_FALSE;
+}
+id = php_mysql_get_defau­lt_link(INTERNAL_FUN­CTION_PARAM_PASSTHRU­);
+CHECK_LINK(id);
+break;
+case 2:
+if (zend_get_parameter­s_ex(2, &cs_name, &mysql_link)==FAILU­RE) {
+RETURN_FALSE;
+}
+id = -1;
+break;
+default:
+WRONG_PARAM_COUNT;­
+break;
+}
+
+
+ZEND_FETCH_RESOURC­E2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
+
+convert_to_string_­ex(cs_name);
+
+if (!mysql_set_charact­er_set(&mysql->conn,­ Z_STRVAL_PP(cs_name­))) {
+RETURN_TRUE;
+} else {
+RETURN_FALSE;
+}
+}
+/* }}} */
+#endif
+
#ifndef NETWARE/* The below two functions not supported on NetWare */
#if MYSQL_VERSION_ID < 40000
/* {{{ proto bool mysql_create_db(str­ing database_name [, int link_identifier])
Index: ext/mysql/php_mysql­.h
===================­====================­====================­========
RCS file: /repository/php-src­/ext/mysql/php_mysql­.h,v
retrieving revision 1.33.2.2.4.1
diff -u -r1.33.2.2.4.1 php_mysql.h
--- ext/mysql/php_mysql­.h1 Jan 2006 13:46:55 -00001.33.2.2.4.1
+++ ext/mysql/php_mysql­.h18 Oct 2006 11:41:37 -0000
@@ -91,6 +91,9 @@
PHP_FUNCTION(mysql_­thread_id);
PHP_FUNCTION(mysql_­client_encoding);
PHP_FUNCTION(mysql_­ping);
+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+PHP_FUNCTION(mysql­_set_charset);
+#endif

ZEND_BEGIN_MODULE_G­LOBALS(mysql)
long default_link;


Index: ext/mysql/php_mysql­.c
===================­====================­====================­========
RCS file: /repository/php-src­/ext/mysql/php_mysql­.c,v
retrieving revision 1.213.2.6.2.5
diff -u -r1.213.2.6.2.5 php_mysql.c
--- ext/mysql/php_mysql­.c2 Aug 2006 10:04:11 -00001.213.2.6.2.5
+++ ext/mysql/php_mysql­.c18 Oct 2006 12:05:41 -0000
@@ -101,6 +101,10 @@
#define MYSQL_HAS_YEAR
#endif

+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+#define MYSQL_HAS_SET_CHARS­ET
+#endif
+
#define MYSQL_ASSOC1<<0
#define MYSQL_NUM1<<1
#define MYSQL_BOTH(MYSQL_AS­SOC|MYSQL_NUM)
@@ -173,6 +177,9 @@
PHP_FE(mysql_thread­_id,NULL)
PHP_FE(mysql_client­_encoding,NULL)
PHP_FE(mysql_ping,N­ULL)
+#ifdef MYSQL_HAS_SET_CHARS­ET
+PHP_FE(mysql_set_c­harset,NULL)
+#endif
#ifdef HAVE_GETINFO_FUNCS
PHP_FE(mysql_get_cl­ient_info,NULL)
PHP_FE(mysql_get_ho­st_info,NULL)
@@ -1126,6 +1133,48 @@
/* }}} */
#endif

+#ifdef MYSQL_HAS_SET_CHARS­ET
+/* {{{ proto bool mysql_set_charset(s­tring csname [, int link_identifier])
+ sets client character set */
+PHP_FUNCTION(mysql­_set_charset)
+{
+zval **cs_name, **mysql_link;
+int id;
+php_mysql_conn *mysql;
+
+switch(ZEND_NUM_AR­GS()) {
+case 1:
+if (zend_get_parameter­s_ex(1, &cs_name)==FAILURE)­ {
+RETURN_FALSE;
+}
+id = php_mysql_get_defau­lt_link(INTERNAL_FUN­CTION_PARAM_PASSTHRU­);
+CHECK_LINK(id);
+break;
+case 2:
+if (zend_get_parameter­s_ex(2, &cs_name, &mysql_link)==FAILU­RE) {
+RETURN_FALSE;
+}
+id = -1;
+break;
+default:
+WRONG_PARAM_COUNT;­
+break;
+}
+
+
+ZEND_FETCH_RESOURC­E2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
+
+convert_to_string_­ex(cs_name);
+
+if (!mysql_set_charact­er_set(&mysql->conn,­ Z_STRVAL_PP(cs_name­))) {
+RETURN_TRUE;
+} else {
+RETURN_FALSE;
+}
+}
+/* }}} */
+#endif
+
#ifndef NETWARE/* The below two functions not supported on NetWare */
#if MYSQL_VERSION_ID < 40000
/* {{{ proto bool mysql_create_db(str­ing database_name [, int link_identifier])
Index: ext/mysql/php_mysql­.h
===================­====================­====================­========
RCS file: /repository/php-src­/ext/mysql/php_mysql­.h,v
retrieving revision 1.37.2.1
diff -u -r1.37.2.1 php_mysql.h
--- ext/mysql/php_mysql­.h1 Jan 2006 12:50:09 -00001.37.2.1
+++ ext/mysql/php_mysql­.h18 Oct 2006 12:02:50 -0000
@@ -91,6 +91,9 @@
PHP_FUNCTION(mysql_­thread_id);
PHP_FUNCTION(mysql_­client_encoding);
PHP_FUNCTION(mysql_­ping);
+#if (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+PHP_FUNCTION(mysql­_set_charset);
+#endif

ZEND_BEGIN_MODULE_G­LOBALS(mysql)
long default_link;



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/­unsub.php
comment 5 answers | Add comment
Re: Encoding issue with Tedd 19:17:50
 At 5:55 PM +0000 1/23/07, Dave Goodchild wrote:>This may be more of a mysql issue, but I am using php for my app so here>goes...>
I have a fee field in the database, and when users post events they can>specify entrance fee in . In some, not all, of the fields I am getting, for>example, 7 rather than . Is this an encoding issue?

My guess is that it is. There are difference
between browsers, OS's, and thus support for
multilingual code-points. Not all allow the user
to submit those types of characters and worse
yet, some allow to them to be submitted
incorrectly.

As such, if it were me and I wanted a form for
the end user to indicate what currency s/her was
entering, I would make it a selection control of
some type and thereby control the user's input.

My $0.02.

tedd
--
-------
http://sperling.com­ http://ancientstone­s.com http://earthstones.­com

--
PHP General Mailing List (http://www.php.net­/)
To unsubscribe, visit: http://www.php.net/­unsub.php


comment 5 answers | Add comment

Add new topic:

How:  Register )
 
Логин:   Пароль:   
Комментировать могут: Премодерация:
Topic:
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > PHP web-programmingGo to page: « previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | next »

see also:
[Design of JBoss Portal] - Personalize…
[Design of JBoss Portal] - Re: Error
[Design of JBoss Eclipse IDE (dev)]…
пройди тесты:
see also:
A new type of computer monitor
Employee Monitoring software review…
Review on Any DVD Cloner

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .