php-general Digest 24 Feb 2005 11:09:24 -0000 Issue 3304

Topics (messages 209304 through 209334):

Re: Web Browser Timeout on Upload Script
        209304 by: dpgirago.mdanderson.org

Re: uploading files with a single quote in the filename
        209305 by: Bret Hughes
        209306 by: neil.jansons.net
        209308 by: Jochem Maas
        209309 by: Bret Hughes
        209315 by: Dotan Cohen

Re: while loop
        209307 by: Jochem Maas

hash issues
        209310 by: Erbacher Karl
        209313 by: Jason Wong

Re: wml help,please!
        209311 by: Richard Miller

Word file to PDF
        209312 by: Kevin Javia

html_entities_decode, but ignoring embedding php tags
        209314 by: Tim Burgan

fopen and redirects
        209316 by: Warren Vail

replace special characters
        209317 by: Frank Arensmeier
        209318 by: Jason Wong
        209319 by: Stian Berger
        209329 by: Frank Arensmeier

Re: Can $_SERVER['REMOTE_ADDR']  be trusted?
        209320 by: Lester Caine
        209333 by: Marek Kilimajer

Capturing user's IP Address
        209321 by: Jacques
        209326 by: N Deepak
        209328 by: Nick Talbott

Server includes and Absolute URL
        209322 by: Jacques

Re: password case sensitive
        209323 by: William Stokes

Load a C library into extension?
        209324 by: N Deepak

Cookies
        209325 by: William Stokes
        209327 by: N Deepak
        209334 by: William Stokes

PHP slowness
        209330 by: Gerard

Identifying a user who previously created a profile
        209331 by: Jacques

Re: [PHP-DB] Accents! Pls help. Still very confused.
        209332 by: Henrik Hornemann

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
I think there is a file size argument both in the html form tag and within 
php.ini (max_file_size...? or something like that). I would try to make 
both very large, just as a test.
Anyway, I had a similar problem that was fixed by playing around with 
these settings.

David





"Matt Cassarino" <[EMAIL PROTECTED]>

02/23/2005 03:01 PM



 

To:
<[email protected]>
cc:
"Matt Cassarino" <[EMAIL PROTECTED]>




Subject:
[PHP] Web Browser Timeout on Upload Script



Hi,

I am running a simple Upload script in PHP using a HTML Form with a File 
field.  The user can browse their computer and upload a file.  It works 
great, except for large files, where the browser will timeout.  The 
timeout appears to happen after about 5 minutes.  Any ideas on how to get 
around this?

Ideal solution would be on the server side b/c I don't want to have my 
users set a browser option.

Thanks a lot!

Matt Cassarino
Cell: (206) 484-4626
Web: www.mattcass.com
Email: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
On Wed, 2005-02-23 at 16:40, [EMAIL PROTECTED] wrote:
> Thanks Bret
> 
> I have tried turning all reporting on - error_reporting(E_ALL);
> but that doesn't reveal anything significant
> 
> I have looked in the logs but there is nothing significant there.
> 
> Because the type is file in the form it is not handled like a post - the
> values go into an array called $_FILES
> 
> There seems to be no way to intercept this before the filename gets
> truncated
> 


Well for another data point when I uploaded a file using our upload form
the ' gets escaped on both IE6 (win98 running in win4lin) and galeon.

test's qoutes.jpg becomes test\'s quotes.jpg on a fedora server with
apache and php of course.

I don't suppose the file gets put into a directory named with the first
portion of the file?

FWIW here is what my form tag looks like 

 <form enctype="multipart/form-data" action="uploadFiles.php"
method="POST">

and the filechooser

 <input name="userfile" type="file" >

Bret

--- End Message ---
--- Begin Message ---
Hi Brett

My form is effectively identical to yours
<form enctype="multipart/form-data" action="/uploadfiles.php" method="post">
<b>Upload a file:</b> <input name="userfile" type="file" size="100">

No the first part of the file name is just dropped and the file with the
truncated name is saved in the correct place.

But with it escaping the quote do you mean that you end up with a file with
\ in it? That would be an illegal filename.

Neil

"Bret Hughes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Wed, 2005-02-23 at 16:40, [EMAIL PROTECTED] wrote:
> Thanks Bret
>
> I have tried turning all reporting on - error_reporting(E_ALL);
> but that doesn't reveal anything significant
>
> I have looked in the logs but there is nothing significant there.
>
> Because the type is file in the form it is not handled like a post - the
> values go into an array called $_FILES
>
> There seems to be no way to intercept this before the filename gets
> truncated
>


