[PHP] Extracting the body of the http request entity?

2001-04-27 Thread nik

 I need to write a script which extracts information POSTed by a
non-browser client, and stores it on the server.  With a browser client
I could upload from with input type=file form elements and use the
PHP upload functions, but using a browser at the client end is not an
option here.

According to the w3c docs, POSTed  content is sent in the request
entity body.  Since the request has a header, it's logical that it can
have a body too :-) but I don't see any PHP functionality for getting at
it. Someone in another group suggested accessing a variable called
$HTTP_RAW_POST_DATA, but that doesn't seem to exist when I POST data to
either of my test systems, which are Linux/Apache or Win98/PWS.

PHP itself must be able to extract the POSTed data - it does so when
saving a POSTed file to its temporary location - but this function don't
seem to be exposed in the API... is it?

Thanks for any wisdom!
nik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] What's wrong with Apache + php + mysql on Windows?

2001-04-27 Thread nik

 Hello, I can't understand the reason apache server running locally on my
 Win98 machine delays so much to respond browser when accesing php
 scripts in the form

 http://localhost/myscript.php

 When I transfer php scripts to host server via FTP, script execution is
 immediate, even remote server being in another continent.

 I was running apache + php + mysql on Win95 and delay was terrible. Now
 I moved to Win98 and delay became still worse.

 I know some parameter in httpd.conf or php.ini should be changed, but
 how to kwow which parameter?.

You could  try tweaking the filesystem optimisiation in Control Panel 
System  Performance.  If your system is optimised for desktop use, it'll
make an even more lousy server than Win9x usually does. :-)

nik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to execute a php scripts

2001-04-27 Thread Henning Kilset Pedersen

Bertrand,

if you're serious about trying to get help for something, it would be very
helpful if you ask a more specific question, with code samples of what
you've done so far.

There are excellent tutorials on this subject, at http://www.phpbuilder.com,
http://www.phpbeginner.com, http://www.zend.com, http://www.devshed.com etc.
etc. Start with the devshed one, click on the PHP area, and find your way
through PHP101. It takes a few hours to get into it, but it will be worth
your time, believe me.

You also have to tell us if you have phpapache (or another webserver) on
the MySQL computer, or if you're running PHP and the webserver on Windows
and MySQL on a different (Linux, as you said) computer. These things are
important for things such as user access rights in MySQL (the default mysql
account doesn't have privileges to access the database from a remote host,
only @localhost).


Regards,
Henning Pedersen
Funcom Oslo



-Original Message-
From: Bertrand TACHAGO [mailto:[EMAIL PROTECTED]]
Sent: 27. april 2001 18:45
To: [EMAIL PROTECTED]
Subject: [PHP] How to execute a php scripts


Hi,

I want to know how to execute a php scripts which update a MySQL
database.

I am working on Win 98 and MySQL is install on Linux on another
computer.

Thank You in Advance.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] php4 on RedHat 7.1

2001-04-27 Thread Ralph Guzman

Your httpd.conf configuration should look something like this:

AddType application/x-httpd-php .php .phtml .php3 .php4
AddType application/x-httpd-php-source .phps

-Original Message-
From: j2n tech [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php4 on RedHat 7.1


I'm trying to get a webmail client to work under RH 7.1 with Apache 1.3.19.
I downloaded php-4.0.4pl and configured and installed it.  Now when I try to
bring up a php page it trys to download it instead of execute.  I added the
AddType line for php4 in my httpd.conf but it made no difference.  I
noticed Apache 1.3.19 with RH7.1 treats modules differently with the
IfDefine functions...am i missing something here?  Anybody have any idea how
I might be able to get this to work?

Thanks.

--j2n.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] parse error is always on line 1 == error ?

2001-04-27 Thread Jimmy Lantz

Hi, I have a problem,
that when I get a parse error it always says that it's on line 1 in 
this or that file.
Where is the configuration option to set this right?
I have on another server seen that it's possible to get it to state 
the actual error line.
(it's PHP Version 3.0.15  on  solaris)
Please help me out on this one.
Best wishes
Jimmy Lantz
Sweden


Re: [PHP] Problem with the HTTP_REFERER

2001-04-27 Thread Rosen

Is anybody knows how can I redirect to another page
and the REFERER to another page to be my page ?

Thanks,
Rosen Marinov


Rosen [EMAIL PROTECTED] wrote in message
9c912a$had$[EMAIL PROTECTED]">news:9c912a$had$[EMAIL PROTECTED]...
 Hi,
 I have BIG problem using HTTP_REFERER.
 I have two pages:

 main.php:
 A HREF=test.php target= _blankClick here/A

 test.php:
 .somecode
 echo SCRIPT
 language=\javascript\window.location.href=\http://$web\;;/script;

 $web - some website.


 But on the $web site (some site) I can't get the REFERER !!!





 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mcrypt module for Win32

2001-04-27 Thread Carsten Gehling

From: Maxim Maletsky [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 5:00 AM


 I think PEAR has it.

 have you tried to look at it?

Found it, thanks!

It contains HCE_MD5, but AFAICT it does not utilize the other encryption
modes found in mcrypt. But it doesn't matter - I think this is fine for me.

I need it to create a serial-key with which a customer can unlock certain
modules in my scripts.

- Carsten




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] check if an url is valid

2001-04-27 Thread Black Dragon

ok, I'll try with socket.

Thanks

 no, sockets are not a bad solution at all. They are just as fast.

 And plus fsockopen has more functionality such as timing out, result
 messages, mess_num etc... what fopen doesn't have.

 I think fsockopen is better for this job.


 Sincerely,

  Maxim Maletsky
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com




 -Original Message-
 From: Black Dragon [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 6:41 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] check if an url is valid


 Hi!

 can you tell me how can I check if a remote files exists?

 I've tried with fopen, but I've a warning on STDOUT if file doesn't
exists.
 I wouldn't redirect the STDERR to solve this problem.

 I could use fsockopen, but I feel that this is a bad solution.

 Can you tell me something that is easy?

 I would a function that return true/false if an url is/not is valid;
without
 error to browser

 Thanks




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Fw: how do I calculate this?

2001-04-27 Thread Jacky


Jack
[EMAIL PROTECTED]
There is nothing more rewarding than reaching the goal you set for yourself
- Original Message - 
From: Jacky 
To: [EMAIL PROTECTED] 
Sent: Friday, April 27, 2001 2:59 PM
Subject: how do I calculate this?


Hi all
I have a variable that store number of days, I want to divided by 7 and if it can be 
divided by 7 perfectly, then I will redirect them to one page, otherwise send them to 
another page.
How do I set up condition in the if...thenelse bit to determine if the value is 
divided by 7 perfectly or not?
cheers 
Jack
[EMAIL PROTECTED]
There is nothing more rewarding than reaching the goal you set for yourself



Re: [PHP] parse error is always on line 1 == error ?

2001-04-27 Thread Frank Joerdens

On Fri, Apr 27, 2001 at 08:49:46AM +0200, Jimmy Lantz wrote:
 Hi, I have a problem,
 that when I get a parse error it always says that it's on line 1 in 
 this or that file.
 Where is the configuration option to set this right?

When I had this problem it turned out that the files in question had
been created on a Macintosh in Adobe GoLive, I think. The newline
characters in files created by this program are different to those used
on Unix or DOS computers, which messes up things to the effect that the
PHP parser only sees a single line. I used a tool from the Perl Power
Tools page to convert the Mac files to Unix format, and the problem went
away:

http://language.perl.com/ppt/src/nlcvt/index.html

Cheers, Frank

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How to execute a php scripts

2001-04-27 Thread Bertrand TACHAGO

Hi,

I want to know how to execute a php scripts which update a MySQL
database.

I am working on Win 98 and MySQL is install on Linux on another
computer.

Thank You in Advance.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] sending content-type header after session_start()

2001-04-27 Thread Yasuo Ohgaki

Use ob_start() at the top of script. (Before calling session_start()) It will do
what you want.
You may want to flush output buffer. Refer to output buffering functions for
details.

Regards,
--
Yasuo Ohgaki


[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 please correct me if I'm wrong, but it seems that in PHP 4, after calling
 session_start(), you are stuck with serving an HTML page.

 What if you want to call session_start(), but you want to send headers
 after the session has started? for example, I'd like to deliver a
 downloadable file, but before I deliver that file, I'd like to check the
 user's session and make sure that the user is logged in and that the user
 has proper authorization to access the file.

 I've got a workaround for this problem (see below). However, I would prefer
 to handle the problem with the built-in session handling functions. Does
 anyone know if this can be done?
 Thanks
 -Matt
 ?php
 /
 this page serves a request to download a file. The file should
 not be served unless the user has authorization to view this file. To
 check that authorization, the user must be logged in
 /
 function my_session_start() {
 // decode session data, if any
 if($GLOBALS[PHPSESSID]) {
 $fname = /tmp/sess_.$GLOBALS[PHPSESSID]; // file path hardcoded
 for this example
 $fcontents = @file($fname);
 if($fcontents) {
 $fcontents = implode(, $fcontents);
 include(User.phpc); // defines the User object stored in the session
 session_decode ($fcontents);
 }
 }
 }
 / start processing the page
 get session data, and still allow content type headers to be sent.
 why doesn't the built-in session_start() allow this?
 /
 my_session_start();
 $s_user = $HTTP_SESSION_VARS[s_user];
 if(!$s_user) {
 $err = user not logged in;
 } else {
 // pseudo code from here on
 if(!$s_user-has_authorization_to_download_requested_file()) {
 $err = user not logged in, or has no authorization to download this
 file;
 } else {
 header(content-type: .requested_file_mime_type());
 output_requested_file_data();
 }
 }
 }
 if($err) echo Error: $err;
 ?



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] bug with sessions and output-compression?????

2001-04-27 Thread Sebastian Stadtlich

Hi

I just rewrote a website to use sessions all over the site. on one page
i used
output-compression just to test it. if i use MSIE everything just works
fine, BUT:
if i use Netscape WITHOUT cookies the PHP does not rewrite the relative
urls
here is the code of the page :

session_start();
function my_obstart() {
$encoding = getenv(HTTP_ACCEPT_ENCODING);
if (eregi(gzip,$encoding))
{
ob_start(ob_gzhandler);
} else
{
ob_start();
}
}
my_obstart();
...
...

i can't view the html-source-code when using netscape and compression,
so i don't
know exactly what arrives at the browser

thanks

Sebastian 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] What's wrong with Apache + php + mysql on Windows?

2001-04-27 Thread Nicolas Guilhot

You can try to had HostnameLookups off in your httpd.conf if it is not
already present.
More info at http://www.apache.org/DELETE_ME/mod/core.html#hostnamelookups

---
 Hello, I can't understand the reason apache server running locally on my
 Win98 machine delays so much to respond browser when accesing php
 scripts in the form

 http://localhost/myscript.php

 When I transfer php scripts to host server via FTP, script execution is
 immediate, even remote server being in another continent.

 I was running apache + php + mysql on Win95 and delay was terrible. Now
 I moved to Win98 and delay became still worse.

 I know some parameter in httpd.conf or php.ini should be changed, but
 how to kwow which parameter?.
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: check if an url is valid

2001-04-27 Thread yanto


there is no pure fopen function available to connect to other site. because
basically fopen use to open file (file open). fopen in php just try to
facilite programmer with human friendly name, but inside, when the argument
is url, it'll make standard socket connection like any other tcp/ip
connetion.


-toto-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] help me pls

2001-04-27 Thread Yamin Prabudy

I write a script for dealing with a form and the algorithem will look like
this

if (isset($somthing)) {
the form is here and user input it

}

if($filter_in_the_form == 'something) {
print the 1st
}

elseif($all_condition_done == 'OK') {
   print the 2nd

} else { print nothing done }



when i run it the first condition are done,OK then i input my data in
the form
then the $filter_in_the_form checked up something and so another form then i
input the data.after i submit it should print out
all the data then I input as a result

but the thinks happen is  then result of my input data print out with
the 2nd form
how do I print out the data with out showing the 2nd form ???

in perl when i used cgi i just define cgi-new

Thanks in Advance

Yamin Prabudy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: check if an url is valid

2001-04-27 Thread Manisha

Any body know how to un-subscribe temporarily. As I am going out station 
for 2 weeks. I want to stop all my PHP user group mails. (other wise there 
will be big junk) But later again I want to restart.

If I un-subscribe now whether I will be able to subscribe again ?


manisha


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Fw: how do I calculate this?

2001-04-27 Thread bill

$days = whatever;

if ($days % 7 == 0) {
  ...then $days is divisible by seven;
} else {
  ...if is not;
}

