Re: [PHP] Cpanel accounting library

2004-05-25 Thread Jordi Canals
Burhan Khalid wrote:
Jordi Canals wrote:
Hi all,
Cpanel is a control panel to manage accounts for ISP's (And espcially 
ISP's resellers). I knnow there is some librarys to directly manage 
the accounts from PHP-Scripts and I got some very small and 
undocummented samples.

I'm working on some scripts to manage the accounts directly from PHP 
(Scripts will be GNU/GPL licensed).
I haven't found good examples for this, but I have written a cpanel 
class that provides methods to query cpanel accounting information.

Sample methods :
userExists
fetchUser
listUsers
setCredentials
and the usual
kill(), suspend(), etc.
I had planned on polishing it and submitting it to PEAR, but I haven't 
found the time to do so.  Let me know if you need any specific 
functionality, and I can just paste that snippet for you.

I've got the script suplied by cPanel. Is not much to see there, but at 
least I have the parameters to call the functions and could understand a 
bit how it works. With that, I can start making some tests and make some 
samples to work.

At this moment I'm a bit busy in other projects, so I will test it as 
time permits... What I need is basically to automate the account 
creation and cancellation, nothing more, nothing less :)

Don't forget to post a notice when you submit your class to PEAR ;)
Regards,
Jordi.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] can myapp.exe run on Win ce or pocket pc?

2004-05-25 Thread Shelby
Hi,
I would like to develope a desktop application using PHP.
I was wondering can the .exe program run on Win CE/Pocket PC?

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



[PHP] Re: DOM XML output whitespace

2004-05-25 Thread Dan Phiffer
Martin Geisler wrote:
I don't remember any more where I found this, but with
formatOutput = true;
?>
you get what you ask for: formatted output.
Excellent, that did the trick!
Thanks,
-Dan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Can myapp.exe run on Win CE or Pocket PC?

2004-05-25 Thread Shelby
Hi,
I would like to develope a desktop application using PHP.
I was wondering can the .exe program run on Win CE/Pocket PC?

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



[PHP] can myapp.exe run on Win Ce or Pocket PC

2004-05-25 Thread Shelby
Hi,
I would like to develope a desktop application using PHP.
I was wondering can the .exe program run on Win CE/Pocket PC?

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



[PHP] Displaying Secure Server Lock Symbol??

2004-05-25 Thread Jeff Swanberg
Very new at this so pardon my ignorance:

Off of my regular server, I'm calling a script off of a secure server in
order to process a credit card inquiry.  I thought that, just by calling the
script off of the secure server, that the "gold lock" icon would
automatically appear but it does not.  Is there something I'm supposed to do
when going to that script to make that icon appear?

Right now my button click code looks like:
href="https://secure.plasticpayments.com/keatleyphoto/authorizenet.php?UID=<
? echo $UID ?>&id=">

What else need I do on my end?  Or, is the error in the authorizenet.php
script on the secure server?

Jeff

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



Re: [PHP] ie issue: when I do a forced redirect with the header()

2004-05-25 Thread Jake Johnson
Very Cool!  That is what I was looking for!
Thanks,
Jake Johnson
http://www.plutoid.com

On Fri, Jun 20, 2003 at 12:46:04PM +0100, Pete Morganic wrote:
> Slkigh Ammendment to below
>  header("Location: https://www.google.com";) ;
> die;
> ?>
> 
> 
> Jake Johnson wrote:
> >Have you tried...
> > >header("Location: https://www.google.com";) ;
> >?>
> >
> >Regards,
> >Jake Johnson
> >[EMAIL PROTECTED]
> >
> >--
> >Plutoid - http://www.plutoid.com
> >Shop Plutoid for the best prices on Rims and Car Audio Products
> >
> >
> >On Tue, 17 Jun 2003, Jeff Means wrote:
> >
> >
> >>How do I force IE to update the location bar when I do a forced redirect??
> >>
> >>
> >>--
> >>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

-- 
Jake Johnson
http://www.plutoid.com

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



Re: [PHP] RE:php and java applets

2004-05-25 Thread raditha dissanayake
Ben Ford wrote:
This is straight from the http://java.sun.com/applets/  web page:
" When you use a Java technology-enabled browser to view a page that contains 
an applet, the applet's code is transferred to your system and executed by 
the browser's Java Virtual Machine (JVM). "
 

I have had one of my own applets featured on this page so i can assure 
you with sufficient authority that a java applet can connect to the host 
that delivered it.  This just says the applet runs on the client - 
something I never disputed.

Anyway like I said in a previous message this is way off topic for this 
list so let's take it else where.

Java Applets cannot connect to the same host they were loaded from.  They run 
on the client machine as a local program.  I know this because I attempted to 
run an applet and have it connect to a mysql server the resided on the web 
server. 
 

You are trying to connect to the localhost which is your client machine 
(again i mentioned this in previus mail).  Localhost is not he 
originating server in your case so that connection is not allowed.


The applet could not connect using localhost as the domain name of the 
server. ( Which due to security settings was the only URL I could connect 
to.) 

 

If you want to know how to by pass the java applet security restrictions 
please read up on http://www.raditha.com/java/sandbox/

best regards
raditha
--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Perfect Squares

2004-05-25 Thread Stephen Craton
I guess I don't mean perfect squares, more or less square roots with
terminating decimals. Thanks for all the help, and I found that Jason's code
will work for the program I'm doing right now.

Thanks,
Stephen Craton
http://www.melchior.us
 

