[PHP] php server installation

2008-04-10 Thread hce
Hi,

I've installed lighty and php5 to a FC6 box for testing php code in my
local machine, I set up www.mytest.com to the /etc/hosts. I can see a
page of http://www.mytest.com/index.html, but a blank page to
http://www.mytest.com/index.php. I've run an command "php -l
index.php", the result was "No syntax errors detected in index.php".
What I was missing?

Thank you.

Jim

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



[PHP] Re: books for php

2008-04-10 Thread Manuel Lemos
Hello,

on 04/06/2008 12:28 PM news.php.net said the following:
> Which are the good books for learning php? 

Here you may find several PHP books that got good reviews:

http://www.phpclasses.org/reviews/latest/latest.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: How to create combo-boxes/list boxes connected with MS SQL Serverdatabase in PHP scripts

2008-04-10 Thread Manuel Lemos
Hello,

on 04/09/2008 02:27 AM [EMAIL PROTECTED] said the following:
> Sir
> I want to create combo-boxes/list-boxes from a table which is available in 
> MS-Sql server database. I have established connectivity with ms-sql server 
> database using odbc.
> how can i create combo-boxes in my php scripts?
> waiting for an early reply.

You may want to try this forms generation class that comes with a
plug-in to link 2 or more select inputs . There are variants of that
plug-in can retrieve new options from a database on the server. Most
popular databases are supported, including MS-SQL server, with the
variants that use the Metabase or PEAR::MDB2 database API.

http://www.phpclasses.org/formsgeneration

Here is a live example of the linked select plug-in:

http://www.meta-language.net/forms-examples.html?example=test_linked_select

Here you may watch a tutorial video also about this plug-in:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-linked-select.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] APC & FastCGI != upload progress ?

2008-04-10 Thread Manuel Lemos
Hello,

on 04/09/2008 03:07 PM steve said the following:
>>> FastCGI is *the* way to run PHP, but I think Apache is not the
>>> platform for it anymore.
>> If need more than one server, Apache pre-forked model may limited.
>> Otherwise it is just fine. Other than that, I think there are some
>> features that only work with Apache SAPI.
> 
> Apache SAPI is the easiest. But it falls apart when you have a higher
> load. FastCGI can stall those who are thinking of getting their second
> webserver. When you have a whole farm of them the differences are
> grossly obvious.

Sure, but it also adds overhead when replying to HTTP requests. There
are no miracles.


>>> Is the COMMET implementation on the client side long polling
>>> (reconnect) or does it stream using script tags? What goes on in the
>>> server? Does it push the buffer of blank data that WebKit requires? Is
>>> it a PHP daemon process running as a simple HTTP server?
>> Actually it is just an hidden iframe that loads an HTML page with small
>> Javascript chunks that flush each COMET AJAX server response. This is a
>> regular HTTP request performed to the same script that serves that form.
>> The form AJAX plug-in can detect the AJAX request and respond
>> adequately. So it works equally well in all browsers including Webkit.
> 
> So you keep a whole Apache/PHP process open for each user? That is
> nice for a small site, but doesn't work with tens of thousands of
> simultaneous connections. :(

No, I did not say that. "AJAX" requests using this approach are
triggered on demand. For PHP is like any other request. Executing an
AJAx request this way or a regular request submiting a form or following
a link consumes just one process.


> Webkit has a bug/feature that it would buffer the incoming data until
> it reached 1024 bytes. You can see how the django server deals with it
> in their comet implementation:
> http://code.google.com/p/django-evserver/source/browse/trunk/comet.py
>
> Orbited also uses 100 "" as padding.

Maybe you are talking about some other Comet approach. Last time I tried
the approach that I described with Safari, I did not see any delay due
to buffering. But if there is any delay imposed by any browsers, it
would not be hard to add any padding.


> So does meteor I believe. Here is what they say:
> "Safari and IE have a buffer which must fill up before any response is
> parsed. Data received before the buffer is full will not be rendered
> or interpreted and will not fire the Interactive state of an XHR until
> the buffer is full or the connection is closed. The obvious solution

The approche described above does not render anything nor uses
XMLHTTPRequests. It is just a regular page with some Javascript loaded
in an hidden iframe. That Javascript communicates and updates with the
iframe parent page.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: dynamic boxes problem... JS and PHP

2008-04-10 Thread David Lidstone

Ryan S wrote:

Hey everyone,

A bit of a puzzle here, dont know if this is a JS problem or PHP or FF or  
just me.

(My money is on the last one :p )


Here's what I am trying to do:
In a form  I have a listbox with the values 1-5, and under the listbox i have a  with the id of 
"recips" (like so: ;). It does also sound like a possible 'wellformedness' issue as you 
have different results from IE and Fx.


Good luck, David

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



[PHP] PHP GD library installing

2008-04-10 Thread Luca Paolella
How do I install/activate the GD library with my existing PHP version?  
I'm quite sure it isn't already, since I got this error:


Fatal error: Call to undefined function imagecreate() in /Volumes/Data/ 
Users/luca/Library/WebServer/Documents/reloadTest/image.php on line 6


Please forgive my ignorance, and thanks for your help

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



Re: [PHP] PHP GD library installing

2008-04-10 Thread Thijs Lensselink

Quoting Luca Paolella <[EMAIL PROTECTED]>:


How do I install/activate the GD library with my existing PHP version?
I'm quite sure it isn't already, since I got this error:

Fatal error: Call to undefined function imagecreate() in
/Volumes/Data/Users/luca/Library/WebServer/Documents/reloadTest/image.php on
line 6

Please forgive my ignorance, and thanks for your help



On windows it's as easy as downloading the dll from pecl4win.php.net.

But from your directory structure i presume you have some sort of *nix system.
So you have to reconfigure and rebuild PHP. Add the following to the  
configure line. And rebuild PHP after that. Make sure GD is installed  
on the system.


--with-gd --with-jpeg-dir --with-png-dir

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



Re: [PHP] PHP GD library installing

2008-04-10 Thread Robin Vickery
On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote:
> Quoting Luca Paolella <[EMAIL PROTECTED]>:
>
>
> > How do I install/activate the GD library with my existing PHP version?
> > I'm quite sure it isn't already, since I got this error:
> >
> > Fatal error: Call to undefined function imagecreate() in
> >
> /Volumes/Data/Users/luca/Library/WebServer/Documents/reloadTest/image.php
> on
> > line 6
> >
> > Please forgive my ignorance, and thanks for your help
> >
> >
>
>  On windows it's as easy as downloading the dll from pecl4win.php.net.
>
>  But from your directory structure i presume you have some sort of *nix
> system.
>  So you have to reconfigure and rebuild PHP.

Ouch... first try installing the php gd module through whatever
package manager your *nix distribution uses. For instance, on Ubuntu
linux you'd do:

sudo aptitude install php5-gd

-robin

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



[PHP] newsletter administration

2008-04-10 Thread Alain Roger
Hi,

I need to do a little CMS for managing Newsletter for 1 of my customers.
as i never worked on such thing in the past, i would be glad to have your
feedback.

basically, web site users are registered into DB.
my customer would like to send them a newsletter to promote new products and
services.
this newsletter should be in HTML format and send 1 by 1 to each customer.

where can i find information or template how to develop such managing tool
for newsletter ?
i mean online, customer will create his newsletter layout and add images,
links, text, and so on...

to what should i pay attention ?

thanks a lot,

-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] newsletter administration