the % is the modulus operator. basically divides left hand side by right
hand side and returns the remainder.

HTH

On Fri, 27 Apr 2001, Jacky wrote:

 - Original Message -
 From: Jacky
 To: [EMAIL PROTECTED]
 Sent: Friday, April 27, 2001 2:59 PM
 Subject: how do I calculate this?


 Hi all I have a variable that store number of days, I want to divided
 by 7 and if it can be divided by 7 perfectly, then I will redirect
 them to one page, otherwise send them to another page. How do I set up
 condition in the if...thenelse bit to determine if the value is
 divided by 7 perfectly or not? cheers Jack [EMAIL PROTECTED]
 There is nothing more rewarding than reaching the goal you set for
 yourself



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with the HTTP_REFERER

2001-04-27 Thread Simon Ould

My interpretation of the problem is:
You want a link on page A.php which points to B.php, 
B.php does some stuff, then redirects the user to page C.php

You want the value of HTTP_REFERER on page C.php to be A.php

Correct? If so, read on, if not, then delete this email.

I'm using php-4.0.4pl1, apache 1.3.14, IE5.5, win2000, and this works on my
system.

My two solutions both use the following 2 files :
[index.html]
HTML
HEAD
TITLETest/TITLE
/HEAD
BODY
A HREF=test.php target=_blankClick here/A
/BODY
/HTML

[targetpage.php]
HTML
HEAD
TITLEtargetpage.php/TITLE
/HEAD
BODY
You came to this page from ?php echo $HTTP_REFERER;?
/BODY
/HTML


Solution 1:
Use the php function header
(http://www.php.net/manual/en/function.header.php)

[test.php]
?php
//... do stuff
$web= http://localhost/referer_test/targetpage.php;;
header (Location: .$web);
?

---
Solution 2:
Pass HTTP_REFERER in the URL: This also works on my system, but isn't
exactly the neatest of methods.

[test.php]
HTML
HEAD
TITLEtest.php/TITLE
/HEAD
BODY
?php
$web= localhost/referer_test/targetpage.php;
$web= $web.?HTTP_REFERER=.$HTTP_REFERER;  //pass HTTP_REFERER
in the URL
echo SCRIPT
language=\javascript\window.location.href=\http://$web\;/script;
?
/BODY
/HTML




Hope that helped,

Simon.

 -Original Message-
 From: Rosen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 07:56
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Problem with the HTTP_REFERER
 
 
 Is anybody knows how can I redirect to another page
 and the REFERER to another page to be my page ?
 
 Thanks,
 Rosen Marinov
... snip ...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




php-general Digest 27 Apr 2001 10:34:07 -0000 Issue 652

2001-04-27 Thread php-general-digest-help


php-general Digest 27 Apr 2001 10:34:07 - Issue 652

Topics (messages 50523 through 50590):

Sizeof a multi-dimensional array??
50523 by: Chris Anderson
50556 by: Maxim Maletsky

Re: Ultradev PHP Server Model
50524 by: John Platte
50532 by: Andrew Hill
50535 by: John Monfort

Re: cell iterations in loop
50525 by: Jerry Lake

What's wrong with Apache + php + mysql on Windows?
50526 by: Mig
50557 by: Steve Maroney
50583 by: nik
50585 by: Nicolas Guilhot

(SOLVED)Re: [PHP] setting the name of the file in Save As windows
50527 by: Black Dragon

How to Crypt entire MySQL DataBase
50528 by: Augusto Cesar Castoldi

Re: (another) cms, but internationalized
50529 by: Michael Kimsal

scripts execute as user nobody
50530 by: Mr. Adam ALLEN.

sending content-type header after session_start()
50531 by: matt.wong.tumbleweed.com
50579 by: Yasuo Ohgaki

Re: Ultradev PHP Server Model--found!
50533 by: John Monfort

Re: how to get var value
50534 by: Jacky.lilst

line break
50536 by: Gary
50537 by: Alex Piaz
50538 by: Joao Prado Maia
50539 by: Alex Piaz

What is this??
50540 by: Manesh
50541 by: Jack Dempsey
50542 by: Manesh
50546 by: Andrew Hill
50547 by: Philip Olson

PHP+MS Access and/or MS SQL
50543 by: kelvin.eXtropia.com

error reporting/handling
50544 by: Jack Dempsey

what is wrong with this login script?
50545 by: Jacky.lilst

Re: math calculations query
50548 by: Maxim Maletsky
50562 by: Steve Werby

Re: mcrypt module for Win32
50549 by: Maxim Maletsky
50574 by: Carsten Gehling

Re: alter table name with php and mysql
50550 by: Maxim Maletsky

Re: in_array() function not supported on my server... anyth ing else?
50551 by: Maxim Maletsky

mkstemp()
50552 by: Randy Johnson

printable output of array
50553 by: Mike Tuller

Re: check if an url is valid
50554 by: Maxim Maletsky
50575 by: Black Dragon
50586 by: yanto
50588 by: Manisha

Re: Array  Javascript?
50555 by: Maxim Maletsky

*.php and the search engienes on the web
50558 by: SED
50559 by: Philip Olson
50561 by: Steve Werby

php4 on RedHat 7.1
50560 by: j2n tech
50568 by: Ralph Guzman

php dieing/apache or something!
50563 by: Eric Peters

Submiting two forms at the same time
50564 by: Reuben D Budiardja

A newbie search site question
50565 by: waro
50567 by: David Robley

Please send me som Semaphore and Shared Memory  example...
50566 by: ±èº´°Ç

How can this be done?
50569 by: Subodh Gupta
50570 by: Jack Dempsey

parse error is always on line 1 == error ?
50571 by: Jimmy Lantz
50577 by: Frank Joerdens

Re: [PHP-DB] How can this be done?
50572 by: Beau Lebens

Re: Problem with the HTTP_REFERER
50573 by: Rosen
50590 by: Simon Ould

Re: how do I calculate this?
50576 by: Jacky.lilst
50589 by: bill

How to execute a php scripts
50578 by: Bertrand TACHAGO
50584 by: Henning Kilset Pedersen

loops with array_walk or foreach using array??? of variable pairs
50580 by: Helmut Ott

bug with sessions and output-compression?
50581 by: Sebastian Stadtlich

Extracting the body of the http request entity?
50582 by: nik

help me pls
50587 by: Yamin Prabudy

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]


--



Alright, count($x) would give me the number of array elements in $x. But how can I get 
the count of a multi-dimensional array? Count($x[0]) doesn't seem to work. Thanks in 
advance

Chris Anderson   aka Null

PHP Developer / Nulltech
PHP-GTK Tester / gtk.php.net
STA Administrator / www.stronger.org
DOD Co-Owner / www.dayofdefeat.com





it should.

if(is_array($x[0]))
$count = count($x[0]);
else
$count = 'not an array';

Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-Original Message-
From: Chris Anderson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 9:31 AM
To: PHP
Subject: [PHP] Sizeof a multi-dimensional array??


Alright, count($x) would give me the number of array elements in $x. But how
can I get the count of a multi-dimensional array? Count($x[0]) doesn't seem
to work. Thanks in advance

Chris Anderson   aka Null

PHP Developer / Nulltech
PHP-GTK Tester / gtk.php.net
STA 

Re: [PHP] Problem with the HTTP_REFERER

2001-04-27 Thread Geir Eivind Mork

On Thursday 26 April 2001 13:33, Rosen wrote:
  main.php:
  A HREF=test.php target= _blankClick here/A

You need a good deal of beating if you do your markup like that. there are 
something called a standard and that standard would make that line look like 
this:

a href=test.php 

but anyway, make your own referer by using session variables or hardcode it.

-- 
 php developer / CoreTrek AS| The three questions of greatest concern 
 Sandnes / Rogaland / Norway| are -- 1. Is it attractive? 2. Is it
 web: http://www.moijk.net/ | amusing?  3. Does it know its place?  

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] please help!

2001-04-27 Thread kaab kaoutar

Hi!
can u please chek this url http://www.tekora.com/tekora.html
its a flash demo of an online site builder?
do u think we can create a site for someone that way online using ph (fast 
template) ?
thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] What's wrong with Apache + php + mysql on Windows?

2001-04-27 Thread Steven Haryanto

Are you referring to delay in executing PHP scripts? If you run PHP
as a CGI binary, that would give significant slowdown. CGI's are
much slower in Windows than in Linux.

Or perhaps you are running out of RAM? That really slows the whole
thing down.

Steve

At 4/27/2001 06:14 AM, Mig wrote:
Hello, I can't understand the reason apache server running locally on my
Win98 machine delays so much to respond browser when accesing php
scripts in the form

http://localhost/myscript.php

When I transfer php scripts to host server via FTP, script execution is
immediate, even remote server being in another continent.

I was running apache + php + mysql on Win95 and delay was terrible. Now
I moved to Win98 and delay became still worse.

I know some parameter in httpd.conf or php.ini should be changed, but
how to kwow which parameter?.

Thanks for any idea.

Mig


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: Parsing HTML files from an external web server

2001-04-27 Thread Tim Ward

Are you looking at the site the calling script is on? I had the same problem
spidering my site to build a search engine. Using http://localhost/;
instead of the site address got it working.

I find that file() works fine on external pages but falls over (in exactly
the same way as yours) when accessing local pages by web address instead of
localhost.

At the time my guess was that it was something to do with the firewall
thinking it was being spoofed (external call with an internal IP address),
but I'm a bit out of my depth here so that could be complete bollocks.

Anyway, hope this is of some help.

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


 -Original Message-
 From: James Kneebone [mailto:[EMAIL PROTECTED]]
 Sent: 26 April 2001 12:57
 To: [EMAIL PROTECTED]
 Subject: Parsing HTML files from an external web server
 
 
 Hello List.
 
 I'm having a little trouble with parsing HTML files and 
 inputting the data
 from
 the HTML file into a MySQL database. I get the following 
 error when trying
 toparse the file.
 
 Warning: file(http://www.server.com/file.htm;) - No error in
 d:\webpages\world\lists.php on line 8
 
 The following is part of my php code
 
 ?
 
 $url = http://www.server.com/file.htm;;
 
 $fileArray = file($url);
 
 $state = 0;
 $line = 0;
 $ProvinceCount = 0;
 
 $Details = Array();
 
 
 
 I then have more code which parses the file and parses the 
 data and puts it in
 an array.
 
 I was wondering whether anybody could provide information as 
 to what the
 possible problem could be. If you want more information, 
 please contact me
 off-list.
 
 Thanks,
 
 James  
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] session.auto_start problem

2001-04-27 Thread Andreas Wolff

hi all,

i'm using PHP on a Win98 machine, and after switching session.auto_start=1,
PHP is enhancing every address with  SessionID's; well, normally I'm
satisfied with this behaviour, but for a single page containing some
javascript I would like to have it turned it off. I red there is a compiling
param for linux etc., but for the precompiled windows distribution i'm using
...
So, any idea's ??

Andreas Wolff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Variable (naming them) Functions.

2001-04-27 Thread Maxim Maletsky

Hello everyone:
 
I was wondering, does anyone of you know a method to declare a function
(give it a name) basing on a value acquired during run time? 
 