- -Original Message-
- From: Jason Barnett [mailto:[EMAIL PROTECTED]
- Sent: Tuesday, May 25, 2004 6:59 PM
- To: [EMAIL PROTECTED]
- Subject: [PHP] Re: Perfect Squares
- 
- Stephen Craton wrote:
- 
- > I'm in a bit of a pickle. I need to find out if a variable is a perfect
- > square or not, and this needs to test for decimal numbers as well, such
- as
- > 2.25. The thing is, the only function I've found in PHP is
- > gmp_perfect_square() which isn't supported on my web server, and I don't
- > know how to compile the GMP code into PHP on my windows box. So, how
- exactly
- > would you go about finding out if something is a perfect square or not?
- 
- It's been a while since I studied this in math, so I figured I'd find
- out the definition of perfect square.  What I found:
- http://en.wikipedia.org/wiki/Perfect_square
- 
- Neither of those definitions fit what for your example number 2.25.  For
- instance,
- 
- $sqrt = sqrt($number);
- if ($sqrt * $sqrt == $number) {
-//should always be true, except negative values and possibly rounding
- }
- 
- --
- PHP General Mailing List (http://www.php.net/)
- To unsubscribe, visit: http://www.php.net/unsub.php
- 

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



[PHP] Re: Perfect Squares

2004-05-25 Thread Jason Barnett
Stephen Craton wrote:
I'm in a bit of a pickle. I need to find out if a variable is a perfect
square or not, and this needs to test for decimal numbers as well, such as
2.25. The thing is, the only function I've found in PHP is
gmp_perfect_square() which isn't supported on my web server, and I don't
know how to compile the GMP code into PHP on my windows box. So, how exactly
would you go about finding out if something is a perfect square or not?
It's been a while since I studied this in math, so I figured I'd find 
out the definition of perfect square.  What I found:
http://en.wikipedia.org/wiki/Perfect_square

Neither of those definitions fit what for your example number 2.25.  For 
instance,

$sqrt = sqrt($number);
if ($sqrt * $sqrt == $number) {
  //should always be true, except negative values and possibly rounding
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Perfect Squares

2004-05-25 Thread Jason Barnett
John Kaspar wrote:
Try taking the square root of the variable
$sqrt = sqrt($var);
then compare the number of decimal places.
if (strlen(strstr($sqrt,".")) <= strlen(strstr($var,"."))) {
// perfect
}
Just guessing of course.
I'd do something similar, but a little different:
$sqrt = sqrt($var);
if ($var == $sqrt * $sqrt) {
  // perfect
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Parse XML

2004-05-25 Thread Jason Barnett
I'm surprised that no one else already replied to this?!?!  Anyhow, my 
answers are below.

Phil Dowson wrote:
Hi,
I am having a couple of difficulties with a script to parse XML. This may
well be because my 16 month kid was up all night, but I'm banging my head
against a wall right now.
OT: And this is why I'm still happily single.  But my time will come.
The script quite easily extracts one of the entries listed under 
but doesnt list the other. This is my first look into parsing XML, so I am
not sure of the terminology :-). How can I have both entries in this XML
file parsed to an array that I can use to build a table. (I just really need
the array, I can take it from there).
So, make all of the xml children listed under LIST_2 become part of an 
array?  I first have to ask if you're using PHP5 now (or will soon). The 
dev team has added a new simpleXML extension that handles this type of 
operation and it can be quite simple (imagine that!).  An example 
straight from the site shows how to turn xml into an array:


if (file_exists('test.xml')) {
   $xml = simplexml_load_file('test.xml');
   var_dump($xml);
} else {
   exit('Failed to open test.xml.');
}
?>
This handy extension also allows you to use xpath.  For an overview see:
http://www.php.net/simplexml
If you're using PHP4 then I would suggest you try this PEAR package.  It 
will create PHP objects from XML:
http://pear.php.net/package/XML_Tree

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


[PHP] Re: Perfect Squares

2004-05-25 Thread John Kaspar
Try taking the square root of the variable
$sqrt = sqrt($var);
then compare the number of decimal places.
if (strlen(strstr($sqrt,".")) <= strlen(strstr($var,"."))) {
// perfect
}
Just guessing of course.
On 5/25/2004 5:06 PM, Stephen Craton wrote:
I'm in a bit of a pickle. I need to find out if a variable is a perfect
square or not, and this needs to test for decimal numbers as well, such as
2.25. The thing is, the only function I've found in PHP is
gmp_perfect_square() which isn't supported on my web server, and I don't
know how to compile the GMP code into PHP on my windows box. So, how exactly
would you go about finding out if something is a perfect square or not?
 

Thanks,
Stephen Craton
http://www.melchior.us
 

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


Re: [PHP] Re: Customer Session Handlers Using MySQL

2004-05-25 Thread Torsten Roehr
"Paul Higgins" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Would I also have to write the sess_write() and sess_read() functions?  If
I
> want to store an array or object, how would I go about doing that?


Take a look at PEAR's HTTP_Session source code. It includes a DB session
container:

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

Regards,

Torsten Roehr

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



[PHP] Perfect Squares

2004-05-25 Thread Stephen Craton
I'm in a bit of a pickle. I need to find out if a variable is a perfect
square or not, and this needs to test for decimal numbers as well, such as
2.25. The thing is, the only function I've found in PHP is
gmp_perfect_square() which isn't supported on my web server, and I don't
know how to compile the GMP code into PHP on my windows box. So, how exactly
would you go about finding out if something is a perfect square or not?

 

Thanks,

Stephen Craton

http://www.melchior.us

 

 

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



Re: [PHP] Sessions simply do not work?

2004-05-25 Thread Torsten Roehr
"Michael R. Wayne" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Sessions do not work properly for me.  Thanks to other people on
> this list, we've proven that the test script I am using works fine
> for other people.  So, something is wrong with PHP on all of my
> systems since the same script fails (see previous posts) on multiple
> servers for me.
>
> So, I am now seeking information on how to debug PHP (not my
> script but PHP itself) to determine where the failure lies.
>
> Help??
>
> /\/\ \/\/

Before you're diving into the PHP core, have you tried using a DB (MySQL) as
the container for your session data? You could easily set up a test script
with PEAR's DB and HTTP_Session. I'm using this configuration and my
provider just upgraded to 4.3.6 - no problems at all.

http://pear.php.net/package/DB
http://pear.php.net/package/HTTP_Session

Regards,

Torsten Roehr

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



[PHP] PHP Only directory

2004-05-25 Thread Erik Meyer
Greetings,

I am fairly new at this and I am going to create my first web server.  I
have installed PHP as the documentation says and the only question that I
have is whether or not PHP can be configured on a single directory only,
(example mydomain.com/php/). The server that I am running on is Red Hat
Linux 9.

Erik W. Meyer
Technical Support Engineer
Ebase
www.ebaseweb.com

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



Re: [PHP] interesting

2004-05-25 Thread Justin Patrin
John W. Holmes wrote:
From: "Justin Patrin" <[EMAIL PROTECTED]>
IMHO it's just better to use concatenation and single quotes for your
string. PHP doesn't have to parse your strings for variables that way
and it makes it obvious what parts are variables.

To each his own. Shall we discuss the merits of print vs. echo next? Or
maybe template systems!?!?
;)
---John Holmes...
Just giving my opinion. I don't want yet another Holy War. I've been 
involved with too many of those.

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


Re: [PHP] interesting

2004-05-25 Thread Daniel Clark
Ok, print or echo :-)

>>From: "Justin Patrin" <[EMAIL PROTECTED]>
>>
>>> IMHO it's just better to use concatenation and single quotes for your
>>> string. PHP doesn't have to parse your strings for variables that way
>>> and it makes it obvious what parts are variables.
>>
>>To each his own. Shall we discuss the merits of print vs. echo next? Or
>>maybe template systems!?!?
>>
>>;)
>>
>>---John Holmes...
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>




Re: [PHP] interesting

2004-05-25 Thread Curt Zirzow
* Thus wrote John W. Holmes ([EMAIL PROTECTED]):
> From: "Justin Patrin" <[EMAIL PROTECTED]>
> 
> > IMHO it's just better to use concatenation and single quotes for your
> > string. PHP doesn't have to parse your strings for variables that way
> > and it makes it obvious what parts are variables.
> 
> To each his own. Shall we discuss the merits of print vs. echo next? Or
> maybe template systems!?!?

Dont tempt me :)


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] interesting

2004-05-25 Thread John W. Holmes
From: "Justin Patrin" <[EMAIL PROTECTED]>

> IMHO it's just better to use concatenation and single quotes for your
> string. PHP doesn't have to parse your strings for variables that way
> and it makes it obvious what parts are variables.

To each his own. Shall we discuss the merits of print vs. echo next? Or
maybe template systems!?!?

;)

---John Holmes...

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



Re: [PHP] interesting

2004-05-25 Thread Daniel Clark
Good point Justin !

>>John W. Holmes wrote:
>>
>>> From: Daniel Clark
>>> 
>>> 
>echo "\"{$search_for_list[$i][0]}\""; will work, btw.

What does the {}around the array mean?
>>> 
>>> 
>>> It delimits your variable so PHP knows what to interpret as a variable and
>>> what to interpret as a string.
>>> 
>>> $ar[1] = 'foo';
>>> echo "Value is {$ar[1]}"; // Value is foo
>>> 
>>> $ar = 'foo';
>>> echo "Value is {$ar}[1]"; //Value is foo[1]
>>> echo "Value is {$ar[1]}"; //Value is f
>>> 
>>> echo "Hello {$name}, you are {$age} years old";
>>> 
>>> etc...
>>> 
>>> ---John Holmes...
>>
>>IMHO it's just better to use concatenation and single quotes for your 
>>string. PHP doesn't have to parse your strings for variables that way 
>>and it makes it obvious what parts are variables.
>>
>>-- 
>>paperCrane 

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



Re: [PHP] interesting

2004-05-25 Thread Justin Patrin
John W. Holmes wrote:
From: Daniel Clark

echo "\"{$search_for_list[$i][0]}\""; will work, btw.
What does the {}around the array mean?

It delimits your variable so PHP knows what to interpret as a variable and
what to interpret as a string.
$ar[1] = 'foo';
echo "Value is {$ar[1]}"; // Value is foo
$ar = 'foo';
echo "Value is {$ar}[1]"; //Value is foo[1]
echo "Value is {$ar[1]}"; //Value is f
echo "Hello {$name}, you are {$age} years old";
etc...
---John Holmes...
IMHO it's just better to use concatenation and single quotes for your 
string. PHP doesn't have to parse your strings for variables that way 
and it makes it obvious what parts are variables.

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


Re: [PHP] interesting

2004-05-25 Thread Daniel Clark
Thank you John, and Michal :-)

>>From: Daniel Clark
>>
echo "\"{$search_for_list[$i][0]}\""; will work, btw.
>>>
>>> What does the {}around the array mean?
>>
>>It delimits your variable so PHP knows what to interpret as a variable and
>>what to interpret as a string.
>>
>>$ar[1] = 'foo';
>>echo "Value is {$ar[1]}"; // Value is foo
>>
>>$ar = 'foo';
>>echo "Value is {$ar}[1]"; //Value is foo[1]
>>echo "Value is {$ar[1]}"; //Value is f
>>
>>echo "Hello {$name}, you are {$age} years old";
>>
>>etc...
>>
>>---John Holmes...
>>

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



Re: [PHP] interesting

2004-05-25 Thread John W. Holmes
From: Daniel Clark

>>echo "\"{$search_for_list[$i][0]}\""; will work, btw.
>
> What does the {}around the array mean?

It delimits your variable so PHP knows what to interpret as a variable and
what to interpret as a string.

$ar[1] = 'foo';
echo "Value is {$ar[1]}"; // Value is foo

$ar = 'foo';
echo "Value is {$ar}[1]"; //Value is foo[1]
echo "Value is {$ar[1]}"; //Value is f

echo "Hello {$name}, you are {$age} years old";

etc...

---John Holmes...

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



Re: [PHP] interesting

2004-05-25 Thread Michal Migurski
> What does the { } around the array mean?

http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] Simplistic PHP tutorial

2004-05-25 Thread Dennis Seavers
I disagree with the suggestion that you need to or should have programming
experience to learn PHP, although it is helpful.  There are a few books out
there (and books probably are the best starting point) that assume the
reader has no programming background, although you need to be familiar with
HTML (and not just creating HTML pages with a WYSIWYG like GoLive or
FrontPage).  Larry Ullman's book is a good example (PHP FOR THE WORLD WIDE
WEB, Peach Pit Press).


