Re: [PHP] unlink, symlink and caching

2005-12-22 Thread jgmtfia Mr
> Be sure to include the OS, filesystem type and the configure line
> in the report, cause there seems to be something system dependent
> causing it since the script you posted earlier worked fine on my
> system.

Thanks for your help.  I appreciate it.

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



RE: [PHP] utf-8 in mysql but not outputting as utf-8 on web

2005-12-22 Thread Denis Gerasimov
Hello,

Also the first query that is executed to MySQL server has to be:

SET CHARACTER SET utf8

This will set the character set for current connection to UTF-8 (default is
latin-1).

HTH

Have a great day,

Denis S Gerasimov 
Web Developer
Team Force LLC

Web:   www.team-force.org
RU & Int'l:   +7 8362-468693
email:[EMAIL PROTECTED]

> -Original Message-
> From: Curt Zirzow [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 23, 2005 9:02 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] utf-8 in mysql but not outputting as utf-8 on web
> 
> >
> > On a web page, I set the charset to utf-8 via:
> > header("Content-type: text/html; encoding: UTF-8");
> > as the top-line
> 
> you want:
> 
>   Content-Type: text/html; charset=UTF-8
> 
> 
> Also, take a look at the php.ini setting:
> 
>   http://php.net/manual/en/ini.core.php#ini.default-charset
> 
> 
> I would set that to UTF-8 and not worry about the header calls;
> besides all pages should have some sort charset encoding set.
> 
> Curt.
> --
> cat .signature: No such file or directory
> 
> --
> 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] utf-8 in mysql but not outputting as utf-8 on web

2005-12-22 Thread Curt Zirzow
On Thu, Dec 22, 2005 at 07:01:07PM -0800, jonathan wrote:
> I'm inserting some info into a mysql table which has the charset set  
> to utf-8.
> 
> When I do a select via the command-line from mysql, it looks like this:
> Clams and mussels with Dijon-cr�me fra�che-saffron sauce
> 
> assuming this is coming out in your email client ok, it should look  
> good.
> 
> On a web page, I set the charset to utf-8 via:
> header("Content-type: text/html; encoding: UTF-8");
> as the top-line

you want:

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


Also, take a look at the php.ini setting: 

  http://php.net/manual/en/ini.core.php#ini.default-charset


I would set that to UTF-8 and not worry about the header calls;
besides all pages should have some sort charset encoding set.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Connection: close Always?

2005-12-22 Thread Curt Zirzow
On Thu, Dec 22, 2005 at 05:23:51PM -0500, Michael B Allen wrote:
>...
> 
> #
> # KeepAlive: Whether or not to allow persistent connections (more than
> # one request per connection). Set to "Off" to deactivate.
> #
> KeepAlive Off
> 
> Mmm, why does the Fedora 4 apache package ship with keep-alive disabled?

Yeah, i ran accross that on other linux distro packaging systems,
keepalive boosts performance by quite a bit.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] unlink, symlink and caching

2005-12-22 Thread Curt Zirzow
On Thu, Dec 22, 2005 at 02:41:40PM -0700, jgmtfia Mr wrote:
> > > I just ran the test with php4 cli and it works correctly.
> > > PHP 4.3.10-15 (cli) (built: May  9 2005 08:54:56)
> > >
> > > But with php5 cli and apache2 module it does not:
> > > PHP 5.1.0b3 (cli) (built: Oct 18 2005 16:13:19)
> > > PHP 5.1.0 apache module
> >
> > The versions I ran the tests  were on:
> >   PHP 5.1.0RC5-dev (cli) (built: Nov 17 2005 10:02:23)
> >   PHP 5.1.2-dev (cli) (built: Dec 19 2005 12:03:32)
> >
> > > Is this not a bug?
> >
> > If it still happens on your system with the latest snapshot it
> > sounds like it.
> 
> I just downloaded + compiled 5.1.1 and it does have the same problem. 
> What should be next step be?

Probably reporting a bug report at http://bugs.php.net/, i did a
quick search but didn't see any open related to this but you might
want to search a little harder than I did.

Be sure to include the OS, filesystem type and the configure line
in the report, cause there seems to be something system dependent
causing it since the script you posted earlier worked fine on my
system.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Sessions...

2005-12-22 Thread Chris Shiflett

Greg Donald wrote:

I've been using this database driven PHP sessions setup for years:

http://dbsessions.destiney.com/


I offer a similar implementation:

http://phpsecurity.org/code/ch08-2