I tried using the syntax as of a variable function call:
 
 
snip
 
   $fname = 'hello';
   function { sprintf(%s, $fname) }($arg='') {
  Return I named you : $fname;
   }
   echo $fname($fname);
   # no luck...
 
 
   function {$fname}($arg='') {  
   # nope...
 
 
   function $fname($arg='') {  
   # neither...
 
/snip
 
and so on... all parse errors...
 
 
 
Any way to do it?
 
I am looping an array with some function names checking if a function was
declared already, and if not then declare, if yes - give a different name.
 
I also went through these bibles:
   http://www.php.net/manual/en/ref.funchand.php
http://www.php.net/manual/en/ref.funchand.php 
but found nothing that helps.
 
Thanks in advance,
Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.phpbeginner.com http://www.phpbeginner.com 

 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] RE: Sizeof a multi-dimensional array??

2001-04-27 Thread Tim Ward

you need to count all the elements in each of the elements. $x is a simple
array each member of which is an array

?php
function ArraySize($Array)
{   $count = 0;
foreach($Array as $Element)
{   if (is_array($Element))
{   $count += ArraySize($Element);
} else
{   $count++;
}
}
return $count;
}
?

this should work for any array, although for some reason it falls over if
the array passed in hasn't been predfined as an array.

i.e.
?php
$fred = array();
$fred[1][1][1] = 5;
$fred[1][2][3] = 5;
$fred[2][2][3] = 5;
echo(ArraySize($fred));
?
... works
but ...
?php
$fred[1][1][1] = 5;
$fred[1][2][3] = 5;
$fred[2][2][3] = 5;
echo(ArraySize($fred));
?
... doesn't. I haven't worked out why, yet.

Tim Ward
Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


 -Original Message-
 From: Chris Anderson [mailto:[EMAIL PROTECTED]]
 Sent: 25 April 2001 01:31
 To: PHP
 Subject: Sizeof a multi-dimensional array??
 
 
 Alright, count($x) would give me the number of array elements 
 in $x. But how can I get the count of a multi-dimensional 
 array? Count($x[0]) doesn't seem to work. Thanks in advance
 
 Chris Anderson   aka Null
 
 PHP Developer / Nulltech
 PHP-GTK Tester / gtk.php.net
 STA Administrator / www.stronger.org
 DOD Co-Owner / www.dayofdefeat.com
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Variable (naming them) Functions.

2001-04-27 Thread Maxim Maletsky


got a typo in my previous post:

I was trying this:

   $fname = 'hello';
   function { sprintf(%s, $fname) }($fname='') {
  Return I named you : $fname;
   }
   echo $fname($fname);

But that doesn't matter...

Thanks,
waiting for your help.

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Maxim Maletsky 
Sent: Friday, April 27, 2001 8:58 PM
To: 'PHP General List. (E-mail)'
Subject: [PHP] Variable (naming them) Functions.


Hello everyone:
 
I was wondering, does anyone of you know a method to declare a function
(give it a name) basing on a value acquired during run time? 
 
I tried using the syntax as of a variable function call:
 
 
snip
 
   $fname = 'hello';
   function { sprintf(%s, $fname) }($arg='') {
  Return I named you : $fname;
   }
   echo $fname($fname);
   # no luck...
 
 
   function {$fname}($arg='') {  
   # nope...
 
 
   function $fname($arg='') {  
   # neither...
 
/snip
 
and so on... all parse errors...
 
 
 
Any way to do it?
 
I am looping an array with some function names checking if a function was
declared already, and if not then declare, if yes - give a different name.
 
I also went through these bibles:
   http://www.php.net/manual/en/ref.funchand.php
http://www.php.net/manual/en/ref.funchand.php 
but found nothing that helps.
 
Thanks in advance,
Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.phpbeginner.com http://www.phpbeginner.com 

 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Problem with the HTTP_REFERER

2001-04-27 Thread Rosen

Thanks very much !!!

Rosen Marinov


Simon Ould [EMAIL PROTECTED] wrote in message
511B289BD436D41199AE0001021A9B5E05C5AB@SERVER">news:511B289BD436D41199AE0001021A9B5E05C5AB@SERVER...
 My interpretation of the problem is:
 You want a link on page A.php which points to B.php,
 B.php does some stuff, then redirects the user to page C.php

 You want the value of HTTP_REFERER on page C.php to be A.php

 Correct? If so, read on, if not, then delete this email.

 I'm using php-4.0.4pl1, apache 1.3.14, IE5.5, win2000, and this works on
my
 system.

 My two solutions both use the following 2 files :
 [index.html]
 HTML
 HEAD
 TITLETest/TITLE
 /HEAD
 BODY
 A HREF=test.php target=_blankClick here/A
 /BODY
 /HTML

 [targetpage.php]
 HTML
 HEAD
 TITLEtargetpage.php/TITLE
 /HEAD
 BODY
 You came to this page from ?php echo $HTTP_REFERER;?
 /BODY
 /HTML


 Solution 1:
 Use the php function header
 (http://www.php.net/manual/en/function.header.php)

 [test.php]
 ?php
 //... do stuff
 $web= http://localhost/referer_test/targetpage.php;;
 header (Location: .$web);
 ?

 ---
 Solution 2:
 Pass HTTP_REFERER in the URL: This also works on my system, but isn't
 exactly the neatest of methods.

 [test.php]
 HTML
 HEAD
 TITLEtest.php/TITLE
 /HEAD
 BODY
 ?php
 $web= localhost/referer_test/targetpage.php;
 $web= $web.?HTTP_REFERER=.$HTTP_REFERER; file://pass HTTP_REFERER
 in the URL
 echo SCRIPT
 language=\javascript\window.location.href=\http://$web\;/script;
 ?
 /BODY
 /HTML




 Hope that helped,

 Simon.

  -Original Message-
  From: Rosen [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 27, 2001 07:56
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Problem with the HTTP_REFERER
 
 
  Is anybody knows how can I redirect to another page
  and the REFERER to another page to be my page ?
 
  Thanks,
  Rosen Marinov
 ... snip ...

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with the HTTP_REFERER

2001-04-27 Thread Simon Ould

I guess that this is worth a mention: (Copied from
http://www.php.net/manual/en/function.header.php)
Remember that the header() function must be called before any actual output
is sent, either by normal HTML tags blank lines in a file, or from PHP. It
is a very common error to read code with include(), or require(), functions,
or another file access function, and have spaces or empty lines that will
output before header() is called. The same problem exists when using a
single PHP/HTML file. 


 -Original Message-
 From: Simon Ould [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 11:12
 To: 'Rosen'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Problem with the HTTP_REFERER

...snip...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] explode won't explode

2001-04-27 Thread Tom Beidler

I have the following code that doesn't seem to explode. I'm trying to make
a field that looks like 21,23,25,27 or small,medium,large,x-large into a
pulldown menu with the individual item broken out.

if (($size != )  ($size != n/a)) {
   $sizearry = explode(,, $size);
   while (list($key,$value) = each($sizearry)) {
   $size_option_block .= option value=\$value\$size/option\n;
}

The interesting thing (and probably the problem) is that I have very similar
code just before it that works fine. Here's the code that appears just
before and works.

if (($color != )  ($color != n/a)) {
   $colorarry = explode(,, $color);
   while (list($key,$value) = each($colorarry)) {
   $color_option_block .= option value=\$value\$value/option\n;
}

I'm not that familiar with explode. Are my $key and $value variables
conflicting?


.
Tom Beidler
Orbit Tech Services
805.682.8972 (phone)
805.682.5833 (fax)
[EMAIL PROTECTED]
http://www.orbittechservices.com/
.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: scripts execute as user nobody

2001-04-27 Thread Daniel BI

If you are compiling php as an apache module,
you may configure apache with the options:
--server-uid=asduk 
and
--server-gid=asdukgrp
(or what you want..)

if you don't compile them at all, may try to
set the directory's group as asdukgrp like this:

chgrp asdukgrp -R path-to-your-php-scripts-dir

it should work.

Daniel BI

==original message==
I have a problem with my PHP scripts on my web-hot, all my php scripts are
running as the user nobody (group nobody).

Whenever I login via ftp/telnet I am logged in as the user asduk (group
asdukgrp).

The problem I have is that I cannot delete my files because the permissions
on the directory is set to 775. I cannot change to the user nobody  my host
will not allow that.

If I change the permissions on the directories to 777 then I can delete the
files, but have read that this is dangerous.

If anyone has suggestions on how to get round this problem I'd appreciate
them (or let me know if a user browsing a php site in directories with
permission 777 can exploit this).

I am using PHP 3.0.14 (when using PHP4.05 RC1 on a different host I don't
get this problem - but need this working with PHP 3.0.14)

Thanks for any help
Mr. Adam ALLEN.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] RE: What is this??

2001-04-27 Thread Jon Haworth

Try http://members.evolt.org/

HTH
Jon


-Original Message-
From: Manesh [mailto:[EMAIL PROTECTED]]
Sent: 27 April 2001 13:35
To: Manesh; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] RE: What is this??


I need a free web server that gives me 1 Myslq accound and php hoasting!  if
soneone know of any please tell me.

thx


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] explode won't explode

2001-04-27 Thread jdwright



Hiya,

 I have the following code that doesn't seem to explode. I'm trying to make
 a field that looks like 21,23,25,27 or small,medium,large,x-large into a
 pulldown menu with the individual item broken out.

 if (($size != )  ($size != n/a)) {
$sizearry = explode(,, $size);
while (list($key,$value) = each($sizearry)) {
$size_option_block .= option value=\$value\$size/option\n;
 }

I think you've used the wrong varaible between option/option. You should
have $value, but you've put in the original variable: $size.

 The interesting thing (and probably the problem) is that I have very similar
 code just before it that works fine. Here's the code that appears just
 before and works.

 if (($color != )  ($color != n/a)) {
$colorarry = explode(,, $color);
while (list($key,$value) = each($colorarry)) {
$color_option_block .= option value=\$value\$value/option\n;
 }

 I'm not that familiar with explode. Are my $key and $value variables
 conflicting?


 .
 Tom Beidler
 Orbit Tech Services
 805.682.8972 (phone)
 805.682.5833 (fax)
 [EMAIL PROTECTED]
 http://www.orbittechservices.com/
 .



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions.

2001-04-27 Thread SED

Why not use classes? If I understand you problem correctly, I think classes
should solve your problem. Right?

SED

-Original Message-
From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
Sent: 27. apríl 2001 11:58
To: 'PHP General List. (E-mail)'
Subject: [PHP] Variable (naming them) Functions.


Hello everyone:

I was wondering, does anyone of you know a method to declare a function
(give it a name) basing on a value acquired during run time?

I tried using the syntax as of a variable function call:


snip

   $fname = 'hello';
   function { sprintf(%s, $fname) }($arg='') {
  Return I named you : $fname;
   }
   echo $fname($fname);
   # no luck...


   function {$fname}($arg='') { 
   # nope...


   function $fname($arg='') { 
   # neither...

/snip

and so on... all parse errors...



Any way to do it?

I am looping an array with some function names checking if a function was
declared already, and if not then declare, if yes - give a different name.

I also went through these bibles:
   http://www.php.net/manual/en/ref.funchand.php
http://www.php.net/manual/en/ref.funchand.php
but found nothing that helps.

Thanks in advance,
Sincerely,

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  www.phpbeginner.com http://www.phpbeginner.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Extracting the body of the http request entity? found it!

2001-04-27 Thread nik


 According to the w3c docs, POSTed  content is sent in the request
 entity body.  Since the request has a header, it's logical that it can
 have a body too :-) but I don't see any PHP functionality for getting at
 it. Someone in another group suggested accessing a variable called
 $HTTP_RAW_POST_DATA, but that doesn't seem to exist when I POST data to
 either of my test systems, which are Linux/Apache or Win98/PWS.

 PHP itself must be able to extract the POSTed data - it does so when
 saving a POSTed file to its temporary location - but this function don't
 seem to be exposed in the API... is it?

Sorry to answer my own question!

If you POST an html form with input elements, these are parsed by PHP into
variables, and the data is discarded.  BUT if you POST raw data from a
generic http component, without sending name-value pairs, this data is
exposed in $HTTP_RAW_POST_DATA.

nik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP Book?

2001-04-27 Thread Hamed Nik

Hey everyone...

I've been programming in perl for about 3 years now, i have installed php
and have been working on it for about three weeks. I started by converting
some of the programs I've written in Perl to PHP it seems its pretty
similar to Perl and not very hard to learn for a perl programmer... but i
need some reference book with some practical examples so i could work
with... and probably something that gives me ideas on different types of
programs and things that i could do in PHP... something that covers
everything in PHP... and is NOT copied from the manual! :))

I am sure most of you in this group have got some sort of a PHP book... can
you please tell me out of your experience which ones are good for me to buy?

Regards
Hamed Nik




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Extracting the body of the http request entity? found it!

2001-04-27 Thread Bruin, Bolke de


I would like to add a note to this, that this works in general, but
the thing which actually triggers the setting of $HTTP_POST_RAW_DATA
is a not recognized mime-type.

Bolke

-Oorspronkelijk bericht-
Van: nik [mailto:[EMAIL PROTECTED]]
Verzonden: Friday, April 27, 2001 3:04 PM
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] Extracting the body of the http request entity?
found it!



 According to the w3c docs, POSTed  content is sent in the request
 entity body.  Since the request has a header, it's logical that it can
 have a body too :-) but I don't see any PHP functionality for getting at
 it. Someone in another group suggested accessing a variable called
 $HTTP_RAW_POST_DATA, but that doesn't seem to exist when I POST data to
 either of my test systems, which are Linux/Apache or Win98/PWS.

 PHP itself must be able to extract the POSTed data - it does so when
 saving a POSTed file to its temporary location - but this function don't
 seem to be exposed in the API... is it?

Sorry to answer my own question!

If you POST an html form with input elements, these are parsed by PHP into
variables, and the data is discarded.  BUT if you POST raw data from a
generic http component, without sending name-value pairs, this data is
exposed in $HTTP_RAW_POST_DATA.

nik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] What's wrong with Apache + php + mysql on Windows?

2001-04-27 Thread Ivan Porro

Hi,

I've a w2k installation with Apache and it's a very fast and reliable
environment. Ok, still prefer Linux but... My machine is a celeron433
(just pushed to 507) and 128M ram, w2kpro eng. Hope this help you,

bye


Steve Maroney wrote:
 
 I think the question should be what's wrong with
 Windows?  :)
 
 Sorry, I can't give you more of an intelligent answer
 
 Steve
 
 On Thu, 26 Apr 2001, Mig wrote:
 
  Hello, I can't understand the reason apache server running locally on my
  Win98 machine delays so much to respond browser when accesing php
  scripts in the form
 
  http://localhost/myscript.php
 
  When I transfer php scripts to host server via FTP, script execution is
  immediate, even remote server being in another continent.
 
  I was running apache + php + mysql on Win95 and delay was terrible. Now
  I moved to Win98 and delay became still worse.
 
  I know some parameter in httpd.conf or php.ini should be changed, but
  how to kwow which parameter?.
 
  Thanks for any idea.
 
  Mig
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
(p)Ivan

Student 
DIST Bio-Lab
Viale Causa 13
16145 Genoa - Italy
 
tel: +39 010 3532789
e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP Book?

2001-04-27 Thread Angerer, Chad

Professional PHP by WROX.  Great book.  It provides you with some real world
examples.

Chad Angerer
HTML Programmer
Internet Broadcasting Systems
651.365.4006


-Original Message-
From: Hamed Nik [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 8:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Book?


Hey everyone...

I've been programming in perl for about 3 years now, i have installed php
and have been working on it for about three weeks. I started by converting
some of the programs I've written in Perl to PHP it seems its pretty
similar to Perl and not very hard to learn for a perl programmer... but i
need some reference book with some practical examples so i could work
with... and probably something that gives me ideas on different types of
programs and things that i could do in PHP... something that covers
everything in PHP... and is NOT copied from the manual! :))

I am sure most of you in this group have got some sort of a PHP book... can
you please tell me out of your experience which ones are good for me to buy?

Regards
Hamed Nik




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] forms and RETURN key

