php-general Digest 2 Oct 2005 15:26:22 -0000 Issue 3715

2005-10-02 Thread php-general-digest-help

php-general Digest 2 Oct 2005 15:26:22 - Issue 3715

Topics (messages 223506 through 223529):

Re: function not returning anything via return$
223506 by: Jasper Bryant-Greene

session_name(CCLTrolley)
223507 by: John Taylor-Johnston
223508 by: Robert Cummings
223509 by: John Taylor-Johnston
223510 by: Robert Cummings
223511 by: Jasper Bryant-Greene
223512 by: Robert Cummings
223514 by: John Taylor-Johnston
223515 by: Robert Cummings
223516 by: John Taylor-Johnston
223517 by: John Taylor-Johnston
223518 by: Robert Cummings
223520 by: Robert Cummings
223521 by: John Taylor-Johnston

problem half-solved, however have another
223513 by: matt VanDeWalle

Re: RecursiveIteratorIterator för PHP 5.0.5 Win32
223519 by: Erik Franzén

anyone want to teach php?
223522 by: Karl James

Re: Auto unzip uploaded file
223523 by: mail

Broken pipe
223524 by: Ben-Nes Yonatan

Test Emai --- Please igonre
223525 by: Zareef Ahmed

Re: PHP 5 Hosting
223526 by: Zareef Ahmed

php5--com terribly wrong ?
223527 by: Martin Staiger

Test Mail please igonre it
223528 by: Zareef Ahmed

Re: Sanitize paths
223529 by: Philip Hallstrom

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:
php-general@lists.php.net


--
---BeginMessage---

[EMAIL PROTECTED] wrote:

rdfpic2html( $rdfpicdata );


Shouldn't that be:

$rdfpicdata = rdfpic2html( $rdfpicdata );

Since you haven't defined rdfpic2html as receiving its argument by 
reference...


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
---End Message---
---BeginMessage---

$TrolleyContents is a string.
Basically what I want to accomplish here is if $TrolleyContents already 
exists append $AddToTrolley to $TrolleyContents, if not register 
$TrolleyContents.

Am I going about it right?
John

?php
#printcontents.php

session_name(CCLTrolley);
session_start();

if (isset($HTTP_POST_VARS[AddToTrolley]))
{
$TrolleyContents = $TrolleyContents.,.$HTTP_POST_VARS[AddToTrolley];
}else{
session_register(TrolleyContents);
}
echo $TrolleyContents;

phpinfo();
?
---End Message---
---BeginMessage---
On Sat, 2005-10-01 at 23:57, John Taylor-Johnston wrote:
 $TrolleyContents is a string.
 Basically what I want to accomplish here is if $TrolleyContents already 
 exists append $AddToTrolley to $TrolleyContents, if not register 
 $TrolleyContents.
 Am I going about it right?
 John
 
 ?php
 #printcontents.php
 
 session_name(CCLTrolley);
 session_start();
 
 if (isset($HTTP_POST_VARS[AddToTrolley]))
 {
 $TrolleyContents = $TrolleyContents.,.$HTTP_POST_VARS[AddToTrolley];
 }else{
 session_register(TrolleyContents);
 }
 echo $TrolleyContents;
 
 phpinfo();
 ?

Looks a bit odd to me :) But could be because you're using outdated
semantics. It should be sufficient to do the following:

?php

session_name( 'CCLTrolley' );
session_start();

//
// Initialize the trolley.
//
if( !isset( $_SESSION['TrolleyContents'] ) )
{
$_SESSION['TrolleyContents'] = '';
}

//
// Add new entry.
//
if( isset( $_POST['AddToTrolley'] ) )
{
if( $_SESSION['TrolleyContents'] ) == '' )
{
$_SESSION['TrolleyContents'] = $_POST['AddToTrolley'];
}
else
{
$_SESSION['TrolleyContents'] .= ','.$_POST['AddToTrolley'];
}
}

echo $_SESSION['TrolleyContents'];

phpinfo();

?

Is there a reason you're using a comma delimited string? I would
recommend using an array instead:

?php

session_name( 'CCLTrolley' );
session_start();

//
// Initialize the trolley.
//
if( !isset( $_SESSION['TrolleyContents'] ) )
{
$_SESSION['TrolleyContents'] = array();
}