> [Original Message]
> From: Gabino Travassos <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Date: 05/25/2004 9:17:10 AM
> Subject: Re: [PHP] Simplistic PHP tutorial
>
> > I've looked at the php.net tutorial, and though I'm learning some things
> >  from it, it's still a bit over my head. It seems to presuppose a
comfort
> > level with programming which I do not have.
> >
> > Can anyone recommend a simple, hand-holding, introductory tutorial
> > suitable for someone with no programming experience to speak of?
>
> Personally, if I was teaching someone programming concepts from scratch I
> would start them with Javascript. It's mostly platform-independent, you
> don't need to install any software, and you don't need to upload your
files
> to a server that has PHP installed. Most of the basics (functions,
> variables, math) are the same in php, perl, flash, and Javascript, and
> Javascript is the simplest one in terms of getting started and testing
your
> code quickest.
>
> There are some differences, of course, but you'll always be
double-checking
> your syntax anyway.
>
> I like the PHP book from Wiley. And MySQL/PHP Database Applications from
M&T
> Books.
> For Javascript, buy the cheapest, oldest used book you can find. Or Inside
> Javascript from New Riders.
>
> Luck.
>
>
> -- 
> 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] find out ip address [beginner]

2004-05-25 Thread Matt Matijevich
could you ping or gethostip that webserver using the sytem command, then
parse what you recieve?

$val = system ('ping -c 1 outherwebserver');
or
$val = system ('gethostip outherwebserver');
//then parse $val to pull out the ip address

there is probably a better way to do it though, not even sure it if
that will work.

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



Re: [PHP] interesting

2004-05-25 Thread Daniel Clark
What does the { } around the array mean?

>>From: "Bob Lockie" <[EMAIL PROTECTED]>
>>
>>> echo "\"" . $search_for_list[$i][0] . "\"" works but
>>> echo "\"$search_for_list[$i][0]\"" prints "Array[0].
>>
>>$search_for_list[$i] is an 'Array' which is followed by the string '[0]' ...
>>how is PHP supposed to know you mean
>>$search_for_list[$i][0]?
>>
>>echo "\"{$search_for_list[$i][0]}\""; will work, btw.
>>
>>---John Holmes...




Re: [PHP] Re: find out ip address [beginner]

2004-05-25 Thread Tobes
*lol
ok, at first I believed this was php... didn't look all that closely I
suppose

"Chris W. Parker" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Jonesy 
on Monday, May 24, 2004 2:21 PM said:

> WFM:
>|$ ping ibm.com
>|PING ibm.com (129.42.18.99) 56(84) bytes of data.
>:

wow. that's the weirdest looking php i've ever seen. is that a beta or
something?



chris.

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



Re: [PHP] find out ip address [beginner]

2004-05-25 Thread Tobes
My page is supposed to compare the client IP address to the IP address of an
other webserver. I have that domain name and would like to find out it's IP
address. Unfortunately its IP address changes regularly (dynamic dns) so
that gethostbyname() does not work (it caches the IP address).
I am working on PHP4 and can't patch / update / anything the system. I
couldn't even tell you what exact version and plugins, etc is running on
that web server I am working on.

Any more info needed to answer this question? Feel free to ask...

Thanks for all help in advance

Tobes

"Chris W. Parker" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Tobes 
on Monday, May 24, 2004 2:09 PM said:

> hi, i need some code to find out the ip address of a server. just a
> simple dns query.
>
> how do i do that? i'm a beginner, please help.

are you saying you already have the FQDN (Fully Qualified Domain Name)?
or are you trying to get the ip address of the client system requesting
your page?



chris.

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



Re: [PHP] interesting

2004-05-25 Thread John W. Holmes
From: "Bob Lockie" <[EMAIL PROTECTED]>

> echo "\"" . $search_for_list[$i][0] . "\"" works but
> echo "\"$search_for_list[$i][0]\"" prints "Array[0].

$search_for_list[$i] is an 'Array' which is followed by the string '[0]' ...
how is PHP supposed to know you mean
$search_for_list[$i][0]?

echo "\"{$search_for_list[$i][0]}\""; will work, btw.

---John Holmes...

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



[PHP] interesting

2004-05-25 Thread Bob Lockie
echo "\"" . $search_for_list[$i][0] . "\"" works but
echo "\"$search_for_list[$i][0]\"" prints "Array[0].
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Sessions simply do not work?

2004-05-25 Thread Michael R. Wayne

Sessions do not work properly for me.  Thanks to other people on
this list, we've proven that the test script I am using works fine
for other people.  So, something is wrong with PHP on all of my
systems since the same script fails (see previous posts) on multiple
servers for me.

So, I am now seeking information on how to debug PHP (not my
script but PHP itself) to determine where the failure lies.

Help??

/\/\ \/\/

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



Re: [PHP] mySQL table output...

2004-05-25 Thread Don Read

On 23-May-2004 Russell P Jones wrote:
> I just want to print out a table from mySQL. Thats it. into an html
> table.
> 
> Column 1 |  Col 2 | Col 3
> -
> Val 1|  val 2 | val 3
> Val 4|  val 5 | val 6
> 
> 
> any ideas on how to do this?
> 

if ($res = mysql_query($qry)) {
echo '';
while ($row = mysql_fetch_array($res) 
echo '' .implode('', $row) .'';
echo '';
} 


Regards,
-- 
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



Re: [PHP] Re: Now I can't start the session either...

2004-05-25 Thread Peter Risdon
Brian Dunning wrote:
On May 25, 2004, at 9:06 AM, Craig wrote:
It doesnt necessarily mean the error occured on that line, that may have
been the last executed statement
post a few more lines or we cant help you.


// Start the session
if (! session_id()) session_start();
if (not is_string($_SESSION['login_status']))
try
if (!is_string($_SESSION['login_status']))

{
$_SESSION['login_status'] = 'false';
}
if ($_SESSION['login_status'] == 'false')
{
echo "  Sign In";
} else {
echo "  Sign Out";
}
?>

Which looks OK to me, but it returns:
Parse error: parse error, unexpected T_STRING in
c:\inetpub\wwwroot\palms\htdocs\start-selling.php on line 3
What's going on here??


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


[PHP] Re: Problem with number_format

2004-05-25 Thread Martin Geisler
[EMAIL PROTECTED] (Curt Zirzow) writes:

> * Thus wrote Martin Geisler ([EMAIL PROTECTED]):
>> 
>> Caution
>> 
>>   When rounding on exact halves round() rounds down on evens and up
>>   on odds. [...]
>
> This is a documentation error. And is not on the current
> documentation.

Indeed you're right, sorry about that.

-- 
Martin Geisler  My GnuPG Key: 0xF7F6B57B

PHP EXIF Library  |  PhpWeather  |  PhpShell
http://pel.sf.net/|  http://phpweather.net/  |  http://gimpster.com/
Read/write EXIF data  |  Show current weather|  A shell in a browser

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



RE: [PHP] Re: Customer Session Handlers Using MySQL

2004-05-25 Thread Paul Higgins
Would I also have to write the sess_write() and sess_read() functions?  If I 
want to store an array or object, how would I go about doing that?

Paul
From: Jason Barnett <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Customer Session Handlers Using MySQL
Date: Tue, 25 May 2004 12:41:43 -0500
1)  Does this mean that I cannot use the $_SESSION[] variable to enter 
information into the session?
Sure you can.  When you use a custom session handler then setting / getting 
the $_SESSION[] variables will use sess_write and sess_read in order to 
write/read that information.  I think the only problem with using $_SESSION 
variables is when you use session_register.  So, I just use $_SESSION for 
everything and all is good.

2)  How can I pass objects from one page to another, if I am using the 
this type of session handler?
You'll still persist sessions as you would without the custom session 
handler, e.g. sending the session ID as part of the URL.  The main 
difference is that now you have a custom sess_open function to tell PHP 
where / how to retrieve the session information for that user.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.click-url.com/go/onm00200362ave/direct/01/

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


Re: [PHP] Re: test

2004-05-25 Thread Daniel Clark
I think it's someone else on the list getting the email lists, and spaming. 

>>Signed up litterally 1 minute ago and I'm already getting spam. From
>>"Advance Credit Suisse Bank"
>>
>>Great. Thanks php.net.
>>
>>Guess you can't even trust the well known sites not to slam you with spam.

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



Re: [PHP] Re: test

2004-05-25 Thread Brian Dunning
"Advance Credit Suisse Bank"
Great. Thanks php.net.
Guess you can't even trust the well known sites not to slam you with 
spam.
Come on, that's not fair. Those emails are sent by some unscrupulous 
individual who subscribed to the list and set up a rule to reply those 
spams to everyone who posts to the list. They're certainly not sent by 
anyone at PHP or who runs this list.  :)

The same thing can happen with every mailing list in the world. This 
excellent resource should not be blamed.

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


[PHP] Parse XML

2004-05-25 Thread Phil Dowson
Hi,

I am having a couple of difficulties with a script to parse XML. This may
well be because my 16 month kid was up all night, but I'm banging my head
against a wall right now.

The script quite easily extracts one of the entries listed under 
but doesnt list the other. This is my first look into parsing XML, so I am
not sure of the terminology :-). How can I have both entries in this XML
file parsed to an array that I can use to build a table. (I just really need
the array, I can take it from there).

Thanks !

Phil

Here's my code (please let me know if I'm missing anything really simple):