A few notes about yours (if you don't mind the critique):

1. It doesn't use a separate database connection, but it creates one 
anyway. I create a separate one, but only so that it can be dropped into 
any web application without adversely affecting it. In practice, I 
prefer to use a single connection.


2. Your sess_close() function does nothing, and this can make the 
session mechanism behave unexpectedly for a developer. For example, 
someone who actually depends upon session_write_close() for concurrent 
connections is severely impacted.


3. $GLOBALS[tb_sessions] is invalid syntax. It works, but only because 
PHP will check to see if you meant $GLOBALS['tb_sessions'] after it 
fails to find a constant named tb_sessions.


4. Your sess_read() function should return an empty string when no data 
is found, not FALSE. I originally made this same mistake.


5. Your sess_read() function has an SQL injection vulnerability. The 
argument passed comes directly from the user.


6. Your sess_write() function has the same SQL injection vulnerability.

7. In sess_write(), you also don't escape the session data, and this 
will give you problems, even with legitimate data that doesn't represent 
an SQL injection attack. For example, try setting a session variable 
that contains a quote somewhere:


$_SESSION['publisher'] = "O'Reilly";

8. Your sess_write() function has the same SQL injection vulnerability.

9. Your sess_destroy() function has the same SQL injection vulnerability.

10. Your sess_gc() function returns the number of affected rows. 
Shouldn't it return TRUE on success? You may just be depending upon the 
evaluation of any non-zero integer to TRUE.


11. Your sess_gc() function ignores the session configuration and 
chooses its own expiry.


I hope this was helpful. I don't mean any disrespect - quite the 
opposite, since you're freely sharing your code. I applaud that. :-)


I think the SQL injection vulnerability is the biggest flaw. Most 
everything else doesn't matter too much, but that's a big one, and it 
exists in most of your session functions. A simple call to 
mysql_real_escape_string() can protect against this vulnerability (in 
these cases), and you'll see that I use this function on everything I 
use in my SQL queries, even when it seems ridiculous to do so:


$access = time();
$access = mysql_real_escape_string($access);

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



Re: [PHP] utf-8 in mysql but not outputting as utf-8 on web

2005-12-22 Thread Ligaya Turmelle

Have you read this article - http://www.phparch.com/sample.php?mid=57 .


jonathan wrote:
I'm inserting some info into a mysql table which has the charset set  to 
utf-8.


When I do a select via the command-line from mysql, it looks like this:
Clams and mussels with Dijon-crème fraîche-saffron sauce

assuming this is coming out in your email client ok, it should look  good.

On a web page, I set the charset to utf-8 via:
header("Content-type: text/html; encoding: UTF-8");
as the top-line

I then do a select for this field and it outputs like this in the  browser:
Clams and mussels with Dijon-crème fraîche-saffron sauce

I'm familiar with html encoding. As this is going to go to XML, I  
wanted to see if I could keep it in the native format. Am I doing  
something wrong on the web side why I won't display this correctly?  Is 
there some Apache config I need to be aware of?


thanks,

jonathan


--

life is a game... so have fun.

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

Re[3]: [PHP] utf-8 in mysql but not outputting as utf-8 on web

2005-12-22 Thread Kenneth Andresen

Hello Jonathan,

You probably don't have php5 compiled with mbstrings enabled, if you 
have complied php5 with iconv instead you can try


iconv('utf-8' , 'html', $string);

I don't know what to recommend if you don't have any of these complied 
into php5.


Best regards,
Kenneth

--

jonathan wrote:

thanks, never used this function. the weird thing is that it's  
throwing a fatal error saying mb_convert_encoding is undefined. I'm  
running 5.0.4.


h.



Fatal error: Call to undefined function: mb_convert_encoding() in / 
home/arclocal/public_html/preview/Inc/menu.class.php on line 1563




On Dec 22, 2005, at 7:08 PM, Kenneth Andresen wrote:


Hello,

why not simply convert the text to html

mb_convert_encoding($string, 'html', 'utf-8');


Best regards,
Kenneth


jonathan wrote:

I'm inserting some info into a mysql table which has the charset  
set  to utf-8.


When I do a select via the command-line from mysql, it looks like  
this:

Clams and mussels with Dijon-crème fraîche-saffron sauce

assuming this is coming out in your email client ok, it should  
look  good.


On a web page, I set the charset to utf-8 via:
header("Content-type: text/html; encoding: UTF-8");
as the top-line

I then do a select for this field and it outputs like this in the   
browser:

Clams and mussels with Dijon-crème fraîche-saffron sauce

I'm familiar with html encoding. As this is going to go to XML, I   
wanted to see if I could keep it in the native format. Am I doing   
something wrong on the web side why I won't display this  
correctly?  Is there some Apache config I need to be aware of?


thanks,

jonathan











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



Re: [PHP] Sessions...

2005-12-22 Thread Greg Donald
On 12/22/05, Dan Parry <[EMAIL PROTECTED]> wrote:
> I've decided to rock the boat and start using a custom handler (we need to
> check who's online etc; the standard stuff) utilising our MySQL (v3.28) DB

I've been using this database driven PHP sessions setup for years:

http://dbsessions.destiney.com/



--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

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



Re: [PHP] utf-8 in mysql but not outputting as utf-8 on web

2005-12-22 Thread Kenneth Andresen

Hello,

why not simply convert the text to html

mb_convert_encoding($string, 'html', 'utf-8');


Best regards,
Kenneth


jonathan wrote:

I'm inserting some info into a mysql table which has the charset set  
to utf-8.


When I do a select via the command-line from mysql, it looks like this:
Clams and mussels with Dijon-crème fraîche-saffron sauce

assuming this is coming out in your email client ok, it should look  
good.


On a web page, I set the charset to utf-8 via:
header("Content-type: text/html; encoding: UTF-8");
as the top-line

I then do a select for this field and it outputs like this in the  
browser:

Clams and mussels with Dijon-crème fraîche-saffron sauce

I'm familiar with html encoding. As this is going to go to XML, I  
wanted to see if I could keep it in the native format. Am I doing  
something wrong on the web side why I won't display this correctly?  
Is there some Apache config I need to be aware of?


thanks,

jonathan


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



[PHP] utf-8 in mysql but not outputting as utf-8 on web

2005-12-22 Thread jonathan
I'm inserting some info into a mysql table which has the charset set  
to utf-8.


When I do a select via the command-line from mysql, it looks like this:
Clams and mussels with Dijon-crème fraîche-saffron sauce

assuming this is coming out in your email client ok, it should look  
good.


On a web page, I set the charset to utf-8 via:
header("Content-type: text/html; encoding: UTF-8");
as the top-line

I then do a select for this field and it outputs like this in the  
browser:

Clams and mussels with Dijon-crème fraîche-saffron sauce

I'm familiar with html encoding. As this is going to go to XML, I  
wanted to see if I could keep it in the native format. Am I doing  
something wrong on the web side why I won't display this correctly?  
Is there some Apache config I need to be aware of?


thanks,

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



[PHP] Problems getting the nodeName with DomDocument

2005-12-22 Thread Kenneth Andresen
I am having problems with the following functions where my return simply 
is "#text Joe #text Smith #text unknown", it should have read

firstname Joe lastname Smith address unknown

What am I doing wrong?


$xmlstring = 
"JoeSmithunknown";


$domdoc = new DomDocument();
$domdoc->loadXML($xmlstring);
$domroot = $domdoc->documentElement;

function process_children($node)
{
   $children = $node->childNodes;
   foreach ($children as $elem) {
   if ($elem->nodeType == XML_TEXT_NODE) {
   if (strlen(trim($elem->nodeValue))) {
   $name = $elem->nodeName ;
   $res = mb_convert_encoding(trim($elem->nodeValue), 
'html', 'utf-8');
   echo "$name  $res \n";
   }

   } else if ($elem->nodeType == XML_ELEMENT_NODE) {
   process_children($elem);
   }
   }
}

process_children($domroot);

?>

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



Re: [PHP] PHP interference in frames

2005-12-22 Thread PHP Superman
I'm taking a wild guess here, maybe the browser insists on waiting for some
content but it's maximum content wait time is 5 seconds, the browser could
detect the connection to the server is still open and wait for 5 seconds or
another time

On 12/22/05, Ron Rudman <[EMAIL PROTECTED]> wrote:
>
> I've got this down to a bare bones test but am still stumped.  Can anyone
> explain why I get the behavior I do?
>
> I have a frameset with 3 frames:
> 
> testing
> 
> 
> 
> 
> 
> 
>
> test1.php and test2.php are both simply:
> test3.php is simply:   
>
> When I invoke the main frameset, the output from test3.php takes 5 seconds
> to appear.
> If I comment out either one of the sleep calls, the output from test3.phpis
> immediate, which is what I expected in the first place.
>
> I have session.auto_start = 0 in php.ini, so this has nothing to do with
> sessions.
> I am running php 5.0.5.
> I get the same results with both apache 2/mod_php and lighttpd/fastcgi,
> the
> latter with 40 php processes running.
>
> I thought that each frame in a page was executed independently and
> asynchronously, yet frame4.php insists on "waiting" for one of the other
> frames to complete  (if the sleeps are 5 and 10, frame3 produces its
> output
> after 5 seconds).
>
> What am I missing here?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!


[PHP] PHP interference in frames

2005-12-22 Thread Ron Rudman
I've got this down to a bare bones test but am still stumped.  Can anyone 
explain why I get the behavior I do?

I have a frameset with 3 frames:

testing

 
 
 



test1.php and test2.php are both simply:
test3.php is simply:   

When I invoke the main frameset, the output from test3.php takes 5 seconds 
to appear.
If I comment out either one of the sleep calls, the output from test3.php is 
immediate, which is what I expected in the first place.

I have session.auto_start = 0 in php.ini, so this has nothing to do with 
sessions.
I am running php 5.0.5.
I get the same results with both apache 2/mod_php and lighttpd/fastcgi, the 
latter with 40 php processes running.

I thought that each frame in a page was executed independently and 
asynchronously, yet frame4.php insists on "waiting" for one of the other 
frames to complete  (if the sleeps are 5 and 10, frame3 produces its output 
after 5 seconds).

What am I missing here?

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



[PHP] Free Hosting?

2005-12-22 Thread Dan Uyemura
All - 
 
In my searches of a new host I have found this.. and in the spirit of
the holidays I will kindly share with everyone here.  
 
http://www.365yearsfree.com  
 
I guess by finding the "hot host" everyday you get entered into a
drawing to win a free year of hosting, and they claim they will give out
a year a day for 2006... 
 
It looks like they have just launched (advertise page reads 870 ad
views, so it might have launched this week?) so I think we have the best
shot to win over the year!  Good luck to all.
 
PS: if you made it this far, I just found the "Hot Host".. It's Lunar
Pages.
 
-D
 


Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Mike Rondeau
I am still a newbie, but I am suprised that it effects browers at all, since it 
returns
pure HTML to the browser, right? Something so simple as echoing a "hello world" 
shouldn't cause trouble in so popular a browser as Netscape I would think...

Mike
PHP Newbie
  - Original Message - 
  From: David Grant 
  To: Nanu Kalmanovitz 
  Cc: php-general@lists.php.net 
  Sent: Thursday, December 22, 2005 2:54 AM
  Subject: Re: [PHP] PHP is OK in IE but not in Netscape


  Nanu,

  Nanu Kalmanovitz wrote:
  > Ok, I will forget Netscape, what other popular browsers beside M$-IE
  > works with M$-Windows?

  I wouldn't "forget" Netscape, because people still use it.  Just make
  sure your code validates to W3C standards and so long as it isn't too
  cutting edge, must browsers should display it fine.

  To answer your question, Opera is probably the third most popular
  browser on Windows.

  Cheers,

  David
  -- 
  David Grant
  http://www.grant.org.uk/

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



Re: [PHP] Connection: close Always?

2005-12-22 Thread Michael B Allen
On Thu, 22 Dec 2005 17:16:03 -0500
Michael B Allen <[EMAIL PROTECTED]> wrote:

> On Thu, 22 Dec 2005 09:42:08 +0100
> Jochem Maas <[EMAIL PROTECTED]> wrote:
> 
> > Michael B Allen wrote:
> > > Why does PHP always close the connection with Connection: close? I'm
> > > using PHP 4.3.11 w/ Firefox 1.0.4. Requests are HTTP/1.1 and Connection:
> > > keep-alive is requested.
> > > 
> > 
> > a very small sum of money says that this is due to your
> > webserver config and not php (check httpd.conf?).
> > oh and I recommend upgrading to at least php4.4.x in order to
> > be up2date with [security] fixes et al.
> 
> Yup.
> 
> #
> # The following directives modify normal HTTP response behavior to
> # handle known problems with browser implementations.
> #
> BrowserMatch "Mozilla/2" nokeepalive
> 
> WTF? Mozilla doesn't handle keep-alive!

Correction. Mozilla 2 aka Netscape 2.0 doesn't handle keep-alive
correctly. The directive responsible is actually:

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive Off

Mmm, why does the Fedora 4 apache package ship with keep-alive disabled?

Mike

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



[PHP] Sessions...

2005-12-22 Thread Dan Parry
Hi

 

I'm having some trouble with sessions and was wondering if anyone could give
me some insight

 

Background:

 

We have experienced some difficulties previously with sessions which were
fixed(ish) by using ini_set("session.save_handler", "files"); and manually
dropping a cookie with the propagated session ID in it

 

Without the implicit cookie (and subsequent ID checking) the session
wouldn't fix and changing page would make it overwrite its own data with
NULL (as if the session had been restarted)

 

Current:

 

I've decided to rock the boat and start using a custom handler (we need to
check who's online etc; the standard stuff) utilising our MySQL (v3.28) DB

 

Seeing that I'm not great with sessions (my bad, I haven't studied enough),
I used some code (pretty much verbatim) from the Zend site that sets up a
sessions class.
http://www.zend.com/zend/spotlight/code-gallery-wade8.php?article=code-galle
ry-wade8 << that's where the tutorial lives

 