//
// Add new entry.
//
if( isset( $_POST['AddToTrolley'] ) )
{
$_SESSION['TrolleyContents'][$_POST['AddToTrolley']] =
$_POST['AddToTrolley']
}

echo implode( ',', $_SESSION['TrolleyContents'] );

phpinfo();

?

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'
---End Message---
---BeginMessage---

Robert Cummings wrote:


On Sat, 2005-10-01 at 23:57, John Taylor-Johnston wrote:
 


$TrolleyContents is a string.
Basically what I want to accomplish here is if $TrolleyContents already 
exists append $AddToTrolley 

php-general Digest 3 Oct 2005 03:40:04 -0000 Issue 3716

2005-10-02 Thread php-general-digest-help

php-general Digest 3 Oct 2005 03:40:04 - Issue 3716

Topics (messages 223530 through 223545):

Re: Sanitize paths
223530 by: Robert Cummings

convert array to HTML GET request
223531 by: Martin van den Berg
223532 by: Jasper Bryant-Greene
223534 by: M. Sokolewicz
223535 by: Chris
223538 by: adriano ghezzi

Re: PHP 5 Hosting
223533 by: Oliver Grätz
223536 by: Torgny Bjers

Re: anyone want to teach php?
223537 by: John Taylor-Johnston

HTML Header Location - relative URI issue
223539 by: Jaepil Kim
223540 by: Jasper Bryant-Greene
223541 by: Jaepil Kim

Image resizing...
223542 by: Sonia

Re: php5--com terribly wrong ?
223543 by: Sonia

Re: session_name(CCLTrolley)
223544 by: John Taylor-Johnston

buffer problem having a mind of its own
223545 by: matt VanDeWalle

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:
php-general@lists.php.net


--
---BeginMessage---
On Sun, 2005-10-02 at 11:26, Philip Hallstrom wrote:
  realpath() is your friend...
 
  That has been my first impression too, but...
 
  realpath() expands all symbolic links
 
  I am actually using symlinks :)
 
  I trust the files on my server so local redirects via symlinks are no
  problem, the user submitted data is.

The following might help you write your own:

http://www.interjinn.com/jinnDoc/interjinn.function.jinnfullRelativePath.phtml

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'
---End Message---
---BeginMessage---
Newbe question:

How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.

Thanks,

Martin.
---End Message---
---BeginMessage---

Martin van den Berg wrote:

How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.


HTTP GET and POST requests are formatted the same, just sent in 
different ways. I don't know if there's a function; I'd just use:


?php
$myArray = array(
'apples' = 'oranges',
'pears' = 'peaches',
);

$queryParts = array();
foreach( $myArray as $key=$value ) {
$queryParts[] = $key=$value;
}

$query = implode( '', $queryParts );

