[PHP-DB] How to write errorhandling??

2001-10-21 Thread Luditus

Hi Fokes,

I would like to send an mail via the mail function.

If the mail failes I would like to redirect to an errorpage. Currently my
code looks like this:

 if ( mail($email,$subject_confirm_account, $message_confirm_account,
$from_confirm_account) ){
  HEADER(Location:index.php?fuseaction=txtmsg=registered); //success
 }
 else{
  HEADER(Location:index.php?fuseaction=txtmsg=mailproblem); // mail could
not been sent
 };

Unfortunatelly I get an erromessage like that:

Warning: Failed to Connect in
e:\projects\globosapiens\07_production\actual\account\include\user.php on
line 256

Warning: Cannot add header information - headers already sent by (output
started at
e:\projects\globosapiens\07_production\actual\account\include\user.php:256)
in e:\projects\globosapiens\07_production\actual\account\include\user.php on
line 260

Where is the problem??? I can't see it.

Maybe one of you guys could help me out.

Thanx in advance,

Luditus



-- 
PHP Database 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-DB] Gestion de championnat

2001-10-21 Thread DAVID1980


Salut tout le monde.

Quelqu'un a-t-il déjà trouvé qq part ou fais un scripts qui gererai un
championnat de football type D1- D2 avec classsements divers et
journée...

Merci

David


--
PHP Database 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-DB] Add Record to DB and Return Auto_Increment ID?

2001-10-21 Thread Brett Conrad

Hi.

I'm creating a class mapped to the functions of a guestbook.  Each guestbook
submission becomes an entry in a db table.  I am using the DB Pear class.

I'm new to PHP and my question is this:

What is the best way to create a method that adds a new guestbook entry and
returns its auto_increment id.  I could use an Insert statement and then a
Select statement to find out what id was added for the record, but that
seems a little inefficient.  Any ideas?

Thanks for any help.  Much appreciated,

Brett



-- 
PHP Database 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-DB] Add Record to DB and Return Auto_Increment ID?

2001-10-21 Thread Ben Edwards

Do the insert missing out auto_increment column and then get it afterwoods 
with.

$key = mysql_insert_id();

This actually is cleared on next database access, there is another function 
that is not (cant remember other function and I may of got them the wrong 
way round).

If you are new to PHP you should look things up in the manual, there is a 
PDF and web searchable version for both MySQL and PHP.  Search for 
AUTO_INCREMENT.

Although I am impressed you are using db list not general one ;)

Ben

At 07:15 P 21/10/01, Brett Conrad wrote:
Hi.

I'm creating a class mapped to the functions of a guestbook.  Each guestbook
submission becomes an entry in a db table.  I am using the DB Pear class.

I'm new to PHP and my question is this:

What is the best way to create a method that adds a new guestbook entry and
returns its auto_increment id.  I could use an Insert statement and then a
Select statement to find out what id was added for the record, but that
seems a little inefficient.  Any ideas?

Thanks for any help.  Much appreciated,

Brett



--
PHP Database 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]

**
* Ben Edwards+352 091 429995 *
* Homepagehttp://www.gifford.co.uk/~bedwards *
* i-Contact Progressive Videohttp://www.videonetwork.org *
* Smashing the Corporate image http://www.subvertise.org *
* Bristol's radical newshttp://www.bristle.co.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8   *
**


-- 
PHP Database 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-DB] Asigning function values to variables??

2001-10-21 Thread Luditus

Hi there,

I am trying to send an email with html tags coming from functions.
Something is wrong with asigning the value to the variable. I guess I don't
know the proper syntax.

Can anybody help me out?

e.g.:

$body .= .box_header('test').;
$body .= h1text/h1;
$body .= .box_footer().;


Thanx in advance

Luditus




-- 
PHP Database 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-DB] How to write errorhandling??

2001-10-21 Thread Luditus

Unfortunatelly this doesn't work at all. Same error. Any other ideas?

Cheers

Luditus


Attila Strauss [EMAIL PROTECTED] schrieb im Newsbeitrag
01102113081306.00694@pluto">news:01102113081306.00694@pluto...
 hi

 do an

 exit;

 after the header();

 cu
 attila



 On Sunday 21 October 2001 12:45, Luditus wrote:
  Hi Fokes,
 
  I would like to send an mail via the mail function.
 
  If the mail failes I would like to redirect to an errorpage. Currently
my
  code looks like this:
 
   if ( mail($email,$subject_confirm_account, $message_confirm_account,
  $from_confirm_account) ){
HEADER(Location:index.php?fuseaction=txtmsg=registered); //success
   }
   else{
HEADER(Location:index.php?fuseaction=txtmsg=mailproblem); // mail
  could not been sent
   };
 
  Unfortunatelly I get an erromessage like that:
 
  Warning: Failed to Connect in
  e:\projects\globosapiens\07_production\actual\account\include\user.php
on
  line 256
 
  Warning: Cannot add header information - headers already sent by (output
  started at
 
e:\projects\globosapiens\07_production\actual\account\include\user.php:256)
  in