Using the custom handler the sessions are failing to fixate again, even if I
drop a cookie with the propagated session ID and subsequently reuse it

 

I used my login script to attempt to track the problem and discovered that
the script that performs the login successfully writes to the database but
when it returns to the main page the session is present in the database but
the session value field is, once again, empty

 

Er, help. Please. I'm running out of hair to tear out :-)

 

TIA and apologies if this has already been answered or this is a halfwitted
question

 

Dan



Re: [PHP] Connection: close Always?

2005-12-22 Thread Michael B Allen
On Thu, 22 Dec 2005 09:42:08 +0100
Jochem Maas <[EMAIL PROTECTED]> wrote:

> Michael B Allen wrote:
> > Why does PHP always close the connection with Connection: close? I'm
> > using PHP 4.3.11 w/ Firefox 1.0.4. Requests are HTTP/1.1 and Connection:
> > keep-alive is requested.
> > 
> 
> a very small sum of money says that this is due to your
> webserver config and not php (check httpd.conf?).
> oh and I recommend upgrading to at least php4.4.x in order to
> be up2date with [security] fixes et al.

Yup.

#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive

WTF? Mozilla doesn't handle keep-alive!

Mike

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



Re: [PHP] Re: insert to DB

2005-12-22 Thread PHP Superman
PHP might not be sending you an error, are warnings turned on in php.ini? if
not turn the on and see if you get any errors