// For GET, use e.g.:
$data = file_get_contents( http://www.example.com/?$query; );

// For POST, pass $query to curl_setopt for an HTTP POST (see CURL docs)
?

Disclaimer: I typed this from memory and haven't tested it, so there 
might be minor errors, but you get the picture.

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
---End Message---
---BeginMessage---

Jasper Bryant-Greene wrote:

Martin van den Berg wrote:


How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.



HTTP GET and POST requests are formatted the same, just sent in 
different ways. I don't know if there's a function; I'd just use:


?php
$myArray = array(
'apples' = 'oranges',
'pears' = 'peaches',
);

$queryParts = array();
foreach( $myArray as $key=$value ) {
$queryParts[] = $key=$value;
you might also want to use urlencode() in here to make sure the URL 
stays valid.


- tul


}

$query = implode( '', $queryParts );

// For GET, use e.g.:
$data = file_get_contents( http://www.example.com/?$query; );

// For POST, pass $query to curl_setopt for an HTTP POST (see CURL docs)
?

Disclaimer: I typed this from memory and haven't tested it, so there 
might be minor errors, but you get the picture.
---End Message---
---BeginMessage---

PHP 5 has the http_build_query function which does exactly what you want:

http://www.php.net/http_build_query

Chris

Martin van den Berg wrote:


Newbe question:

How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.

Thanks,

Martin.

 

---End Message---
---BeginMessage---
if i understand well you need to get an array from html post


if you use the same name for your html fields you automatically have
an array in $_POST

eg

input type=text  name=myfield value=field_1
input type=text name=myfield value=field_2

you'll get the array  ar_myfield = $_POS['myfield']

you should 

Re: [PHP] Auto unzip uploaded file

2005-10-02 Thread mail
James Lobley wrote: 
 You might like to take a look at this:
http://www.phpconcept.net/pclzip/index.en.php
 I've had great success with it - both extracting files and creating zips.

Thank you, the page looks great.

Norbert
 
 

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



[PHP] Broken pipe

2005-10-02 Thread Ben-Nes Yonatan

Hi all,

I wrote a php script which is running very long queries (hours) on a 
database.
I seem to have a problem to run the code when there are single queries 
which take long times (like 5 hours for an update query), from the log 
of the database I received the following code:



2005-09-30 17:12:13 IDT postgres : LOG:  0: duration: 18730038.678 
ms  statement: UPDATE product_temp SET nleft=(SELECT
2005-09-30 17:12:13 IDT postgres : LOCATION:  exec_simple_query, 
postgres.c:1035
2005-09-30 17:12:13 IDT postgres : LOG:  08006: could not send data to 
client: Broken pipe

2005-09-30 17:12:13 IDT postgres : LOCATION:  internal_flush, pqcomm.c:1050
2005-09-30 17:12:13 IDT postgres : LOG:  08P01: unexpected EOF on client 
connection

2005-09-30 17:12:13 IDT postgres : LOCATION:  SocketBackend, postgres.c:287
2005-09-30 17:12:13 IDT postgres : LOG:  0: disconnection: session 
time: 6:04:58.52
2005-09-30 17:12:13 IDT postgres : LOCATION:  log_disconnections, 
postgres.c:3403



Now after the 5 hours update it need to echo into a log file a line 
which say that it ended this command (just for me to know the times), my 
assumption is that PHP read the code into memory at start and opened the 
connection to the file, after a time which he waited to any given life 
sign he gave up and closed the connection to the file, and when the 
code came back to the file it encountered no connection to the file 
(broken pipe).



Am I correct at my assumption? if so how can I set the PHP to wait how 
much I tell him?


Ofcourse if im wrong I would like to know the reason also :)


Thanks in advance,

 Ben-Nes Yonatan

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



[PHP] Test Emai --- Please igonre

2005-10-02 Thread Zareef Ahmed
This is a test mail. Please igno
re it --
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] PHP 5 Hosting

2005-10-02 Thread Zareef Ahmed
On 9/30/05, Tom Chubb [EMAIL PROTECTED] wrote:

 This is an interesting one.
 As someone learning PHP, I am still confused which route I should be going
 down?
 Especially as I am looking to take on a dedicated server soon, I don't
 know if PHP5 will become standard soon or are we going to see PHP6
 first??!?

 It is a really serious problem, PHP 5 have so much good things specially in
terms of XML that I just want to use them in my programmes but whenever I
decide to do programming in PHP 5, I stuck on the choice of a good server.
Most of the Hosting service providers are still providing hosting in PHP 4.
 I think PHP is going through a very tough phase. It has got the
capabilities but we can not use them, thats why we can SAY that PHP is good
programming language But we can not PROVE that in practically.
 Well the original posting was about hosting service provider, somewhere I
read about HOSTWAY. they are in PHP 5 hosting.
  Zareef Aahmed

Please can some more experienced people let me have their views on this?
 Many thanks,#
 Tom

 On 30/09/05, Joe Wollard [EMAIL PROTECTED] wrote:
  The first two results both seem pretty good at a glance:
 
  http://www.google.com/search?hl=enq=php5+ssh+hostingbtnG=Google+Search
 
 
 
  On Sep 29, 2005, at 8:29 PM, Ed Lazor wrote:
 
   Any recommendations on good host providers for PHP 5? Bonus points
   if they support SSH access and a PHP compiler like Zend.
  
   Thanks,
  
   Ed
  
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 --
 Tom Chubb
 [EMAIL PROTECTED]
 07915 053312

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




--
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


[PHP] php5--com terribly wrong ?

2005-10-02 Thread Martin Staiger
Dear experts,

something must be terribliy wrong with either php5-com or our
configuration/code.

We used to control MS-Index-Server via php4 without any problems:

$q = new com (ixsso.Query);
$util = new com (ixsso.util);
$q-query = $QueryText . ' AND  #filename (*';
$q-SortBy = rank[d];
$q-catalog = docs;
$q-Columns = filename, Path, size, characterization, rank;
$q-MaxRecords = 300;
$util-AddScopeToQuery ($q, /, deep);
$q-LocaleID = $util-ISOToLocaleID(EN-US);

$rs = $q-CreateRecordSet(nonsequential);

// Loop over result
while (!$rs-EOF)
{


 $rowcount++;
 $rs-MoveNext();
}


Since we migrated to php5 we changed the iterator to run with FOREACH which
causes a fatal error:

foreach($rs as $ResultCounter)
{
   ...

}
-- Fatal error: Uncaught exception 'Exception' with message 'Object of type
variant did not create an Iterator'
in..
Same thing happens with:
foreach($rs as $ResultCounter = $row)
{
   ...
}
-- Fatal error: Uncaught exception 'Exception' with message 'Object of type
variant did not create an Iterator'
in..

Also, we tried to use the com-exception try..catch which didn't work either.

What's wrong here???

Environment :
win XP/2003, Apache 2.0.53, php 5.0.5

I'm thankful for any hint!
Marc

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



[PHP] Test Mail please igonre it

2005-10-02 Thread Zareef Ahmed
--
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] Sanitize paths

