Re: [PHP] user-defined superglobals?

2003-08-24 Thread Mike Migurski
It would be nice to have a php-function like

declare_superglobal($_MYFRAMEWORK);

And then use $_MYFRAMEWORK like $_GET.

You have a few options: if you are looking to set variables that are
static and atomic, you can use environmental variables in an .htaccess
file (getenv() to access them) or you can use read-only constants
(define() to create them).

If you need a global read-write or array variable, just use $_GLOBALS:
use $_GLOBALS['_MYFRAMEWORK'] like $_GET, etc.

-
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



[PHP] sqlite

2003-08-24 Thread Kevin Waterson
I am writing an admin for sqlite but have struck a 
problem with exporting data. I wish to simply 
get a dump of the current sql database. from
the commandline this would be done with .dump
however this causes an error when used with
sqlite_query()

Is there any other method to get a sqlite dump?

Kind regards
kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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



[PHP] Using PHP on an .html file

2003-08-24 Thread Pag
	I looked everywhere for the answer to this dilemma, and i know there is a 
way around it, maybe something about the headers, cant really remember how 
it was, but can someone please tell me how i can use PHP code on a file 
with an extension of .html?

	For example, on a file called info.html, i want to have some PHP code that 
actually gets executed.

	Thanks.

	Pag



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


Re: [PHP] Using PHP on an .html file

2003-08-24 Thread Kevin Waterson
This one time, at band camp, Pag [EMAIL PROTECTED] wrote:

 
   I looked everywhere for the answer to this dilemma, and i know there is a 
 way around it, maybe something about the headers, cant really remember how 
 it was, but can someone please tell me how i can use PHP code on a file 
 with an extension of .html?
 
   For example, on a file called info.html, i want to have some PHP code that 
 actually gets executed.

In your httpd.conf add the line

AddType application/x-httpd-php html

Kind regards
Kevin
-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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



[PHP] parse error with mysql_connect

2003-08-24 Thread Mjec
Hi,

I keep getting Parse Error on line 36, but I can't figure out why...

relevant code:

35: // Initialize MySQL database
36: $h = 
mysql_connect('localhost','localhost',constant(mysql_user),constant(mysql
_password));
37: mysql_select_db('mjec_mjecnet', $h);

using PHP v. 4.3.2

Thanks,

Mjec

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



Re: [PHP] Using PHP on an .html file

2003-08-24 Thread Chan Hong Guan
Kevin Waterson wrote:
This one time, at band camp, Pag [EMAIL PROTECTED] wrote:


	I looked everywhere for the answer to this dilemma, and i know there is a 
way around it, maybe something about the headers, cant really remember how 
it was, but can someone please tell me how i can use PHP code on a file 
with an extension of .html?

	For example, on a file called info.html, i want to have some PHP code that 
actually gets executed.


In your httpd.conf add the line

AddType application/x-httpd-php html
You forgot your dot

AddType application/x-httpd-php .html
Kind regards
Kevin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using PHP on an .html file

2003-08-24 Thread Mike Migurski
  For example, on a file called info.html, i want to have some PHP
 code that actually gets executed.

In your httpd.conf add the line

AddType application/x-httpd-php html

Better to do this in an .htaccess file, so you don't incur PHP processing
overhead on the entire server (if there are others using it).

http://httpd.apache.org/docs/configuring.html#htaccess

-
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] sqlite

2003-08-24 Thread andu
On Sun, 24 Aug 2003 13:09:55 +1000
Kevin Waterson [EMAIL PROTECTED] wrote:

 I am writing an admin for sqlite but have struck a 
 problem with exporting data. I wish to simply 
 get a dump of the current sql database. from
 the commandline this would be done with .dump
 however this causes an error when used with
 sqlite_query()
 
 Is there any other method to get a sqlite dump?

I just installed the sqlite extension today myself and was looking for
all those dot commands but I don't think they are supported by the
extension unfortunately. My suggestion is to call sqlite with exec() in
order to get the .dump.