On 12/18/05, David Hall <[EMAIL PROTECTED]> wrote:
>
>
> >  >if ($_POST["$submit"])
> >{
> >   $Name = $_POST["Name"];
> >$Rating = $_POST["Rating"];
> >
> >$sql = "UPDATE leaderboard SET Name='$Name', Rating='$Rating' WHERE
> > ID=$id";
> >   //replace news with your table name above
> >   $result = mysql_query($sql);
> >   echo "Thank you! Information updated.";
> >  }
> > }
> > ?>
>
> You don't set id in this case.   Of course, from some of your other
> code, it looks like you're relying on register_globals to be on, so
> maybe it is and that's not why.
>
> David Hall
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!


Re: [PHP] how to calculate with dates?

2005-12-22 Thread Ray Hauge



John Nichel wrote:


Marten Lehmann wrote:


Hello,

I'm used to work with Date::Calc in Perl. How can I calculate with 
dates in PHP, like adding an hour or a year to a date?


Regards
Marten



http://us3.php.net/mktime



You could also use the PEAR Date package.  I have used it in a few 
projects to help with manipulating dates.


http://pear.php.net/package/Date

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



Re: [PHP] unlink, symlink and caching

2005-12-22 Thread jgmtfia Mr
> > I just ran the test with php4 cli and it works correctly.
> > PHP 4.3.10-15 (cli) (built: May  9 2005 08:54:56)
> >
> > But with php5 cli and apache2 module it does not:
> > PHP 5.1.0b3 (cli) (built: Oct 18 2005 16:13:19)
> > PHP 5.1.0 apache module
>
> The versions I ran the tests  were on:
>   PHP 5.1.0RC5-dev (cli) (built: Nov 17 2005 10:02:23)
>   PHP 5.1.2-dev (cli) (built: Dec 19 2005 12:03:32)
>
> > Is this not a bug?
>
> If it still happens on your system with the latest snapshot it
> sounds like it.