2005-10-02 Thread Philip Hallstrom

realpath() is your friend...


That has been my first impression too, but...


realpath() expands all symbolic links


I am actually using symlinks :)

I trust the files on my server so local redirects via symlinks are no
problem, the user submitted data is.


Then realpath() your doc root as well and then you'll be comparing apples 
to apples...


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



Re: [PHP] Sanitize paths

2005-10-02 Thread Robert Cummings
On Sun, 2005-10-02 at 11:26, Philip Hallstrom wrote:
  realpath() is your friend...
 
  That has been my first impression too, but...
 
  realpath() expands all symbolic links
 
  I am actually using symlinks :)
 
  I trust the files on my server so local redirects via symlinks are no
  problem, the user submitted data is.

The following might help you write your own:

http://www.interjinn.com/jinnDoc/interjinn.function.jinnfullRelativePath.phtml

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] convert array to HTML GET request

2005-10-02 Thread Martin van den Berg
Newbe question:

How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.

Thanks,

Martin.

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



Re: [PHP] convert array to HTML GET request

2005-10-02 Thread Jasper Bryant-Greene

Martin van den Berg wrote:

How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.


HTTP GET and POST requests are formatted the same, just sent in 
different ways. I don't know if there's a function; I'd just use:


?php
$myArray = array(
'apples' = 'oranges',
'pears' = 'peaches',
);

$queryParts = array();
foreach( $myArray as $key=$value ) {
$queryParts[] = $key=$value;
}

$query = implode( '', $queryParts );