2008-04-10 Thread Aschwin Wesselius

Alain Roger wrote:

Hi,

I need to do a little CMS for managing Newsletter for 1 of my customers.
as i never worked on such thing in the past, i would be glad to have your
feedback.

basically, web site users are registered into DB.
my customer would like to send them a newsletter to promote new products and
services.
this newsletter should be in HTML format and send 1 by 1 to each customer.

where can i find information or template how to develop such managing tool
for newsletter ?
i mean online, customer will create his newsletter layout and add images,
links, text, and so on...

to what should i pay attention ?

thanks a lot,

  


Hi,

Not to disturb your agreement with your customer, but sending out 
newsletters is a difficult business.


If your customer sends out these newsletters from his own mailserver, 
chances are that his mailserver becomes blacklisted. Even if the 
messages are legit, some people think otherwise.


The result of this is, that his whole domain becomes blocked, so his 
business can't send normal e-mail from this domain anymore to people who 
use blacklists.


This has nothing to do with your question about programming it in PHP 
etc., but I do want you to notice these impacts.


On the PHP/HTML part, make your layout as strict as possible. Every 
e-mail client parses the HTML differently and Outlook 2007 even went 
back to Word HTML compatibility which is a pain in the bottom to get it 
right.


Building good, solid templates for newsletters is not something I would 
like to build for any customer.


--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other'/


Re: [PHP] newsletter administration

2008-04-10 Thread Brice
On Thu, Apr 10, 2008 at 12:55 PM, Alain Roger <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I need to do a little CMS for managing Newsletter for 1 of my customers.
> as i never worked on such thing in the past, i would be glad to have your
> feedback.
>
> basically, web site users are registered into DB.
> my customer would like to send them a newsletter to promote new products
> and
> services.
> this newsletter should be in HTML format and send 1 by 1 to each customer.
>
> where can i find information or template how to develop such managing tool
> for newsletter ?


You can use http://www.phplist.com/

Regards,
Brice Favre


> i mean online, customer will create his newsletter layout and add images,
> links, text, and so on...
>
> to what should i pay attention ?
>
> thanks a lot,
>
> --
> Alain
> 
> Windows XP SP2
> PostgreSQL 8.2.4 / MS SQL server 2005
> Apache 2.2.4
> PHP 5.2.4
> C# 2005-2008
>


Re: [PHP] PHP GD library installing

2008-04-10 Thread Thijs Lensselink

Quoting Robin Vickery <[EMAIL PROTECTED]>:


On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote:

Quoting Luca Paolella <[EMAIL PROTECTED]>:


> How do I install/activate the GD library with my existing PHP version?
> I'm quite sure it isn't already, since I got this error:
>
> Fatal error: Call to undefined function imagecreate() in
>
/Volumes/Data/Users/luca/Library/WebServer/Documents/reloadTest/image.php
on
> line 6
>
> Please forgive my ignorance, and thanks for your help
>
>

 On windows it's as easy as downloading the dll from pecl4win.php.net.

 But from your directory structure i presume you have some sort of *nix
system.
 So you have to reconfigure and rebuild PHP.


Ouch... first try installing the php gd module through whatever
package manager your *nix distribution uses. For instance, on Ubuntu
linux you'd do:

sudo aptitude install php5-gd



Ouch? That's exactly what i added to my post "Make sure GD is installed
on the system."



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



[PHP] Evaluating math without eval()

2008-04-10 Thread Jason Norwood-Young
Hi all

First post to this list! I'm trying to figure out how to evaluate a
string with a mathematical expression and get a result, but without
using eval() as I'm accepting user input into the string. I don't just
want addition, subtraction, multiplication and division - I'd like to
take advantage of other functions like ceil, floor etc. 

So the string "18-10" should give me 8, "ceil(1/2)*10" should be 10 (if
my maths is correct) and the string "18-10;\r\nunlink('/var/www/*');"
should not execute.

Any ideas?

Thanks!
Jason


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



Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Richard Heyes

First post to this list! I'm trying to figure out how to evaluate a
string with a mathematical expression and get a result, but without
using eval() as I'm accepting user input into the string. I don't just
want addition, subtraction, multiplication and division - I'd like to
take advantage of other functions like ceil, floor etc. 


So the string "18-10" should give me 8, "ceil(1/2)*10" should be 10 (if
my maths is correct) and the string "18-10;\r\nunlink('/var/www/*');"
should not execute.