== PHP CODE

 $val) {

   if($val['type'] == "open") {
 array_push($hash_stack, $val['tag']);
 }
   elseif($val['type'] == "close") {
 array_pop($hash_stack);
 }
   elseif($val['type'] == "complete") {
 array_push($hash_stack, $val['tag']);
 eval("\$ret[" . implode($hash_stack, "][") . "] =
'{$val[value]}';");
 array_pop($hash_stack);
 }

  }
print_r($ret);
?>


== XML CODE




  

  09011234
  

  BLOGGS, JOE
   

  15 MAIN STREET
  MAINLAND  WS
  9

  

  


  09011235
  

  BROOK, CURTIS
  

  16 MAIN STREET
  MAINLAND  WS
  9

  

  

  


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



Re: [PHP] Re: test

2004-05-25 Thread Jordi Canals
Sherri wrote:
Woah!
Signed up litterally 1 minute ago and I'm already getting spam. From
"Advance Credit Suisse Bank"
Just wait. There are some more waiting for you ;) You should receive the 
"Information Desk" and "Ingram Computer Services" mails yet.

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


[PHP] Re: test

2004-05-25 Thread Jason Barnett
Sherri wrote:
Woah!
Signed up litterally 1 minute ago and I'm already getting spam. From
"Advance Credit Suisse Bank"
Great. Thanks php.net.
Guess you can't even trust the well known sites not to slam you with spam.
The problem is this list has no active moderator (at least none that 
makes themselves known).  I've just added them to my block list in my 
email filter.  Some people don't, and just consider the spam as a 
?friendly? reminder that their message has been received.

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


[PHP] Re: test

2004-05-25 Thread Sherri
Woah!

Signed up litterally 1 minute ago and I'm already getting spam. From
"Advance Credit Suisse Bank"

Great. Thanks php.net.

Guess you can't even trust the well known sites not to slam you with spam.

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



[PHP] Re: test

2004-05-25 Thread Sherri
Ah ha. Had to confirm my email address.

Got it.

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



Re: [PHP] test

2004-05-25 Thread John Nichel
Sherri wrote:
Yup. this is a test. Sorry.
Did we pass??
--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] test

2004-05-25 Thread Sherri
Yup. this is a test. Sorry.

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



[PHP] Re: Customer Session Handlers Using MySQL

2004-05-25 Thread Jason Barnett
1)  Does this mean that I cannot use the $_SESSION[] variable to enter 
information into the session?
Sure you can.  When you use a custom session handler then setting / 
getting the $_SESSION[] variables will use sess_write and sess_read in 
order to write/read that information.  I think the only problem with 
using $_SESSION variables is when you use session_register.  So, I just 
use $_SESSION for everything and all is good.

2)  How can I pass objects from one page to another, if I am using the 
this type of session handler?
You'll still persist sessions as you would without the custom session 
handler, e.g. sending the session ID as part of the URL.  The main 
difference is that now you have a custom sess_open function to tell PHP 
where / how to retrieve the session information for that user.

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


RE: [PHP] Custom Session Handlers Using MySQL

2004-05-25 Thread Paul Higgins
Sorry for the double post, but that should be Custom not Customer.
Paul

From: "Paul Higgins" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP] Customer Session Handlers Using MySQL
Date: Tue, 25 May 2004 13:26:32 -0400
Hello all,
I found a quick tutorial on how to write a session handler that uses MySQL 
(http://phpbuilder.com/columns/ying2602.php3?page=1 ).

I have a couple of questions regarding this type of session handling:
1)  Does this mean that I cannot use the $_SESSION[] variable to enter 
information into the session?
2)  How can I pass objects from one page to another, if I am using the this 
type of session handler?

Thanks!
Paul
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Watch LIVE baseball games on your computer with MLB.TV, included with MSN 
Premium! http://join.msn.click-url.com/go/onm00200439ave/direct/01/

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


[PHP] Customer Session Handlers Using MySQL

2004-05-25 Thread Paul Higgins
Hello all,
I found a quick tutorial on how to write a session handler that uses MySQL 
(http://phpbuilder.com/columns/ying2602.php3?page=1 ).

I have a couple of questions regarding this type of session handling:
1)  Does this mean that I cannot use the $_SESSION[] variable to enter 
information into the session?
2)  How can I pass objects from one page to another, if I am using the this 
type of session handler?

Thanks!
Paul
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


[PHP] Re: Simplistic PHP tutorial

2004-05-25 Thread Martin Geisler
[EMAIL PROTECTED] (Neal) writes:

> Can anyone recommend a simple, hand-holding, introductory tutorial
> suitable for someone with no programming experience to speak of?

I have a tutorial online here which is supposed to be pretty basic:

  http://gimpster.com/wiki/PhpTutorial

It was written a long time ago so it doesn't include the newer PHP4
stuff.

-- 
Martin Geisler  My GnuPG Key: 0xF7F6B57B

PHP EXIF Library  |  PhpWeather  |  PhpShell
http://pel.sf.net/|  http://phpweather.net/  |  http://gimpster.com/
Read/write EXIF data  |  Show current weather|  A shell in a browser

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



Re: [PHP] Simplistic PHP tutorial

2004-05-25 Thread Rob Adams
"Gabino Travassos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Personally, if I was teaching someone programming concepts from scratch I
> would start them with Javascript. It's mostly platform-independent, you

>From my experience, PHP is much better at running the same code on different
platforms than JS is.