I just downloaded + compiled 5.1.1 and it does have the same problem. 
What should be next step be?

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



Re: [PHP] how to calculate with dates?

2005-12-22 Thread John Nichel

Marten Lehmann wrote:

Hello,

I'm used to work with Date::Calc in Perl. How can I calculate with dates 
in PHP, like adding an hour or a year to a date?


Regards
Marten



http://us3.php.net/mktime

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] how to calculate with dates?

2005-12-22 Thread Marten Lehmann

Hello,

I'm used to work with Date::Calc in Perl. How can I calculate with dates 
in PHP, like adding an hour or a year to a date?


Regards
Marten

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



Re: [PHP] unlink, symlink and caching

2005-12-22 Thread Curt Zirzow
On Thu, Dec 22, 2005 at 08:29:53AM -0700, jgmtfia Mr wrote:
> > Thank you for checking on this.
> >
> > I am using debain stable with a 2.6.14.3 kernel.  The filesystem in
> > question is ext2 on a 48 MB ramdisk.
> >
> > I also did the following on another machine using ext2 on a harddisk
> > with command line php.
> 
> I just ran the test with php4 cli and it works correctly.
> PHP 4.3.10-15 (cli) (built: May  9 2005 08:54:56)
> 
> But with php5 cli and apache2 module it does not:
> PHP 5.1.0b3 (cli) (built: Oct 18 2005 16:13:19)
> PHP 5.1.0 apache module

The versions I ran the tests  were on:
  PHP 5.1.0RC5-dev (cli) (built: Nov 17 2005 10:02:23)
  PHP 5.1.2-dev (cli) (built: Dec 19 2005 12:03:32)

> Is this not a bug?

If it still happens on your system with the latest snapshot it
sounds like it.

Curt.
-- 
cat .signature: No such file or directory

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



[PHP] Re: PHP is OK in IE but not in Netscape

2005-12-22 Thread Al

You do not have a legitimate HTML page. Back to the books first.