If you can provide your users with distinct inputs (if it's a form) go 
that route.


--
Richard Heyes
Employ me:
http://www.phpguru.org/cv

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



Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Jason Norwood-Young

On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote:
> > First post to this list! I'm trying to figure out how to evaluate a
> > string with a mathematical expression and get a result, but without
> > using eval() as I'm accepting user input into the string. I don't just
> > want addition, subtraction, multiplication and division - I'd like to
> > take advantage of other functions like ceil, floor etc. 
> > 
> > So the string "18-10" should give me 8, "ceil(1/2)*10" should be 10 (if
> > my maths is correct) and the string "18-10;\r\nunlink('/var/www/*');"
> > should not execute.
> 
> If you can provide your users with distinct inputs (if it's a form) go 
> that route.

Thanks Richard

Unfortunately it's not that simple. The equation sits in a DB and can be
anything - eg. ((([valuation]/[purchaseprice])/100)*100)/[numyears]
would be a typical field. [valuation], [purchaseprice] and [numyears]
gets replaced by relevant fields from user-entered data. But the system
is expandable which means I don't know what the equations, data or
fields are going to be beforehand. 

I'm working on some kinda preg_replace function to sanitize the data at
the moment and then run an eval - arg I hate regexp! Ideally eval would
have some kind of sandboxing option, or you could limit the functions
available in an eval.

J


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



Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Jason Norwood-Young
On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote:
> > First post to this list! I'm trying to figure out how to evaluate a
> > string with a mathematical expression and get a result, but without
> > using eval() as I'm accepting user input into the string. I don't just
> > want addition, subtraction, multiplication and division - I'd like to
> > take advantage of other functions like ceil, floor etc. 

In reply to my own question, I came up with the following function based
on a comment on php.net
(http://www.php.net/manual/en/function.eval.php#71045). I had a look at
the array returned by get_defined_functions() and the maths functions
seem mostly to be grouped (with the exception of the random number
stuff). It works on my installation but there's nothing in the
documentation about get_defined_functions() returning in a particular
order - it would be safer to list each math function but I'm lazy.

protected function safe_eval($s) {
$funcs=get_defined_functions();
$funcs=$funcs["internal"];
$funcs=array_slice($funcs,array_search("abs",
$funcs),array_search("rad2deg",$funcs)-array_search("abs",$funcs));
$sfuncs="(".implode(")(",$funcs).")";
$s=preg_replace('`([^+\-*=/\(\)\d\^<>&|\.'.$sfuncs.']*)`','',$s);
if (empty($s)) {
return 0;
} else {
try {
eval("\$s=$s;");
return $s;
} catch(Exception $e) {
return 0;
}
}
}


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



Re: [PHP] PHP GD library installing

2008-04-10 Thread Robin Vickery
On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote:
> Quoting Robin Vickery <[EMAIL PROTECTED]>:
>
>
> > On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote:
> >
> > > Quoting Luca Paolella <[EMAIL PROTECTED]>:
> > >
> > >
> > > > How do I install/activate the GD library with my existing PHP version?
> > > > I'm quite sure it isn't already, since I got this error:
> > > >
> > > > Fatal error: Call to undefined function imagecreate() in
> > > >
> > >
> /Volumes/Data/Users/luca/Library/WebServer/Documents/reloadTest/image.php
> > > on
> > > > line 6
> > > >
> > > > Please forgive my ignorance, and thanks for your help
> > > >
> > > >
> > >
> > >  On windows it's as easy as downloading the dll from pecl4win.php.net.
> > >
> > >  But from your directory structure i presume you have some sort of *nix
> > > system.
> > >  So you have to reconfigure and rebuild PHP.
> > >
> >
> > Ouch... first try installing the php gd module through whatever
> > package manager your *nix distribution uses. For instance, on Ubuntu
> > linux you'd do:
> >
> > sudo aptitude install php5-gd
> >
> >
>
>  Ouch? That's exactly what i added to my post "Make sure GD is installed
>  on the system."

Making sure GD is installed on the system is a very sensible thing to do.

The "ouch" was aimed at the suggestion that if you're on a *nix
system, the course of action is to recompile php. Normally these days
you'd just install the gd module (the equivalent of your windows dll)
through your package manager.

-robin

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



[PHP] Vote for PHP support in Google App Engine

2008-04-10 Thread Paul van Brouwershaven
Have you seen the Google App Engine already, the guys from Google are crazy! You now can host your 
application on the Google network, including Big Table and GFS!


Ok, one problem... they currently only support Python for programming, but the good news is that 
they will add more languages like PHP in the future.


To get PHP as the next language that will be integrated on Google App Engine, please give your vote 
at there Project page at code.google.com!!


http://code.google.com/p/googleappengine/issues/detail?id=13

Read and see more about Google App Engine:
  - http://code.google.com/appengine/
  - http://code.google.com/p/googleappengine/

Regards,

Paul

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



[PHP] Re: Connecting to an epp server

2008-04-10 Thread Paul van Brouwershaven

don't forget to send the 4 bytes!

Alan Willsher schreef:

Hi im trying to connect to Nominets EPP server

Details can be found here http://www.nominet.org.uk/registrars/systems/epp/

Im trying to send a login request the example can be found here
http://www.nominet.org.uk/registrars/systems/epp/login/

My script seems to connect ok, but im recieving no response when I try to
send the login xml details.



  http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">

  
EXAMPLE-TAG
foo-BAR2

  1.0
  en


   http://www.nominet.org.uk/epp/xml/nom-account-1.0

   http://www.nominet.org.uk/epp/xml/nom-domain-1.0
   http://www.nominet.org.uk/epp/xml/nom-contact-1.0

   http://www.nominet.org.uk/epp/xml/nom-ns-1.0

  
  ABC-12345

  ';

fputs($fp, $xml, strlen($xml));

while (!feof($fp)) {
  $response .= fgets($fp, 128);
}
echo $response;

fclose($fp);

}
?>



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



Re: [PHP] PHP GD library installing

2008-04-10 Thread Thijs Lensselink

Quoting Robin Vickery <[EMAIL PROTECTED]>:


On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote:

Quoting Robin Vickery <[EMAIL PROTECTED]>:


> On 10/04/2008, Thijs Lensselink <[EMAIL PROTECTED]> wrote:
>
> > Quoting Luca Paolella <[EMAIL PROTECTED]>:
> >
> >
> > > How do I install/activate the GD library with my existing PHP version?
> > > I'm quite sure it isn't already, since I got this error:
> > >
> > > Fatal error: Call to undefined function imagecreate() in
> > >
> >
/Volumes/Data/Users/luca/Library/WebServer/Documents/reloadTest/image.php
> > on
> > > line 6
> > >
> > > Please forgive my ignorance, and thanks for your help
> > >
> > >
> >
> >  On windows it's as easy as downloading the dll from pecl4win.php.net.
> >
> >  But from your directory structure i presume you have some sort of *nix
> > system.
> >  So you have to reconfigure and rebuild PHP.
> >
>
> Ouch... first try installing the php gd module through whatever
> package manager your *nix distribution uses. For instance, on Ubuntu
> linux you'd do:
>
> sudo aptitude install php5-gd
>
>

 Ouch? That's exactly what i added to my post "Make sure GD is installed
 on the system."


Making sure GD is installed on the system is a very sensible thing to do.

The "ouch" was aimed at the suggestion that if you're on a *nix
system, the course of action is to recompile php. Normally these days
you'd just install the gd module (the equivalent of your windows dll)
through your package manager.



My bad! :) I always compile everything from source



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



Re: [PHP] PHP GD library installing

2008-04-10 Thread Daniel Brown
On Thu, Apr 10, 2008 at 4:54 AM, Luca Paolella <[EMAIL PROTECTED]> wrote:
> How do I install/activate the GD library with my existing PHP version? I'm
> quite sure it isn't already, since I got this error:
>
>  Fatal error: Call to undefined function imagecreate() in
> /Volumes/Data/Users/luca/Library/WebServer/Documents/reloadTest/image.php on
> line 6

First, this is a server to which you have root access, correct?
You won't be able to install it otherwise, such as if you're on a
shared web host.

Secondly, what *NIX are you using?  It looks to me like a
BSD-style system maybe MacOS?

-- 

Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed!

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



Re: [PHP] Vote for PHP support in Google App Engine

2008-04-10 Thread Julian Kennedy
On Thursday 10 April 2008 16:32, Paul van Brouwershaven wrote:
> Have you seen the Google App Engine already, the guys from Google are
> crazy! You now can host your application on the Google network, including
> Big Table and GFS!
>
> Ok, one problem... they currently only support Python for programming, but
> the good news is that they will add more languages like PHP in the future.
>
> To get PHP as the next language that will be integrated on Google App
> Engine, please give your vote at there Project page at code.google.com!!
>
> http://code.google.com/p/googleappengine/issues/detail?id=13
>
> Read and see more about Google App Engine:
>- http://code.google.com/appengine/
>- http://code.google.com/p/googleappengine/
>
> Regards,
>
> Paul

Looks like they extending their services to web hosting. Wonder when they'll 
offer VPS accounts?

Regards
 
 

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



Re: [PHP] Vote for PHP support in Google App Engine

2008-04-10 Thread Paul van Brouwershaven

Julian Kennedy schreef:
Looks like they extending their services to web hosting. Wonder when they'll 
offer VPS accounts?


No they will not, you may upload your application. They have created a very nice system, but there 
are some restrictions because of security Bigtable and GFS. But your application can scale without 
investing in expensive servers and management. The only think you have to do is building your 
software, Google wil run it on there enormously platform.


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



Re: [PHP] Re: Connecting to an epp server

2008-04-10 Thread Alan Willsher
What is 4 bytes ?

On Thu, Apr 10, 2008 at 3:35 PM, Paul van Brouwershaven <
[EMAIL PROTECTED]> wrote:

> don't forget to send the 4 bytes!
>
> Alan Willsher schreef:
>
>  Hi im trying to connect to Nominets EPP server
> >
> > Details can be found here
> > http://www.nominet.org.uk/registrars/systems/epp/
> >
> > Im trying to send a login request the example can be found here
> > http://www.nominet.org.uk/registrars/systems/epp/login/
> >
> > My script seems to connect ok, but im recieving no response when I try
> > to
> > send the login xml details.
> >
> >
> >  > $fp = @fsockopen('ssl://testbed-epp.nominet.org.uk', 700, $errno,
> > $errstr,
> > 100);
> > echo "(".$errno." ".$errstr.")";
> > if(!$fp) {
> > echo "Not Connected!";
> > }
> >
> > else {
> > echo "Connected!\r\n";
> >
> > $xml = '
> >   >   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >   xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
> >
> >  
> >EXAMPLE-TAG
> >foo-BAR2
> >
> >  1.0
> >  en
> >
> >
> >   http://www.nominet.org.uk/epp/xml/nom-account-1.0
> > 
> >   http://www.nominet.org.uk/epp/xml/nom-domain-1.0
> > 
> >   http://www.nominet.org.uk/epp/xml/nom-contact-1.0
> > 
> >   http://www.nominet.org.uk/epp/xml/nom-ns-1.0
> >
> >  
> >  ABC-12345
> >
> >  ';
> >
> > fputs($fp, $xml, strlen($xml));
> >
> >while (!feof($fp)) {
> >  $response .= fgets($fp, 128);
> >}
> >echo $response;
> >
> >fclose($fp);
> >
> > }
> > ?>
> >
> >
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Evaluating math without eval()

2008-04-10 Thread Jim Lucas

Jason Norwood-Young wrote:

On Thu, 2008-04-10 at 13:15 +0100, Richard Heyes wrote:

First post to this list! I'm trying to figure out how to evaluate a
string with a mathematical expression and get a result, but without
using eval() as I'm accepting user input into the string. I don't just
want addition, subtraction, multiplication and division - I'd like to
take advantage of other functions like ceil, floor etc. 


So the string "18-10" should give me 8, "ceil(1/2)*10" should be 10 (if
my maths is correct) and the string "18-10;\r\nunlink('/var/www/*');"
should not execute.
If you can provide your users with distinct inputs (if it's a form) go 
that route.


Thanks Richard

Unfortunately it's not that simple. The equation sits in a DB and can be
anything - eg. ((([valuation]/[purchaseprice])/100)*100)/[numyears]
would be a typical field. [valuation], [purchaseprice] and [numyears]
gets replaced by relevant fields from user-entered data. But the system
is expandable which means I don't know what the equations, data or
fields are going to be beforehand. 


Maybe something like this



Anyone have suggestions on tests that is_numeric() might not catch?



I'm working on some kinda preg_replace function to sanitize the data at
the moment and then run an eval - arg I hate regexp! Ideally eval would
have some kind of sandboxing option, or you could limit the functions
available in an eval.

J




--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


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



[PHP] RES: [PHP-INSTALL] ftp_put cannot upload a file.

2008-04-10 Thread Thiago Pojda
Tina,
 
Is there any error message in php logs?
 
Can you reproduce manually what you're trying to do with PHP? I mean,
connect and put that file.
 
Enable E_ALL in PHP and try again.
 
I'm copying PHP-GENERAL mailing list as this is not related to PHP-INSTALL
issues.
 
 
Regards,
Atenciosamente,


  www.softpartech.com.br


Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
[EMAIL PROTECTED]
ExcelĂȘncia em Softwares Financeiros


  _  

De: Tina [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 10 de abril de 2008 14:33
Para: [EMAIL PROTECTED]
Assunto: [PHP-INSTALL] ftp_put cannot upload a file.


Dear Sir/Madam
 
I have the following code section and it returns else statement.  A firefox
web browser 1.0.1 is used on a suse linux 2.6.11.4-20a-smp.  php 5 and
apache 2. 
 
---
$uploadfile = ftp_put($ftpconnect, $destinationfile, $sourcefile,
FTP_BINARY);
if ( $uploadfile ) {
echo "Uploaded file = $sourcefile to server name = $servername as file =
$destinationfile.";
} else {
echo "Upload is failed to upload file = $sourcefile to server name =
$servername.";
}
---
 
Would you let me know what causes this problem?
 
 
Ms (Tina) Thieu Van Hung



  _  

Yahoo! for Good helps you make
 a difference



Re: [PHP] php server installation

2008-04-10 Thread Nathan Nobbe
On Thu, Apr 10, 2008 at 1:05 AM, hce <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I've installed lighty and php5 to a FC6 box for testing php code in my
> local machine, I set up www.mytest.com to the /etc/hosts. I can see a
> page of http://www.mytest.com/index.html, but a blank page to
> http://www.mytest.com/index.php. I've run an command "php -l
> index.php", the result was "No syntax errors detected in index.php".
> What I was missing


php -l indicates only that php is working on the cli.
what are the contents of index.php; i recommend a page as follows


if the page prompts you to download something then php isnt installed, or at
least the webserver isnt configured to run it, but if you see a bunch of
stuff similar to the cli output of php -i, ur in good shape :)

-nathan


[PHP] Re: Vote for PHP support in Google App Engine

2008-04-10 Thread Shawn McKenzie

Paul van Brouwershaven wrote:
Have you seen the Google App Engine already, the guys from Google are 
crazy! You now can host your application on the Google network, 
including Big Table and GFS!


Ok, one problem... they currently only support Python for programming, 
but the good news is that they will add more languages like PHP in the 
future.


To get PHP as the next language that will be integrated on Google App 
Engine, please give your vote at there Project page at code.google.com!!


http://code.google.com/p/googleappengine/issues/detail?id=13

Read and see more about Google App Engine:
  - http://code.google.com/appengine/
  - http://code.google.com/p/googleappengine/

Regards,

Paul


Looks like there is a petition also:  http://i-want-php.appspot.com

Sorry, I meant:

http://i-want-php.appspot.com";;

?>


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



[PHP] Re: RES: [PHP-INSTALL] ftp_put cannot upload a file.

2008-04-10 Thread Shawn McKenzie

Thiago Pojda wrote:

Tina,
 
Is there any error message in php logs?
 
Can you reproduce manually what you're trying to do with PHP? I mean,

connect and put that file.
 
Enable E_ALL in PHP and try again.
 
I'm copying PHP-GENERAL mailing list as this is not related to PHP-INSTALL

issues.
 
 
Regards,

Atenciosamente,


  www.softpartech.com.br


Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
[EMAIL PROTECTED]
ExcelĂȘncia em Softwares Financeiros


  _  

De: Tina [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 10 de abril de 2008 14:33

Para: [EMAIL PROTECTED]
Assunto: [PHP-INSTALL] ftp_put cannot upload a file.


Dear Sir/Madam
 
I have the following code section and it returns else statement.  A firefox

web browser 1.0.1 is used on a suse linux 2.6.11.4-20a-smp.  php 5 and
apache 2. 
 
---

$uploadfile = ftp_put($ftpconnect, $destinationfile, $sourcefile,
FTP_BINARY);
if ( $uploadfile ) {
echo "Uploaded file = $sourcefile to server name = $servername as file =
$destinationfile.";
} else {
echo "Upload is failed to upload file = $sourcefile to server name =
$servername.";
}
---
 
Would you let me know what causes this problem?
 
 
Ms (Tina) Thieu Van Hung




  _  


Yahoo! for Good helps you make
 a difference


There could be any number of things wrong, so follow the advice to turn 
on error reporting.  Most likely:


1. Your connection is not valid
2. You didn't login ftp_login() or it failed
3. The local file can't be found
4. The remote dir can't be found or the connected user doesn't have 
permission to write to it
5. If going through a firewall or for other reasons, you most likely 
need ftp_pasv()


-Shawn

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



Re: [PHP] Re: Vote for PHP support in Google App Engine

2008-04-10 Thread Spam Recipient
function sign_petition()
{
throw new Exception('I WANT PHP may use your email address to
personalize your experience on their website.');
}

try {
sign_petition();
} catch (Exception $e) {
echo 'No thank you: ',  $e->getMessage(), "\n";
}

-- 

Homer:  You know what?

Grampa: What?

Homer:  We're both screw-ups.

   Grampa vs. Sexual Inadequacy


On Thu, 2008-04-10 at 13:40 -0500, Shawn McKenzie wrote:
> Paul van Brouwershaven wrote:
> > Have you seen the Google App Engine already, the guys from Google are 
> > crazy! You now can host your application on the Google network, 
> > including Big Table and GFS!
> > 
> > Ok, one problem... they currently only support Python for programming, 
> > but the good news is that they will add more languages like PHP in the 
> > future.
> > 
> > To get PHP as the next language that will be integrated on Google App 
> > Engine, please give your vote at there Project page at code.google.com!!
> > 
> > http://code.google.com/p/googleappengine/issues/detail?id=13
> > 
> > Read and see more about Google App Engine:
> >   - http://code.google.com/appengine/
> >   - http://code.google.com/p/googleappengine/
> > 
> > Regards,
> > 
> > Paul
> 
> Looks like there is a petition also:  http://i-want-php.appspot.com
> 
> Sorry, I meant:
> 
>  
> echo "
>   Looks
>   like
>   there
>   is
>   a
>   petition
>   also:
>   http://i-want-php.appspot.com";;
> 
> ?>
> 
> 


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



Re: [PHP] Requested PHP apps / sites

2008-04-10 Thread Dan
That would be a pretty interesting app to make.  If you actually followed 
Osborn's Brainstorming technique then you should be able to develop a pretty 
cool real-time think tank where developers work in a sort of chat room but 
with a place to post common code, with markup, share a virtual whiteboard, 
etc.


Could be cool.

- Dan



   Oh, what you're looking for is a think tank.  I'd been trying to
find people in my area to get together and do the same thing.  No such
luck around here, but you may have luck in your local area.  Working
offline with people, when you can bounce ideas off of one-another
while doing something else, gets the creative juices flowing more,
because you're not focused on saying, "okay, we need to come up with
an idea."

--

Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed! 



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



Re: [PHP] Requested PHP apps / sites

2008-04-10 Thread Wolf

 Dan <[EMAIL PROTECTED]> wrote: 
> That would be a pretty interesting app to make.  If you actually followed 
> Osborn's Brainstorming technique then you should be able to develop a pretty 
> cool real-time think tank where developers work in a sort of chat room but 
> with a place to post common code, with markup, share a virtual whiteboard, 
> etc.
> 
> Could be cool.
> 
> - Dan
> 
> 
> >Oh, what you're looking for is a think tank.  I'd been trying to
> > find people in my area to get together and do the same thing.  No such
> > luck around here, but you may have luck in your local area.  Working
> > offline with people, when you can bounce ideas off of one-another
> > while doing something else, gets the creative juices flowing more,
> > because you're not focused on saying, "okay, we need to come up with
> > an idea."
> >
> > -- 
> > 
> > Ask me about:
> > Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
> > and shared hosting starting @ $2.50/mo.
> > Unmanaged, managed, and fully-managed! 
> 

Google Document Sharing

Allows multiple people to edit, review, modify, markup...

:)

Wolf

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



[PHP] Socket create with ssl server

2008-04-10 Thread Alan Willsher
Hi how do you use socket_create with an ssl server

ie I would do something like

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind($sock, $sourceip);
socket_connect($sock, 'server.com', 2043);

but if I do

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind($sock, $sourceip);
socket_connect($sock, 'ssl://server.com', 2043);

I get Warning: socket_connect(): Host lookup failed [-10001]: Unknown host

Where do I need to add the ssl://


[PHP] $_SESSION problem

2008-04-10 Thread tedd

Hi gang:

I'm stumped and in need of some expert explanation.

I have prepared two demos (showing code) for your enjoyment:

[1] http://www.webbytedd.com/x/index.php
[2] http://sperling.com/x/index.php

Both of these demos have the exact same code; and are on the same 
server; with exactly the same php-info -- so, why do they behave 
differently re sessions?


Note that [1] will retain the session values throughout the entire 
session, while [2] does not and loses session values.


Why?

Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] $_SESSION problem

2008-04-10 Thread Nathan Nobbe
On Thu, Apr 10, 2008 at 4:29 PM, tedd <[EMAIL PROTECTED]> wrote:

> Hi gang:
>
> I'm stumped and in need of some expert explanation.
>
> I have prepared two demos (showing code) for your enjoyment:
>
> [1] http://www.webbytedd.com/x/index.php
> [2] http://sperling.com/x/index.php
>
> Both of these demos have the exact same code; and are on the same server;
> with exactly the same php-info -- so, why do they behave differently re
> sessions?
>
> Note that [1] will retain the session values throughout the entire
> session, while [2] does not and loses session values.


as a sanity check have you dumped out the contents of the session after
writing to it on [2] ?
eg.



also, doubtful or id assume youd mention it; but do you have .htaccess on
either of the sites?  you might just dump out the session component of the
php config on each site to ensure theyre the same.

-nathan


Re: [PHP] $_SESSION problem

2008-04-10 Thread Nathan Nobbe
On Thu, Apr 10, 2008 at 5:05 PM, Nathan Nobbe <[EMAIL PROTECTED]>
wrote:

> On Thu, Apr 10, 2008 at 4:29 PM, tedd <[EMAIL PROTECTED]> wrote:
>   you might just dump out the session component of the php config on each
> site to ensure theyre the same.
>

on that last note, this could be useful,



-nathan


Re: [PHP] Socket create with ssl server

2008-04-10 Thread Nirmalya Lahiri
--- Alan Willsher <[EMAIL PROTECTED]> wrote:

> Hi how do you use socket_create with an ssl server
> 
> ie I would do something like
> 
> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> socket_bind($sock, $sourceip);
> socket_connect($sock, 'server.com', 2043);
> 
> but if I do
> 
> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> socket_bind($sock, $sourceip);
> socket_connect($sock, 'ssl://server.com', 2043);
> 
> I get Warning: socket_connect(): Host lookup failed [-10001]:
> Unknown host
> 
> Where do I need to add the ssl://
> 

Hi,
 before test your sample program, please check the name
"ssl://server.com" from any DNS server that, the name is really
present in internet or not. Your problem is basically name resolution
error from DNS server. To check the name, apply "host" command from
unix/linux terminal.

 Another point is...as I know the url of ssl encripted page starts
with "https://"; not with "ssl://"...!!!


---
Nirmalya Lahiri
[+91-9433113536]

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [PHP] Requested PHP apps / sites

2008-04-10 Thread Shawn McKenzie

Dan wrote:
That would be a pretty interesting app to make.  If you actually 
followed Osborn's Brainstorming technique then you should be able to 
develop a pretty cool real-time think tank where developers work in a 
sort of chat room but with a place to post common code, with markup, 
share a virtual whiteboard, etc.


Could be cool.

- Dan



   Oh, what you're looking for is a think tank.  I'd been trying to
find people in my area to get together and do the same thing.  No such
luck around here, but you may have luck in your local area.  Working
offline with people, when you can bounce ideas off of one-another
while doing something else, gets the creative juices flowing more,
because you're not focused on saying, "okay, we need to come up with
an idea."

--

Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed! 


Well, I have my idea to do the site to help/collect the brainstorming. 
But that probably won't be my coding project, as this seems to me to be 
just a good forum with polls, for which several good ones already exist.


Maybe I use those to build the site and then the ideas come forth?

-Shawn

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



Re: [PHP] Requested PHP apps / sites

2008-04-10 Thread Shawn McKenzie

Shawn McKenzie wrote:

Dan wrote:
That would be a pretty interesting app to make.  If you actually 
followed Osborn's Brainstorming technique then you should be able to 
develop a pretty cool real-time think tank where developers work in a 
sort of chat room but with a place to post common code, with markup, 
share a virtual whiteboard, etc.


Could be cool.

- Dan



   Oh, what you're looking for is a think tank.  I'd been trying to
find people in my area to get together and do the same thing.  No such
luck around here, but you may have luck in your local area.  Working
offline with people, when you can bounce ideas off of one-another
while doing something else, gets the creative juices flowing more,
because you're not focused on saying, "okay, we need to come up with
an idea."

--

Ask me about:
Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
and shared hosting starting @ $2.50/mo.
Unmanaged, managed, and fully-managed! 


Well, I have my idea to do the site to help/collect the brainstorming. 
But that probably won't be my coding project, as this seems to me to be 
just a good forum with polls, for which several good ones already exist.


Maybe I use those to build the site and then the ideas come forth?

-Shawn


Sorry, I meant:




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



[PHP] Google App Engine needs PHP support

2008-04-10 Thread Manuel Lemos
Hello,

Google App Engine was launched but it does not support PHP. This article
presents some ideas that can help Google adding PHP support sooner
rather than later.

http://www.phpclasses.org/blog/post/77-Google-App-Engine-needs-PHP-support.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Google App Engine needs PHP support

2008-04-10 Thread Shawn McKenzie

Manuel Lemos wrote:

Hello,

Google App Engine was launched but it does not support PHP. This article
presents some ideas that can help Google adding PHP support sooner
rather than later.

http://www.phpclasses.org/blog/post/77-Google-App-Engine-needs-PHP-support.html


-1 Redundant :-)

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



Re: [PHP] Vote for PHP support in Google App Engine

2008-04-10 Thread mike
A co-worker and I were talking about this again today, and I stumbled
upon this crazy idea.

What if this is Google providing people it's own preferred hosting and
backend solutions in the hopes that people make some cool apps they
can easily just buy and not even have to convert to land in their own
environment? I mean, it has their integrated auth, their datastore and
their filesystem.

I'm not quite sure their interest is to support everyone's favorite
language (I could be wrong) but it could be a covert way to get people
to code apps that have very little overhead to bring in-house, since
technically it already is :)