// For GET, use e.g.:
$data = file_get_contents( http://www.example.com/?$query; );

// For POST, pass $query to curl_setopt for an HTTP POST (see CURL docs)
?

Disclaimer: I typed this from memory and haven't tested it, so there 
might be minor errors, but you get the picture.

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



Re: [PHP] PHP 5 Hosting

2005-10-02 Thread Oliver Grätz
Sheesh! No week passing by without people complaining about hosters
missiong out on PHP5. This is one point where we in Germany seem to be
lucky. The two biggest german hosters 11 (about 4 million domains) and
Strato (about 2.5 million domains) both offer SSH and the possibility to
chosse the PHP version on a per directory basis (via .htaccess). Strato
offers PHP 3.x, 4.0.x, 4.3.x and 5.0.x in parallel. Perhaps you should
think about outsourcing your hosting *g*.

For about 13 EUR per month you get PHP3, 4, 5 and even Ruby, SSH access,
MySQL access, 4 Domains, 600MB space and 30 GB free traffic.

AllOLLi

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



Re: [PHP] convert array to HTML GET request

2005-10-02 Thread M. Sokolewicz

Jasper Bryant-Greene wrote:

Martin van den Berg wrote:


How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.



HTTP GET and POST requests are formatted the same, just sent in 
different ways. I don't know if there's a function; I'd just use:


?php
$myArray = array(
'apples' = 'oranges',
'pears' = 'peaches',
);

$queryParts = array();
foreach( $myArray as $key=$value ) {
$queryParts[] = $key=$value;
you might also want to use urlencode() in here to make sure the URL 
stays valid.


- tul


}

$query = implode( '', $queryParts );

// For GET, use e.g.:
$data = file_get_contents( http://www.example.com/?$query; );

// For POST, pass $query to curl_setopt for an HTTP POST (see CURL docs)
?

Disclaimer: I typed this from memory and haven't tested it, so there 
might be minor errors, but you get the picture.


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



Re: [PHP] convert array to HTML GET request

2005-10-02 Thread Chris

PHP 5 has the http_build_query function which does exactly what you want:

http://www.php.net/http_build_query

Chris

Martin van den Berg wrote:


Newbe question:

How does one convert an array into a HTML GET request easely? Are
there any standard functions?

Same for HTML POST requests.

Thanks,

Martin.

 



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



Re: [PHP] PHP 5 Hosting

2005-10-02 Thread Torgny Bjers
Oliver Grätz wrote:

Sheesh! No week passing by without people complaining about hosters
missiong out on PHP5. This is one point where we in Germany seem to be
lucky. The two biggest german hosters 11 (about 4 million domains) and
Strato (about 2.5 million domains) both offer SSH and the possibility to
chosse the PHP version on a per directory basis (via .htaccess). Strato
offers PHP 3.x, 4.0.x, 4.3.x and 5.0.x in parallel. Perhaps you should
think about outsourcing your hosting *g*.
  


I am assuming they're running PHP through CGI in this case, am I
correct, or are they hosting on Windows to achieve the multiple PHP
versions? If CGI, that rather affects performance of larger
applications, it especially impact render time of more complex templates
and forms. During my own testing we gained lots of time by just running
it as a compiled Apache module instead of through CGI and in .htaccess.

On our hosting servers we solved it by running a compiled PHP 5 Apache
module on one server, and regular on the others. This way, if someone
requests PHP 5, they can be put on the server that supports it, and if
somebody wants to switch server from PHP 4 to PHP 5, it's an easy enough
task. Or, of course, we have the CGI option to fall back on.

Regards,
Torgny

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



[PHP] Re: anyone want to teach php?

2005-10-02 Thread John Taylor-Johnston

Karl,
I cannot make promises, but I might have someone. If he answers me, I'll 
let you know.
He got me started a few years ago. Excellent teacher, and author of 
phpMyAdmin :-P

John

Karl James wrote:


Hello Team,

I was wondering if there is anyone that would like to teach 
Me the language as a teacher of a class would. Like 
Giving assignments and stuff. 

I tried to learn from books and website tutorials but it doesn't 
Seem to do the trick for me.


Would anybody be willing to do this, if so please email me 
Off list, and directly to my verizon.net address listed below.


I would be willing to pay somebody for their services.
I would like to keep it reasonable please. I am live from check
To check. I understand most of the basics. I will have to refresh
My self with the basics again but it shouldn't take to much time.

Please let me know your thoughts if any one can help me.

Karl James (The Saint)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.theufl.com/
 



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



Re: [PHP] convert array to HTML GET request

2005-10-02 Thread adriano ghezzi
if i understand well you need to get an array from html post


if you use the same name for your html fields you automatically have
an array in $_POST

eg

input type=text  name=myfield value=field_1
input type=text name=myfield value=field_2

you'll get the array  ar_myfield = $_POS['myfield']

you should achieve the same result using myfield[key] in the name of html

hyh

by ag.


2005/10/2, Martin van den Berg [EMAIL PROTECTED]:
 Newbe question:

 How does one convert an array into a HTML GET request easely? Are
 there any standard functions?

 Same for HTML POST requests.

 Thanks,

 Martin.

 --
 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] HTML Header Location - relative URI issue

2005-10-02 Thread Jaepil Kim

Hi

HTML 1.1 specifies that Location in HTML Header should be absolute URI.
Also says that some of the browsers will not work with relative URI.

Can anyone show me which browsers fail to work with *relative URI* in a
HTML Header Location?

Regards,

Jaepil

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



Re: [PHP] HTML Header Location - relative URI issue

2005-10-02 Thread Jasper Bryant-Greene

Jaepil Kim wrote:

HTML 1.1 specifies that Location in HTML Header should be absolute URI.
Also says that some of the browsers will not work with relative URI.

Can anyone show me which browsers fail to work with *relative URI* in a
HTML Header Location?


I assume you mean HTTP 1.1, not HTML 1.1. IMHO the question you should 
be asking is why would you want to knowingly disobey the standard and 
send a relative URI? It's not exactly difficult to send an absolute URI 
in any circumstance I can think of.


There is no guarantee that future user agents will continue to work with 
your website if you do send a relative URI, as they are usually (albeit 
loosely) based around the standards, which require an absolute URI [1].


[1] http://w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



Re: [PHP] HTML Header Location - relative URI issue

2005-10-02 Thread Jaepil

Jasper Bryant-Greene wrote:

Jaepil Kim wrote:


HTML 1.1 specifies that Location in HTML Header should be absolute URI.
Also says that some of the browsers will not work with relative URI.

Can anyone show me which browsers fail to work with *relative URI* in a
HTML Header Location?



I assume you mean HTTP 1.1, not HTML 1.1. IMHO the question you should 
be asking is why would you want to knowingly disobey the standard and 
send a relative URI? It's not exactly difficult to send an absolute URI 
in any circumstance I can think of.


There is no guarantee that future user agents will continue to work with 
your website if you do send a relative URI, as they are usually (albeit 
loosely) based around the standards, which require an absolute URI [1].


[1] http://w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30


Thanks for the reply.

The situation is that I'm working with code that was written by someone 
else. And relative URIs were used all over the place.


I had to decide how serious this is, that's why I had to ask a rather 
stupid question.


Regards,

Jaepil

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



[PHP] Image resizing...

2005-10-02 Thread Sonia
Hi All

I've been working on finishing a project SGML2IMAGE and I am sort of having
trouble with resizing of images. I am trying to just use the GD library so
when I distro the package it will not need any other things installed to be
used. Now I am using...

imagecreatetruecolor ();
imagecreatefrom___ ();
imagecopyresampled ();
image___ ();

But the thumbnails look blurry for any image less than 50% of the original
image created by the PHP SGML parser. So my question seeing I am not very
good with the GD library. Am I using the best functions to do the resize or
should I be using some other image function(s) that may give better results!
To give you a idea of what I am doing see the demo running on my note
book

http://24.218.192.217/capture.php

Thanks

sonia

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



[PHP] Re: php5--com terribly wrong ?

2005-10-02 Thread Sonia
If you need this functionality then you should go back to PHP 4 the version
that worked for you. I also have problems with this and winmgmts object.
some classes work others don't, most times it's a VARIANT type problems. I
know Wez is really busy but if you keep checking the snap shots you will see
he is fixing things as they come in. A good idea is to check  bugs.php.net
before upgrading as it will help determine if a update is a wise decision!

Sonia

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



Re: [PHP] session_name(CCLTrolley)

2005-10-02 Thread John Taylor-Johnston

Robert Cummings wrote:


Is there a reason you're using a comma delimited string? I would
recommend using an array instead:

?php
session_name( 'CCLTrolley' );
session_start();
// Initialize the trolley.
if( !isset( $_SESSION['TrolleyContents'] ) )
{
   $_SESSION['TrolleyContents'] = array();
}
// Add new entry.
if( isset( $_POST['RNum'] ) )
{
   $_SESSION['TrolleyContents'][$_POST['RNum']] = $_POST['RNum'];
}
echo implode( ',', $_SESSION['TrolleyContents'] );
print_r($_SESSION);
?

Cheers,
Rob.
 



Hi,
Still absorbing this array stuff :).
I'm getting this error. And when RNum = 1 or = 16 or = 116, it only 
registers '1', or whatever the first digit is.