Always validate here http://validator.w3.org/

If a page validates, it will run on about browser except NS4x and IE5x




Nanu Kalmanovitz wrote:

Hi
 
The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but

not in Netscape 7.0.
 
How can I fix it?
 
TIA
 
Nanu




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



[PHP] Re: Filtering URLs problem..

2005-12-22 Thread Al

I didn't fully test this; but it should get you started.

$types= array('http', 'ftp', 'https', 'mms', 'irc');

$pattern= "%.+%i";  // the 
"i" makes it non case sensitive

if(preg_match($pattern, $URL_str, $match)){

$URL= match[1];
}

else{

User did not enter a complete link; do the simple thing
}



Anders Norrbring wrote:


I'm writing a filter/parsing function for texts entered by users, and 
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http, 
mms, irc etc and format them as links, that part was real easy..


The hard part is when a user has already entered a complete link..
In short:

http://www.server.tld/page.html
should be converted to:
href='http://www.server.tld/page.html'>http://www.server.tld/page.html


That part works fine, but if the user enters:

click here

it all becomes a mess...  Can somebody please make a suggestion on this?


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



Re: [PHP] unlink, symlink and caching

2005-12-22 Thread jgmtfia Mr
> Thank you for checking on this.
>
> I am using debain stable with a 2.6.14.3 kernel.  The filesystem in
> question is ext2 on a 48 MB ramdisk.
>
> I also did the following on another machine using ext2 on a harddisk
> with command line php.

I just ran the test with php4 cli and it works correctly.
PHP 4.3.10-15 (cli) (built: May  9 2005 08:54:56)

But with php5 cli and apache2 module it does not:
PHP 5.1.0b3 (cli) (built: Oct 18 2005 16:13:19)
PHP 5.1.0 apache module

Is this not a bug?

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



Re: [PHP] Help Desk software

2005-12-22 Thread Peppy
http://phptickets.org/


- Original Message - 
From: "Glenn Sieb" <[EMAIL PROTECTED]>
To: 
Cc: "Daniel Lahey" <[EMAIL PROTECTED]>
Sent: Tuesday, December 20, 2005 10:13 PM
Subject: Re: [PHP] Help Desk software


> Daniel Lahey said the following on 12/20/2005 10:28 PM:
> > Can anyone recommend some good Open-Source Help Desk software for
> > PHP?  (I know this is a little off-topic, but I'm having a hard time
> > finding decent Open Source software.)
> IMHO the best is RT, which is Perl and Mason.
> (http://www.bestpractical.com/rt)
> 
> There are some nice PHP ones out there, but I don't have any experience
> with them:
> 
> ruQueue: http://freshmeat.net/projects/ruqueue/
> Hesk: http://www.phpjunkyard.com/free-helpdesk-software.php
> Help Desk Software: http://www.helpdeskreloaded.com/
> 
> I'm sure there are more..
> 
> Best,
> --Glenn
> 
> -- 
> AIM: RainbearNJ  YahooIM: rainbear_nj
> 
> "They that can give up essential liberty to obtain a little temporary 
> safety deserve neither liberty nor safety." 
>   ~Benjamin Franklin, Historical Review of Pennsylvania, 1759
> 
> -- 
> 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] Re: a quick one, self submitting jump menu

2005-12-22 Thread David Robley
Ross wrote:

> 
> How can I self submit a page whne registered globals are off. Is there a
> way to use $_SERVER?
> 
> What I am ultimately trying to do is use values from a jump menu...
> 
> 
>   
> option1
> option2
> 
>   
> 
> 
> 
> to self submit and use the submitted values in a if-else or CASE
> statement. This is all on the same page.

You would need to add a VALUE property to each of the OPTION tags, and
depending on the METHOD property of the form, chech the $_POST or $_GET
array



Cheers
-- 
David Robley

Vote Democratic... It's easier than getting a job.

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread dave
or maibe firefox

David Grant wrote:
> Nanu,
> 
> Nanu Kalmanovitz wrote:
> 
>>Ok, I will forget Netscape, what other popular browsers beside M$-IE
>>works with M$-Windows?
> 
> 
> I wouldn't "forget" Netscape, because people still use it.  Just make
> sure your code validates to W3C standards and so long as it isn't too
> cutting edge, must browsers should display it fine.
> 
> To answer your question, Opera is probably the third most popular
> browser on Windows.
> 
> Cheers,
> 
> David

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Jochem Maas

Nanu Kalmanovitz wrote:

Thanks all!
 
Ok, I will forget Netscape, what other popular browsers beside M$-IE

works with M$-Windows?


does it not occur to anyone that this sort of question
is better directed at a search engine? its called research.

another reason being that there is no 'php' in 'browser' - not
including the thing Wez Furlong built that allows you to run php
as a clientside scripting engine (which AFAIK is very experimental)

 
TIA
 
