[PHP-DB] Differences between php3 and php4

2003-02-22 Thread Y Al Hinai

Hi everyone..

I am new to php.  I have PHP4.2.3 installed with Apache on my computer.  I was 
practicing on the language from a book called PHP essentials by Julie C Meloni.  I 
am facing many problems as many functions from php3 are not working anymore in PHP4!  
For example, header(), include(mydata.txt); and mail().  Also, to recieve variables 
from an HTML form, i had to add HTTP_POST_VARS()!! how would I know that i have to 
add that?!.  I have many similar problems due to the differences between the two 
version.  I have 2 questions:

1. Is there any source (book or URL or whatever)  that shows what have been changed 
between php3 and php4 and what are the new functions or values are? Something like a 
table or differences in functions.

2. How do u get the mail() and include() to work?  
Also, who do u get header() to header() function to work in PHP4??  This is the code i 
am using for the header() followed by the error message:
===CODE
if (!isset($PHP_AUTH_USER)) {
  // If empty, send header causing dialog box to appear
  header('WWW-Authenticate: Basic realm=My_Private_Stuff');
  header('HTTP/1.0 401 Unauthorized');  
  echo 'Authorization Required.';
  exit;
 }
 // If not empty, display values for variables
else {
   echo 
  PYou have entered this username: $PHP_AUTH_USERbr
  You have entered this password: $PHP_AUTH_PWbr
  The authorization type is: $PHP_AUTH_TYPE/p; }
===ERROR
Warning: Cannot add header information - headers already sent by (output started at 
C:\Program Files\Apache Group\Apache2\htdocs\auth.php:9) in C:\Program Files\Apache 
Group\Apache2\htdocs\auth.php on line 17

Warning: Cannot add header information - headers already sent by (output started at 
C:\Program Files\Apache Group\Apache2\htdocs\auth.php:9) in C:\Program Files\Apache 
Group\Apache2\htdocs\auth.php on line 18
Authorization Required.

Please help me here ...



-
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more

Re: [PHP-DB] Differences between php3 and php4

2003-02-22 Thread Leif K-Brooks


Y Al Hinai wrote:

include(mydata.txt);

Should be:
include('mydata.txt');
1. Is there any source (book or URL or whatever)  that shows what have been changed between php3 and php4 and what are the new functions or values are? Something like a table or differences in functions.

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

2. How do u get the mail() and include() to work?  
Also, who do u get header() to header() function to work in PHP4??  This is the code i am using for the header() followed by the error message:

There can't be ANY output before a call to header().  That includes 
spaces and new lines before ?php.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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