Warning: Bad arguments to implode() in /var/.../printtrolley.php on line 14
Array ( [TrolleyContents] = 1 3 4 4 5 6 )

I was expecting to see soemthing like:

TrolleyContents[16]
TrolleyContents[32]
TrolleyContents[45]
TrolleyContents[48]
TrolleyContents[55]
TrolleyContents[116]

if I have done my homework, since last night ;), correctly?

The manual example says:
?php
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(,, $array);
echo $comma_separated; // lastname,email,phone
?

What is my correct seperator? And why does only one digit get registered?

Thanks,
John

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



[PHP] buffer problem having a mind of its own

2005-10-02 Thread matt VanDeWalle

hello again
I was writing and rewriting my user function for my  chat server trying to 
crush this bug but its beyond me whats going on.  basically I have it so 
if a new user comes on, we know that if they type new at the prompt so 
it goes to the newuser function, asks for a username, accepts that 
alright, but when I ask for a password(echoed or not), even if i ask for 
anything else, just the second input of the function, it skips right 
threw that, prompts for it but apparently the buffer still has a \n in it 
so it is assuming that is the password and going right onto the 3rd signup 
prompt, i could stick with the default password being a random number and 
avoiding this whole problem, but i actually don't, the buffer is still 
full of whatever, and would ask the 3rd prompt but just drop right threw,