e:\projects\globosapiens\07_production\actual\account\include\user.php
  on line 260
 
  Where is the problem??? I can't see it.
 
  Maybe one of you guys could help me out.
 
  Thanx in advance,
 
  Luditus



-- 
PHP Database 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-DB] Re: Asigning function values to variables??

2001-10-21 Thread Christian Kuhtz

Luditus wrote:
[..]
 $body .= .box_header('test').;

Why are you double quoting what looks to be a function call?

And why is this posted to php.db?

-- 
PHP Database 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-DB] How to write errorhandling??

2001-10-21 Thread zpr


Attila Strauss [EMAIL PROTECTED] wrote in message
01102113081306.00694@pluto">news:01102113081306.00694@pluto...
 hi

 do an

 exit;

 after the header();

 cu
 attila



 On Sunday 21 October 2001 12:45, Luditus wrote:
  Hi Fokes,
 
  I would like to send an mail via the mail function.
 
  If the mail failes I would like to redirect to an errorpage. Currently
my
  code looks like this:
 
   if ( mail($email,$subject_confirm_account, $message_confirm_account,
  $from_confirm_account) ){
HEADER(Location:index.php?fuseaction=txtmsg=registered); //success
   }
   else{
HEADER(Location:index.php?fuseaction=txtmsg=mailproblem); // mail
  could not been sent
   };
 
  Unfortunatelly I get an erromessage like that:
 
  Warning: Failed to Connect in
  e:\projects\globosapiens\07_production\actual\account\include\user.php
on
  line 256
 
  Warning: Cannot add header information - headers already sent by (output
  started at
 
e:\projects\globosapiens\07_production\actual\account\include\user.php:256)
  in
e:\projects\globosapiens\07_production\actual\account\include\user.php
  on line 260
 
  Where is the problem??? I can't see it.
 
  Maybe one of you guys could help me out.
 
  Thanx in advance,
 
  Luditus

My experience is that ypu cannot use the header command if ypu type any text
or something like that before the header..   i had to place the header on
the top of the php page and if error goto header_func (of something like
that)..
i probably don't make sense..   to tired,  =)




-- 
PHP Database 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-DB] How to write errorhandling??

2001-10-21 Thread Matthew Loff


If you use the at symbol to supress the error message from being
printed, the if() statement will still recognize an error has
occurred... So, try this:

 if (@mail($email,$subject_confirm_account, $message_confirm_account,
$from_confirm_account)) {
HEADER(Location:index.php?fuseaction=txtmsg=registered);
//success
 } else {
HEADER(Location:index.php?fuseaction=txtmsg=mailproblem); //
mail could not been sent
 };


-Original Message-
From: Luditus [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, October 21, 2001 6:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to write errorhandling??


Hi Fokes,

I would like to send an mail via the mail function.

If the mail failes I would like to redirect to an errorpage. Currently
my
code looks like this:

 if ( mail($email,$subject_confirm_account, $message_confirm_account,
$from_confirm_account) ){
  HEADER(Location:index.php?fuseaction=txtmsg=registered); //success
 }
 else{
  HEADER(Location:index.php?fuseaction=txtmsg=mailproblem); // mail
could
not been sent
 };

Unfortunatelly I get an erromessage like that:

Warning: Failed to Connect in
e:\projects\globosapiens\07_production\actual\account\include\user.php
on
line 256

Warning: Cannot add header information - headers already sent by (output
started at
e:\projects\globosapiens\07_production\actual\account\include\user.php:2
56)
in
e:\projects\globosapiens\07_production\actual\account\include\user.php
on
line 260

Where is the problem??? I can't see it.

Maybe one of you guys could help me out.

Thanx in advance,

Luditus



-- 
PHP Database 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 Database 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-DB] How to write errorhandling??

2001-10-21 Thread Pierre-Alain Joye


Hello,

 Warning: Cannot add header information - headers already sent by (output
 started at
 e:\projects\globosapiens\07_production\actual\account\include\user.php:256)
 in e:\projects\globosapiens\07_production\actual\account\include\user.php
 on line 260

 Where is the problem??? I can't see it.
You don't have to send anything else than headers or data that uses header 
(cookies) before use any header functions. This error is probably due to an 
echo/print or you keep a space before ?.

To avoid php error/warning/notice or simply to debug/custom messages, take a 
look to the set_error_handler/user_error/trigger_error functions in the 
documentation.

They are prettz usefull to make a fully transparent error management system. 
Your client will not see classic ugly messages. Another nice use is to debug 
http headers functions.