2001-04-27 Thread Matt Williams


 If I run this form using IE, hitting the Return/Enter key submits the form
 but the 'ok' variable is not set; it just redraws the form.  If however, I
 uncomment the third echo line (the one for Name2), then hitting the
 Return/Enter key does have the desired effect in IE.  In NS, the first
 version acts just like IE; the form redraws and that is all. But using the
 second variant with both text fields, hitting the Return key in NS does
 nothing at all.


I think this is the way it is.

Rather than testing for the value of submit, I have started adding a hidden
field called formname with the value being which ever form it is.
I then look for this instead of the value of the submit button

HTH

M@


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Book?

2001-04-27 Thread Ivan Porro

Hi,

i suggest three:

o) Beginning PHP4 by Chris Lea et. al. Editors ISBN and so on at:

www.amazon.com/exec/obidos/search-handle-form/107-8101819-4534115

o) PHP poket reference by Rasmus Leedorf, O'Reilly. OK 4 a brief fuction
reference and fundamentals (it's the best choice when you learn
something about php but u dn.t want to go out with a 5 inch manual.


o) www.phpbuilder.com  they have tutorials from beginners (i.e. php
programming with MySQL) to advanced (page caching  compression). I've
learned a lot of php on Web.


Hamed Nik wrote:
 
 Hey everyone...
 
 I've been programming in perl for about 3 years now, i have installed php
 and have been working on it for about three weeks. I started by converting
 some of the programs I've written in Perl to PHP it seems its pretty
 similar to Perl and not very hard to learn for a perl programmer... but i
 need some reference book with some practical examples so i could work
 with... and probably something that gives me ideas on different types of
 programs and things that i could do in PHP... something that covers
 everything in PHP... and is NOT copied from the manual! :))
 
 I am sure most of you in this group have got some sort of a PHP book... can
 you please tell me out of your experience which ones are good for me to buy?
 
 Regards
 Hamed Nik
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
(p)Ivan

Student 
DIST Bio-Lab
Viale Causa 13
16145 Genoa - Italy
 
tel: +39 010 3532789
e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] suggestions for binary data in database

2001-04-27 Thread Ray Hilton

Hi,

I have a site, http://rayh.co.uk which is basically my personal home page
and nothing more than a hobby.

However, on the site, i am currently storing images in the database, purely
because i can.  But i wonder, how much will the server load be affected when
pulling binary data out of the database?  compared to the file system?  i
assume its going to be quite a lot higher.  DO you reckon it would be better
to scrap that and store the images on the file system?

Ray Hilton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Ultradev PHP Server Model

2001-04-27 Thread Matt Williams


  I was wondering, is anyone aware of a PHP server model, for Ultradev?
 
  Or, any leads on how I can create one?
 
  I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
  of the Ultradev server model features (and convenience), but
  they only support ASP/JSP/JScript.

 I'm not aware of one -- I wish I were!

 The book Extending Dreamweaver 4 from Macromedia documents their API's,
 including server models. I've got the book...it's pretty hefty. I *think*
 it's fairly complete, though I can't immediately determine if it has all
 the info necessary to create a new server model.

 I sincerely hope someone does this! I would give it a shot if I weren't so
 green...


Check out

http://www.geocities.com/php4ud/

I've never tried it but it was in my bookmarks to have a look at.

I would be grateful of any feedback on it.

Cheers

M@



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] a (simple) question?

2001-04-27 Thread Ivan Porro

Hi,

anyone know a simple way to realize multiple-upload at once (something
like Msoft CTRL-multiple selection when browsing and uniqe Upload
button). I've found only a multiple file input field in a form but the
numbers of file I'had to upload is unknow.

TIA
-- 
(p)Ivan

Student 
DIST Bio-Lab
Viale Causa 13
16145 Genoa - Italy
 
tel: +39 010 3532789
e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] --enable-trans-sid and forms

2001-04-27 Thread Larry Hotchkiss

Its my understanding that PHP appends the SID on the end of the URL
regardless of weather its a form or not. If thats not happening for you,
check your php.ini and make sure you have session.use_trans_sid enabled.



Boget, Chris wrote:
 
 If you have PHP compiled with --enable-trans-sid,
 are the URLs that are part of the form's action supposed
 to be modified to include the SID?  So far that's not
 been happening and I just want to verify that this is
 expected behavior.
 
 thnx,
 Chris

-- 
Larry Hotchkiss
Universal Capital
612-551-9309
http://www.unicap.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP+MS Access and/or MS SQL

2001-04-27 Thread Ivan Porro

Hi,

www.mysql.com, and check the website for a myaccess or myodbc doc's. I
know (I dwnloaded it) that exist a myaccess plugin to save access dB to
mysql structure files.

From php side you have a lot of classical dbfunction to access MSAccess
dB, simply using odbc_function and creating a ODBC Data Source Name
using Manage ODBC data source in Control Panel on the 'db server'
machine. Notice that These odbc with MSAccess work ONLY LOCALLY (in
lan,not remotely). U have to use MSSQL server to realize remote dB
storage.

Good Luck,

Ivan

[EMAIL PROTECTED] wrote:
 
 just point your browser to phpbuilder.net. Alternatively, just send me an email =)
 
 Date: Wed, 25 Apr 2001 19:02:12 -0700 (PDT)
 From: John Monfort [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Message-ID: [EMAIL PROTECTED]
 MIME-Version: 1.0
 Content-Type: TEXT/PLAIN; charset=US-ASCII
 Subject: PHP+MS Access and/or MS SQL
 
  Hello everyone,
 
  I'm looking for information on PHP+ MS Access , and PHP+MS SQL.
 
  Any recommendations?
 
  Thx in advance!
 
 __John Monfort_
 _+---+_
  P E P I E  D E S I G N S
www.pepiedesigns.com
 The world is waiting, are you ready?
 -+___+-
 
 On Thu, 26 Apr 2001, Ben Quinn wrote:
 
  Hi all,
 
  I am trying to copy an image from an external server and save it to my own.
  I have the following script to do this for a txt file and it works great!
 
  ?
 
  $page  = ../temp/yep.txt;
 
  $date = date(http:/www.example.com/yep.txt);
 
  $cartFile = fopen($page,a);
  fwrite($cartFile,$date,strlen($date));
  fclose($cartFile);
 
  ?
 
  But i can't get it to work for image files - the images are saved and
  displayed on screen as a whole bunch of rubbish.
 
  I'd appreciate any help you can give me
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 k.e.l.v.i.n c.h.a.n
 the open web technology company
 www.eXtropia.com
 [EMAIL PROTECTED]
 Tel: 7738550

-- 
(p)Ivan

Student 
DIST Bio-Lab
Viale Causa 13
16145 Genoa - Italy
 
tel: +39 010 3532789
e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] --enable-trans-sid and forms

2001-04-27 Thread Boget, Chris

   Its my understanding that PHP appends the SID on the 
 end of the URL regardless of weather its a form or not. If thats 
 not happening for you, check your php.ini and make sure you 
 have  session.use_trans_sid enabled.

It is enabled.  And it's being appended to most URLs (though, not 
all, but that's another problem I posted to another thread).  
However, it's not being appended to any of my form's actions.

Chris



[PHP] HELP!! Mail and attachments

2001-04-27 Thread Tym Rehm

I have been trying to get this to work for days and I'm confused. I want to
attach a Word document to an email. I found this code on php.net and I'm
trying to modify it to work. I get the email sent, the attached Word
document is filled with junk and not the document I'm trying to send.

Here is the code and sorry for the large email.

?php
$border=--==_856811060==_;
#/* recipients */
#$recipient .= Mary [EMAIL PROTECTED] . , ; #//note the comma
#$recipient .= Kelly [EMAIL PROTECTED] . , ;
#$recipient .= [EMAIL PROTECTED];
$recipient = [EMAIL PROTECTED];

#/* subject */
$subject = Birthday Reminders for August;

#/* message */
$message .= $border\n;
$message .= Content-Type: text/plain; charset=us-ascii;format=flowed\n;
$message .= The following email includes a formatted ASCII table\n;
$message .= Day \t\tMonth \t\tYear\n;
$message .= 3rd \t\tAug \t\t1970\n;
$message .= 17rd\t\tAug \t\t1973\n;
$message .= $border\n;
#$message .= Content-Type: application/msword; name=\/mail/Ftp\ User\
Info.doc\\n;
#$message .= Content-Transfer-Encoding: base64\n;
#$message .= Content-Disposition: attachment; filename=\/mail/Ftp\ User\
Info.doc\\n;
#$message .=$border\n;

#/* you can add a stock signature */
$message .= --\r\n; //Signature delimiter
$message .= Birthday reminder copylefted by public domain;

#/* additional header pieces for errors, From cc's, bcc's, etc */

$headers .= From: Birthday Reminder [EMAIL PROTECTED]\n;
$headers .= X-Sender: [EMAIL PROTECTED]\n;
$headers .= X-Mailer: PHP\n; // mailer
$headers .= X-Priority: 1\n; // Urgent message!
$headers .= Return-Path: [EMAIL PROTECTED]\n;  // Return path for errors
# I added this code
$headers .= Mime-Version: 1.0\n;
$headers .= Content-Type: multipart/mixed; boundary=\$border\\n;
#$headers .= Content-Type: text/plain; charset=us-ascii;format=flowed\n;
$headers .= Content-Type: application/msword; name=\Ftp\ User\
Info.doc\\n;
$headers .= Content-Transfer-Encoding: base64\n;
$headers .= Content-Disposition: attachment; filename=\Ftp\ User\
Info.doc\\n;

#/* If you want to send html mail, uncomment the following line */
#$headers .= Content-Type: text/html; charset=iso-8859-1\n; // Mime type

#$headers .= cc:[EMAIL PROTECTED]\n; // CC to
#$headers .= bcc:[EMAIL PROTECTED], [EMAIL PROTECTED]\n; // BCCs
to
#$headers .= cc:[EMAIL PROTECTED]\n; // CC to
#$headers .= bcc:[EMAIL PROTECTED],
[EMAIL PROTECTED]\n; // BCCs to

#/* and now mail it */
mail($recipient, $subject, $message, $headers);
print htmlheadtitleMail/title/head\n;
printbody\n;
print pMail Sent?\n;
print/body/html\n;
?

Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] What is this??

2001-04-27 Thread Ivan Porro

try

error_reporting(E_ERROR);