Well for another data point when I uploaded a file using our upload form
the ' gets escaped on both IE6 (win98 running in win4lin) and galeon.

test's qoutes.jpg becomes test\'s quotes.jpg on a fedora server with
apache and php of course.

I don't suppose the file gets put into a directory named with the first
portion of the file?

FWIW here is what my form tag looks like

 <form enctype="multipart/form-data" action="uploadFiles.php"
method="POST">

and the filechooser

 <input name="userfile" type="file" >

Bret

--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:
Thanks

some answers:
turning magic quotes on and off seemed to make no difference
1. single quotes aren't important to me but this application allows users to
upload photos which often use descriptive filenames which sometimes have
single quotes eg. "my mum's car.jpg". I replace the spaces with underscores
but I can't get to the filename before the single quote and the text before
it have been stripped.
2. the original filename is only important insofar as it often has
descriptive information in it.
3. I can't really answer this question very well except to say that it
happens in my development environment (IE6 on win2k with apache on win2k) as
well as on my hosting server (IE6 on win2k and apache on linux).

you're a webdeveloper. please install firefox :-)


"Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Hi
When uploading files using a type=file in a form, if a file is uploaded

with

a single quote the file gets truncated to whatever is after the quote
eg.
blah'sblah.txt

will be uploaded as
sblah.txt

Is this a magic quotes issue?


I don't think so, test it by turning it on/off.


What is the best way to deal with it?


couple of questions:

1. are single quotes really necessary in filenames?
2. is the original filename really that important to you?
3. does this happen on just one browser/[client]platform? it could be
a browser bug (i.e. it gets stripped on the clientside which would means
thats
its nothing to do with a PHP bug/setting/feature/misunderstanding/etc)


Neil




--- End Message ---
--- Begin Message ---
On Wed, 2005-02-23 at 18:45, [EMAIL PROTECTED] wrote:
> Hi Brett
> 
> My form is effectively identical to yours
> <form enctype="multipart/form-data" action="/uploadfiles.php" method="post">
> <b>Upload a file:</b> <input name="userfile" type="file" size="100">
> 
> No the first part of the file name is just dropped and the file with the
> truncated name is saved in the correct place.
> 
> But with it escaping the quote do you mean that you end up with a file with
> \ in it? That would be an illegal filename.
> 
> Neil
> 

Yep that is exactly what I mean.  Not sure if \it is illegal on a linux
box although unusual    The directory separator is /.  I am going to be
looking at the code soon to try and get a handle on it.  At this point I
do not know where it is coming from but I should be able to examine the
variables that get sent to the server and see where in the
browser/php/OS interaction the thing is occurring. 

I'll let you know.  I like allowing users to name files as they will and
test all my scripts that handle file names to make sure the handle
spaces well but should probably check for a few boneheaded things like
that.  A little javascript goes a  long way in these sort of situations
:)

Bret

--- End Message ---
--- Begin Message ---
> that.  A little javascript goes a  long way in these sort of situations

You don't want to do that will javascript. I, for one, surf with
javascript turned off. The malicious script kiddie, I would presume,
also would be very happy to send you a silly filename without letting
javascript check it.

Dotan Cohen
http://English-Lyrics.com
http://Song-Lyriks.com

--- End Message ---
--- Begin Message --- Reinhart Viane wrote:
Well I'm able to do that, there are only 4 different types, but the 4
queries have exactly the same syntax so I think it's better to combine them.
Not?

what about using UNION on the four queries?

--- End Message ---
--- Begin Message ---
I am creating a database where I need people to log in using a unique 
username and password. I would like to hash the passwords using the one-way 
function mhash().  However, when I try to do this, I have some issues that I 
cannot figure out.  Here is what I have (I'll include every mention of the 
variable in case I am missing something obvious):

The file that displays the sign-up form: The user enters a username and 
password into the form, the password is hashed and the hashed value is 
stored in the database.
        <input type='password' name='password' max length='50'>
        $pass=bin2hex(mhash(MHASH_SHA1, $password));
        <input type='hidden' name='pass' value='$pass'>

The input is sent to a file that verifies the data and stores it to the 
database
        $pass=$_POST['pass'];
        INSERT INTO table (username, password) VALUES ('$logname', '$pass');