Explained a little bit better here:
http://michaelshadle.com/2008/04/10/google-appengine-1-develop-site-2-get-bought-by-google-3-profit/

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



Re: [PHP] Socket create with ssl server

2008-04-10 Thread Greg Bowser
The sockets extension is a much "lower" level interface to sockets
than the fsockets/stream_ functions in PHP.

Unlike with the aforementioned, with the sockets extension, you can't
just expect to magically get an ssl connection by using "ssl://".

Your problem is that the sockets extension has no idea what you mean
by "ssl://"; and since "ssl://foo" is clearly not a valid domain name,
resolution fails.

Short Answer: use fsockets if you need SSL ;)

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



Re: [PHP] $_SESSION problem

2008-04-10 Thread Eric Wood

tedd wrote:


[1] http://www.webbytedd.com/x/index.php
[2] http://sperling.com/x/index.php

Both of these demos have the exact same code; and are on the same 
server; with exactly the same php-info -- so, why do they behave 
differently re sessions?


Strange.  I've run into issues whenever I use variable names which are 
the same as session variables.  It's as if they step on each others 
toes.  I try to use uniq var names.  I've also recently run into 
customized 401 pages (which you may not see happen, check the logs) 
start up and the session data gets overwrite due to a lack of session 
file locking. 


-eric

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