on top of script. PHP 4 don't like variable (such i.e. variable checked
in if() ) before u declare or set them (i.e. in one-page only form
management.

by.

(note: u must be sure that the variable is used correctly! this only
kill the annoyng warning)

Manesh wrote:
 
 where is that?
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jack
 Dempsey
 Sent: Thursday, April 26, 2001 10:38 PM
 To: Manesh
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] What is this??
 
 Manesh wrote:
 
  Warning: Undefined variable
 
  How do i get rid of this???
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 if you're sure that its because you didn't initialize first before
 using, then look in your php.ini file...there are options there where
 you can error strictness...
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
(p)Ivan

Student 
DIST Bio-Lab
Viale Causa 13
16145 Genoa - Italy
 
tel: +39 010 3532789
e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Extracting the body of the http request entity? found it!

2001-04-27 Thread nik



 I would like to add a note to this, that this works in general, but
 the thing which actually triggers the setting of $HTTP_POST_RAW_DATA
 is a not recognized mime-type.


Aha!  Blinding light of understanding - THANKYOU!

nik



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHP+MS Access and/or MS SQL

2001-04-27 Thread Andrew Hill

Hi,

A small correction, remote ODBC DSNs work fine with Access.
It's simply a question of installing appropriate drivers.

Best regards,
Andrew
--
Andrew Hill - OpenLink Software
Director Technology Evangelism
Universal Data Access Integration 
http://www.openlinksw.com

 
 
 Hi,
 
 www.mysql.com, and check the website for a myaccess or myodbc doc's. I
 know (I dwnloaded it) that exist a myaccess plugin to save access dB to
 mysql structure files.
 
 From php side you have a lot of classical dbfunction to access MSAccess
 dB, simply using odbc_function and creating a ODBC Data Source Name
 using Manage ODBC data source in Control Panel on the 'db server'
 machine. Notice that These odbc with MSAccess work ONLY LOCALLY (in
 lan,not remotely). U have to use MSSQL server to realize remote dB
 storage.
 
 Good Luck,
 
 Ivan
 
 [EMAIL PROTECTED] wrote:
  
  just point your browser to phpbuilder.net. Alternatively, just 
 send me an email =)
  
  Date: Wed, 25 Apr 2001 19:02:12 -0700 (PDT)
  From: John Monfort [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Message-ID: 
 [EMAIL PROTECTED]
  MIME-Version: 1.0
  Content-Type: TEXT/PLAIN; charset=US-ASCII
  Subject: PHP+MS Access and/or MS SQL
  
   Hello everyone,
  
   I'm looking for information on PHP+ MS Access , and PHP+MS SQL.
  
   Any recommendations?
  
   Thx in advance!
  
  __John Monfort_
  _+---+_
   P E P I E  D E S I G N S
 www.pepiedesigns.com
  The world is waiting, are you ready?
  -+___+-
  
  On Thu, 26 Apr 2001, Ben Quinn wrote:
  
   Hi all,
  
   I am trying to copy an image from an external server and save 
 it to my own.
   I have the following script to do this for a txt file and it 
 works great!
  
   ?
  
   $page  = ../temp/yep.txt;
  
   $date = date(http:/www.example.com/yep.txt);
  
   $cartFile = fopen($page,a);
   fwrite($cartFile,$date,strlen($date));
   fclose($cartFile);
  
   ?
  
   But i can't get it to work for image files - the images are saved and
   displayed on screen as a whole bunch of rubbish.
  
   I'd appreciate any help you can give me
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
  
  
  
  k.e.l.v.i.n c.h.a.n
  the open web technology company
  www.eXtropia.com
  [EMAIL PROTECTED]
  Tel: 7738550
 
 -- 
 (p)Ivan
 
 Student 
 DIST Bio-Lab
 Viale Causa 13
 16145 Genoa - Italy
  
 tel: +39 010 3532789
 e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Ultradev PHP Server Model

2001-04-27 Thread Ovidiu EFTIMIE

php4ud became PhAkt (http://www.interakt.ro/phakt)

Ovidiu


 -Original Message-
 From: Matt Williams [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 3:59 PM
 To: John Platte; John Monfort
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Ultradev PHP Server Model



   I was wondering, is anyone aware of a PHP server model, for Ultradev?
  
   Or, any leads on how I can create one?
  
   I'm developing a site with PHP+MS Access+Ultradev. I wanted
 to use some
   of the Ultradev server model features (and convenience), but
   they only support ASP/JSP/JScript.
 
  I'm not aware of one -- I wish I were!
 
  The book Extending Dreamweaver 4 from Macromedia documents
 their API's,
  including server models. I've got the book...it's pretty hefty.
 I *think*
  it's fairly complete, though I can't immediately determine if it has all
  the info necessary to create a new server model.
 
  I sincerely hope someone does this! I would give it a shot if I
 weren't so
  green...
 

 Check out

 http://www.geocities.com/php4ud/

 I've never tried it but it was in my bookmarks to have a look at.

 I would be grateful of any feedback on it.

 Cheers

 M@



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP+MS Access and/or MS SQL

2001-04-27 Thread Ivan Porro

10X a lot !!!

Bye.


Andrew Hill wrote:
 
 Hi,
 
 A small correction, remote ODBC DSNs work fine with Access.
 It's simply a question of installing appropriate drivers.
 
 Best regards,
 Andrew
 --
 Andrew Hill - OpenLink Software
 Director Technology Evangelism
 Universal Data Access Integration
 http://www.openlinksw.com
 
 
 
  Hi,
 
  www.mysql.com, and check the website for a myaccess or myodbc doc's. I
  know (I dwnloaded it) that exist a myaccess plugin to save access dB to
  mysql structure files.
 
  From php side you have a lot of classical dbfunction to access MSAccess
  dB, simply using odbc_function and creating a ODBC Data Source Name
  using Manage ODBC data source in Control Panel on the 'db server'
  machine. Notice that These odbc with MSAccess work ONLY LOCALLY (in
  lan,not remotely). U have to use MSSQL server to realize remote dB
  storage.
 
  Good Luck,
 
  Ivan
 
  [EMAIL PROTECTED] wrote:
  
   just point your browser to phpbuilder.net. Alternatively, just
  send me an email =)
  
   Date: Wed, 25 Apr 2001 19:02:12 -0700 (PDT)
   From: John Monfort [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Message-ID:
  [EMAIL PROTECTED]
   MIME-Version: 1.0
   Content-Type: TEXT/PLAIN; charset=US-ASCII
   Subject: PHP+MS Access and/or MS SQL
  
Hello everyone,
  
I'm looking for information on PHP+ MS Access , and PHP+MS SQL.
  
Any recommendations?
  
Thx in advance!
  
   __John Monfort_
   _+---+_
P E P I E  D E S I G N S
  www.pepiedesigns.com
   The world is waiting, are you ready?
   -+___+-
  
   On Thu, 26 Apr 2001, Ben Quinn wrote:
  
Hi all,
   
I am trying to copy an image from an external server and save
  it to my own.
I have the following script to do this for a txt file and it
  works great!
   
?
   
$page  = ../temp/yep.txt;
   
$date = date(http:/www.example.com/yep.txt);
   
$cartFile = fopen($page,a);
fwrite($cartFile,$date,strlen($date));
fclose($cartFile);
   
?
   
But i can't get it to work for image files - the images are saved and
displayed on screen as a whole bunch of rubbish.
   
I'd appreciate any help you can give me
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
   
   
  
   k.e.l.v.i.n c.h.a.n
   the open web technology company
   www.eXtropia.com
   [EMAIL PROTECTED]
   Tel: 7738550
 
  --
  (p)Ivan
 
  Student
  DIST Bio-Lab
  Viale Causa 13
  16145 Genoa - Italy
 
  tel: +39 010 3532789
  e-mail: [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
(p)Ivan

Student 
DIST Bio-Lab
Viale Causa 13
16145 Genoa - Italy
 
tel: +39 010 3532789
e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Submiting two forms at the same time

2001-04-27 Thread John Platte

As long as you're using the GET variables simply to pass along values (not
allowing the user to change the GET variables), you can stick the values
in the action property of your POST form and get the same result.

So the below code would become:

form action=bla.php?bar=yehaa method=post
input type=hidden name=foo value=yahoo
/form

Hope this helps.

(Hello in Goshen...I grew up in Fort Wayne. My pop's a Taylor FW prof...)

Reuben D Budiardja wrote:

 What I want to do is to 
 have two forms with different method (GET and POST), and then send them
at 
 one time, so that in the next page I get both $HTTP_POST_VARS and 
 $HTTP_GET_VARS. To illustrate this:
 
  FORM ACTION=3Dbla.php METHOD=3Dpost
  INPUT TYPE=3Dhidden NAME=3Dfoo VALUE=3Dyahoo
  /FORM
 
 FORM ACTION=3Dbla.php METHOD=3DGET
 INPUT TYPE=3Dhidden NAME=3Dbar VALUE=3Dyehaa
 /FORM
 
 I want so that after submiting these forms, somehow, in the bla.php I=20
 have
 $HTTP_POST_VARS[foo] = yahoo
 $HTTP_GET_VARS[bar] = yehaa
 
 at one time. Is this possible at all?

John Platte

Truth binds the mind to what satisfies it,
but worldly thinking does not satisfy
and therefore ignites curiosity.

   -- St. Theophan the Recluse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] a (simple) question?

2001-04-27 Thread Michael Kimsal

You can only do one file in each box - get a yahoo mail account and see how
they
handle file uploading.


Ivan Porro wrote:

 Hi,

 anyone know a simple way to realize multiple-upload at once (something
 like Msoft CTRL-multiple selection when browsing and uniqe Upload
 button). I've found only a multiple file input field in a form but the
 numbers of file I'had to upload is unknow.

 TIA
 --
 (p)Ivan

 Student
 DIST Bio-Lab
 Viale Causa 13
 16145 Genoa - Italy

 tel: +39 010 3532789
 e-mail: [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php4 on RedHat 7.1

2001-04-27 Thread .

Yes, it has that in there right out of the box like this:

IfDefine HAVE_PHP4
LoadModule php4_modulemodules/libphp4.so
/IfDefine
#
# AddType: allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# The following is for PHP4 (conficts with PHP/FI, below):
IfModule mod_php4.c
  AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps
/IfModule

It comes like that from a clean install of RH 7.1, but why is it not
working?  Any Ideas?



Ralph Guzman wrote in message ...
Your httpd.conf configuration should look something like this:

AddType application/x-httpd-php .php .phtml .php3 .php4
AddType application/x-httpd-php-source .phps

-Original Message-
From: j2n tech [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php4 on RedHat 7.1


I'm trying to get a webmail client to work under RH 7.1 with Apache 1.3.19.
I downloaded php-4.0.4pl and configured and installed it.  Now when I try
to
bring up a php page it trys to download it instead of execute.  I added the
AddType line for php4 in my httpd.conf but it made no difference.  I
noticed Apache 1.3.19 with RH7.1 treats modules differently with the
IfDefine functions...am i missing something here?  Anybody have any idea
how
I might be able to get this to work?

Thanks.

--j2n.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] how to use Semaphore...

2001-04-27 Thread ±èº´°Ç

how to use Semaphore... through PHP...

please help me.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Build problems

2001-04-27 Thread Yasuo Ohgaki

The cause of this error is complier cannot find kernel related headers.
Download kernel source (2.2 not 2.4), and untar under /usr/src/linux.
(or get/install kernel source/header RPM for 6.2)

Regards,
--
Yasuo Ohgaki


Curtis Maurand [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,
   I'm building 4.0.4pl1 on RedHat 6.2 with all updates applied.  It
 configures OK and then when issue make i get:

 [root@fenris php-4.0.4pl1]# make
 Making all in Zend
 make[1]: Entering directory `/home/curtis/php-4.0.4pl1/Zend'
 /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
 -I../main
-DLINUX=2 -DEAPI -DUSE_EXPAT -DXML_BYTE_ORDER=12  -g -O2 -c
 zend_language_sca
 nner.c
 In file included from /usr/include/errno.h:36,
  from zend_language_scanner.c:2619:
 /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory
 In file included from /usr/include/bits/posix1_lim.h:126,
  from /usr/include/limits.h:30,
  from
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/li
 mits.h:117,
  from
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/sy
 slimits.h:7,
  from
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/li
 mits.h:11,
  from zend_language_scanner.c:2620:
 /usr/include/bits/local_lim.h:27: linux/limits.h: No such file or
 directory
 make[1]: *** [zend_language_scanner.lo] Error 1
 make[1]: Leaving directory `/home/curtis/php-4.0.4pl1/Zend'
 make: *** [all-recursive] Error 1

 Any one have any clues?  I can't get 3.0.16 to build either and I need
 mysql support.  If anyone knows where I can find functional RPM's that
 would be OK, too.



 Curtis


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] parse error is always on line 1 == error ?

2001-04-27 Thread John Platte

I use BBEdit on the Mac, uploading PHP code to a Unix server, and I get
parse errors on line 1 unless I remember to set line breaks to Unix \n
(rather than Mac and Windows line endings, which use different
characters). You may be running into a similar problem.

Jimmy Lantz wrote:

 Hi, I have a problem,
 that when I get a parse error it always says that it's on line 1 in 
 this or that file.
 Where is the configuration option to set this right?
 I have on another server seen that it's possible to get it to state 
 the actual error line.

John Platte

Truth binds the mind to what satisfies it,
but worldly thinking does not satisfy
and therefore ignites curiosity.

   -- St. Theophan the Recluse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] network error

2001-04-27 Thread claudia

Hi,

maybe now someone can help me.
While i get a network error message from netscape i get no message from
ie. It´s like i make a reload on my page and not that i am sending a lot of
data over with my form.
While testing with ie i figured out that the problem, why ie displays
nothing is, because the variable HTTP_POST_VARS is empty and my script
checks the HTTP_POST_VARS variable.
But how can it happen that sometimes HTTP_POST_VARS has data and sometimes
not? I have a Apache Web-Server.

Any idea?

claudia

 Hi,

 has anyone ever seen the message Network error occured while Netscape
 was receiving data ...

 This happens when i save data in my informix database. The values are
 saved, but i get the error message when the browser trys to load the new
 page. The strange thing is, it happens only sometimes on various sites.
 I think it has something to do with the traffic on the site (ca. 400
 users).

 After inserting a flush() into the page, which i want to load, i get
 parts of the new page. I saved this page on disk and had a look at the
 HTML, it´s complete, but my browser can´t show it and i get the network
 error message.

 If i make a View Source of the uncomplete page i get:
 TITLEMissing Post reply data/TITLE
 H1Data Missing/H1
 This document resulted from a POST operation and has expired from the
 cache. If you wish you can repost the form data to recreate the document
 by pressing the breload/b button.

 I´m working on NT4, php4.0.4pl1, ODBC- Informix Database

 Thanks for any help!

 Claudia


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions.

2001-04-27 Thread PHPBeginner.com

no classes CAN'T solve my problem:

it is an abstraction layer. called as func_hello(); I want, inside
func_hello() {} declare a new function based on what happened before
func_hello() was called. In other words: I of course though about classes,
and there is in fact a work around, but I need to know if 'function
$var($arg) { return; }' syntax exists and what it is.

in the docs there's nothing being said.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-Original Message-
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 9:53 PM
To: Maxim Maletsky
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Variable (naming them) Functions.


Why not use classes? If I understand you problem correctly, I think classes
should solve your problem. Right?

SED

-Original Message-
From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
Sent: 27. apríl 2001 11:58
To: 'PHP General List. (E-mail)'
Subject: [PHP] Variable (naming them) Functions.


Hello everyone:

I was wondering, does anyone of you know a method to declare a function
(give it a name) basing on a value acquired during run time?

I tried using the syntax as of a variable function call:


snip

   $fname = 'hello';
   function { sprintf(%s, $fname) }($arg='') {
  Return I named you : $fname;
   }
   echo $fname($fname);
   # no luck...


   function {$fname}($arg='') { 
   # nope...


   function $fname($arg='') { 
   # neither...

/snip

and so on... all parse errors...



Any way to do it?

I am looping an array with some function names checking if a function was
declared already, and if not then declare, if yes - give a different name.

I also went through these bibles:
   http://www.php.net/manual/en/ref.funchand.php
http://www.php.net/manual/en/ref.funchand.php
but found nothing that helps.

Thanks in advance,
Sincerely,

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  www.phpbeginner.com http://www.phpbeginner.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Book?

2001-04-27 Thread Randal Pitt

I used 'Professional PHP Programming' by WROX Press first, but to learn more
about what PHP can do and the best way to do it, I recommend 'Web
Application Development with PHP4', you can get both from Amazon.

Randal.


Hamed Nik wrote in message 9cbr3a$mkc$[EMAIL PROTECTED]...
Hey everyone...

I've been programming in perl for about 3 years now, i have installed php
and have been working on it for about three weeks. I started by converting
some of the programs I've written in Perl to PHP it seems its pretty
similar to Perl and not very hard to learn for a perl programmer... but i
need some reference book with some practical examples so i could work
with... and probably something that gives me ideas on different types of
programs and things that i could do in PHP... something that covers
everything in PHP... and is NOT copied from the manual! :))

I am sure most of you in this group have got some sort of a PHP book... can
you please tell me out of your experience which ones are good for me to
buy?

Regards
Hamed Nik




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] parse error is always on line 1 == error ?

2001-04-27 Thread Jimmy Lantz

Yes, thank you you're right this is exactly what it was, I used 
Dreamweaver on a mac to edit the files, but now if I encounter parse 
error I convert them with BBEdit.
Thank you.
Jimmy Lantz

I use BBEdit on the Mac, uploading PHP code to a Unix server, and I get
parse errors on line 1 unless I remember to set line breaks to Unix \n
(rather than Mac and Windows line endings, which use different
characters). You may be running into a similar problem.

Jimmy Lantz wrote:

  Hi, I have a problem,
  that when I get a parse error it always says that it's on line 1 in
  this or that file.
  Where is the configuration option to set this right?
  I have on another server seen that it's possible to get it to state
  the actual error line.

John Platte

Truth binds the mind to what satisfies it,
but worldly thinking does not satisfy
and therefore ignites curiosity.

-- St. Theophan the Recluse


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] --enable-trans-sid and forms

2001-04-27 Thread Johnson, Kirk

Here is what I see in my FORM with --enable-trans-sid:

FORM METHOD=POST ACTION=./test_formRun.php
INPUT TYPE=HIDDEN NAME=PHPSESSID
VALUE=cbf75d263416e77d773b1772f6e1be89
INPUT TYPE=IMAGE  NAME=image
SRC=submit.gif?PHPSESSID=cbf75d263416e77d773b1772f6e1be89  ALIGN=top 

PHP is adding the HIDDEN field with the session id. For some reason, it also
appends it to the SRC attribute of the image submit button, but doesn't add
it in the ACTION url.

Kirk

 -Original Message-
   Its my understanding that PHP appends the SID on the 
 end of the URL
 regardless of weather its a form or not.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] --enable-trans-sid and forms