Nanu
 


"Zareef Ahmed" <[EMAIL PROTECTED]> 22/12/2005 11:30:21 >>>


 

- Original Message - 
From: "Nanu Kalmanovitz" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 22, 2005 4:22 AM
Subject: [PHP] PHP is OK in IE but not in Netscape
 




Hi

The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE


but


not in Netscape 7.0.


Strange... Can you post the code, Well I check it with firefox it fine
there.
 


How can I fix it?

TIA

Nanu


 



PHP Expert Consultancy in Development  http://www.indiaphp.com 
Yahoo! : consultant_php MSN : [EMAIL PROTECTED] 
 

 


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



Re: [PHP] a quick one, self submitting jump menu

2005-12-22 Thread Jochem Maas

Ross wrote:
How can I self submit a page whne registered globals are off. Is there a way 
to use $_SERVER?


what do you think register_globals does?
hint: $_SERVER is a superglobal and has nothing to do with (and
is not affected by) the register_globals setting.



What I am ultimately trying to do is use values from a jump menu...




if you leave the action attribute empty (or drop it altogether)
then your form will submit to the same URL as that which generated the
page that contains the form. if you set the action of the form to '>'
(as you have done in your example) then I have no idea what happens
(probably not much)


  
option1
option2

  



to self submit and use the submitted values in a if-else or CASE statement. 
This is all on the same page.



Ross 



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



RE: [PHP] a quick one, self submitting jump menu

2005-12-22 Thread Albert
Ross wrote:
> How can I self submit a page whne registered globals are off. Is there a 
> way to use $_SERVER?

Try $_REQUEST.

If the values are send using POST then $_POST

If the values are send using GET then $_GET

Albert


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.3/209 - Release Date: 2005/12/21
 

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread David Grant
Nanu,

Nanu Kalmanovitz wrote:
> Ok, I will forget Netscape, what other popular browsers beside M$-IE
> works with M$-Windows?

I wouldn't "forget" Netscape, because people still use it.  Just make
sure your code validates to W3C standards and so long as it isn't too
cutting edge, must browsers should display it fine.

To answer your question, Opera is probably the third most popular
browser on Windows.

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

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



[PHP] a quick one, self submitting jump menu

2005-12-22 Thread Ross

How can I self submit a page whne registered globals are off. Is there a way 
to use $_SERVER?

What I am ultimately trying to do is use values from a jump menu...


  
option1
option2

  



to self submit and use the submitted values in a if-else or CASE statement. 
This is all on the same page.


Ross 

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



RE: [PHP] High load Forum?

2005-12-22 Thread Jared Williams

Take a look at

http://www.big-boards.com/

Jared 

> Hi,
> 
> Im looking for a good forum thats supports high load. (Now 
> between 300-2.000 active sessions, much more in next 2 years)
> 
> I have heard about vBulletin and PhpBB. At the moment I think 
> vBulletin is the best choice, because I know some very big 
> places that uses it.
> 
> What do u think about this?

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Nanu Kalmanovitz
Thanks all!
 
Ok, I will forget Netscape, what other popular browsers beside M$-IE
works with M$-Windows?
 
TIA
 
Nanu
 
>>> "Zareef Ahmed" <[EMAIL PROTECTED]> 22/12/2005 11:30:21 >>>
 

- Original Message - 
From: "Nanu Kalmanovitz" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 22, 2005 4:22 AM
Subject: [PHP] PHP is OK in IE but not in Netscape
 

> Hi
>
> The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE
but
> not in Netscape 7.0.
Strange... Can you post the code, Well I check it with firefox it fine
there.
 
>
> How can I fix it?
>
> TIA
>
> Nanu
 


PHP Expert Consultancy in Development  http://www.indiaphp.com 
Yahoo! : consultant_php MSN : [EMAIL PROTECTED] 
 
>
 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 
 
 



[PHP] GD/Freetype text problems with bold or size < 8 - Followup

2005-12-22 Thread Jason Young

Just to followup on this,

I was able to install PHP 5.1.1 with its embedded GD library, and it 
turns out that GD is definitely the cause of the issues.


So my question now is what changes to the source can be made to ensure 
the highest-quality fonts in smaller sizes?  As I've said, I've been on 
hosts with very smooth rendering of smaller text (size < 8, assuming 96 
pixel resolution), but my current build looks horrible.
http://card.mygamercard.net/mini/Morgon.jpg is what it looks like now - 
all text is 6 point aside from the bold text at the top, which is 8.

This is the 5.0.4 install.

http://data.mygamercard.net/test.png is an image I created using a 
built-but-not-installed version of PHP 5.1.1.
I changed the GD_RESOLUTION to 72 point font, so to compensate, these 
are a font size of 9.


What I would like is for the fonts to look similar to what would really 
be displayed, had this been standard system fonts in a browser or other 
application.