$command=sqlite db_name  '.dump';
exec($command,$result);
print_r( $result);// shows the dump array

 
 Kind regards
 kevin
 
 -- 
  __  
 (_ \ 
  _) )            
 |  /  / _  ) / _  | / ___) / _  )
 | |  ( (/ / ( ( | |( (___ ( (/ / 
 |_|   \) \_||_| \) \)
 Kevin Waterson
 Port Macquarie, Australia
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


-- 
Andu

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



Re: [PHP] '' Sign in _GET Parameter

2003-08-24 Thread AciD
Try this :
$link = $row[company];
echo (a href='full_profile_1.php?name=.urlencode($link).');
--
www.cpm-fr.com


Thanks for the link,
$link = $row['company'];\00\00
a href=\full_profile_1.php?name=', urlencode($link),' \\00\00
However this does not seem to work / what am I missing ?
Thanks
-Pushpinder
On Friday, August 22, 2003, at 03:23 PM, CPT John W. Holmes wrote:
From: Pushpinder Singh Garcha [EMAIL PROTECTED]
I am using an application where I retrieve user profile from a MySQL
DB using the Company Name .  I pass the name of the company to the PHP
script as a '$_GET' parameter. e.g. when the name of the company is
'IBM'. , the URL with the query string would look like :
http://masterstream.com/CRM/full_profile_1.php?name=IBM
Now one of the records had a name : PSG  Inc. , in this case the URL
with the query string would look like
http://masterstream.com/CRM/full_profile_1.php?name=PSG%20%20Inc.
However in the case of the latter I am not able to pull out any records
from the MySQL database. It says that no records with the name were
found.   I went ahead and tweaked the name of the company, to remove
the  sign in 'PSG  Inc.'   Now the query works fine.  Can some one
throw some light here. I am sure something minor is to be done when
passing the name of the company in the parent script.
The  character separates variables in the query string, so it must be
encoded if it appears in the data. Take a look at
http://us2.php.net/urlencode
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] sqlite

2003-08-24 Thread Kevin Waterson
This one time, at band camp, andu [EMAIL PROTECTED] wrote:

 $command=sqlite db_name  '.dump';
 exec($command,$result);
 print_r( $result);// shows the dump array

As sqlite is bundled with php5, I guess command line type commands
are not available because it is compiled in.

Kevin


-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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



[PHP] finding out localhost :-P

2003-08-24 Thread Pag
	Heres the problem. I have one of my client's site hosted on a crappy 
server, and i have it running with php+mysql ok, the thing is i need to 
connect to that site's mysql's database from a different site to get data. 
The problem is that on the origin site (the crappy server), to connect to 
the database, i use localhost. How can i find out the real server to 
connect to from the other site? I tried using the whole domain, like 
www.crappyserver.com, but doesnt work. :-P
	Thanks.

	Pag

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


Re: [PHP] finding out localhost :-P

2003-08-24 Thread Ray Hunter
Make sure that the user that you are connecting with has permissions to
connect to mysql from that computer. You can check the user table in the
mysql database to see the user and their associated permissions.

I would suggest checking out mysql.com for additional information.

--
BigDog



On Sat, 2003-08-23 at 22:00, Pag wrote:
   Heres the problem. I have one of my client's site hosted on a crappy 
 server, and i have it running with php+mysql ok, the thing is i need to 
 connect to that site's mysql's database from a different site to get data. 
 The problem is that on the origin site (the crappy server), to connect to 
 the database, i use localhost. How can i find out the real server to 
 connect to from the other site? I tried using the whole domain, like 
 www.crappyserver.com, but doesnt work. :-P
   Thanks.
 
   Pag

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



Re: [PHP] sqlite

2003-08-24 Thread andu
On Sun, 24 Aug 2003 14:44:19 +1000
Kevin Waterson [EMAIL PROTECTED] wrote:

 This one time, at band camp, andu [EMAIL PROTECTED] wrote:
 
  $command=sqlite db_name  '.dump';
  exec($command,$result);
  print_r( $result);// shows the dump array
 
 As sqlite is bundled with php5, I guess command line type commands
 are not available because it is compiled in.

Something like that, I use it as a separately compiled dynamic library
with php4 though.

 
 Kevin
 
 
 -- 
  __  
 (_ \ 
  _) )            
 |  /  / _  ) / _  | / ___) / _  )
 | |  ( (/ / ( ( | |( (___ ( (/ / 
 |_|   \) \_||_| \) \)
 Kevin Waterson
 Port Macquarie, Australia
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


-- 
Andu

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



[PHP] homepage script..

2003-08-24 Thread Dasmeet
Hi!,
I am developing a web site for an ISP.. They want to add homepage 
functionality.. that is their subscribers can have thier homepage (say 
with 2MB space each).
Is there any script (free or paid) for such system.. to manage, create 
accounts etc...
Any information would be of great help!
Thanks
Dasmeet

--
--
Domainwala.com
Domain Names from $7.99 at http://www.domainwala.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 24 Aug 2003 06:42:26 -0000 Issue 2255

2003-08-24 Thread php-general-digest-help

php-general Digest 24 Aug 2003 06:42:26 - Issue 2255

Topics (messages 160518 through 160567):

Expiration time of a cookie
160518 by: Stevie D Peele
160527 by: Matthias Nothhaft

Re: user-defined superglobals?
160519 by: Matthias Nothhaft
160522 by: Tom Rogers
160524 by: Matthias Nothhaft
160528 by: Jim Lucas
160550 by: Curt Zirzow
160551 by: Jason Sheets
160553 by: Matthias Nothhaft
160554 by: Mike Migurski

Need help om screen display error
160520 by: Gloria L. McMillan

file upload problem
160521 by: Matthias Wulkow
160529 by: Jim Lucas
160532 by: Matthias Wulkow
160534 by: Jim Lucas
160537 by: Matthias Wulkow
160538 by: Catalin Trifu
160539 by: Jim Lucas
160540 by: Matthias Nothhaft

sdfdsafasdf
160523 by: macromaniac

Re: Easy XML  PHP tutorials ?
160525 by: Boaz Yahav

Re: google style paginating
160526 by: Boaz Yahav

timing a session
160530 by: Damian Brown
160535 by: Matthias Nothhaft
160536 by: John W. Holmes

Re: 2 questions
160531 by: Thomas Hochstetter

PHP connection
160533 by: Dennis Dujan - Partycult.de

loading extension in script
160541 by: andu

Re: Need help on screen display error
160542 by: Gloria L. McMillan

Re: Problem with the post variables.
160543 by: chris
160544 by: Jim Lucas

Tips on print to screen debugging
160545 by: Gloria L. McMillan
160546 by: John W. Holmes
160547 by: Gloria L. McMillan
160548 by: Gloria L. McMillan
160549 by: John W. Holmes
160552 by: Jim Lucas

sqlite
160555 by: Kevin Waterson
160561 by: andu
160563 by: Kevin Waterson
160566 by: andu

Using PHP on an .html file
160556 by: Pag
160557 by: Kevin Waterson
160559 by: Chan Hong Guan
160560 by: Mike Migurski

parse error with mysql_connect
160558 by: Mjec

Re: '' Sign in _GET Parameter
160562 by: AciD

finding out localhost :-P
160564 by: Pag
160565 by: Ray Hunter

homepage script..
160567 by: Dasmeet

Administrivia:

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

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

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
What is the longest expiration time of a cookie?

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
---End Message---
---BeginMessage---
Stevie D Peele wrote:
What is the longest expiration time of a cookie?

Hm, good question ;-)
A day has 86400 seconds.
Multiply it by 'enough' days (eg 365) and always refresh
your cookie's expiration. This might solve your problem.
Regards,
Matthias

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!


---End Message---
---BeginMessage---
Hi Ray Hunter, you wrote:
you can define your own superglobals by defining the vars first then
accessing them thru the $GLOBALS var.
example:

?php
// file1.php
$var1 = test1\n;
$var2 = test2\n;
?
?php
// file2.php
include( 'file1.php' );
function test() {
  echo $GLOBALS['var1'];
  echo $GLOBALS['var2'];
  echo Test\n
}
test();

?

That should get you started with globals.

Well, this is clear, (I'm only new in the list - not in PHP ;-) )
but I want it in a better/shorter way
for the master var of a big project!
Is there a way to request such a feature and where?
I think this would be nice for application frameworks!?
Maybe also for PEAR...
Regards,
Matthias

--
BigDog
On Sat, 2003-08-23 at 11:45, Matthias Nothhaft wrote:

Hi List,

is there a way (mybe in php5?) to define/declare a global var as a 
superglobal, so that I can use this var like the known superglobals
($_GET, $_SESSION, etc.) ???

If not, is there a list for feature requests?

Regards,
Matthias





---End Message---
---BeginMessage---
Hi,

Sunday, August 24, 2003, 3:45:33 AM, you wrote:
MN Hi List,

MN is there a way (mybe in php5?) to define/declare a global var as a 
MN superglobal, so that I can use this var like the known superglobals
MN ($_GET, $_SESSION, etc.) ???

MN If not, is there a list for feature requests?


MN Regards,
MN Matthias

You can always add to one of the superglobals, remembering not to have
a name clash with get or post variables.

$_GET['test'] = 'Hi;

now that will be available in all functions.

-- 
regards,
Tom

---End Message---
---BeginMessage---
Sorry this all is not what I'm looking for.
I see it 

Re: [PHP] Easy XML PHP tutorials ?????

2003-08-24 Thread murugesan
www.w3schools.com

-murugesan
- Original Message - 
From: Boaz Yahav [EMAIL PROTECTED]
To: Joe Harman [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 1:09 AM
Subject: RE: [PHP] Easy XML  PHP tutorials ?


Try this too : http://www.sitepoint.com/article/1165

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-Original Message-
From: Joe Harman [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 1:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy XML  PHP tutorials ?


Hello all. does anyone have any very easy XML tutorials . I have a
simple weather feed I want to implement. but no XML experience

thanks

Joe Harman




 
 

-- 
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] CRC and Polynomials

2003-08-24 Thread Methusula
Hi,

Can anyone tell me which 32-bit polynomial is used by PHP in the crc
function? I am trying to write a crc function from scratch, however, php
does not appear to use any of the most commonly used polynomial divisors.

Methusula.



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



[PHP] regex replace href-content

2003-08-24 Thread Christoph Gassmann
Dear List,

I´m writing a little framework with special features for my application. The
content of my Website is in HTML-Pages from other users working with
HTML-Editors.

I parse the content in their body in my framework.

now I have to replace the content of their links from a
href=test.htmltest/a to a href=index.php?page=test.htmltest/a. It
works fine with the following replacement.

$body2 = preg_replace('/href=(.*?)/i', 'href=index.php?page=$1', $body);

But if the content of their href´s is an external link (http:// at
beginning) or a javascript-link (javascript: at beginning) I don´t want to
do that.

With (?!http:\/\/) before a word I can say, if there is an http:// in front
of, don´t replace. But it works only if I know the content of the link...
like this.

$body1 = preg_replace('/href=(?!http:\/\/)www.test.com/i',
'href=index.php?page=internal', $body);

I can´t figure out how to combine the two replacements to work...

do you have any sugesstion? thanks for your help.

christoph

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



Re: [PHP] CRC and Polynomials

2003-08-24 Thread Andrew Brampton
I found this mentioned in a old user comment (it might not be relevant now):
Some quick reverse engineering shows they're using the standard CRC32
parameters:

Polynomial 0x04C11DB7l
Initial register value 0x
Register is inverted at end of calculation
Bytes are reflected as they come in, and the result is reflected before it
is returned.

The documentation says this function returns the CRC polynomial of the
string - that's a little misleading IMHO. I'd say it simply returns the CRC
of the string. The polynomial is a magic number in the calculation.

and I've just downloaded the lastest source and found the crc32 function to
be in crc32.c and crc32.h. In the comments it mentions that the polynomial
is
/* generated using the AUTODIN II polynomial
 * x^32 + x^26 + x^23 + x^22 + x^16 +
 * x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
 */

and there is a big table of 256 number which you may find useful.

Oh finally I also found mentioned in the NEWS file that:
- Added a crc32 checksum function - used by the UdmSearch search engine
  and currently run through a system call.  This will speed up the UdmSearch
  php frontend significantly. (Rasmus)

Which seems to be called udm_crc32, and so far undocumented.

I hope this information has been useful.
Andrew
- Original Message -
From: Methusula [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 1:01 PM
Subject: [PHP] CRC and Polynomials


 Hi,

 Can anyone tell me which 32-bit polynomial is used by PHP in the crc
 function? I am trying to write a crc function from scratch, however, php
 does not appear to use any of the most commonly used polynomial divisors.

 Methusula.



 --
 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: [users@httpd] RE: Can't POST over 500K

2003-08-24 Thread Jeffrey D. Means
This is not an apache proble it is a problem with your php.ini file.  In
this file there is a line that specifies how large of POST data can be
received, the default is 500k.  If you are running apache 2.0 there is
an additional place where this might be being defined.  You can find
this file in the conf.d directory where your config files for apache
live mine is /etc/httpd/conf.d/php.conf  I hope this helps.

-Original Message-
From: Caldwell Sgt Brandon L [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 1:17 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [EMAIL PROTECTED] RE: Can't POST over 500K


It really seems like apache isn't letting me post over 500kb. Here is
the sample code I used to test this problem independantly from the
bulletin board software:

form name=form1 method=post action=
enctype=multipart/form-data input type=file name=imagefile 
 
input type=submit name=Submit value=Submit 
  ?
if(isset( $Submit ))
{
copy ($_FILES['imagefile']['tmp_name'],$_FILES['imagefile']['name']) or
die (Could not copy);
echo ;
echo Name: .$_FILES['imagefile']['name'].;
echo Size: .$_FILES['imagefile']['size'].;
echo Type: .$_FILES['imagefile']['type'].;
echo Copy Done;//}
}
?/form

I may have to break down and send this in chunks, but it really seems
that shouldn't be required. As for my phpinfo() response, it list 20M
which is what is in php.ini. I've gone all the way up to 200M just to be
sure.

-Original Message-
From: Leif W [mailto:[EMAIL PROTECTED]
Sent: Friday, August 22, 2003 9:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [EMAIL PROTECTED] RE: Can't POST over 500K


If it is in fact a timeout issue, you may want to consider either
breaking up the file into smaller chunks and reassembling on the server,
or have the script only read so much, then stop and alert the client
with a page with a refresh and some javascript to resubmit the file
again, and have the server seek to the right position and read another
chunk of data, and so on until the file is done.  Not sure how to do it
in PHP.  I think PHP doesn't let you get at the system reads for a file
upload, it just does it and sticks it in $_FILES.  But Perl will let you
do such a thing, as there's no built-in mechanism for file uploads, it
has to be coded, or use some module.

Leif

- Original Message - 
From: Mike [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 9:36 AM
Subject: Re: [EMAIL PROTECTED] RE: Can't POST over 500K


 At 06:30 AM 8/22/2003, you wrote:
 So no one else has anything suggestions on this?
 
 -Original Message-
 From: Caldwell Sgt Brandon L
 Sent: Wednesday, August 20, 2003 7:46 AM
 To: '[EMAIL PROTECTED]'
 Subject: Can't POST over 500K
 
 
  Not sure if this is Apache or PHP, but I'm leaning towards
Apache.
 I'm using Invision Power Board (also phpBB), and whenever I attempt 
 to upload a file, I am limited to 500KB files.  I've changed all the 
 setting
in
 php.ini as well as the settings in each of the respective BB
configurations.
 The error varies per browser: IE returns page not found; Mozzilla 
 return The document has no data.; Konqueror responds with a lost
connection.
  I'm using Apache 2.0.40 with PHP 4 on a RedHat 9.0 server.
Thanks

 Someone else would be better suited then me to point you were to 
 change it (whether Apache or PHP or the Bulletin Board software), but 
 I would check time-out settings.

 500kb files are pretty large, even for Cable, ISDN and DSL 
 connections. I just uploaded a 700+kb file to one of our servers (in 
 my case I used a
Miva
 applet I wrote some years ago to upload the file).

 I'm on business DSL (typically faster than residential DSL services) 
 and that 700+kb file took awhile to upload. I didn't time it (I should

 have - duh). While it didn't take minutes, it wasn't near 
 instantaneous either.

 So rather than checking for a size limit, it might be worth looking 
 into a potential low time-out setting somewhere in your configuration 
 or application(s).

 Hope that helps.
 -mike


 -
 The official User-To-User support forum of the Apache HTTP Server 
 Project. See URL:http://httpd.apache.org/userslist.html for more 
 info. To unsubscribe, e-mail: [EMAIL PROTECTED]
   from the digest: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
The official User-To-User support forum of the Apache HTTP Server
Project. See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
The official User-To-User support forum of the Apache HTTP Server
Project. See URL:http://httpd.apache.org/userslist.html for more info.
To 

[PHP] HTML form handling

2003-08-24 Thread Chris Baxter
Hi,

I am trying to send the results of a form to my email account and am having
difficulty carrying the form variable through if I use an html mime type.

Basically, if I send the form using a plain text format, the form results
are sucessfully copied to the email, however, if I change to mime type to
HTML (becuase I want to include a company logo and make the form a little
easier to read by using tabulation and bold text), I only seem to get the
HTML, not the php variables that carry the from info.

Below is an example of the script for the body of the email, which I am then
sending using the mail() function:

$body =  html
body
table width=85% border=0  align=center
   tr
  td width=50%Applicant 1 Forename:/td
  td ? $App_1_Forename; ?/td
/tr
tr
  tdApplicant 1 Surname:/td
  td ? $App_1_Surname; ?/td
/tr
tr
  tdApplicant 2 Forename:/td
  td ? echo $App_2_Forename; ?/td
/tr
tr
  tdApplicant 2 Surname: /td
  td ? echo $App_2_Surname; ?/td
/tr
/table
/body
/html;

thanks in advance for any suggestions,

Chris

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



[PHP] Re: homepage script..

2003-08-24 Thread DvDmanDT
easyhost and invisionpower filemanager... Although, it seems better to write
the script yourself, would make it so much more fitting your exact wantings
and needs...

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
Dasmeet [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 Hi!,
 I am developing a web site for an ISP.. They want to add homepage
 functionality.. that is their subscribers can have thier homepage (say
 with 2MB space each).
 Is there any script (free or paid) for such system.. to manage, create
 accounts etc...
 Any information would be of great help!
 Thanks
 Dasmeet

 -- 
 --
 Domainwala.com
 Domain Names from $7.99 at http://www.domainwala.com

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



[PHP] Re: finding out localhost :-P

2003-08-24 Thread DvDmanDT
You can goto like whatsmyip.com (or something similar) to get your ip and
connect to it unless there's a proxy or something...
http://www.liero-masters.host.sk/ip.php is another place, that I use as it
only displays the IP, and nothing else... :p

However, connecting to the domainname should work... So, check the
settings...
-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
Pag [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]

 Heres the problem. I have one of my client's site hosted on a crappy
 server, and i have it running with php+mysql ok, the thing is i need to
 connect to that site's mysql's database from a different site to get data.
 The problem is that on the origin site (the crappy server), to connect to
 the database, i use localhost. How can i find out the real server to
 connect to from the other site? I tried using the whole domain, like
 www.crappyserver.com, but doesnt work. :-P
 Thanks.

 Pag

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



[PHP] Does the URL influence if the page/data gets cached?

2003-08-24 Thread Richard Davey
Hi all,

We've recently released a significantly sized new web site coded entirely in
PHP. One of the things done on the site is to link to various sections of it
as follows:

http://www.domain.com/?m=orders
http://www.domain.com/?f=index

As you can see we're neglecting to include the index.php in the link. Now
this actually works perfectly (as it should) and the pages are displayed as
you'd expect, however one thing we're finding is that it appears some
browser just don't cache any of the page data. The images, html etc seems to
be called back from the server each time. This is part speculation on my
behalf of just watching the page load, sometimes it doesn't seem to do it,
othertimes it does.  It's very hard to explain but I'm throwing it out here
incase anyone has any ideas?  I've not done anything special with the
headers, there's no gzip compression or anything. I'm just wondering in the
back of my mind if the data on a page with a URL such as that simply doesn't
get cached?

Feel free to test it out for yourselves on the live site:
http://www.thegamecreators.com - I do apologise in advance for Mozilla
users, we tested it heavily with Mozilla 1.4 on Windows but have had reports
that in newer versions the menu breaks out of the page.  In Opera7, IE and
Moz 1.4 it should work as designed.

Cheers,

Rich

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



[PHP] str_replace performance in large mailing script

2003-08-24 Thread frederik feys








Hi all,



I have a mailing script that sends individualised
mails to users(some users even get more than one mail).

I have a template html mail file. I individualise
this by using str_replace function. 

It is really slow. 

Can anyone point me to some performance tips?

I was thinking of including an modified template(with
variables) in my message part.



Thanks for any help!

Fred








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

[PHP] In need of a script

2003-08-24 Thread Stevie D Peele
Can someone show me an example of some code that works something like
this :

?php

if cookie is present
redirect to a certain page

?

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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



[PHP] Re: How to open random Flash page with hyperlink?

2003-08-24 Thread zerof
Please see this simple exemple:
http://www.educar.pro.br/faqgeral/fla0003.php

zerof
-
Phillip Pang [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 I'm trying to create a hyperlink that will open a random Flash page so that  users 
 will
see a different flash module each time. Here is some of the code  that I wrote but I'm 
not
sure if it'll work since I'm not very good at
 coding. Oh yeah, I'm not using a database either.
-

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



Re: [PHP] In need of a script

2003-08-24 Thread Matt
On  Sunday, August 24, 2003 at 9:49 AM Stevie D Peele wrote:

 Can someone show me an example of some code that works something like
 this :

 ?php

 if cookie is present
 redirect to a certain page

 ?
?php // this must be the first line in the script (or use output
buffering) -- see http://www.php.net/header for explanation
if ($_COOKIE['cookie_I_want_to_know_about']) {
  header('Location: http://www.someserver.com/page.php');
?

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



Re: [PHP] In need of a script

2003-08-24 Thread [EMAIL PROTECTED]
it's in the manual.

Stevie D Peele wrote:

Can someone show me an example of some code that works something like
this :
?php

if cookie is present
redirect to a certain page
?

Thanks


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] start_session()

2003-08-24 Thread murugesan
Can any one say what it the purpose of start_session()
fuction
-murugesan.

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



[PHP] Help with reading files

2003-08-24 Thread Yasir Malik
I am doing my development for our project on a Linux server, but our
client uses Windows. One of the features that we have is the ability to
send emails. The email feature will have a feature where the client can
upload a file from their computers with a list of emails. My script would
then parse out the file and send the emails. How would I access the
contents of the file? We are using PHP for the development. Thanks in
advance.
Yasir

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



Re: [PHP] str_replace performance in large mailing script

2003-08-24 Thread David Otton
On Sun, 24 Aug 2003 14:42:01 +0200, you wrote:

I have a mailing script that sends individualised mails to users(some
users even get more than one mail).
I have a template html mail file. I individualise this by using
str_replace function. 
It is really slow. 
Can anyone point me to some performance tips?

Without knowing how you're doing it now, it's kinda hard.

First tip is to use the right tool for the job - use mailing list software,
not a scripting language optimised for HTML.

Second tip is that sprintf() should be faster than str_replace(). Compare:

$text = Hello %s;
$name = John;

echo (str_replace (%s, $name, $text));
echo (sprintf ($text, $name));

Third tip is to make your template an array of strings rather than a single
large array.

Fourth tip is that you're probably running str_replace over the entire body
of the text. At the very least, pre-process the template to find out which
lines have substitutions in them, then only perform the replace on those
lines in the main loop.

Eg if we find that only lines 2, 3, and 15 need to be modified:

$text = array (/* blah */);
$lines = array (2, 3, 15);
$replacements = array (John, [EMAIL PROTECTED], Viagra);
$i = 0;
foreach ($lines as $line)
{
$text[$line] = sprintf ($text[$line], $replacements[$i++]);
}

BTW, do you realise you're sending HTML emails?

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



Re: [PHP] Help with reading files

2003-08-24 Thread [EMAIL PROTECTED]
How to handle file upload is well explained right at the start of the 
manual. Once the file has been transfered to your server you can make 
use of the numerous methods described in the 'filesystem functions' of 
the manual to handle it.

Yasir Malik wrote:

I am doing my development for our project on a Linux server, but our
client uses Windows. One of the features that we have is the ability to
send emails. The email feature will have a feature where the client can
upload a file from their computers with a list of emails. My script would
then parse out the file and send the emails. How would I access the
contents of the file? We are using PHP for the development. Thanks in
advance.
Yasir
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] str_replace performance in large mailing script

2003-08-24 Thread David Otton
On Sun, 24 Aug 2003 15:38:13 +0100, you wrote:

Second tip is that sprintf() should be faster than str_replace(). Compare:

$text = Hello %s;
$name = John;

echo (str_replace (%s, $name, $text));
echo (sprintf ($text, $name));

Thinking about it, straight concatenation should be faster than sprintf()

$text = Hello %s, welcome to the list;
$text = explode (%s, $text);
echo ($text[0] . $name . $text[1]);

The explode goes outside the main loop, of course. Pre-processing.

The downside is that the simpler (and faster) you make it, the more
assumptions you have to make about the template (in this case, one
substitution per line and the substitution can't be the first or last
element on the line).

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



Re: [PHP] start_session()

2003-08-24 Thread John W. Holmes
murugesan wrote:
Can any one say what it the purpose of start_session()
fuction
Umm... to start a session. Read this: 
http://us2.php.net/manual/en/ref.session.php

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com



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


[PHP] Array element from function return

2003-08-24 Thread Wouter van Vliet
Hi,

I'm trying to get the first element of a value returned by a function ..

== example ==
function return_Array() {
return ('one', 'zwei', 'kolm', 'vier');
}

print return_Array()[0];
==/ example ==

Now i'd like this script to print 'one' for me .. can it be done without
creating a temporary variable?

Thanks,
Wouter

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



Re: [PHP] Array element from function return

2003-08-24 Thread John W. Holmes
Wouter van Vliet wrote:

I'm trying to get the first element of a value returned by a function ..

== example ==
function return_Array() {
return ('one', 'zwei', 'kolm', 'vier');
}
print return_Array()[0];
==/ example ==
Now i'd like this script to print 'one' for me .. can it be done without
creating a temporary variable?
No, use a temporary variable.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


RE: [PHP] Array element from function return

2003-08-24 Thread Wouter van Vliet
Hmm .. thanks .. but shortly after posting I came to this idea that I might
want to use array_shift(); for this one .. works with numerical indices 

Out of interest, is it really impossible to get such a thing for string
indices?

 - -Oorspronkelijk bericht-
 - Van: John W. Holmes [mailto:[EMAIL PROTECTED]
 - Verzonden: zondag 24 augustus 2003 17:34
 - Aan: Wouter van Vliet
 - CC: PHP General
 - Onderwerp: Re: [PHP] Array element from function return
 -
 -
 - Wouter van Vliet wrote:
 -
 -  I'm trying to get the first element of a value returned by a
 - function ..
 - 
 -  == example ==
 -  function return_Array() {
 -return ('one', 'zwei', 'kolm', 'vier');
 -  }
 - 
 -  print return_Array()[0];
 -  ==/ example ==
 - 
 -  Now i'd like this script to print 'one' for me .. can it be
 - done without
 -  creating a temporary variable?
 -
 - No, use a temporary variable.
 -
 - --
 - ---John Holmes...
 -
 - Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 -
 - php|architect: The Magazine for PHP Professionals  www.phparch.com
 -
 - --
 - 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] Content of Variable ist html code

2003-08-24 Thread Matthias Wulkow

Hi php-general,

I'm thinking of how I could store the content of a String-variable a) in a
Variable to be passed to other functions b) in a Database (MySQL) too . The content is 
html-code (with
tags and style code (css)).
The point is that I'm making myself a kind
of CMS, and I want to edit a page, enter html code, store it in the
database and then display it as content on a page. So, in the edit
menu, I have to be able to see the html tags, but on the target page,
the html entities have to be translated by the browser... and all that
has to be storable in MySQL...

How do I do that the best...?!?
addslahes, stripslahses, htmlentities, html_entity_decode are the only
functions I have found, which seem to be really useful. Are there
others I could need, or do you think I'm fine with that?

Thanx for answering

SvT

-- 
Who is the ennemy?

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



Re: [PHP] Content of Variable ist html code

2003-08-24 Thread Dan Anderson
I'm not sure what you're asking but...

Using htmlentities() and undohtmlentities() (look up the real functions)
to data going into and out of your database will allow you to store it
without getting lots of errors...

mySQL storage (even TEXT and BLOB types) can't be larger then so many
bytes (system dependent) so you would have to have code to split up and
put back together big web pages.

-Dan

On Sun, 2003-08-24 at 11:55, Matthias Wulkow wrote:
 Hi php-general,
 
 I'm thinking of how I could store the content of a String-variable a) in a
 Variable to be passed to other functions b) in a Database (MySQL) too . The content 
 is html-code (with
 tags and style code (css)).
 The point is that I'm making myself a kind
 of CMS, and I want to edit a page, enter html code, store it in the
 database and then display it as content on a page. So, in the edit
 menu, I have to be able to see the html tags, but on the target page,
 the html entities have to be translated by the browser... and all that
 has to be storable in MySQL...
 
 How do I do that the best...?!?
 addslahes, stripslahses, htmlentities, html_entity_decode are the only
 functions I have found, which seem to be really useful. Are there
 others I could need, or do you think I'm fine with that?
 
 Thanx for answering
 
 SvT
 
 -- 
 Who is the ennemy?

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



Re: [PHP] Using PHP on an .html file

2003-08-24 Thread Dan Anderson
 Better to do this in an .htaccess file, so you don't incur PHP processing
 overhead on the entire server (if there are others using it).

Apache suggests not using .htaccess files at all because they require a
recursive traversing of directories looking for .htaccess files, because
some supersede others or something like that.

So look up how to allow it only on that directory using the main config
files.  (Not sure if that's possible)

-Dan

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



[PHP] vhost php_value include_path: Seg fault

2003-08-24 Thread Jason End
Using:
- Apache 1.3.27
- PHP 4.2.3

I just changed my httpd.conf to have two virtual
hosts. One of them uses php, so I added the
include_path, but when I try to test the config I get
a core dump.
Here's the vhost section for the domain using php:
[...]
VirtualHost *
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /usr/local/www/data/domain/
ServerName domain.org
ErrorLog /var/log/domain.org-error_log
CustomLog /var/log/domain.org-access_log common
php_value include_path .:/usr/local/domainlibs
Alias /admin/ /usr/local/www/data/domain/admin/
/VirtualHost
[...]

thanks, 

Jay

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Re: parse error with mysql_connect

2003-08-24 Thread Catalin Trifu
Hi,

The prototype for mysql_connect is:

resource mysql_connect ( [string server [, string username [, string
password [, bool new_link [, int client_flags ] )

As you can see you get parse error because the fourth argument
should be boolean, not string.

Cheers,
Catalin

35: // Initialize MySQL database
36: $h =
mysql_connect('localhost','localhost',constant(mysql_user),constant(mysql
_password));
37: mysql_select_db('mjec_mjecnet', $h);

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



Re: [PHP] In need of a script

2003-08-24 Thread Stevie D Peele
Heres what I wrote --

?php
if ($_COOKIE['pagename'])
{
header('Location: http://www.net-riches.com/800x600.html');
}
? 

and I got a parse error on line 4, but I do not see what is wrong on line
4!

Can anyone else see?

Thanks



On Sun, 24 Aug 2003 10:04:50 -0400 Matt [EMAIL PROTECTED] writes:
 On  Sunday, August 24, 2003 at 9:49 AM Stevie D Peele wrote:
 
  Can someone show me an example of some code that works something 
 like
  this :
 
  ?php
 
  if cookie is present
  redirect to a certain page
 
  ?
 ?php // this must be the first line in the script (or use output
 buffering) -- see http://www.php.net/header for explanation
 if ($_COOKIE['cookie_I_want_to_know_about']) {
   header('Location: http://www.someserver.com/page.php');
 ?
 
 
 
 

Re: [PHP] In need of a script

2003-08-24 Thread Curt Zirzow
* Thus wrote Stevie D Peele ([EMAIL PROTECTED]):
 Heres what I wrote --
 
 ?php
 if ($_COOKIE['pagename'])
 {
 header('Location: http://www.net-riches.com/800x600.html');
 }
 ? 
 
 and I got a parse error on line 4, but I do not see what is wrong on line
 4!

There is no parse error in that code.
 
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



[PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-24 Thread weston
I'm building a small web application for a friend using PHP. He'd like to
use MS Access to keep the data in, and update the data on the site by FTP'ing 
Access files he edits on his machine up to the web host.

The web host is unix-based (FreeBSD, slightly hacked by Verio, I believe), so
this means COM functions aren't available. ODBC was my next thought, but I've
never used it, and there are a few things I don't understand. Setting up a 
DSN is one of them -- apparently this isn't as simple as constructing a string,
and all the tutorials I can find seem to involve going into a Windows control
panel and making a setting. This of course will not be possible, since there
are no windows control panels on FreeBSD.

In short: can anyone offer any quick tips on how to use the odbc database functions or 
PEAR::DB to query data from an MS Access file sitting on a UNIX box?

Thanks,
Weston

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



php-general Digest 24 Aug 2003 18:54:05 -0000 Issue 2256

2003-08-24 Thread php-general-digest-help

php-general Digest 24 Aug 2003 18:54:05 - Issue 2256

Topics (messages 160568 through 160598):

Re: Easy XML  PHP tutorials ?
160568 by: murugesan

CRC and Polynomials
160569 by: Methusula
160571 by: Andrew Brampton

regex replace href-content
160570 by: Christoph Gassmann

Re: [EMAIL PROTECTED] RE: Can't POST over 500K
160572 by: Jeffrey D. Means

HTML form handling
160573 by: Chris Baxter

Re: homepage script..
160574 by: DvDmanDT

Re: finding out localhost :-P
160575 by: DvDmanDT

Does the URL influence if the page/data gets cached?
160576 by: Richard Davey

str_replace performance in large mailing script
160577 by: frederik feys
160584 by: David Otton
160586 by: David Otton

In need of a script
160578 by: Stevie D Peele
160580 by: Matt
160581 by: jabber.raditha.com
160596 by: Stevie D Peele
160597 by: Curt Zirzow

Re: How to open random Flash page with hyperlink?
160579 by: zerof

start_session()
160582 by: murugesan
160587 by: John W. Holmes

Help with reading files
160583 by: Yasir Malik
160585 by: jabber.raditha.com

Array element from function return
160588 by: Wouter van Vliet
160589 by: John W. Holmes
160590 by: Wouter van Vliet

Content of Variable ist html code
160591 by: Matthias Wulkow
160592 by: Dan Anderson

Re: Using PHP on an .html file
160593 by: Dan Anderson

vhost php_value include_path: Seg fault
160594 by: Jason End

Re: parse error with mysql_connect
160595 by: Catalin Trifu

Reading an MS Access Database file on *NIX platform using PHP
160598 by: weston.leary.csoft.net

Administrivia:

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

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

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
www.w3schools.com

-murugesan
- Original Message - 
From: Boaz Yahav [EMAIL PROTECTED]
To: Joe Harman [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 1:09 AM
Subject: RE: [PHP] Easy XML  PHP tutorials ?


Try this too : http://www.sitepoint.com/article/1165

Sincerely
 
berber
 
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
Share your code : http://addexample.weberdev.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-Original Message-
From: Joe Harman [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 22, 2003 1:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy XML  PHP tutorials ?


Hello all. does anyone have any very easy XML tutorials . I have a
simple weather feed I want to implement. but no XML experience

thanks

Joe Harman




 
 

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

Can anyone tell me which 32-bit polynomial is used by PHP in the crc
function? I am trying to write a crc function from scratch, however, php
does not appear to use any of the most commonly used polynomial divisors.

Methusula.


---End Message---
---BeginMessage---
I found this mentioned in a old user comment (it might not be relevant now):
Some quick reverse engineering shows they're using the standard CRC32
parameters:

Polynomial 0x04C11DB7l
Initial register value 0x
Register is inverted at end of calculation
Bytes are reflected as they come in, and the result is reflected before it
is returned.

The documentation says this function returns the CRC polynomial of the
string - that's a little misleading IMHO. I'd say it simply returns the CRC
of the string. The polynomial is a magic number in the calculation.

and I've just downloaded the lastest source and found the crc32 function to
be in crc32.c and crc32.h. In the comments it mentions that the polynomial
is
/* generated using the AUTODIN II polynomial
 * x^32 + x^26 + x^23 + x^22 + x^16 +
 * x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
 */

and there is a big table of 256 number which you may find useful.

Oh finally I also found mentioned in the NEWS file that:
- Added a crc32 checksum function - used by the UdmSearch search engine
  and currently run through a system call.  This will speed up the UdmSearch
  php frontend significantly. (Rasmus)

Which seems to be called udm_crc32, and so far undocumented.

I hope this information has been useful.
Andrew
- Original Message -
From: Methusula [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 1:01 PM
Subject: [PHP] CRC and Polynomials


 Hi,

 Can anyone tell me which 32-bit polynomial is used by PHP in the crc
 function? I am trying to write a crc function from scratch, however, php
 does not appear to use any of the most commonly used polynomial 

[PHP] Probably has already been asked... Remote commands

2003-08-24 Thread Richard D. Marriner II
I'm sure this has been asked but I need clearification.  I would like to
create a script that can run remote programs and edit remote files on Linux
(both hosts are linux).   The reason is I would like to make a web hosting
control panel using PHP that I can have my mail  dns server on one machine
and web on the other.  Is there any way possible to do this with PHP?

I searched the arhives and found something about ssh_agent but couldn't find
a lot of information from google.  Any help would be appreciated.   I have
php experience just not very much...

Anything would be appreciated!
Thank You
Richard Marriner II

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



[PHP] RE: Reading an MS Access Database file on *NIX platform using PHP

2003-08-24 Thread Travis Kroh
This is a widespread problem. One which we faced, and eventually solved by
deciding to just write the application in .NET instead.

Some links that may be helpful...
This link deals with problems trying to use PHP's built-in function
odbc_connect on a Linux box:
http://forums.devshed.com/t37357/s.html

These links mention using database functions within this PHP include
library (adodb.inc.php) and skipping ODBC altogether:
http://www.devshed.com/Server_Side/PHP/ADODB
http://php.weblogs.com/ADODB

The basic problem is trying to get something on a nix box to play nice with
Jet. We never found an elegant way of doing it. (Some brief thought was
given to writing a VB app to live on the windows box, conveniently leaving a
port open to listen for requests from our PHP script and return results.
Humorous, yet ever-so-brief thought. :)

Good luck.
-trav

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 1:55 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Reading an MS Access Database file on *NIX platform using PHP


I'm building a small web application for a friend using PHP. He'd like to
use MS Access to keep the data in, and update the data on the site
by FTP'ing
Access files he edits on his machine up to the web host.

The web host is unix-based (FreeBSD, slightly hacked by Verio, I
believe), so
this means COM functions aren't available. ODBC was my next
thought, but I've
never used it, and there are a few things I don't understand. Setting up a
DSN is one of them -- apparently this isn't as simple as
constructing a string,
and all the tutorials I can find seem to involve going into a
Windows control
panel and making a setting. This of course will not be possible,
since there
are no windows control panels on FreeBSD.

In short: can anyone offer any quick tips on how to use the odbc
database functions or PEAR::DB to query data from an MS Access
file sitting on a UNIX box?

Thanks,
   Weston


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



RE: [PHP] In need of a script

2003-08-24 Thread Wouter van Vliet
Though no parse error, it can result in an notice about 'undefined index' ..
I'd prefer

?php
if (isset($_COOKIE['pagename'])) {
header('Location: /newpage.php');
die;
};
?

Taking care of three things:
- No undifined index notice
- the cookie can also have a value that evaluates to false
- the 'die;' makes sure the script really ends .. sometimes, somehow for
some
  undefined reason it does not stop after a header..


Wouter


 - -Oorspronkelijk bericht-
 - Van: Curt Zirzow [mailto:[EMAIL PROTECTED]
 - Verzonden: zondag 24 augustus 2003 20:22
 - Aan: [EMAIL PROTECTED]
 - Onderwerp: Re: [PHP] In need of a script
 -
 -
 - * Thus wrote Stevie D Peele ([EMAIL PROTECTED]):
 -  Heres what I wrote --
 - 
 -  ?php
 -  if ($_COOKIE['pagename'])
 -  {
 -  header('Location: http://www.net-riches.com/800x600.html');
 -  }
 -  ?
 - 
 -  and I got a parse error on line 4, but I do not see what is
 - wrong on line
 -  4!
 -
 - There is no parse error in that code.
 -
 - 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

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



[PHP] script not terminating on user abort

2003-08-24 Thread Dennis Jacobfeuerborn
Hi!
The connection_* function don't seem to work for me and I can no longer
determine when the user has aborted the script. When I close the browser
window the script just keeps running. (see bug #23163)

The body of the script essentially looks like this:

while( !$done ) {
$con-sendMessage(x); # Send msg to Jabber server
sleep(1);
}

I made an interesting and somewhat weird observation though:
If I use the print or echo command in the while-loop once (!) then the
script will terminate after the loop has run *exactly* three times after
the abort.

If I put more than one print/echo in the loop (2-inf) then the script
will terminate after *exactly* 2 (!) iterations of the loop after the
script has aborted.

The length of the string used in the print/echo statement doesn't seem
to matter.

I hope this helps as this bug is currently a showstopper for the stuff
I'm developing (a PHP Jabber client).

I'm running Red Hat 7.3 with the standard apache-1.3.27-2 package and a
self-compiled php-4.3.3rc4 (php-4.3.2 didn't work either).
-- 
-
conversis GmbH

Dennis Jacobfeuerborn
Geschftsfhrer

Falkstrae 73-77
47058 Duisburg

[EMAIL PROTECTED]

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



Re: [PHP] Reading an MS Access Database file on *NIX platform using PHP

2003-08-24 Thread David Otton
On Sun, 24 Aug 2003 14:54:41 -0400 (EDT), you wrote:

I'm building a small web application for a friend using PHP. He'd like to
use MS Access to keep the data in, and update the data on the site by FTP'ing 
Access files he edits on his machine up to the web host.

The web host is unix-based (FreeBSD, slightly hacked by Verio, I believe), so
this means COM functions aren't available. ODBC was my next thought, but I've
never used it, and there are a few things I don't understand. Setting up a 
DSN is one of them -- apparently this isn't as simple as constructing a string,
and all the tutorials I can find seem to involve going into a Windows control
panel and making a setting. This of course will not be possible, since there
are no windows control panels on FreeBSD.

Suggestion: go backwards. Set up the data in, say, MySQL with an ODBC
driver, and use Access as a front-end onto that data (Access makes a good
front-end for manipulating other databases). I've done this with SQL Server,
but it should be possible with anything that can talk ODBC.

He gets the interface he's used to, you get a database that can run under
BSD. Of course, changes will be reflected in the site in real-time, which
may be a good thing or a bad thing.

Either that or export the data from Access in a readable format, and import
it at the other end.

http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8q=connect+access+mysql

4th link looks useful.

In short: can anyone offer any quick tips on how to use the odbc database functions 
or PEAR::DB to query data from an MS Access file sitting on a UNIX box?

That's not what ODBC does. It's a protocol for talking to a database server,
not a program for parsing a file.

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