Re: [PHP] $_SESSION problem

2008-04-10 Thread paragasu
it looks fine to me. but i want to share one bad experience with sessions.
the code i wrote work just fine on my testing server (please note, the
phpinfo is same with
my production server).

after days of figuring out why the session do not work. finally, i found the
solutions.
the solutions is to add a

@session_write_close() on the end of the execution code. on my case it
happen
every time i forward the page. so adding the @session_write_close before the
header('location: ') fix the problem.

this might be a possible explanation..


Re: [PHP] $_SESSION problem

2008-04-10 Thread mike
I believe you can accomplish the same thing by just putting this in:

register_shutdown_function('session_write_close');



On 4/10/08, paragasu <[EMAIL PROTECTED]> wrote:
> it looks fine to me. but i want to share one bad experience with sessions.
> the code i wrote work just fine on my testing server (please note, the
> phpinfo is same with
> my production server).
>
> after days of figuring out why the session do not work. finally, i found the
> solutions.
> the solutions is to add a
>
> @session_write_close() on the end of the execution code. on my case it
> happen
> every time i forward the page. so adding the @session_write_close before the
> header('location: ') fix the problem.
>
> this might be a possible explanation..
>

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



RE: [PHP] Socket create with ssl server

2008-04-10 Thread Wolf
Top postinng due to sendng from my cell phone...