I turned on  implicit_flush in php.ini, just as a second measure, I call 
ob_implicit_flush() after reading from the socket each time, but the '\n' 
or whatever mysterious character, still seems to be there, also, I know 
too because before i started working on redoing the logon function, i 
would log on and i would automatically have a character sent but i didn't 
type anything so something is really screwy or am I just not clearing the 
buffers the right way?
oh yes, as you may have assumed from what I wrote, or may not have, after 
the password or otherwise 2nd prompt, things work as expected with the 
other prompts,

if this helps, I am using php 4.3.10  in command line interface

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



Re: [PHP] session_name(CCLTrolley)

2005-10-02 Thread John Taylor-Johnston
Warning: Bad arguments to implode() in /var/.../printtrolley.php on 
line 14

Array ( [TrolleyContents] = 1 3 4 4 5 6 )

I restarted Mozilla and tried again.
It's ok now.
Thanks for your time.

Array
(
   [TrolleyContents] = Array
   (
   [16] = 16
   [30] = 30
   [47] = 47
   [76] = 76
   [368] = 368
   [1687] = 1687
   [1939] = 1939
   [1761] = 1761
   [1880] = 1880
   [1936] = 1936
   )

)

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



Re: [PHP] session_name(CCLTrolley)

2005-10-02 Thread Robert Cummings
On Mon, 2005-10-03 at 00:16, John Taylor-Johnston wrote:
  Warning: Bad arguments to implode() in /var/.../printtrolley.php on 
 line 14
  Array ( [TrolleyContents] = 1 3 4 4 5 6 )
 
 I restarted Mozilla and tried again.
 It's ok now.
 Thanks for your time.

The old session was probably still populated with the string version.

 
 Array
 (
 [TrolleyContents] = Array
 (
 [16] = 16
 [30] = 30
 [47] = 47
 [76] = 76
 [368] = 368
 [1687] = 1687
 [1939] = 1939
 [1761] = 1761
 [1880] = 1880
 [1936] = 1936
 )
 
 )

This is the old version I demonstrated. You should go with the later
version that sets the values to the quantity :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] PHP 5 Hosting

2005-10-02 Thread Oliver Grätz
Torgny Bjers schrieb:
 I am assuming they're running PHP through CGI in this case, am I
 correct, or are they hosting on Windows to achieve the multiple PHP
 versions? If CGI, that rather affects performance of larger
 applications, it especially impact render time of more complex templates
 and forms. During my own testing we gained lots of time by just running
 it as a compiled Apache module instead of through CGI and in .htaccess.

Well, I guess you are right. One can compile multiple versions of PHP to
run as Apache module in parallel by changing the sources (one has to
change some symbol names) but I think Strato didn't do that since most
shared hosting services run PHP as CGI anway for security reasons.

Also, I think writing applications with high performance requirements
somewhat contradicts deploying them on shared hosts. If you need
performance: Get a dedicated server and - if you want - even compile yer
own hand-optimized PHP.

And: Clever development circumvents the CGI bottleneck. Developing is
absolutely no problem under CGI since it's done by just a few users and
here the flexibility of multiple version kicks in: You can freely
choose! For the production version you simply use a good userland cache
that minimizes the work done by PHP.


AllOLLi

  Bree: Do you know, I’ve finally convinced Rex to buy his first orchid.
George: Make sure you study up. I hate people who own precious flowers
 and don’t know how to take proper care of them.
   Rex: You know what I hate? Weeds. They just pop up out of nowhere
 and you have to work so hard to get rid of them.
George: I find that with the right chemicals you can get rid of anything.
[DH 120, earns the price for most subtext per sentence.]

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



Re: [PHP] session_name(CCLTrolley)

2005-10-02 Thread John Taylor-Johnston

This is the old version I demonstrated. You should go with the later
version that sets the values to the quantity :)