If anyone has had experience with rendering text, I would really 
appreciate some hints on how to tweak GD to make things look proper.


Thanks

Jason Young wrote:
Currently, I'm running PHP 5.0.4 (only because it's the only one I can 
get to work on my FC4 x64 install!), but for some reason, using pixel 
sizes under 8, or using bold fonts, makes the text look horrible.
My old host (1&1 in case anyone else has them..) had this working well, 
but I have no idea what their settings were.


I've heard that editing the gd.h file to change the resolution from 96 
to 72 helps, but I'm assuming I'd have to recompile something for that 
to take effect, and I can't find a PHP-GD Source RPM for my arch.


What must I do to get everything smooth again?

Fedora Core 4, x64
PHP 5.0.4
PHP-GD module (separate RPM install)
Freetype 2.1
gd-2.0.33

Thank you.


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



[PHP] Re: High load Forum?

2005-12-22 Thread M. Sokolewicz
it all depends on the setup you're using. How well the code is written, 
how much fluff it has (eg. a lof of bbcode parsing makes the forum a lot 
slower), and a few more factors like that. If you're going to have a 
very big / active forum, I would suggest not to use a package as 
provided by multiple companies (vb, phpbb, xmb, ipb, etc) but to write 
your own and try to minimize the amount of work it does (especially 
heavy-duty work like regexp parsing, image-parsing, 
database-connections/transactions, etc.). If you do it yourself, you'll 
be sure you have optimized it as much as you can for your server 
specifically. If you use a bigger package, it'll have lots of fluff you 
don't need, and generally will use older (slower) language constructs to 
be backwards compatible (back to php 4.2.0 in most cases, or even earlier).


- tul

Ruben Rubio Rey wrote:

Hi,

Im looking for a good forum thats supports high load. (Now between 
300-2.000 active sessions, much more in next 2 years)


I have heard about vBulletin and PhpBB. At the moment I think vBulletin 
is the best choice, because I know some very big places that uses it.


What do u think about this?


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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Zareef Ahmed

- Original Message - 
From: "Nanu Kalmanovitz" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 22, 2005 4:22 AM
Subject: [PHP] PHP is OK in IE but not in Netscape


> Hi
>
> The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but
> not in Netscape 7.0.
Strange... Can you post the code, Well I check it with firefox it fine
there.

>
> How can I fix it?
>
> TIA
>
> Nanu



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Ruben Rubio Rey

Nanu Kalmanovitz wrote:


Hi

The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but
not in Netscape 7.0.

How can I fix it?

TIA

Nanu

 

Forget Netscape 7.0. Its not supported anymore. You should be worried 
with mozilla / firefox.
Anyway, im almost sure that is not a php problem. Have u check web 
server (apache, i think) configuration?

Is the data in source code that netscape have download?

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



[PHP] High load Forum?

2005-12-22 Thread Ruben Rubio Rey

Hi,

Im looking for a good forum thats supports high load. (Now between 
300-2.000 active sessions, much more in next 2 years)


I have heard about vBulletin and PhpBB. At the moment I think vBulletin 
is the best choice, because I know some very big places that uses it.


What do u think about this?

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread David Grant
Nanu,

Nanu Kalmanovitz wrote:
> The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but
> not in Netscape 7.0.

Looks fine to me.  What is the contents of hello.php?

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

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



[PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Nanu Kalmanovitz
Hi
 
The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but
not in Netscape 7.0.
 
How can I fix it?
 
TIA
 
Nanu


Re: [PHP] Connection: close Always?

2005-12-22 Thread Jochem Maas

Michael B Allen wrote:

Why does PHP always close the connection with Connection: close? I'm
using PHP 4.3.11 w/ Firefox 1.0.4. Requests are HTTP/1.1 and Connection:
keep-alive is requested.



a very small sum of money says that this is due to your
webserver config and not php (check httpd.conf?).
oh and I recommend upgrading to at least php4.4.x in order to
be up2date with [security] fixes et al.


Mike



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



Re: [PHP] Filtering URLs problem..

2005-12-22 Thread Jochem Maas

Anders Norrbring wrote:


I'm writing a filter/parsing function for texts entered by users, and 
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http, 
mms, irc etc and format them as links, that part was real easy..


The hard part is when a user has already entered a complete link..
In short:

http://www.server.tld/page.html
should be converted to:
href='http://www.server.tld/page.html'>http://www.server.tld/page.html


That part works fine, but if the user enters:

click here

it all becomes a mess...  Can somebody please make a suggestion on this?


regular expressions - in particular a 'negative look behind' assertion.

here is a page that [trys to] explain it:
http://www.mircscripts.org/showdoc.php?type=tutorial&id=2409

google given loads of hits for 'negative look behind', hopefully you
get somewhere - me I have too little time to right now to go into
examples. good luck

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