I'd suggest you lookl at doing the ssl to the server ip address not the host 
name, and from reading your other note, it looks like ssl:  isnlt needed, 
merely the name/ip of the server.

HTH,
Wolf

-Original Message-
From: Alan Willsher <[EMAIL PROTECTED]>
Sent: Thursday, April 10, 2008 5:20 PM
To: php-general@lists.php.net
Subject: [PHP] Socket create with ssl server

Hi how do you use socket_create with an ssl server

ie I would do something like

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind($sock, $sourceip);
socket_connect($sock, 'server.com', 2043);

but if I do

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind($sock, $sourceip);
socket_connect($sock, 'ssl://server.com', 2043);

I get Warning: socket_connect(): Host lookup failed [-10001]: Unknown host

Where do I need to add the ssl://



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



[PHP] Re: Common PHP functions benchmarks

2008-04-10 Thread Jason Knight
Does nobody have any other input?

On Tue, Apr 8, 2008 at 12:52 PM, Jason Knight <[EMAIL PROTECTED]> wrote:

> I've been running some benchmarks on popular PHP functions.  I would like
> to get some input on them from the community.  So far I have run tests on
> Arrays and PHP5's SPL ArrayObject, as well as loops and some networking
> functions.
>
>
> Here is a link to the code used for the benchmarks.
> http://www.synthable.com/benchmarks/
>
> Thanks,
> Jason 
>