I thought I had? Haven't I?
But this is the easiest shopping cart I have ever seen.
However, I still have not understood what you were doing with these 
lines I commented out.


   if( isset( $_SESSION['TrolleyContents'][$_POST['RNum']] ) )
   {
   #$_SESSION['TrolleyContents'][$_POST['RNum']] -= 1;
   #if( $_SESSION['TrolleyContents'][$_POST['RNum']] = 0 )
   #{
   unset( $_SESSION['TrolleyContents'][$_POST['RNum']] );
   #}

They did not work, or seem to?

John

---snip
http://testesp.flsh.usherbrooke.ca/db/trolley.php

Array
(
[TrolleyContents] = Array
(
[2378] = 2378
[2504] = 2504
)
)
)

---snip
?php
session_name( 'CCLTrolley' );
session_start();

// Initialize the trolley.
if( !isset( $_SESSION['TrolleyContents'] ) )
{
   $_SESSION['TrolleyContents'] = array();
}

echo $_POST['ShopAction'].!!br;

if(add == $_POST['ShopAction'])
{
   echo adding ...;
   // Add new entry:

   if( isset( $_POST['RNum'] ) )
   {
   $_SESSION['TrolleyContents'][$_POST['RNum']] = $_POST['RNum'];
   }
   echo implode( ',', $_SESSION['TrolleyContents'] );

   #echo $_POST['RNum'].!!br;
}else{
   echo deleting ...;
   //Delete an entry:
   if( isset( $_SESSION['TrolleyContents'][$_POST['RNum']] ) )
   {
   #$_SESSION['TrolleyContents'][$_POST['RNum']] -= 1;
   #if( $_SESSION['TrolleyContents'][$_POST['RNum']] = 0 )
   #{
   unset( $_SESSION['TrolleyContents'][$_POST['RNum']] );
   #}
   }
}
print_r( $_SESSION );
?

Delete form: snip ---
form ACTION=trolley.php METHOD=POST
input type=hidden name=RNum value=2378
input type=hidden name=searchenquiry value=Taylor-Johnston, 
Johninput type=hidden name=ShopAction value=delete
input type=image name=submit src=/icon/full3.gif border=0 
alt=Delete title=Delete style=padding-right: 
5px;brsmallDelete/small/form


Add form: snip ---
form targt=printwindow ACTION=trolley.php METHOD=POST
input type=hidden name=RNum value=2504
input type=hidden name=searchenquiry value=John 
Taylor-Johnstoninput type=hidden name=ShopAction value=add
input type=image name=submit src=/icon/empty3.gif border=0 
alt=Add to cart title=Add to cart style=padding-right: 
5px;brsmallAdd to cart/small/form


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



Re: [PHP] session_name(CCLTrolley)

2005-10-02 Thread John Taylor-Johnston

This is what you recommended.


Is there a reason you're using a comma delimited string? I would
recommend using an array instead:
?php
session_name( 'CCLTrolley' );
session_start();
// Initialize the trolley.
if( !isset( $_SESSION['TrolleyContents'] ) )
{
$_SESSION['TrolleyContents'] = array();
}
// Add new entry.
if( isset( $_POST['AddToTrolley'] ) )
{
$_SESSION['TrolleyContents'][$_POST['AddToTrolley']] =
$_POST['AddToTrolley']
}
echo implode( ',', $_SESSION['TrolleyContents'] );
phpinfo();
?


This is what I implemented? Where did I go wrong?
John

?php
session_name( 'CCLTrolley' );
session_start();

// Initialize the trolley.
if( !isset( $_SESSION['TrolleyContents'] ) )
{
   $_SESSION['TrolleyContents'] = array();
}

if(add == $_POST['ShopAction'])
{
   // Add new entry:
   if( isset( $_POST['RNum'] ) )
   {
   $_SESSION['TrolleyContents'][$_POST['RNum']] = $_POST['RNum'];
   }
   echo implode( ',', $_SESSION['TrolleyContents'] );
}else{
   //Delete an entry:
   if( isset( $_SESSION['TrolleyContents'][$_POST['RNum']] ) )
   {
   #$_SESSION['TrolleyContents'][$_POST['RNum']] -= 1;
   #if( $_SESSION['TrolleyContents'][$_POST['RNum']] = 0 )
   #{
   unset( $_SESSION['TrolleyContents'][$_POST['RNum']] );
   #}
   }
}
print_r( $_SESSION );
#phpinfo();
?

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