Here's my big problem... I created three seperate sample users with three 
different passwords (password1, password2, password3).  When I go back to 
look at the table info in the database, it shows that all three of the 
passwords are exactly the same.  I'm not sure why this is happening.

--- End Message ---
--- Begin Message ---
On Wednesday 23 February 2005 10:25, Erbacher Karl wrote:

> Here's my big problem... I created three seperate sample users with
> three different passwords (password1, password2, password3).  When I go
> back to look at the table info in the database, it shows that all three
> of the passwords are exactly the same.  I'm not sure why this is
> happening.

I strongly suspect you're hashing an empty string.

  echo "password [$password]";
  $pass=bin2hex(mhash(MHASH_SHA1, $password));

-- 
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
------------------------------------------
New Year Resolution: Ignore top posted posts

--- End Message ---
--- Begin Message --- Does your page work in another phone? When you visit your page in a (B(normal, computer) web browser, do you see the WML code you expect?
(B
(BRichard
(B
(BOn Feb 23, 2005, at 7:33 AM, $B5m:%(B wrote:
(B
(B>
(B> Dear phpers,
(B>
(B> I'm new to wml. And I got such problem:
(B> I can browse my wml page with opera.
(B> But when I use my Nokia 7650, I always get unknown reply error.
(B> My server is redhat 9, My php is 4.2
(B> The following is one of my test page.
(B> <?php
(B> Header("Content-type: text/vnd.wap.wml; charset=UTF-8");
(B> Header("Cache-Control: Max-age=1800");
(B> /*
(B> header("Expires: 0");
(B> Header("Cache-Control: no-cache, must-revalidate");
(B> */
(B> echo '<?xml version="1.0" encoding="UTF-8"?>';
(B> echo '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" (B> "http://www.wapforum.org/dtd/wml3.dtd">';
(B> echo '<wml>
(B> <card>';
(B> //test
(B> echo "php";
(B>
(B> echo '
(B> </card>
(B> </wml>';
(B>
(B> ?>
(B>
(B> Any help would be appreciated.
(B>
(B> Sincerely,
(B> Kun
(B>
(B> -- (B> PHP General Mailing List (http://www.php.net/)
(B> To unsubscribe, visit: http://www.php.net/unsub.php
(B>

--- End Message ---
--- Begin Message ---
Hi there,

How can I convert a Word file (*.doc) to PDF file? Are there any libraries
available?

Can you give me some hint how can I do that?

Thanks.

Kevin.

--- End Message ---
--- Begin Message ---
Hello,


I have a string:
$str = '&lt;p&gt;This is a paragraph&lt;p&gt;&lt;?php echo \'hello\'; ?&gt;';


Which I convert using:
html_entity_decode(stripslashes($str));

Which result in:
<p>This is a paragraph</p><?php echo 'hello'; ?>


But.. I was the PHP tags to STAY ENCODED like: <p>This is a paragraph</p>&lt;?php echo 'hello'; ?&gt;


How do I do this..?


Thanks

Tim
--- End Message ---
--- Begin Message ---
I am using fopen with a url to open a remote file (read only of course).
The url I am providing results in a redirect and the fopen seems to be smart
enough to follow the redirect to return the actual file contents.  How can I
get at the redirected filename?

The problem is the file contains html and relative references in href's
buried in the html are relative to the redirected location and not my
original location, and I would like to subsequently open some of those files
(like a crawler does).

thanks in advance,

Warren Vail

--- End Message ---
--- Begin Message ---
Hello everybody!

I was wondering if you could help me with a little problem I ran into some days ago.

In my database I have some information about file paths. Originally, those paths come from a Windows Excel spreadsheet and look like "..\1 PDF Filer\65051.PDF". In my PHP code I try to do two things:

1) replace ".." with a string like "file://server/folder"
2) replace all "\" characters with "/".

The PHP code looks something like:

$path_to_file = "..\1 PDF Filer\65051.PDF";
$things_to_look_for = array("..", "\");
$things_to_replace_with = array("file://server/folder", "/");
$link = str_replace($things_to_look_for, $things_to_replace_with, $path_to_file);


The big problem is the character "\" which, if I got it right, in UNICODE is used for things like expressing line breaks ('\n' or something like this). The code above is resulting in the following error massage: "Parse error: parse error, expecting `')'' in /xxx/xxx/xxx/TMPz06yoces6o.php on line 2."

Is there a simple solution for this problem?

Regards,

Frank
--- End Message ---
--- Begin Message ---
On Thursday 24 February 2005 16:14, Frank Arensmeier wrote:

> 1) replace ".." with a string like "file://server/folder"
> 2) replace all "\" characters with "/".
>
> The PHP code looks something like:
>
> $path_to_file = "..\1 PDF Filer\65051.PDF";

  $path_to_file = '..\1 PDF Filer\65051.PDF';

Don't use double-quoted strings unless you *need* to. Ditto for the rest 
of your code.

> The big problem is the character "\" which, if I got it right, in
> UNICODE is used for things like expressing line breaks ('\n' or
> something like this).

"\n" is a newline character, however it has nothing to do with unicode, 
RTFM for details.

> The code above is resulting in the following 
> error massage: "Parse error: parse error, expecting `')'' in
> /xxx/xxx/xxx/TMPz06yoces6o.php on line 2."

Switch to using a decent syntax highlighting editor and these types of 
errors will be immediately obvious.

-- 
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
------------------------------------------
New Year Resolution: Ignore top posted posts

--- End Message ---
--- Begin Message --- On Thu, 24 Feb 2005 09:14:32 +0100, Frank Arensmeier <[EMAIL PROTECTED]> wrote:

Hello everybody!

I was wondering if you could help me with a little problem I ran into some days ago.

In my database I have some information about file paths. Originally, those paths come from a Windows Excel spreadsheet and look like "..\1 PDF Filer\65051.PDF". In my PHP code I try to do two things:

1) replace ".." with a string like "file://server/folder"
2) replace all "\" characters with "/".

The PHP code looks something like:

$path_to_file = "..\1 PDF Filer\65051.PDF";
$things_to_look_for = array("..", "\");
$things_to_replace_with = array("file://server/folder", "/");
$link = str_replace($things_to_look_for, $things_to_replace_with, $path_to_file);


The big problem is the character "\" which, if I got it right, in UNICODE is used for things like expressing line breaks ('\n' or something like this). The code above is resulting in the following error massage: "Parse error: parse error, expecting `')'' in /xxx/xxx/xxx/TMPz06yoces6o.php on line 2."

Is there a simple solution for this problem?

Regards,

Frank


You are escaping the last quote, meaning that the rest of your code is "quoted". What you need to do is to escape the escape character.

$path_to_file = addslashes("..\1 PDF Filer\65051.PDF");
$things_to_look_for = array("..", "\\");

You should use addslashes() or similar on you're path name, as some escaped characters have certain meanings. \n for example means a new line character, while \\n on the other hand means \ followed by n.

Manual: http://www.php.net/types.string

--
Stian

--- End Message ---
--- Begin Message ---
Thank you Stian!

In Swedish they say "Sometimes you can't see the forest by all the trees."

/frank

2005-02-24 kl. 09.45 skrev Stian Berger:

On Thu, 24 Feb 2005 09:14:32 +0100, Frank Arensmeier <[EMAIL PROTECTED]> wrote:

Hello everybody!

I was wondering if you could help me with a little problem I ran into some days ago.

In my database I have some information about file paths. Originally, those paths come from a Windows Excel spreadsheet and look like "..\1 PDF Filer\65051.PDF". In my PHP code I try to do two things:

1) replace ".." with a string like "file://server/folder"
2) replace all "\" characters with "/".

The PHP code looks something like:

$path_to_file = "..\1 PDF Filer\65051.PDF";
$things_to_look_for = array("..", "\");
$things_to_replace_with = array("file://server/folder", "/");
$link = str_replace($things_to_look_for, $things_to_replace_with, $path_to_file);


The big problem is the character "\" which, if I got it right, in UNICODE is used for things like expressing line breaks ('\n' or something like this). The code above is resulting in the following error massage: "Parse error: parse error, expecting `')'' in /xxx/xxx/xxx/TMPz06yoces6o.php on line 2."

Is there a simple solution for this problem?

Regards,

Frank


You are escaping the last quote, meaning that the rest of your code is "quoted". What you need to do is to escape the escape character.

$path_to_file = addslashes("..\1 PDF Filer\65051.PDF");
$things_to_look_for = array("..", "\\");

You should use addslashes() or similar on you're path name, as some escaped characters have certain meanings. \n for example means a new line character, while \\n on the other hand means \ followed by n.

Manual: http://www.php.net/types.string

--
Stian

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





--- End Message ---
--- Begin Message ---
Sed wrote:

Is it possible for hackers to give a fake IP address when visiting a website
running PHP?

I want to allow certain IP addresses have access to a website (other IP
addresses not), is it possible for someone (e.g. hacker) to give fake IP
address? If so, how is the website returned to this someone?

If you have any reference or links on this, please send me!

If you know the addresses you want to allow access, then it will be reasonably safe, since the hacker would have to have the same list, and if they have inside information, they are probably already hacking you by some other route. Almost anything can be faked if they want to, but they have to know WHAT to fake ;)


If you want to authenticate users and log their IP address, then forget it. Since most IP addresses are dynamic and the same user could have a different address each time.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message --- Lester Caine wrote:
Sed wrote:

Is it possible for hackers to give a fake IP address when visiting a website
running PHP?


I want to allow certain IP addresses have access to a website (other IP
addresses not), is it possible for someone (e.g. hacker) to give fake IP
address? If so, how is the website returned to this someone?

If you have any reference or links on this, please send me!


If you know the addresses you want to allow access, then it will be reasonably safe, since the hacker would have to have the same list, and if they have inside information, they are probably already hacking you by some other route. Almost anything can be faked if they want to, but they have to know WHAT to fake ;)

I would not rely on IP addresses being secret. There are ways to find out IP addresses that belong to an organization, and try the whole range. For example just by receiving an email. And second, most attacks come from insiders, they have the info and far greater possibilities.

--- End Message ---
--- Begin Message ---
Which function can I use to capture a user's IP Address when he registers on 
my site. I would like to store this value in a database.

Regards
Jacques 

--- End Message ---
--- Begin Message --- Jacques wrote:
Which function can I use to capture a user's IP Address when he registers on my site. I would like to store this value in a database.

print $_SERVER['REMOTE_ADDR'];

--Deepak
--- End Message ---
--- Begin Message ---
On Thursday 24 February 2005 9:38 am, N Deepak wrote:
> Jacques wrote:
> > Which function can I use to capture a user's IP Address when he registers
> > on my site. I would like to store this value in a database.
>
> print $_SERVER['REMOTE_ADDR'];
>
>  --Deepak

...But be careful! -If the user is going via a proxy to access your server 
that will be the IP address of the cache server, not the originating client.

- Nick

--- End Message ---
--- Begin Message ---
Can make use of an absolute URL when using require() or require_once()?

Regards

Jacques 

--- End Message ---
--- Begin Message ---
OK.

I changed to hashed passwords in now they are case sensitive.

Thanks.
-Will

"Richard Lynch" <[EMAIL PROTECTED]> kirjoitti 
viestiss�:[EMAIL PROTECTED]
> William Stokes wrote:
>> I got my little user authentication to work but now I would like to know
>> how
>> to make and check the (upper/lower) case in password. To put it simple. I
>> want users password to be case sensitive.
>
> The default compile settings for MySQL are case-insensitive.
>
> Usually, one stores some kind of hash of a password, not a password 
> itself.
>
> Since the hash comes out quite differently for upper/lower case, that
> usually takes care of case sensitivity.
>
> Actually, I went the other route and forced all passwords to lowercase
> before hashing, because my users were, errr, technically-challenged, and
> case sensitivity was too complicated an issue.  Yes, really.  Been there.
>
> Anyway, if you are storing the password in plain text (not hashed) and
> want case sensitivity, there's probably a MySQL function to compare case
> sensitive.  http://mysql.com search engine would find it.
>
> If not, an ugly hack that will almost for sure work, would be:
> $query = "select md5('$password') = md5(password) ... ";
>
> Here, instead of letting MySQL compare the two text strings
> case-insensitive, you are doing an MD5 hash on each first, which will
> result in wildly different values, and then comparing those
> (case-insensitive).
>
> There is a one in 2 billion chance that somebody could find an input
> ('foo') that is not at all related to the actual password ('bar') and
> bypass your password that way...
>
> If that concerns you, then do:
> $query = "select md5('$password') = md5(password) and '$password' =
> password ...";
>
> I don't think there's any chance at all of two passwords with only case
> difference having the same MD5 hash...
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm 

--- End Message ---
--- Begin Message ---
Hi all,

  I have no doubt posted many queries here in the past few days, and am
  thankful for all the help I have received. :)

  I have been able to write a helloworld extension and compile it.  The
  next step is to call a function in a library libfoo.so.  I think
  this needs a modification in config.m4.

  Any ideas how to go about it?  I have already tried editing LIBNAME
  and LIBSYMBOL.  It says:
  checking for foo in -lfoo... no
  configure: error: wrong foo lib version or lib not found

  The file is present as ext/myext/lib/libfoo.so.

Thanks again,
Deepak

-- 
N Deepak || http://www.ndeepak.info/

--- End Message ---
--- Begin Message ---
Hello,

If I send a session cookie to browser where it is stored in WinXP? Or is it 
stored as a separate file at all. I know that the script sends the cookie 
but I can't find it in the client computer harddrive.

I am testing with Opera, IE6 and Firefox.

Thanks
-Will

--- End Message ---
--- Begin Message --- William Stokes wrote:
Hello,

If I send a session cookie to browser where it is stored in WinXP? Or is it stored as a separate file at all. I know that the script sends the cookie but I can't find it in the client computer harddrive.

I am testing with Opera, IE6 and Firefox.
This is not dependent on the OS, but the browser. IE stores in %WINDIR%\Cookies. Netscape stores in a Cookies subdirectory under C:\Program Files\Netscape\User\...

--Deepak
--- End Message ---
--- Begin Message ---
Hello,

If I send a session cookie to browser where it is stored in WinXP? Or is it
stored as a separate file at all. I know that the script sends the cookie
but I can't find it in the client computer harddrive.

I am testing with Opera, IE6 and Firefox.

Thanks
-Will

--- End Message ---
--- Begin Message ---
Hello people,

Recently, one of my webservers became rather slow. At first we thought it
was the MySQL backend, but when logged in on MySQL using the command line
tool over SSH, it runs as smooth as ever.
Static content (normal html pages) also load without delay. It seems that
the bottleneck is PHP itself.
For the sake of comparison, I created 2 test pages:

http://www.debuginc.com/test.html
http://www.debuginc.com/test.php

Everyone I asked says that the PHP page takes over 5 seconds to load while
the HTML one instantly displays. The only code in the PHP page is <? echo
'hello world'; ?>. No MySQL stuff, so that eliminates the initial idea of
MySQL causing the slowness.

Nevertheless, it IS slow and I have no idea why or where to start looking.
The phpinfo() can be found on www.debuginc.com/info.php. Any help or hints
are highly appreciated.

Another interesting note; this problem started a couple of days ago without
any changes in the config or anything. At first I upped the amount of
connections Apache would accept, but it soon turned out that was not the
problem.

Thanks,
- Gerard

--- End Message ---
--- Begin Message ---
How can I ensure that a user is prevented from creating a second profile 
after he has registered a second time with different registration details?

I thought of capturing his IP Address and checking this value against my 
users table in my database where I have captured IP Addresses of users who 
have previously registered.

Jacques 

--- End Message ---
--- Begin Message ---
Hi,

It is not quite clear what you want to do. You can translate UTF-8 characters 
into html characters like this:
$str = htmlentities($str,ENT_NOQUOTES,'UTF-8'); 
Or you can translate them in a costumizesd way with strtr()
For instance:
$translation = array(
      "ÃÂ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" => 
"Ã",
      "ÃÂ" => "Ã", 'ÃÂ' => "Ã", "ÃÂ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" => 
"Ã",
       "ÃÂ" => "Ã", "Ãâ" => "Ã", "ÃË" => "Ã", "ÃÂ" => "Ã", "ÃÂ" 
=> "&ccedil;",
       "Ãâ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" => "Ã", "ÃÂ" 
=> "&eth;",
       "ÃÂ" => "&uacute", "ÃÂ" => "&aacute", "ÃÂ" => "&acirc"
);
$str = strtr($str, $translation);
Both methods are simpler and a lot faster than regexps.

Hth Henrik Hornemann


-----Oprindelig meddelelse-----
Fra: mario [mailto:[EMAIL PROTECTED] 
Sendt: 23. februar 2005 19:34
Til: [email protected]; [email protected]
Cc: Burhan Khalid; Guillermo Rauch
Emne: [PHP-DB] Accents! Pls help. Still very confused.

Hello,

I am still very puzzled.
If you a couple of minutes of spare time, pls give a look at 
http://www.chiari.org/help/ and suggest a way out.

Thanks a lot.
mario

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


--- End Message ---

Reply via email to