Re: [PHP] Re: Connecting to an epp server

2008-04-10 Thread Paul van Brouwershaven

epp-example from dns.be:

fp = fsockopen ($addr, $port , $errno, $errstr, $timeout);
return 0;
  }

  function readInteger()
  {
$buf = fread($this->fp, 4);
if (strlen($buf) < 4)
{
  echo "failed to read 4 bytes \n";
  exit;
}
$b0 = ord($buf[0]);
$b1 = ord($buf[1]);
$b2 = ord($buf[2]);
$b3 = ord($buf[3]);
$value = $b3 + 256* ($b2 + 256* ($b1 + 256* $b0));
echo "integer read from socket: $value \n";
return $value;
  }

  function readString ($bytes)
  {
echo "waiting for $bytes bytes\n";
$left = $bytes;
$data = '';
while ( !feof($this->fp) ) {
  $chunk = fread($this->fp, $left);
  $data .= $chunk;
  $left = $left - strlen($chunk);
  if ($left == 0)
break;
}
return $data;
  }

  function readEppString()
  {
$len = $this->readInteger();
$len = $len - 4;
return $this->readString ($len);
  }

  function close()
  {
fclose ($this->fp);
  }


// this will fail for values bigger than 0x7FFF (since PHP sucks at math)
// on Windows:  PHP thinks that 0xFFFE modulo 256 = 256 !?!
// on Linux  :  PHP thinks that 0xFFFE modulo 256 = -2  !?!

  function writeInteger ($value)
  {
$b3 = mod ($value, 256);
$value = ($value - $b3)/256;
$b2 = mod ($value, 256);
$value = ($value - $b2)/256;
$b1 = mod ($value, 256);
$value = ($value - $b1)/256;
$b0 = mod ($value, 256);
echo "$value split up in bytes : $b0 $b1 $b2 $b3 \n";
fwrite ($this->fp, chr($b0), 1);
fwrite ($this->fp, chr($b1), 1);
fwrite ($this->fp, chr($b2), 1);
fwrite ($this->fp, chr($b3), 1);
  }

  function writeEppString ($message)
  {
$len = strlen ($message);
echo "len: $len \n";
$len = $len + 4;
echo "total message length: $len bytes \n";
$this->writeInteger ($len);
echo "writing message itself \n";
$written = fwrite ($this->fp, $message);
echo "bytes written: $written \n";
  }

}