Inside your own error_handler function you are able to write messages to 
syslog (only on winnt/*nix, not winMe/9x), files, or whatever you want (or 
directly in the header itself header(X-Debug-1: this a message) ).

Hope that helps,

pa

-- 
PHP Database 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-DB] Mortgage Rates Are At Their Lowest!!!

2001-10-21 Thread quackerstheduck

We can help!
Mortgage Rates have been slashed again!

*Lower your monthly payment!
*Shorten the term of your loan!
*Reduce your interest rate!

SAVE MONEY!!!

NOW is the time to refinance... rates have
NEVER been lower!

We CAN assist everyone, even if you've 
been turned down before!

Take just a minute to complete this form
and a Loan Consultant will contact you at
your convenience. 

http://www.firstmortgagedebt.com


Your information is secure, confidential and
you are under NO OBLIGATION for this
free analysis.


Since you have received this message you have either responded
to one of our offers in the past or your address has been
registered with us.  If you wish to be removed please reply to:
mailto:[EMAIL PROTECTED]?subject=remove
**


-- 
PHP Database 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-DB] Re: fulltext not for me/alternatives

2001-10-21 Thread Ben Edwards


Is there a way to get mysql to change the default from 3 to 2 letter words (or
less) that are ignored in fulltext indexes?
I'm running version 4 alpha. I checked the TODO and it's not listed. Is it
possible to make this a config.h option?

As I said I am on a shared host and don't have the option to recompile 
MySQL.  The answer is yes, it is in an .h file (or something like that).

  A minimum of 4 letters for a word to be
included in a fulltext index seems a bit restrictive.

My point exactly ;)  But this is what it is (4 letters).  Penelizes us non 
hardcore commercial users who can't afford our own box.

The latest documentation categorically states there is no other way of 
changing this.



**
* Ben Edwards+352 091 429995 *
* Homepagehttp://www.gifford.co.uk/~bedwards *
* i-Contact Progressive Videohttp://www.videonetwork.org *
* Smashing the Corporate image http://www.subvertise.org *
* Bristol's radical newshttp://www.bristle.co.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8   *
**


-- 
PHP Database 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-DB] Re: fulltext not for me/alternatives

2001-10-21 Thread Ben Edwards


See the manual, and SHOW VARIABLES LIKE 'ft_%'

Looks like this is something new to 4.  My ISP has 20+ db servers so reckon 
it will be a while before they roll 4 out.  Will email them.  Thanks for 
the info.

However this douse not help me in the immediate future and I still need to 
find a alternative fullsearch method.

Ben



**
* Ben Edwards+352 091 429995 *
* Homepagehttp://www.gifford.co.uk/~bedwards *
* i-Contact Progressive Videohttp://www.videonetwork.org *
* Smashing the Corporate image http://www.subvertise.org *
* Bristol's radical newshttp://www.bristle.co.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8   *
**


-- 
PHP Database 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-DB] Re: fulltext not for me/alternatives

2001-10-21 Thread Sergei Golubchik

Hi!

On Oct 21, Mark Maunder wrote:
 Ben Edwards wrote:
 
  I have a bit of a problem with using freetext indexes because there are a
  LOT of important 3 letter words in my database and as I am using shared
  hosting so do not have the option to recompile MySql.  Can't quite figure
  why 3 is not the default (car, dog, cat war, man, bed, ).  Maybe so you
  would have to recompile to be able to find s_e_x ;).
 
 Is there a way to get mysql to change the default from 3 to 2 letter words (or
 less) that are ignored in fulltext indexes?
 I'm running version 4 alpha. I checked the TODO and it's not listed. Is it
 possible to make this a config.h option? A minimum of 4 letters for a word to be
 included in a fulltext index seems a bit restrictive.

Well, if it's not in the todo, it's probably, already done, isn't it ?

See the manual, and SHOW VARIABLES LIKE 'ft_%'

Regards,
Sergei

-- 
MySQL Development Team
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
   ___/

-- 
PHP Database 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-DB] HTTP User Authentication...

2001-10-21 Thread Beau Lebens

Hey there all,
apologies for being off-topic (had to change my subject because the filter
blocked me!), but I thought someone here may have worked with this before
since authentication and DBs tend to go hand-in-hand.

Here's my situation;
I have a web-based text editor, which requires a user/pass combo to access
it, this is controlled via PHP's very cool $PHP_AUTH_USER/$PHP_AUTH_PW
variables and 401 headers. this section does not allow a user called admin
to access it.

That works fine on its own

I also have an admin section for the administrator, where they can configure
users, access levels etc, which allows *only* a user called admin with the
right password, again using $PHP_AUTH_USER etc.

This section also works fine on its own.

The problems only appear when you open a browser, access the normal area (as
anyone except admin) then access the admin area, then go back to the normal
area. When you do this, it continually requests a user/pass combo to access
that area, every time you request a new page - it seems to not cache the
user/pass combo in this case...

any suggestions would be nmost, most appreciated!! :)

thanks

beau

-- 
Beau F Lebens, Technical Officer
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845

t: +61 8 9266-7297 (has voice-mail)
f: +61 8 9266-2503 (ATT: Beau Lebens)
e: [EMAIL PROTECTED]
w: http://learnt.smec.curtin.edu.au/

-- 
PHP Database 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-DB] MSAccess2000, SQL, and Escape Characters

2001-10-21 Thread Ari M. Roth

Hey all...

Does anyone know how Microsoft Access 2000 handles escaping apostrophes in SQL 
statements?  I tried back-slashing (\') them out, but that didn't work (i.e, insert 
into blah values(1, 'Bob', 'Bob\'s stuff')).  And since that didn't work, 
addslashes(), of course, didn't work either.

Thanks.

Later...

-Ari