2001-04-27 Thread Boget, Chris

 Here is what I see in my FORM with --enable-trans-sid:
 FORM METHOD=POST ACTION=./test_formRun.php
 INPUT TYPE=HIDDEN NAME=PHPSESSID
 VALUE=cbf75d263416e77d773b1772f6e1be89
 PHP is adding the HIDDEN field with the session id. For some 
 reason, it also appends it to the SRC attribute of the image submit 
 button, but doesn't add it in the ACTION url.

I'm not getting that, either...  This is sooo funky.  Sometimes
the --enable-trans-sid works and sometimes it doesn't.  I just
wish there was some consistency about it so I could trouble
shoot where the problem is coming from.
*sigh*.

Chris



RE: [PHP] PHP Book?

2001-04-27 Thread Boaz Yahav

You can check for PHP / MySQL books at :

PHP:

http://www.weberdev.com/index.php3?GoTo=ShowShoppingItems.php3%3FMasterCateg
ory%3D156%26SubCategory%3D106%26SubCategoryName%3DPHP%26MainCategoryName%3DB
ooks

MySQL:
==
http://www.weberdev.com/index.php3?GoTo=ShowShoppingItems.php3%3FMasterCateg
ory%3D156%26SubCategory%3D1%26SubCategoryName%3DMySQL%26MainCategoryName%3DB
ooks


And you can also check the Articles / tutorials and examples on weberdev as
a very good reference.

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.

-Original Message-
From: Hamed Nik [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 3:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Book?


Hey everyone...

I've been programming in perl for about 3 years now, i have installed php
and have been working on it for about three weeks. I started by converting
some of the programs I've written in Perl to PHP it seems its pretty
similar to Perl and not very hard to learn for a perl programmer... but i
need some reference book with some practical examples so i could work
with... and probably something that gives me ideas on different types of
programs and things that i could do in PHP... something that covers
everything in PHP... and is NOT copied from the manual! :))

I am sure most of you in this group have got some sort of a PHP book... can
you please tell me out of your experience which ones are good for me to buy?

Regards
Hamed Nik




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] --enable-trans-sid and forms

2001-04-27 Thread PHPBeginner.com

have you checked your PHP.INI file?

it sais there what links to rewrite.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 12:16 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] --enable-trans-sid and forms


Here is what I see in my FORM with --enable-trans-sid:

FORM METHOD=POST ACTION=./test_formRun.php
INPUT TYPE=HIDDEN NAME=PHPSESSID
VALUE=cbf75d263416e77d773b1772f6e1be89
INPUT TYPE=IMAGE  NAME=image
SRC=submit.gif?PHPSESSID=cbf75d263416e77d773b1772f6e1be89  ALIGN=top 

PHP is adding the HIDDEN field with the session id. For some reason, it also
appends it to the SRC attribute of the image submit button, but doesn't add
it in the ACTION url.

Kirk

 -Original Message-
   Its my understanding that PHP appends the SID on the
 end of the URL
 regardless of weather its a form or not.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mysql table speed

2001-04-27 Thread Bas Jochems

i've got a mysql table with about 150.000 record.
i'm getting data out of this table to generate statistic overviews

it seems that this is a problem, cause it takes a long time to generate
these overviews

q:   how can i speed up this table cause 150.000 records is not that
much i suppose?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mysql table speed

2001-04-27 Thread Jason Murray

 i've got a mysql table with about 150.000 record.
 i'm getting data out of this table to generate statistic overviews
 
 it seems that this is a problem, cause it takes a long time 
 to generate these overviews
 
 q:   how can i speed up this table cause 150.000 records 
 is not that much i suppose?

You should set up an Index on any fields you commonly search on.

The MySQL documentation has information on how to do this. It's at
www.mysql.com. I would tell you, but a) It's better to learn it, b)
I can't remember, and c) It's 1:30am here and I'm still at work :)

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
What'll Scorpy use wormhole technology for?
'Faster pizza delivery.'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] --enable-trans-sid and forms

2001-04-27 Thread Johnson, Kirk

Thanks, Maxim, I hadn't seen the url_rewriter.tags entry in php.ini before.
A search of the PHP manual only returns one unhelpful reference, tho. Any
idea where to find some documentation on this?

TIA

Kirk

 -Original Message-
 From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
 
 have you checked your PHP.INI file?
 
 it sais there what links to rewrite.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] --enable-trans-sid and forms

2001-04-27 Thread Boget, Chris

 have you checked your PHP.INI file?
 it sais there what links to rewrite.

This is what is in my .ini.  

url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry ;
added 3/2/01

Am I missing something here that I should have?  
I don't see anything in the docs about the above 
directive.
Also, note, as I said in a problem I posed in another 
thread, there are some links where the SID is added 
while there are some that it isn't added.  This happens 
in different pages, though.  So while there will be pages 
where *all* the links will have the SID added, there
will be pages where *none* of them have the SID included.  
(though, it is never the case where there is a page
where some have the SID included while some do
not)
And this could be one page right after the other.

This is very odd and *very* frustrating.

Chris



RE: [PHP] PHP Book?

2001-04-27 Thread Simon Ould

PHP Developers Cookbook, by Sterling Hughes
I like it: as the name might suggest, it is packed with real-World examples.

I also bought Beginning PHP Programming (Wrox press). Mistake. Big
mistake. It is aimed at people who are *completely* new to programming. The
review that I read of it didn't convey this aspect :(

For example, in chapter 5 or 6 there is a paragraph along the lines of:
You know that we told you to make your code reusable? Here's why: you can
use something called a function... 
I actually found it vaguely funny, whilst I was banging my head against the
wall.

 -Original Message-
 From: Hamed Nik [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 14:10
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP Book?
 
 
 Hey everyone...
 
 I've been programming in perl for about 3 years now, i have 
 installed php
 and have been working on it for about three weeks. I started 
 by converting
 some of the programs I've written in Perl to PHP it seems 
 its pretty
 similar to Perl and not very hard to learn for a perl 
 programmer... but i
 need some reference book with some practical examples so i could work
 with... and probably something that gives me ideas on 
 different types of
 programs and things that i could do in PHP... something that covers
 everything in PHP... and is NOT copied from the manual! :))
 
 I am sure most of you in this group have got some sort of a 
 PHP book... can
 you please tell me out of your experience which ones are good 
 for me to buy?
 
 Regards
 Hamed Nik
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Syntax for select statement

2001-04-27 Thread Don Pro

Hi,