//=
{
  $socket = new EppSocket();

  $server = "ssl://epp.example.org";  // replace with hostname of your 
registry's epp server
  $port = 33123;
  $timeout = 30;

  $ok = $socket->connect ($server, $port, $timeout);

  if ( $ok != 0)
  {
echo "failed to connect to $server, check server name !!";
exit;
  }
  echo "ok, connected to $server at port $port\n";

  $greeting = $socket->readEppString();
  echo "=\n";
  echo "$greeting ";
  echo "=\n";

  $hello = "xmlns=\"urn:ietf:params:xml:ns:epp-1.0\"> ";

  $socket->writeEppString ($hello);
  echo "waiting for reply \n";

  $response = $socket->readEppString();
  echo "=\n";
  echo "$response ";
  echo "=\n";

  $garbage = "xmlns=\"urn:ietf:params:xml:ns:epp-1.0\"> ";

  $socket->writeEppString ($garbage);
  $response = $socket->readEppString();
  echo "=\n";
  echo "$response ";
  echo "=\n";

  $socket->close();
}
?>



Alan Willsher schreef:

What is 4 bytes ?

On Thu, Apr 10, 2008 at 3:35 PM, Paul van Brouwershaven <
[EMAIL PROTECTED]> wrote:


don't forget to send the 4 bytes!

Alan Willsher schreef:

 Hi im trying to connect to Nominets EPP server

Details can be found here
http://www.nominet.org.uk/registrars/systems/epp/

Im trying to send a login request the example can be found here
http://www.nominet.org.uk/registrars/systems/epp/login/

My script seems to connect ok, but im recieving no response when I try
to
send the login xml details.



 http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
   
 
   EXAMPLE-TAG
   foo-BAR2
   
 1.0
 en
   
   
  http://www.nominet.org.uk/epp/xml/nom-account-1.0

  http://www.nominet.org.uk/epp/xml/nom-domain-1.0

  http://www.nominet.org.uk/epp/xml/nom-contact-1.0

  http://www.nominet.org.uk/epp/xml/nom-ns-1.0
   
 
 ABC-12345
   
 ';

fputs($fp, $xml, strlen($xml));

   while (!feof($fp)) {
 $response .= fgets($fp, 128);
   }
   echo $response;

   fclose($fp);

}
?>



--
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] Common PHP functions benchmarks

2008-04-10 Thread Larry Garfield
I did some similar micro-benchmarking a while back, too:

http://www.garfieldtech.com/blog/magic-benchmarks

On Tuesday 08 April 2008, Jason Knight wrote:
> I've been running some benchmarks on popular PHP functions.  I would like
> to get some input on them from the community.  So far I have run tests on
> Arrays and PHP5's SPL ArrayObject, as well as loops and some networking
> functions.
>
>
> Here is a link to the code used for the benchmarks.
> http://www.synthable.com/benchmarks/
>
> Thanks,
> Jason 


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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