> don't need to install any software, and you don't need to upload your
files
> to a server that has PHP installed. Most of the basics (functions,

You will need to download and install at least 3 different browsers just to
cover all your bases.  And I would bet that most PHP developers don't need
to upload any files to test their code.

> I like the PHP book from Wiley. And MySQL/PHP Database Applications from
M&T
> Books.
> For Javascript, buy the cheapest, oldest used book you can find. Or Inside
> Javascript from New Riders.

I have a JS book I'll sell cheap ($5).  It's called Beginning Javascript.
Way too simplistic for what I wanted to use it for.

  -- Rob

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



Re: [PHP] Session variables not recognized?

2004-05-25 Thread John Nichel
Brian Dunning wrote:
This is 4.3.2 and sessions are enabled.
Session handling was added in PHP 4.0.
The first line of my file is session_start(); but whenever I try to set
or reference $_SESSION['anything'] I get:
 Undefined variable: _SESSION

- Brian
Post some code.
--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Session variables not recognized?

2004-05-25 Thread Brian Dunning
The first line of my file is session_start(); but whenever I try to 
set
or reference $_SESSION['anything'] I get:

  Undefined variable: _SESSION
What's up with that???
what php-version do you use?
It is 4.3.2 on XP. I only recently installed it and this is the first 
time I've tried using sessions and variables on it, so it's entirely 
possible that there is a configuration problem. phpinfo() looks OK to 
me but I admit that I don't really know what to look for. Sessions are 
enabled, that's about all I can tell...  :)

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


Re: [PHP] Session variables not recognized?

2004-05-25 Thread Brian Dunning
This is 4.3.2 and sessions are enabled.
Session handling was added in PHP 4.0.
The first line of my file is session_start(); but whenever I try to 
set
or reference $_SESSION['anything'] I get:

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


Re: [PHP] Re: Now I can't start the session either...

2004-05-25 Thread Brian Dunning
On May 25, 2004, at 9:06 AM, Craig wrote:
It doesnt necessarily mean the error occured on that line, that may 
have
been the last executed statement
post a few more lines or we cant help you.

// Start the session
if (! session_id()) session_start();
if (not is_string($_SESSION['login_status']))
{
$_SESSION['login_status'] = 'false';
}
if ($_SESSION['login_status'] == 'false')
{
echo "  Sign In";
} else {
echo "  Sign Out";
}
?>

Which looks OK to me, but it returns:
Parse error: parse error, unexpected T_STRING in
c:\inetpub\wwwroot\palms\htdocs\start-selling.php on line 3
What's going on here??
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Sessions simply do not work?

2004-05-25 Thread John Nichel
Michael R. Wayne wrote:
It seems that people have forgotten last week's postings.  To recap:
Session support worked fine in 4.1.2.  It's broken in 4.3.4 and 4.3.6
What doesn't work in 4.3.6?  I'm running 4.3.6 w/ Apache 1.3.31 on both 
a Fedora Core 1 and Mac OS X box, and haven't had a problem with 
sessions.  Does this only seem to be a FreeBSD problem?

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Problem with number_format

2004-05-25 Thread fku

>Martin Geisler wrote:

>

>> My PHP manual (from a Debian package) has the following note on the > page for

>round():

>> > Caution

>>

>> When rounding on exact halves round() rounds down on evens and up on

>> odds. If you want to always force it in one direction on a .5 (or

>> .05 in your case) add or substract a tiny fuzz factor.

>>

>

>I'm surprised with this note on manuals. I do not know in other places, but in

>the European Union there are laws and directives that obligates

>to always round to 5/4 in currency operations (Specially on Euro

>Conversions). It means that 5 and above rounds always up, anything

>bellow 5 rounds always down. So, 0,655 must round to 0,66 and 0,654 must

>round to 0,65. In this case, nothing to do: It is the law.



So it seems a PHP4 bug, now corrected in PHP5-RC.

Waiting for a stable release of PHP5, it seems I need to add a "tiny fuzz factor"

where 3rd decimal is 5.

I'm working on Euro conversions, this isn't a good new...:(



Thanks, ciao

Francesco 

---
Spazio ILLIMITATO per la tua Email, Scanner Antivirus,
Antispam, Backup e POP3. Prova la nuova Email di superEva:
http://webmail.supereva.it/
---

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



Re: [PHP] Re: Problem with number_format

2004-05-25 Thread Curt Zirzow
* Thus wrote Martin Geisler ([EMAIL PROTECTED]):
> My PHP manual (from a Debian package) has the following note on the
> page for round():
> 
> Caution
> 
>   When rounding on exact halves round() rounds down on evens and up on
>   odds. If you want to always force it in one direction on a .5 (or
>   .05 in your case) add or substract a tiny fuzz factor. The reason
>   behind rounding half the values down and the other half up is to
>   avoid the classical banking problem where if you always rounded down
>   you would be stealing money from your customers, or if you always
>   rounded up you would end up over time losing money. By averaging it
>   out through evens and odds you statistically break even.

This is a documentation error. And is not on the current
documentation.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Sessions simply do not work?

2004-05-25 Thread Michael R. Wayne
On Tue, May 25, 2004 at 07:37:47AM +0100, Peter Risdon wrote:
> Michael R. Wayne wrote:
> 
> >In my continuing efforts to actually get sessions to work, I upgraded
> >to PHP 4.3.6 and apache 1.3.31.  This did not make the slighest
> >difference.
> >
> >So, does ANYone have ideas of how to debug this?  Or is PHP simply
> >broken and no longer able to maintain sessions?  
> 
> I've just been debugging some session problems. Successfully, but there 
> is something rather brittle in there somewhere 

It seems that people have forgotten last week's postings.  To recap:

Session support worked fine in 4.1.2.  It's broken in 4.3.4 and 4.3.6.

The relevant session variables are:
   Session Support  enabled  (as per phpinfo)
   session.auto_start   On or Off (makes no difference)
   session.use_cookies  Off <- not using cookies
   session.name PHPSESSID
   session.use_trans_sidOff (trans_sid worked with forms in 4.1.2)
   session.gc_maxlifetime   1440
Other things people have asked about:
   url_rewriter.tagsa=href,area=href,frame=src,input=src,form=fakeentry

Environment
   FreeBSD 4.8, Apache/1.3.31 (Unix) PHP/4.3.6 mod_ssl/2.8.17 OpenSSL/0.9.7d 

The session directory is writable and the files are getting properly
written to that directory as shown below.

I invoke the script from a browser and see the following:
   Stage:0 SessionID: 509012dd5633cba355c270f3934d1201   
   ___ [Submit]
   Stage:1 SessionID: 509012dd5633cba355c270f3934d1201
   Request: Array ( ) 
   GET: Array ( ) POST: Array ( [field] => ) COOKIE: Array ( ) 

Checking the session directory, I see an appropriately named file:
   -rw---  1 nobody  msen  10 May 25 12:00 sess_509012dd5633cba355c270f3934d1201
containing
   stage|i:1;
The Apache log contains two lines.  The first does not contain the 
browser version and the second one does:
   "GET /g/xxx.php HTTP/1.0"
   "GET /g/xxx.php HTTP/1.0" 200 476 "-" "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; 
Windows 98) Opera 7.02  [en]"

So I enter foo in the form and hit Submit.  The browser screen shows
that the script failed to use the session variable, but it remembers
it:
   Stage:0 SessionID: d7002911afdc01a5218e06af2b8f02ad   
   foo [Submit]
   Stage:1 SessionID: d7002911afdc01a5218e06af2b8f02ad
   Request: Array ( [PHPSESSID] => 509012dd5633cba355c270f3934d1201 [field] => foo ) 
   GET: Array ( [PHPSESSID] => 509012dd5633cba355c270f3934d1201 ) POST: Array ( 
[field] => foo ) COOKIE: Array ( ) 
The session directory now contains TWO files:
   -rw---  1 nobody  msen  10 May 25 12:00 sess_509012dd5633cba355c270f3934d1201
   -rw---  1 nobody  msen  10 May 25 12:03 sess_d7002911afdc01a5218e06af2b8f02ad
each containing:
   stage|i:1;
and the Apache log once again has two lines.  The browser has passed back
the original session ID but PHP has ignored it and assigned a new one.
   "POST /g/xxx.php?PHPSESSID=509012dd5633cba355c270f3934d1201 HTTP/1.0" 200 605
   "POST /g/xxx.php?PHPSESSID=509012dd5633cba355c270f3934d1201 HTTP/1.0" 200 605 
"http://SERVER/xxx.php"; "Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.05  
[en]"

Now, I hit Submit once more and PHP does manage to re-use the session!  And it
will continue to do so until the script is re-invoked by another browser:
   Stage:1 SessionID: d7002911afdc01a5218e06af2b8f02ad   
   foo [Submit]
   Stage:1 SessionID: d7002911afdc01a5218e06af2b8f02ad
   Request: Array ( [PHPSESSID] => d7002911afdc01a5218e06af2b8f02ad [field] => foo ) 
   GET: Array ( [PHPSESSID] => d7002911afdc01a5218e06af2b8f02ad ) POST: Array ( 
[field] => foo ) COOKIE: Array ( ) 
the session directory remains unchanged other than access time on the
reused session:
   -rw---  1 nobody  msen  10 May 25 12:00 sess_509012dd5633cba355c270f3934d1201
   -rw---  1 nobody  msen  10 May 25 12:13 sess_d7002911afdc01a5218e06af2b8f02ad
each containing:
   stage|i:1;
The Apache log once again contains two lines:
   "POST /g/xxx.php?PHPSESSID=d7002911afdc01a5218e06af2b8f02ad HTTP/1.0" 200 605
   "POST /g/xxx.php?PHPSESSID=d7002911afdc01a5218e06af2b8f02ad HTTP/1.0" 200 605 
"http://SERVER/xxx.php?PHPSESSID=509012dd5633cba355c270f3934d1201"; "Mozilla/4.0 
(compatible; MSIE 5.0; Windows 2000) Opera 6.05  [en]"

And, finally, here is the test script.   Install it as xxx.php if you want to test it:


PHP Test page

   
  
  
   
";
   echo " Request: "; print_r($_REQUEST);
   echo "GET: "; print_r($_GET); echo " POST: "; print_r($_POST); echo " COOKIE: 
"; print_r($_COOKIE);

?>


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



[PHP] RE:php and java applets

2004-05-25 Thread Ben Ford
This is straight from the http://java.sun.com/applets/  web page:
" When you use a Java technology-enabled browser to view a page that contains 
an applet, the applet's code is transferred to your system and executed by 
the browser's Java Virtual Machine (JVM). "

Java Applets cannot connect to the same host they were loaded from.  They run 
on the client machine as a local program.  I know this because I attempted to 
run an applet and have it connect to a mysql server the resided on the web 
server. 

The applet could not connect using localhost as the domain name of the 
server. ( Which due to security settings was the only URL I could connect 
to.) 

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



Re: [PHP] Session variables not recognized?

2004-05-25 Thread Daniel Clark
Session handling was added in PHP 4.0. 

>>The first line of my file is session_start(); but whenever I try to set 
>>or reference $_SESSION['anything'] I get:
>>
>>  Undefined variable: _SESSION
>>
>>What's up with that???
>>
>>- Brian

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



Re: [PHP] Simplistic PHP tutorial

2004-05-25 Thread Gabino Travassos
> I've looked at the php.net tutorial, and though I'm learning some things
>  from it, it's still a bit over my head. It seems to presuppose a comfort
> level with programming which I do not have.
>
> Can anyone recommend a simple, hand-holding, introductory tutorial
> suitable for someone with no programming experience to speak of?

Personally, if I was teaching someone programming concepts from scratch I
would start them with Javascript. It's mostly platform-independent, you
don't need to install any software, and you don't need to upload your files
to a server that has PHP installed. Most of the basics (functions,
variables, math) are the same in php, perl, flash, and Javascript, and
Javascript is the simplest one in terms of getting started and testing your
code quickest.

There are some differences, of course, but you'll always be double-checking
your syntax anyway.

I like the PHP book from Wiley. And MySQL/PHP Database Applications from M&T
Books.
For Javascript, buy the cheapest, oldest used book you can find. Or Inside
Javascript from New Riders.

Luck.


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



Re: [PHP] Simplistic PHP tutorial

2004-05-25 Thread Ryan A
> > > Hi,
> > >
> > > I've looked at the php.net tutorial, and though I'm learning some
> things
> > > from it,
> it's still a bit over my head. It seems to presuppose a comfort
> > > level with programming which I do not have.
> > >
> > > Can anyone recommend a simple, hand-holding, introductory tutorial
> > > suitable for someone with no programming experience to speak of?

Nearly everyone here (including me) started off on PHP via a book, although
you CAN learn PHP without spending a single cent and learn it online, I too
would suggest you take the book route. There have been a lot of good books
mentioned by the others so have a look at them and the book that I stared
on: "PHP blackbook", pretty good and starts from a real newbie perspective.

I don't mean to discourage you but you must/should have some prior
experience with programming or you are going to find this very very tough,
that said, best of luck, and _when_ you stumble across problems you will
find this list is very friendly in helping you out.

Welcome to PHP.

Cheers,
-Ryan

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



[PHP] Re: Session variables not recognized?

2004-05-25 Thread Thomas Seifert
On Tue, 25 May 2004 08:36:37 -0700 [EMAIL PROTECTED] (Brian Dunning) wrote:

> The first line of my file is session_start(); but whenever I try to set 
> or reference $_SESSION['anything'] I get:
> 
>   Undefined variable: _SESSION
> 
> What's up with that???

what php-version do you use?



thomas

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



[PHP] Re: Now I can't start the session either...

2004-05-25 Thread Craig
It doesnt necessarily mean the error occured on that line, that may have
been the last executed statement
post a few more lines or we cant help you.

Regards


"Craig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can you post your whole file?
>
>
> "Brian Dunning" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Here is the top of my file:
> >
> >  > // Start the session
> > session_start();
> >
> > Which looks OK to me, but it returns:
> >
> > Parse error: parse error, unexpected T_STRING in
> > c:\inetpub\wwwroot\palms\htdocs\start-selling.php on line 3
> >
> > What's going on here??
> >
> > - Brian

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



Re: [PHP] RE:php and java applets

2004-05-25 Thread raditha dissanayake
Ben Ford - Bio-Logic Aqua Technologies wrote:
Java Applets cannot connect to the same host they were loaded from.  They run 
on the client machine as a local program.  I know this because I attempted to 
run an applet and have it connect to a mysql server the lived on the web 
server.

Small clarification.
if an applet is launched from naturestreast.com it can connect to 
naturestreast.com. The only time it cannot connect to that server is 
when there is a firewall or proxy getting in the way. 

 It couldn't connect using localhost as the domain name of the 
 

This is probably what caused you to tear your hair out.  For the applet 
localhost means the client computer and not the server that it was 
launched from.

For any further discussions on this topic please message me off list - 
or let's get on to java  list.

--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE:php and java applets

2004-05-25 Thread Ben Ford - Bio-Logic Aqua Technologies
Java Applets cannot connect to the same host they were loaded from.  They run 
on the client machine as a local program.  I know this because I attempted to 
run an applet and have it connect to a mysql server the lived on the web 
server.  It couldn't connect using localhost as the domain name of the 
server. ( Which due to security settings was the only URL I could connect 
from.)

I could be wrong here, but all I know is from experience.  After experimenting 
I came to this conclusion.

>Am I? I thought that applets were allowed to connect to the same host they 
were loaded from. Which is what I'm trying to do.
>
>Nice site BTW, useful for a few other things I'm working on, thanks.
>
>Tom

>On Sat, May 22, 2004 at 07:46:21AM +0600, raditha dissanayake wrote:
> Tom Playford wrote:
> 
> >That was my original plan. The problem is that if someone works out 
> >the commands needed to
> >communicate with the php control page, they will be able to bypass the 
> >Java access control systems.
> >I suppose I could use https, but does that encrypt the url and post data?
> >
> I think you have found yourself trapped in the java applet sandbox. You 
> need to create a signed applet. see 
> http://www.radinks.com/java/sandbox/  for a brief guide.
> 
> all the best
> 
> -- 
> Raditha Dissanayake.
> -
> http://www.raditha.com/megaupload/upload.php
> Sneak past the PHP file upload limits.
> 
-- 
Ben Ford
Bio-Logic Aqua Technologies
5001 Lower River Rd
Grants Pass, OR 97526

800-FOR-MIST (367-6478)
[EMAIL PROTECTED]

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



[PHP] Re: Now I can't start the session either...

2004-05-25 Thread Craig
Can you post your whole file?


"Brian Dunning" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Here is the top of my file:
>
>  // Start the session
> session_start();
>
> Which looks OK to me, but it returns:
>
> Parse error: parse error, unexpected T_STRING in
> c:\inetpub\wwwroot\palms\htdocs\start-selling.php on line 3
>
> What's going on here??
>
> - Brian

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



Re: [PHP] Re: Problem with number_format

2004-05-25 Thread Jordi Canals
Martin Geisler wrote:
My PHP manual (from a Debian package) has the following note on the
page for round():
Caution
  When rounding on exact halves round() rounds down on evens and up on
  odds. If you want to always force it in one direction on a .5 (or
  .05 in your case) add or substract a tiny fuzz factor. The reason
  behind rounding half the values down and the other half up is to
  avoid the classical banking problem where if you always rounded down
  you would be stealing money from your customers, or if you always
  rounded up you would end up over time losing money. By averaging it
  out through evens and odds you statistically break even.
I'm surprised with this note on manuals. I do not know in other places, 
but in the European Union there are laws and directives that obligates 
to always round to 5/4 in currency operations (Specially on Euro 
Conversions). It means that 5 and above rounds always up, anything 
bellow 5 rounds always down. So, 0,655 must round to 0,66 and 0,654 must 
round to 0,65. In this case, nothing to do: It is the law.

And ... the funny note on laws (almost on spanish laws) says that 
computer programs wich round in a different way are not considered valid 
reasons to not round as stated above.

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


[PHP] Now I can't start the session either...

2004-05-25 Thread Brian Dunning
Here is the top of my file:

Which looks OK to me, but it returns:
Parse error: parse error, unexpected T_STRING in 
c:\inetpub\wwwroot\palms\htdocs\start-selling.php on line 3

What's going on here??
- Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Session variables not recognized?

2004-05-25 Thread Brian Dunning
The first line of my file is session_start(); but whenever I try to set 
or reference $_SESSION['anything'] I get:

 Undefined variable: _SESSION
What's up with that???
- Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Simplistic PHP tutorial

2004-05-25 Thread Ray Hunter
On Tue, 2004-05-25 at 09:17, Stephen Allen wrote:
> On Tue, May 25, 2004 at 10:47:01AM -0400 or thereabouts, Neal wrote:
> > Hi,
> > 
> > I've looked at the php.net tutorial, and though I'm learning some things 
> > from it, it's still a bit over my head. It seems to presuppose a comfort 
> > level with programming which I do not have.
> > 
> > Can anyone recommend a simple, hand-holding, introductory tutorial 
> > suitable for someone with no programming experience to speak of?
> 
> One of the best I've seen, (from a beginners standpoint), is a book from
> Peachpit Press: "PHP for the World Wide Web" 2nd Edition by Larry Ullman -- ISBN
> 0-321-24565-2. It has helped me. Covers the basics of PHP4 and PHP5 and is a
> "Visual Quickstart Guide".

I would suggest checking into a book that has a few chapters on some of
the basics; however, that also has a lot of the the advanced stuff. You
will soon be wanting to know more as you progress and it is better to
find a book that has both. New Rider publishing has a couple great PHP
books out there now that are really good too.

--
BigDog

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



Re: [PHP] Reading from XML file

2004-05-25 Thread Ray Hunter
On Tue, 2004-05-25 at 05:03, Ago wrote:
> I have a PHP script who reads data from a XML file uploaded via http form.
> This file is about 15 MB. The script builds a query of thousands inserts as
> many as the products the XML file contains (more or less 4 inserts).
> After 4 minutes the httpd process aborts by itself. What can it depend on? I
> have also increased the memory_limit parameter in php.ini to 32 MB and
> set_time_limit to 0. What can I do anymore?
> Thanks.

Sounds like you are using a dom parser and not a sax parser. I would
suggest checking on php.net on how to use a sax parser. The xml file
seems to big for the dom parser to really handle.

--
BigDog

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



Re: [PHP] Error building PHP with PostgreSQL support

2004-05-25 Thread Ray Hunter
On Mon, 2004-05-24 at 17:14, Robert Fitzpatrick wrote:
> I am getting the following problem with trying to install from source
> PHP 4.3.6 with PG support on FreeBSD 5.2.1. I have PostgreSQL 7.4.2
> recently upgraded from 7.3.x and it is up and running fine. I also have
> Heimdal 0.6 installed and PostgreSQL was built with that support. Is the
> error below from something missing on the Heimdal side of things or
> PostgreSQL? And what does anyone suggest to resolve the issue? Maybe I
> need to rebuild Heimdal since upgrading PostgreSQL with krb5 support?
> 
> /usr/local/lib/libc-client4.so: warning: tmpnam() possibly used
> unsafely; consider using mkstemp()
> /usr/local/lib/libpq.so: undefined reference to `krb5_cc_get_principal'
> /usr/local/lib/libpq.so: undefined reference to
> `krb5_sname_to_principal'
> /usr/local/lib/libpq.so: undefined reference to `krb5_cc_default'
> /usr/local/lib/libpq.so: undefined reference to `krb5_cc_close'
> /usr/local/lib/libpq.so: undefined reference to `error_message'
> /usr/local/lib/libpq.so: undefined reference to `krb5_free_error'
> /usr/local/lib/libpq.so: undefined reference to `krb5_sendauth'
> /usr/local/lib/libpq.so: undefined reference to `krb5_free_principal'
> /usr/local/lib/libpq.so: undefined reference to `krb5_unparse_name'
> /usr/local/lib/libpq.so: undefined reference to `krb5_free_context'
> /usr/local/lib/libpq.so: undefined reference to `krb5_init_context'
> *** Error code 1

This is a kerberos 5 issue. How are you compiling pgsql into php?

--
Ray

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



Re: [PHP] Simplistic PHP tutorial

2004-05-25 Thread Stephen Allen
On Tue, May 25, 2004 at 10:47:01AM -0400 or thereabouts, Neal wrote:
> Hi,
> 
> I've looked at the php.net tutorial, and though I'm learning some things 
> from it, it's still a bit over my head. It seems to presuppose a comfort 
> level with programming which I do not have.
> 
> Can anyone recommend a simple, hand-holding, introductory tutorial 
> suitable for someone with no programming experience to speak of?

One of the best I've seen, (from a beginners standpoint), is a book from
Peachpit Press: "PHP for the World Wide Web" 2nd Edition by Larry Ullman -- ISBN
0-321-24565-2. It has helped me. Covers the basics of PHP4 and PHP5 and is a
"Visual Quickstart Guide".

-- 
S.Allen
---
barnyard  Tuesday May 25 2004 11:10:01 AM EDT
---
There is nothing more silly than a silly laugh.
-- Gaius Valerius Catullus

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



[PHP] Re: Problem with number_format

2004-05-25 Thread Martin Geisler
[EMAIL PROTECTED] writes:

> please suppose PHP 4.3.2 and $number=502,3550
>
> number_format($number,2,'.',' ') returns 502.36.
>
> It seems ok, but if $number=253,0650 
>
> number_format($number,2,'.',' ') returns 253.06 instead of 253.07.

My PHP manual (from a Debian package) has the following note on the
page for round():

Caution

  When rounding on exact halves round() rounds down on evens and up on
  odds. If you want to always force it in one direction on a .5 (or
  .05 in your case) add or substract a tiny fuzz factor. The reason
  behind rounding half the values down and the other half up is to
  avoid the classical banking problem where if you always rounded down
  you would be stealing money from your customers, or if you always
  rounded up you would end up over time losing money. By averaging it
  out through evens and odds you statistically break even.

-- 
Martin Geisler  My GnuPG Key: 0xF7F6B57B

PHP EXIF Library  |  PhpWeather  |  PhpShell
http://pel.sf.net/|  http://phpweather.net/  |  http://gimpster.com/
Read/write EXIF data  |  Show current weather|  A shell in a browser

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



Re: [PHP] Problem with number_format

2004-05-25 Thread Curt Zirzow
* Thus wrote John W. Holmes ([EMAIL PROTECTED]):
> From: <[EMAIL PROTECTED]>
> 
> > please suppose PHP 4.3.2 and $number=502,3550
> >
> > number_format($number,2,'.',' ') returns 502.36.
> >
> > It seems ok, but if $number=253,0650
> >
> > number_format($number,2,'.',' ') returns 253.06 instead of 253.07.
> >
> > Why?
> > I've noticed this non-coherent approximation behaviour when
> > 3rd decimal number is 5 and decimals are two many many
> > times.
> 
> Isn't there some "rule" where you round up on odd numbers and don't round up
> on even, otherwise it comes out unevenly rounded up?
> 
> So 0.15, 0.35, 0.55 will be rounded up to 0.2, 0.4, and 0.6, respectively,
> whereas 0.25, 0.45, 0.65 will be rounded down to 0.2, 0.4, and 0.6,
> respectively...
> 
> Your test cases seem to fit this.

Interesting theory, but php5 doesn't show that behaviour:
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Simplistic PHP tutorial

2004-05-25 Thread Craig
Personally I would buy a book on programming in general or maybe just go
straight for a
PHP beginners book.

But this is pretty straight forward from the ground up:
http://www.w3schools.com/php/default.asp

HTH
Craig

"Neal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I've looked at the php.net tutorial, and though I'm learning some things
>  from it, it's still a bit over my head. It seems to presuppose a comfort
> level with programming which I do not have.
>
> Can anyone recommend a simple, hand-holding, introductory tutorial
> suitable for someone with no programming experience to speak of?

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



[PHP] Simplistic PHP tutorial

2004-05-25 Thread Neal
Hi,
I've looked at the php.net tutorial, and though I'm learning some things 
from it, it's still a bit over my head. It seems to presuppose a comfort 
level with programming which I do not have.

Can anyone recommend a simple, hand-holding, introductory tutorial 
suitable for someone with no programming experience to speak of?

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


Re: [PHP] Session name length

2004-05-25 Thread Curt Zirzow
* Thus wrote "Miguel J. Jimnez" ([EMAIL PROTECTED]):
> How much long can be the session name? What is the limit? 10, 40, 255 
> alphanumeric chars? or what?
> Thanks...

You're limit will most likey be the cookie length (if you're using
cookies).

That would be about:

 4KB - ~82 Bytes


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] Problem with number_format

2004-05-25 Thread John W. Holmes
From: <[EMAIL PROTECTED]>

> please suppose PHP 4.3.2 and $number=502,3550
>
> number_format($number,2,'.',' ') returns 502.36.
>
> It seems ok, but if $number=253,0650
>
> number_format($number,2,'.',' ') returns 253.06 instead of 253.07.
>
> Why?
> I've noticed this non-coherent approximation behaviour when
> 3rd decimal number is 5 and decimals are two many many
> times.

Isn't there some "rule" where you round up on odd numbers and don't round up
on even, otherwise it comes out unevenly rounded up?

So 0.15, 0.35, 0.55 will be rounded up to 0.2, 0.4, and 0.6, respectively,
whereas 0.25, 0.45, 0.65 will be rounded down to 0.2, 0.4, and 0.6,
respectively...

Your test cases seem to fit this.

---John Holmes...

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



Re: [PHP] Reading from XML file

2004-05-25 Thread raditha dissanayake
Ago wrote:
It is not a database problem, it seems to me something about the reading of
the XML file. This is my code about this:
 

You can't rule out the database because, inserts are a resource 
intensive task.

$data = implode(file("example.xml"), "");
 

ouch!!
xml_parse_into_struct($parser, $data, &$structure, &$index);
 

you will be suckingup all the processor and memory with an operation 
like this. definitely not what you want to do with a web app. If you 
look at the sax parser examples in the php manual you will see how you 
can sequentially read in the data (and insert the data one at a time) 
instead of keeping the whole thing in memory.

xml_parser_free($parser);
it could be the array $data creation fails because the example.xml is too
big,
There you are.
infact if I decrease the size of xml file the script works (even if it
lasts several minutes),
There you are. You might even find that event driven SAX parser example 
i just refered to is a lot faster.

unfortunately the xml_parse_into_struct function
needs the $data array as argument.
My PHP version is 4.0.6.
 

--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reading from XML file

2004-05-25 Thread Ago
It is not a database problem, it seems to me something about the reading of
the XML file. This is my code about this:

$data = implode(file("example.xml"), "");

xml_parse_into_struct($parser, $data, &$structure, &$index);

xml_parser_free($parser);

it could be the array $data creation fails because the example.xml is too
big, infact if I decrease the size of xml file the script works (even if it
lasts several minutes), unfortunately the xml_parse_into_struct function
needs the $data array as argument.
My PHP version is 4.0.6.



"Raditha Dissanayake" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> Ago wrote:
>
> >I have a PHP script who reads data from a XML file uploaded via http
form.
> >This file is about 15 MB. The script builds a query of thousands inserts
as
> >many as the products the XML file contains (more or less 4 inserts).
> >After 4 minutes the httpd process aborts by itself. What can it depend
on? I
> >have also increased the memory_limit parameter in php.ini to 32 MB and
> >set_time_limit to 0. What can I do anymore?
> >
> >
> Use a single insert statement instead of 40,000  - or -
> Drop the primary key before the insert and recreate it after wards. - or -
> save data into a csv file and use  'load data in file'
>
>
> Having said that the page shouldn't stop loading after 4 minutes if you
> use set_time_limit please see if you have some other setting that may be
> killing it.
>
>
> >Thanks.
> >
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> -
> http://www.raditha.com/megaupload/upload.php
> Sneak past the PHP file upload limits.

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



Re: [PHP] Problem with number_format

2004-05-25 Thread Gareth Williams
Hi there,
Try using:
round($number, 2);
cheers,
Gareth
On 25 May 2004, at 16:00, [EMAIL PROTECTED] wrote:
Hi,
please suppose PHP 4.3.2 and $number=502,3550
number_format($number,2,'.',' ') returns 502.36.
It seems ok, but if $number=253,0650
number_format($number,2,'.',' ') returns 253.06 instead of 253.07.
Why?
I've noticed this non-coherent approximation behaviour when
3rd decimal number is 5 and decimals are two many many
times.
It's a my error or should be a bug?
Thanks, ciao
Francesco
---
Spazio ILLIMITATO per la tua Email, Scanner Antivirus,
Antispam, Backup e POP3. Prova la nuova Email di superEva:
http://webmail.supereva.it/
---
--
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] Problem with number_format

2004-05-25 Thread fku

Hi, 

please suppose PHP 4.3.2 and $number=502,3550



number_format($number,2,'.',' ') returns 502.36.



It seems ok, but if $number=253,0650 



number_format($number,2,'.',' ') returns 253.06 instead of 253.07.



Why? 

I've noticed this non-coherent approximation behaviour when 

3rd decimal number is 5 and decimals are two many many 

times.



It's a my error or should be a bug?



Thanks, ciao

Francesco

---
Spazio ILLIMITATO per la tua Email, Scanner Antivirus,
Antispam, Backup e POP3. Prova la nuova Email di superEva:
http://webmail.supereva.it/
---

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



[PHP] Re: Multiple substring replacement

2004-05-25 Thread GodFoca
Because it doesn't replace the newlines, just inserts "" before them...
I liked the implode solution ... (shoulda figured, since I come from a
python background ... but I keep saying to myself that py is better and that
php can't be treated the same way ... ;)

Greetings, and thanks for all the answers,
Nicolas

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



[PHP] R: [PHP] Reading from XML file

2004-05-25 Thread Alessandro Vitale
I had a similar problem on my system too. In my case I fixed the problem
simply outputting some information during the processing (I would recommend
a process bar or something like that). The process itself was correct
anyway, but doing that I was getting the expected behaviour from the
browser: showing me that the page transfer was finished.

good luck

alessandro




-Messaggio originale-
Da: Ago [mailto:[EMAIL PROTECTED]
Inviato: martedì 25 maggio 2004 13.04
A: [EMAIL PROTECTED]
Oggetto: [PHP] Reading from XML file


I have a PHP script who reads data from a XML file uploaded via http form.
This file is about 15 MB. The script builds a query of thousands inserts as
many as the products the XML file contains (more or less 4 inserts).
After 4 minutes the httpd process aborts by itself. What can it depend on? I
have also increased the memory_limit parameter in php.ini to 32 MB and
set_time_limit to 0. What can I do anymore?
Thanks.

--
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] Session name length

2004-05-25 Thread "Miguel J. Jiménez"
How much long can be the session name? What is the limit? 10, 40, 255 
alphanumeric chars? or what?
Thanks...

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
mjjimenez AT isotrol DOT com   ---   http://www.isotrol.com
ICQ# 12670750
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Reading from XML file

2004-05-25 Thread raditha dissanayake
Ago wrote:
I have a PHP script who reads data from a XML file uploaded via http form.
This file is about 15 MB. The script builds a query of thousands inserts as
many as the products the XML file contains (more or less 4 inserts).
After 4 minutes the httpd process aborts by itself. What can it depend on? I
have also increased the memory_limit parameter in php.ini to 32 MB and
set_time_limit to 0. What can I do anymore?
 

Use a single insert statement instead of 40,000  - or -
Drop the primary key before the insert and recreate it after wards. - or -
save data into a csv file and use  'load data in file'
Having said that the page shouldn't stop loading after 4 minutes if you 
use set_time_limit please see if you have some other setting that may be 
killing it.


Thanks.
 


--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Sessions simply do not work?

2004-05-25 Thread Brent Baisley
I've never had a problem using sessions. Do you have a sample piece of 
simple session code that isn't working? You also need to have cookies 
enabled on your client if you are using the default session management 
technique. Your very first line of code, before you do anything else, 
should be session_start(). Actually, it can be in and "include" file, 
but I recall having problems if I did other stuff first. For instance, 
all my php files, except the logion, begin like this:

require('sessionInit.php');

That file checks for an existing session and retrieves session 
variables or redirects to a login screen if no session was found. Also, 
check your php configuration for sessions. You can use phpinfo() to 
check your configuration, there is a section on sessions. You might 
even have session support disabled.

On May 24, 2004, at 5:57 PM, Michael R. Wayne wrote:
In my continuing efforts to actually get sessions to work, I upgraded
to PHP 4.3.6 and apache 1.3.31.  This did not make the slighest
difference.
So, does ANYone have ideas of how to debug this?  Or is PHP simply
broken and no longer able to maintain sessions?
/\/\ \/\/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Reading from XML file

2004-05-25 Thread Ago
I have a PHP script who reads data from a XML file uploaded via http form.
This file is about 15 MB. The script builds a query of thousands inserts as
many as the products the XML file contains (more or less 4 inserts).
After 4 minutes the httpd process aborts by itself. What can it depend on? I
have also increased the memory_limit parameter in php.ini to 32 MB and
set_time_limit to 0. What can I do anymore?
Thanks.

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



[PHP] Printing images

2004-05-25 Thread rui . silva
Hello!

I need to print an image file, but I’m having some problems. 
I have a handler to a printer witch I can print text correctly with the 
printer_write function. 
I can also print an image if it is in bmp format (printer_draw_bmp), however, 
I want to print png files.
How can I do it?

Thank you!


__
Quanto gasta de Acesso à Internet? Faça as contas!
http://acesso.portugalmail.pt/contas

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



Re: [PHP] download security

2004-05-25 Thread Jason Wong
On Saturday 22 May 2004 19:15, mattias lundberg wrote:

> Why isn't there any way to verify the authenticity of downloadable files,
> like you can do on apache.org where there are PGP hashes for each file?
> I know that there are MD5 sums on the website, but I can't assume that the
> webpage is not spoofed. There doesn't seem to be any SSL connection to the
> website. At least the page that gives the MD5 sums could be secure? Cheers,
> Mattias

I usually get the md5 checksums and download the files from separate sites 
where possible. The chances that both sites are compromised are (hopefully) 
minimal. To be extra paranoid you may want to check what OS the sites are 
using and select sites which are running different ones.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You have many friends and very few living enemies.
*/

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



Re: [PHP] Re: send mail error

2004-05-25 Thread Manuel Lemos
Hello,
On 05/25/2004 04:51 AM, Tassos T wrote:
i try this it seems to work but i reseve error message like that :
SMTP server response: 553 sorry, relaying denied from your location
i heve windows server
It seems to need to authenticate. The mail() function does not support 
authentication.

You may want to use this class that comes with a wrapper function named 
smtp_mail() that emulates the mail() function and lets you specify the 
user name and password in the smtp_mail.php script, so you only have to 
include that script and rename the mail() calls to smtp_mail() to solve 
your problem.

http://www.phpclasses.org/mimemessage
You also need this:
http://www.phpclasses.org/smtpclass
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: send mail error

2004-05-25 Thread Tassos T
i try this it seems to work but i reseve error message like that :
SMTP server response: 553 sorry, relaying denied from your location
i heve windows server
please advise
tassos







Craig wrote:
On windows I believe this will work:
ini_set("sendmail_from",[EMAIL PROTECTED]);
Try that. http://www.php.net/ini_set
HTH
Craig
"Tassos T" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 

hello,
i  face a problem with send mail via php.
i have a server with ms IIS and i have not access to php.ini
how i send a email with php script with auto add the sendmail_from into
php.ini ?
PS. i write a php script to send email but i receive the follow error
message
mail(): "sendmail_from" not set in php.ini or custom "From:" header
missing in *...
*please advise
Thanks
Tassos
   

 

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


Re: [PHP] Changing maximum upload file size

2004-05-25 Thread Jason Wong
On Monday 24 May 2004 11:28, Matt Palermo wrote:
> Is there a way to change the maximum file upload size in a PHP script? 
> Kind of like the way you can change the error reporting in a script, but I
> just want to adjust the max file upload size.  Does anyone know if this can
> be done?

No. Because the file upload process is completed before your php script gets 
to run.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Bond reflected that good Americans were fine people and that most of them
seemed to come from Texas.
-- Ian Fleming, "Casino Royale"
*/

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



Re: [PHP] imagettftext() question

2004-05-25 Thread Jason Wong
On Tuesday 25 May 2004 03:52, Mike Rotondo wrote:
>  I've written a script that displays a graph of some data from a text file.
> Beneath each bar in the graph is a text label. I read the php.net
> documentation and it seemed that imagettftext() was the easiest function to
> get text in an image with, so I used that. Here is the text-display code
> (syntax is all correct):
>
> imagettftext($im, 10, 0, $i * 100 + 10, 190, $black, "arial",
> str_pad($candidates[$i][0], 12, " ", STR_PAD_BOTH));
>
> This code works perfectly well on both windows machines I've tried it on,
> but causes an error in the image on both non-windows (Unix variants)
> machines I've tried it on. Does anyone have
> -any idea why its breaking?
> -a solution to get it to work on *nix machines?
> -a different way to display text in an image?

As you haven't stated what error you're getting my guess is that most likely 
it's because you don't have the font file installed on your "non-windows" 
machines. Another thing is that imagettftext() seems to be very finicky and 
needs the full path to the font file.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
One enemy soldier is never enough, but two is entirely too many
-- Murphy's Military Laws n68
*/

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



Re: [PHP] List all files in remote url ?

2004-05-25 Thread Oliver Hankeln
Dave Carrera wrote:
Hi List,
I am trying to list all files in a remote url for processing into my attempt
at a search engine but I cant work out how to list the files found in a
given domain name.
The manual has nothing on this, as I can see, and searching the web has
drawn a blank.
So I ask the list if there is a way of doing it.
The idea is:
Domain name = domain.com
Then fopen or opendir or something on the domain name to get a list of files
found
As far as I know, this can't be done. You have to start fetching a file 
(usually index.html) and then find all links in there and follow them. 
That is why the Search Engines are called Spiders or Crawlers. They 
can't fetch everything. The "crawl" along the "net" that is made up by 
links.

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


Re: [PHP] Php Alias instead of redirect

2004-05-25 Thread Jason Wong
On Tuesday 25 May 2004 12:42, Jake Johnson wrote:

> Is it possible to have an alias so that bots will index the page instead of
> a redirect.

If you're using Apache have a look at the alias directive.
If you're using some *nix system use symbolic links.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Real Users hate Real Programmers.
*/

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



  1   2   >