I've written PHP routines to work on MySQL and so far so good.  However,
I have one question.

I have a select routine that has the following syntax (which works fine
thus far):

$queryID = mysql_query(SELECT Country, Agent FROM Ports
WHERE Portname = '$portname');

My question is, if the variable $portname has the ' character within in,
will this cause an error in my select statement?  If the answer is
Yes, can someone give me a more robust way of writing it using PHP?

Thanks,
Don


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions.

2001-04-27 Thread Johnson, Kirk

Did you see create_function()? Not sure if this is what you are after, but
http://www.php.net/manual/en/function.create-function.php

Kirk

 -Original Message-
 From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Variable (naming them) Functions.
 
 Hello everyone:
  
 I was wondering, does anyone of you know a method to declare 
 a function
 (give it a name) basing on a value acquired during run time? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions.

2001-04-27 Thread PHPBeginner.com

create_function seems not letting you choosing it's name.

am I right, or there's a way to say: create_function($name.$to.be, args,
args, args)?


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 1:03 AM
To: 'PHP General List. (E-mail)'
Subject: RE: [PHP] Variable (naming them) Functions.


Did you see create_function()? Not sure if this is what you are after, but
http://www.php.net/manual/en/function.create-function.php

Kirk

 -Original Message-
 From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Variable (naming them) Functions.

 Hello everyone:

 I was wondering, does anyone of you know a method to declare
 a function
 (give it a name) basing on a value acquired during run time?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions.

2001-04-27 Thread Johnson, Kirk

It lets you choose the variable name which you use when referencing the
function, but the actual function name is set by PHP (as lambda_1, lambda_2,
etc.)

?
$test=myFunction;
$$test = create_function('$a,$b','return log($a * $b);');
echo myFunction is .$myFunction(2,2).br;
? 

Kirk

 -Original Message-
 From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 10:27 AM
 To: Johnson, Kirk; 'PHP General List. (E-mail)'
 Subject: RE: [PHP] Variable (naming them) Functions.
 
 
 create_function seems not letting you choosing it's name.
 
 am I right, or there's a way to say: 
 create_function($name.$to.be, args,
 args, args)?
 
 
 Sincerely,
 
  Maxim Maletsky
  Founder, Chief Developer
 
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 
 
 
 
 -Original Message-
 From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 28, 2001 1:03 AM
 To: 'PHP General List. (E-mail)'
 Subject: RE: [PHP] Variable (naming them) Functions.
 
 
 Did you see create_function()? Not sure if this is what you 
 are after, but
 http://www.php.net/manual/en/function.create-function.php
 
 Kirk
 
  -Original Message-
  From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
  Subject: [PHP] Variable (naming them) Functions.
 
  Hello everyone:
 
  I was wondering, does anyone of you know a method to declare
  a function
  (give it a name) basing on a value acquired during run time?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Grand Opening

2001-04-27 Thread Merchandise WholeSale


First off I would like to Thank You for taking time to read this 
letter. Second of all your e-mail address was pulled from an on-line 
source, if this was unsolicited from an unclean source we're very sorry, 
but you will not receive any other e-mails from us. This is the only  last 
message you'll receive from us, so you don't have to worry about an 
unsubscribe list or spam. Nor will we give your e-mail out to any one else. 
I'd like to stop, and tell you about a new ON-LINE Retail store. 
Merchandise Wholesale, a retail store that has over 2,000 products  for 
home,travel,jewelry,personal needs etc... Please take time out when you 
have it to browse our ON-LINE directory at  
http://www.merchandisewholesale.com  Click on any images of the item to 
enlarge. Our site is always under constant change for the better. 

Thanks for your precious time, HTTP://MERCHANDISEWHOLESALE.COM
  
   [EMAIL PROTECTED]
   
   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] nesting php

2001-04-27 Thread Brendan Caulfield

Hello everyone!

I am trying to pass a variable in a url and can't seem to do it.  The problem is, the 
url is already being determined by a php if statement.  So, when I get to the part 
where I try to append the url I get parse errors. What I would ideally like to do is 
generate the url using php and append the url with a variable, also using php.  The 
variable is a username, therefore i need to use (urlencode()).  Any ideas.

Thanks, 

Brendan


_
Start your day everyday with fellow Sigma Nu brothers. Visit http://www.SigmaNu.com, 
Sigma Nu's exclusive private label start page, where you'll get Fraternity news, New 
York Times news, custom stock portfolios, up-to-the-minute sports scores, current 
weather conditions and five-day forecasts, online shopping with brand name stores, 
web-based Sigma Nu e-mail and much more. This is a free service brought to you by 
Sigma Nu. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Storing php-code in mysqlDB

2001-04-27 Thread heinisch

Hi folks,
I try to store phpcode in a mysql-database, to have them ready, when 
they´ll be needed
When I request these, it seems that they will not be parsed.
Any suggestion?
some code:

// the result comes from an object function
while ($obj - Fetchinto($row)) // as long as there are results
{
$query=$row[0]; // now the query is in $row[0]

echo QUERY $querybr; // now you can see the query
// the query shown looks like this
// SELECT count(lfd) FROM $row[0] WHERE yy = $start_y AND mm = $start_m
// but there should be values instead of vars (BTW there are values in the 
vars)
snipp

Thanks in advance
Oliver


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] nesting php

2001-04-27 Thread Jason Brooke

 Hello everyone!

 I am trying to pass a variable in a url and can't seem to do it.  The
problem is, the url is already being determined by a php if statement.
So, when I get to the part where I try to append the url I get parse errors.
What I would ideally like to do is generate the url using php and append the
url with a variable, also using php.  The variable is a username, therefore
i need to use (urlencode()).  Any ideas.

 Thanks,

 Brendan

The short answer is 'yes, just do it'
Paste the code that's giving you errors and someone will help you

jason




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Storing php-code in mysqlDB

2001-04-27 Thread Jason Murray

 I try to store phpcode in a mysql-database, to have them ready, when 
 they´ll be needed
 When I request these, it seems that they will not be parsed.
 Any suggestion?

Eval() it.

http://www.php.net/manual/en/function.eval.php

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
What'll Scorpy use wormhole technology for?
'Faster pizza delivery.'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] A lot of records

2001-04-27 Thread PHPBeginner.com

search for a such class on the web.

tip: don't select everything, LIMIT your search with LIMIT 100, 20 to select
the records from 100 to 120.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 28, 1998 1:27 AM
To: php-general
Subject: [PHP] A lot of records


Hi,

After a querry on a dBase I get to much result to insert them in one
page, so I have to count them in blocks of, let say 20 records; I used
the count() function to get the number of records in result, but I don't
figure what to do after...

Regards and thanks for your help

Marc

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable (naming them) Functions.

2001-04-27 Thread Christian Reiniger

On Friday 27 April 2001 17:08, PHPBeginner.com wrote:
 no classes CAN'T solve my problem:

 it is an abstraction layer. called as func_hello(); I want, inside
 func_hello() {} declare a new function based on what happened before
 func_hello() was called. In other words: I of course though about
 classes, and there is in fact a work around, but I need to know if
 'function $var($arg) { return; }' syntax exists and what it is.

 in the docs there's nothing being said.

http://php.net/create_function
(maybe together with a little wrapper:
$foo = create_function (...);
$FNames [$var] = $foo;
function delta ($FuncName, $args) {
  return ${$FNames[$FuncName]} ($args);
}
)

But such a thing is an ugly hack and I'm sure you don't need it.


-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] explode won't explode

2001-04-27 Thread Christian Reiniger

On Friday 27 April 2001 14:15, Tom Beidler wrote:
 I have the following code that doesn't seem to explode. I'm trying to
 make a field that looks like 21,23,25,27 or small,medium,large,x-large
 into a pulldown menu with the individual item broken out.

 if (($size != )  ($size != n/a)) {
$sizearry = explode(,, $size);
while (list($key,$value) = each($sizearry)) {
$size_option_block .= option value=\$value\$size/option\n;

Why are yo using $size (the unexploded string) in the last line?

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Storing php-code in mysqlDB

2001-04-27 Thread PHPBeginner.com

YOU ARE GENIUS!

I don't think Jason you have read my previous posts here, but your answer to
Oliver might be able to solve my problem.

still have some BIG doubts on it, but it gave me an idea of a try.

Thanks,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Jason Murray [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 2:33 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP] Storing php-code in mysqlDB


 I try to store phpcode in a mysql-database, to have them ready, when
 they´ll be needed
 When I request these, it seems that they will not be parsed.
 Any suggestion?

Eval() it.

http://www.php.net/manual/en/function.eval.php

Jason

--
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
What'll Scorpy use wormhole technology for?
'Faster pizza delivery.'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] rounding up

2001-04-27 Thread Joseph Bannon

What is the best seamless way to upgrade/update PHP?

Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] line break part2

2001-04-27 Thread Gary

Thanks for everyone's help on the original question. Now that I have 
gotten the line breaks in a file, How do I get the file out with the 
breaks? Also, does anyone know of a good tutorial on file formatting.


?php
$location = log_test.txt;
$toread = fopen($location, r);
set_magic_quotes_runtime(0);
$content = fread($toread, filesize($location));
fclose($toread);
echo $content;
?

TIA
Gary


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sending content-type header after session_start()

2001-04-27 Thread matt . wong

Hello,

please correct me if I'm wrong, but it seems that in PHP 4, after calling
session_start(), you are stuck with serving an HTML page.

What if you want to call session_start(), but you want to send headers
after the session has started? for example, I'd like to deliver a 
downloadable file, but before I deliver that file, I'd like to check the 
user's session and make sure that the user is logged in and that the user 
has proper authorization to access the file.

I've got a workaround for this problem (see below). However, I would prefer
to handle the problem with the built-in session handling functions. Does
anyone know if this can be done?
Thanks
-Matt
?php
/
this page serves a request to download a file. The file should
not be served unless the user has authorization to view this file. To
check that authorization, the user must be logged in
/
function my_session_start() {
// decode session data, if any
if($GLOBALS[PHPSESSID]) {
$fname = /tmp/sess_.$GLOBALS[PHPSESSID]; // file path hardcoded
for this example
$fcontents = @file($fname);
if($fcontents) {
$fcontents = implode(, $fcontents);
include(User.phpc); // defines the User object stored in the session
session_decode ($fcontents);
}
}
}
/ start processing the page
get session data, and still allow content type headers to be sent.
why doesn't the built-in session_start() allow this?
/
my_session_start();
$s_user = $HTTP_SESSION_VARS[s_user];
if(!$s_user) {
$err = user not logged in;
} else {
// pseudo code from here on
if(!$s_user-has_authorization_to_download_requested_file()) {
$err = user not logged in, or has no authorization to download this
file;
} else {
header(content-type: .requested_file_mime_type());
output_requested_file_data();
}
}
}
if($err) echo Error: $err;
?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: SV: [PHP] PHP Book?

2001-04-27 Thread Christian Reiniger

On Friday 27 April 2001 15:15, Johan Holst Nielsen wrote:
  Hey everyone...
 
  I've been programming in perl for about 3 years now, i have installed
  php and have been working on it for about three weeks. I started by

 Try Core PHP Programmning, it's have a lot of good stuff!

That book is definitely the wrong choice for someone with 3 years perl 
experience (perhaps unless there's a second edition).  The copy I 
unfortunately bought is built somehow like that:

5 pages useful intro
45 pages explaining basic language contructs [1]
4 pages explaining classes
11 pages giving a (small) overview of using print(), getting data from 
forms, file upoads, env-vars, cookies, include/require and file IO
340 pages function references (copied from the manual) [2]

After that comes the somehow useful part - overviews of common task areas 
- using databases, string munging, ...
But that's only quick overviews, and some of the topics are just about 
generic (language independent) stuff, e.g. the description of basic 
sorting algorithms (the stuff you do *not* want to use in PHP :)

Well, it gets one plus point because it includes an ASCII chart :)

So: forget about that book. If at all, you'll quickly glance over it and 
then let it collect dust forever.


[1]: Perl is very similar in this area. Just looking through the manual 
will be better (and quicker) than reading that book section

[2]: completely uses - the online manual is much quicker to search and 
much more up to date (the book only covers PHP3)


-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Syntax for select statement

2001-04-27 Thread Christian Reiniger

On Friday 27 April 2001 17:56, Don Pro wrote:

 $queryID = mysql_query(SELECT Country, Agent FROM Ports
 WHERE Portname = '$portname');

 My question is, if the variable $portname has the ' character within
 in, will this cause an error in my select statement?  If the answer is
 Yes, can someone give me a more robust way of writing it using PHP?

Yes.
use addslashes()

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions. DONE! DONE! DONE!

2001-04-27 Thread PHPBeginner.com


Guys,
I think LORD just looked down here in Tokyo, seen me still typing at 3.15am
of Friday night, smoking the third pack of that nasty Marlboros, having no
dinner, with no even a cup coffee remained... and sent to the list that
GENIUS of Jason Murray who solved my problem.

I know, Jason, you didn't mean it, but it REALLY helped me:


  $fname = 'hello';

  $func = sprintf(
  function %s(\$v='') {
Return \\$vBR\;
  },
  $fname
  );

  eval($func);
  echo $fname('Please print it please');

  // And it did!


a dynamic function! I got it.

with eval() I can call it as I wish!

I have no idea, HOW ON THE EARTH could I ever forget about magic EVAL().

I solved it!
Everyone, take a note of this code, as it causes some sleepless nights and
'unhappy' girlfriends to some people. :-)

Thanks everybody,
Jason and Oliver in particular!


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com





-Original Message-
From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 2:48 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable (naming them) Functions.


On Friday 27 April 2001 17:08, PHPBeginner.com wrote:
 no classes CAN'T solve my problem:

 it is an abstraction layer. called as func_hello(); I want, inside
 func_hello() {} declare a new function based on what happened before
 func_hello() was called. In other words: I of course though about
 classes, and there is in fact a work around, but I need to know if
 'function $var($arg) { return; }' syntax exists and what it is.

 in the docs there's nothing being said.

http://php.net/create_function
(maybe together with a little wrapper:
$foo = create_function (...);
$FNames [$var] = $foo;
function delta ($FuncName, $args) {
  return ${$FNames[$FuncName]} ($args);
}
)

But such a thing is an ugly hack and I'm sure you don't need it.


--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Error 032: Recursion error - see error 032

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] line break part2

2001-04-27 Thread PHPBeginner.com

just do 

$content_str = implode(\n, $content);

at the end of the file.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com



-Original Message-
From: Gary [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 2:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] line break part2


Thanks for everyone's help on the original question. Now that I have 
gotten the line breaks in a file, How do I get the file out with the 
breaks? Also, does anyone know of a good tutorial on file formatting.


?php
$location = log_test.txt;
$toread = fopen($location, r);
set_magic_quotes_runtime(0);
$content = fread($toread, filesize($location));
fclose($toread);
echo $content;
?

TIA
Gary


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php4 on RedHat 7.1

2001-04-27 Thread Peter H. Lemieux

Take a look at /var/log/httpd/error_log.  Is there an entry for the very
first time the server was run (before you installed PHP 4.04pl)?  Does
it list PHP/4.0 as installed?  The initial entry in my error_log from
the Wolverine beta of 7.1 shows:

[Fri Apr 27 12:36:13 2001] [notice] Apache/1.3.14 (Unix) 
(Red-Hat/Linux) mod_ssl/2.7.1 OpenSSL/0.9.5a DAV/1.0.2 PHP/4.0.4pl1
mod_perl/1.24_01 configured -- resuming normal operations
[Fri Apr 27 12:36:13 2001] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)

In my case the PHP module was loaded by default (along with ssl and
mod_perl) when I chose the install everything option in RedHat.

If it appears in the log, then the module is running.  Put a file called
info.php into /var/www/html with just the line 

? phpinfo() ? 

in it.  What happens when you view it from a browser?

If it's still not working, I suggest you try uninstalling your version
of PHP and installing the PHP4 rpm that comes with RedHat instead. 
Works fine for me.  

Peter 



. wrote:
 
 Yes, it has that in there right out of the box like this:
 
 IfDefine HAVE_PHP4
 LoadModule php4_modulemodules/libphp4.so
 /IfDefine
 #
 # AddType: allows you to tweak mime.types without actually editing it, or to
 # make certain files to be certain types.
 #
 # The following is for PHP4 (conficts with PHP/FI, below):
 IfModule mod_php4.c
   AddType application/x-httpd-php .php4 .php3 .phtml .php
   AddType application/x-httpd-php-source .phps
 /IfModule
 
 It comes like that from a clean install of RH 7.1, but why is it not
 working?  Any Ideas?
 
 Ralph Guzman wrote in message ...
 Your httpd.conf configuration should look something like this:
 
 AddType application/x-httpd-php .php .phtml .php3 .php4
 AddType application/x-httpd-php-source .phps
 
 -Original Message-
 From: j2n tech [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 26, 2001 8:42 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php4 on RedHat 7.1
 
 
 I'm trying to get a webmail client to work under RH 7.1 with Apache 1.3.19.
 I downloaded php-4.0.4pl and configured and installed it.  Now when I try
 to
 bring up a php page it trys to download it instead of execute.  I added the
 AddType line for php4 in my httpd.conf but it made no difference.  I
 noticed Apache 1.3.19 with RH7.1 treats modules differently with the
 IfDefine functions...am i missing something here?  Anybody have any idea
 how
 I might be able to get this to work?
 
 Thanks.
 
 --j2n.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable (naming them) Functions.

2001-04-27 Thread Yasuo Ohgaki

Variable functions?

?php
foo () {
  echo 'this is foo';
}

bar () {
  echo 'this is bar';
}

$var = $HTTP_GET_VARS['fname'];

$$var();
?

http://localhost/some_script.php?fname=foo

prints this is foo;

http://localhost/some_script.php?fname=bar

print this is bar

Regards,
--
Yasuo Ohgaki


Maxim Maletsky [EMAIL PROTECTED] wrote in message
DC017B079D81D411998C009027B7112A015ED16A@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED16A@EXC-TYO-01...
 Hello everyone:

 I was wondering, does anyone of you know a method to declare a function
 (give it a name) basing on a value acquired during run time?

 I tried using the syntax as of a variable function call:


 snip

$fname = 'hello';
function { sprintf(%s, $fname) }($arg='') {
   Return I named you : $fname;
}
echo $fname($fname);
# no luck...


function {$fname}($arg='') { 
# nope...


function $fname($arg='') { 
# neither...

 /snip

 and so on... all parse errors...



 Any way to do it?

 I am looping an array with some function names checking if a function was
 declared already, and if not then declare, if yes - give a different name.

 I also went through these bibles:
http://www.php.net/manual/en/ref.funchand.php
 http://www.php.net/manual/en/ref.funchand.php
 but found nothing that helps.

 Thanks in advance,
 Sincerely,

  Maxim Maletsky
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
   www.phpbeginner.com http://www.phpbeginner.com









 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP Book?

2001-04-27 Thread Kath

I agree 100% with Professional PHP Programming.  It was my first book.

Also php fast and easy web development by Julie Meloni.

- Kath

- Original Message -
From: Angerer, Chad [EMAIL PROTECTED]
To: 'Hamed Nik' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 9:21 AM
Subject: RE: [PHP] PHP Book?


 Professional PHP by WROX.  Great book.  It provides you with some real
world
 examples.

 Chad Angerer
 HTML Programmer
 Internet Broadcasting Systems
 651.365.4006


 -Original Message-
 From: Hamed Nik [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 27, 2001 8:10 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] PHP Book?


 Hey everyone...

 I've been programming in perl for about 3 years now, i have installed php
 and have been working on it for about three weeks. I started by converting
 some of the programs I've written in Perl to PHP it seems its pretty
 similar to Perl and not very hard to learn for a perl programmer... but i
 need some reference book with some practical examples so i could work
 with... and probably something that gives me ideas on different types of
 programs and things that i could do in PHP... something that covers
 everything in PHP... and is NOT copied from the manual! :))

 I am sure most of you in this group have got some sort of a PHP book...
can
 you please tell me out of your experience which ones are good for me to
buy?

 Regards
 Hamed Nik




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP4, .php3 files and Apache

2001-04-27 Thread Kath

I run a Debian 2.2 server with Apache (from stable) and PHP4 (from stable).

I downloaded phpChat in order to setup a chat center on the website.  However, the 
files are named .php3.  

At first I thought I could be cute and just rename the files to .php, as .php is what 
we name our files on our web server.  However, I realized that all the links would not 
work, as the links and includes()/requires() in the files would call to the wrong name.

Now is there anyway to make Apache run a .php3 file with PHP4?  I should just need to 
add that extension somewhere in Apache (srm.conf), but I'm not familiar with how.

- Kath



Re: [PHP] line break part2

2001-04-27 Thread Philip Olson

Have a look at file() :

  http://www.php.net/manual/en/function.file.php

  $lines = file('log_test.txt');

  echo $lines[4]; // prints line #5


regards,
philip


On Fri, 27 Apr 2001, Gary wrote:

 Thanks for everyone's help on the original question. Now that I have 
 gotten the line breaks in a file, How do I get the file out with the 
 breaks? Also, does anyone know of a good tutorial on file formatting.
 
 
 ?php
 $location = log_test.txt;
 $toread = fopen($location, r);
 set_magic_quotes_runtime(0);
 $content = fread($toread, filesize($location));
 fclose($toread);
 echo $content;
 ?
 
 TIA
 Gary
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variable (naming them) Functions.

2001-04-27 Thread Philip Olson


for point of reference regarding this thread :

  http://www.php.net/manual/en/functions.variable-functions.php


regards,
philip


On Sat, 28 Apr 2001, Yasuo Ohgaki wrote:

 Variable functions?
 
 ?php
 foo () {
   echo 'this is foo';
 }
 
 bar () {
   echo 'this is bar';
 }
 
 $var = $HTTP_GET_VARS['fname'];
 
 $$var();
 ?
 
 http://localhost/some_script.php?fname=foo
 
 prints this is foo;
 
 http://localhost/some_script.php?fname=bar
 
 print this is bar
 
 Regards,
 --
 Yasuo Ohgaki
 
 
 Maxim Maletsky [EMAIL PROTECTED] wrote in message
 DC017B079D81D411998C009027B7112A015ED16A@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED16A@EXC-TYO-01...
  Hello everyone:
 
  I was wondering, does anyone of you know a method to declare a function
  (give it a name) basing on a value acquired during run time?
 
  I tried using the syntax as of a variable function call:
 
 
  snip
 
 $fname = 'hello';
 function { sprintf(%s, $fname) }($arg='') {
Return I named you : $fname;
 }
 echo $fname($fname);
 # no luck...
 
 
 function {$fname}($arg='') { 
 # nope...
 
 
 function $fname($arg='') { 
 # neither...
 
  /snip
 
  and so on... all parse errors...
 
 
 
  Any way to do it?
 
  I am looping an array with some function names checking if a function was
  declared already, and if not then declare, if yes - give a different name.
 
  I also went through these bibles:
 http://www.php.net/manual/en/ref.funchand.php
  http://www.php.net/manual/en/ref.funchand.php
  but found nothing that helps.
 
  Thanks in advance,
  Sincerely,
 
   Maxim Maletsky
   Founder, Chief Developer
   PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
www.phpbeginner.com http://www.phpbeginner.com
 
 
 
 
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Variable (naming them) Functions.

2001-04-27 Thread PHPBeginner.com

no, I knew that,

my problem was generating functions with dynamic names.

I solved it with a simple eval(), see my last post below;

Thanks, Yasuo,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Yasuo Ohgaki [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 3:27 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable (naming them) Functions.


Variable functions?

?php
foo () {
  echo 'this is foo';
}

bar () {
  echo 'this is bar';
}

$var = $HTTP_GET_VARS['fname'];

$$var();
?

http://localhost/some_script.php?fname=foo

prints this is foo;

http://localhost/some_script.php?fname=bar

print this is bar

Regards,
--
Yasuo Ohgaki


Maxim Maletsky [EMAIL PROTECTED] wrote in message
DC017B079D81D411998C009027B7112A015ED16A@EXC-TYO-01">news:DC017B079D81D411998C009027B7112A015ED16A@EXC-TYO-01...
 Hello everyone:

 I was wondering, does anyone of you know a method to declare a function
 (give it a name) basing on a value acquired during run time?

 I tried using the syntax as of a variable function call:


 snip

$fname = 'hello';
function { sprintf(%s, $fname) }($arg='') {
   Return I named you : $fname;
}
echo $fname($fname);
# no luck...


function {$fname}($arg='') { 
# nope...


function $fname($arg='') { 
# neither...

 /snip

 and so on... all parse errors...



 Any way to do it?

 I am looping an array with some function names checking if a function was
 declared already, and if not then declare, if yes - give a different name.

 I also went through these bibles:
http://www.php.net/manual/en/ref.funchand.php
 http://www.php.net/manual/en/ref.funchand.php
 but found nothing that helps.

 Thanks in advance,
 Sincerely,

  Maxim Maletsky
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
   www.phpbeginner.com http://www.phpbeginner.com










 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >