Re: [PHP] Javascript Mouseover Help NOT A JAVASCRIPT QUESTION

2004-03-18 Thread Raditha Dissanayake

   

It's not a javascript question, or problem. As I said in my original post,
it works fine if it's a regular html file. But when I put it in a variable
in php, then use that variable from an included file, the javascript is not
executed. What can I do to fix this?
 

Like i said you have to look at the mozilla javascript console which you 
obviously have not done.

Thanks,
Jake
 



--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

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


Re: [PHP] mail() to own domain not working

2004-03-18 Thread Gerard L Petersen
i found the problem thanks.

even though the MX records were pointing to a different server, since there
is an inactive mail server (qmail) installed on the server for local mail
delivery it would route it to the local server.

i disabled the mail server on localhost completely and now all mail gets
routed to the correct host according to the mx records on the DNS :)


- Original Message - 
From: Raditha Dissanayake [EMAIL PROTECTED]
To: Gerard L Petersen [EMAIL PROTECTED]
Cc: Php-General [EMAIL PROTECTED]
Sent: Wednesday, March 17, 2004 6:52 PM
Subject: Re: [PHP] mail() to own domain not working


 Gerard L Petersen wrote:

 Hi all
 
 Im having a problem with sending mails using the mail function to my own
 domain.
 Mails to any other domain works perfectly. Also our mail server sitting
on a
 different machine.
 
 Any ideas how to fix this?
 
 
 If you are getting any php related error messages please post those
 error messages to the list. If you are not getting any PHP errors please
 look at your mail server log file for details on what's happening. It
 could be purely a server configuration issue in which case you will have
 to post the message to a mailing list/newsgroup related your mail server.




 -- 
 Raditha Dissanayake.
 ---
 http://www.radinks.com/upload/
 Drag and Drop Upload thousands of files and folders in a single
 transfer.  (HTTP or FTP)


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



[PHP] Re: [about mail] I can't see main message either attached file what I

2004-03-18 Thread Xu
I solved this problem.
by edit headers and body about boundary.
here's modified source.

*** below this line is php source 
$boundary42 = md5(rand());
// Headers
$headers = ;
$headers .= From: $sender $senderemail\n;
$headers .= Subject: $subject\n;
$headers .= Return-Path: $senderemail\n;
$headers .= Errors-To: $senderemail\n;
$headers .= Content-Type: multipart/related;;
$headers .=  type=\multipart/alternative\;;
$headers .=  boundary=\$boundary42\;\n;
// Message
$message .= --$boundary42\n;
$message .= Content-Type: $usehtml; charset:EUC-KR;\n;
$message .= Content-Transfer-Encoding: quoted-printable;\n;
$message .= \n;
// text goes here
$message .= $ment;
$message .= \n;
// this ends the message
$message .= \n;
if ( $_FILES['attach']['error'] === 0 ) {
//??? ??
$tmpName = $_FILES['attach']['tmp_name'];
$fileName = $_FILES['attach']['name'];
$filePath = ./attach/;
$fileSize = $_FILES['attach']['size'];
$AttmFile = $filePath.$fileName;

move_uploaded_file( $tmpName, $AttmFile ) or die( ??? ?? );

// now we add attachments (images, etc)
$message .= \n\n--$boundary42\n;
$message .= Content-Type: .$_FILES['attach']['type'].; 
name=\.$fileName.\;\n;
$message .= Content-Disposition: inline; 
filename=\.$fileName.\;\n;
$message .= Content-Transfer-Encoding: base64;\n;
$message .= \n;

//file goes here
$fd=fopen ($AttmFile, r);
$FileContent=fread($fd,filesize($AttmFile));
fclose ($fd);
$FileContent=chunk_split(base64_encode($FileContent));
$message.=$FileContent;
$message .= \n--$boundary42--\n;
}
while ($co  $Total) {

// SMTP ??
$params['host'] = $smtphost;
$params['auth'] = true;
$params[username] = $smtpuser;
$params[password] = $smtppwd;
$mailer = Mail::factory('smtp', $params);
$mname = mysql_result($rst, $co, 0);
$email = mysql_result($rst, $co, 1);
//  $status =$mailer-send($email, $headers, $message);
$status = mail( $email, $Subject, $message, $headers );
if (PEAR::isError($status)) {
$fail++;
$failAddress[] = $email;
$failError[] = $status;
} else {
$success++;
}
$co++;
//  echo $email.br;
}
Xu ? ?:
I'm using Mail.php which is located in /usr/local/lib/php
I made a mail program by php.
Which is attaching a file.
But I guess there's problem in MIME syntax.
I don't know what is wrong...
What's the problem?

** Below this line is php codes. **
include Mail.php;
// defines header
$headers['Subject'] = $subject;
$headers['From'] = $sender. .$senderemail.;
$headers['Content-Type'] = multipart/related;
$headers['Return-Path'] = .$senderemail.;
$headers['Errors-To'] = .$senderemail.;
// message
$message .= --=MIME_BOUNDRY_message_parts\n;
$message .= Content-Type: $usehtml; \n;
$message .= Content-Transfer-Encoding: quoted-printable\n;
$message .= \n$ment\n;
$message .= --=MIME_BOUNDRY_message_parts--\n\n;
// Attachments

if ( $_FILES['attach']['error'] === 0 ) {
//Upload and Attach
$tmpName = $_FILES['attach']['tmp_name'];
$fileName = $_FILES['attach']['name'];
$filePath = ./attach/;
$fileSize = $_FILES['attach']['size'];
$AttmFile = $filePath.$fileName;

move_uploaded_file( $tmpName, $AttmFile ) or die( upload failed );

// now we add attachments
$message .= \n\n--=MIME_BOUNDRY_main_message\n;
$message .= Content-Type: .$_FILES['attach']['type'].;
name=\.$fileName.\;\n;
$message .= Content-Disposition: attachment;
filename=\.$fileName.\;\n\n;
$message .= Content-Transfer-Encoding: base64;\n;
$message .= \n;
//file goes here
$fd=fopen ($AttmFile, r);
$FileContent=fread($fd,filesize($AttmFile));
fclose ($fd);
$FileContent=chunk_split(base64_encode($FileContent));
$message.=$FileContent;
$message .= \n--=MIME_BOUNDRY_main_message\n;
}
// SMTP Connection
$params['host'] = $smtphost;
$params['auth'] = true;
$params[username] = $smtpuser;
$params[password] = $smtppwd;
$mailer = Mail::factory('smtp', $params);
$email = [EMAIL PROTECTED]; # use my email address for test.

// send and check status
$status =$mailer-send($email, $headers, $message);
if (PEAR::isError($status)) {
echo fail;
$fail++;
} else {
echo success;
$success++;
}


** Below this line is what I sent. **

Return-Path: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Subject: C0FCC3BCB8DEC0CF C5D7BDBAB6D1
From: C1F8C5C2 [EMAIL PROTECTED]
Content-Type: multipart/related
Errors-To: [EMAIL PROTECTED]
--=MIME_BOUNDRY_message_parts
Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable
5G4B1d0!..
bEW=:6Q/b
EW=:F.6s4O1q...
:83;Av6u8;@L_!!

[PHP] New extension for PHP 4

2004-03-18 Thread RENAUD HAGER
Dear PHP community,
We are two French students.
We study computer sciences at the Université Louis Pasteur of Strasbourg.
During our fourth year, we had to create a project.
We chose to develop an extension for the PHP community.
att_codec is the name of our extension. It is written in C language and 
usable with PHP4.
It is based on the widely used C-library UUDeview.
This extension provides with a lot of functions that are able to code/decode 
large mails attachments (Formats: base64, UUEncoding, XXEncoding, Yenc).

It is heberged by sourceforge. You can download the sources, the binaries 
and the documentation in the following address : 
https://sourceforge.net/projects/php-attcodec/.
You can also consult our web site in the following address 
http://php-attcodec.sourceforge.net/.

Yours sincerely,
Stéphane Degré,
Renaud Hager
_
MSN Messenger  http://g.msn.fr/FR1001/866 : dialoguez en direct et 
gratuitement avec vos amis !

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


Re: [PHP] Javascript Mouseover Help

2004-03-18 Thread Marek Kilimajer
Jake McHenry wrote:
Hi everyone,

How can I get around my problem? I have a couple pages that I would like to have buttons where the button and background changes when the javascript mouseover event happens. My code works fine if the page is .html, but when I try it as php, the mouseovers no longer work.

I have the mouseover in another php file which is included in the php file that is doing the outputing.
Whenever you have this problem - works in html but not in php, view the 
html source output by php. There is certainly an error in the output, 
php has nothing with it.

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


[PHP] installing with XSLT

2004-03-18 Thread Merlin
Hi there,

I am trying to install php with XSLT support. Somehow it does not work 
out. I installed all packages which are explained on the install page of 
XSLT. But there seems to be a backend thing missing:

This is from the ./configure command:

checking whether to enable xslt support... yes
checking for XSLT Sablotron backend... no
checking for libexpat dir for Sablotron XSL support... no
checking for iconv dir for Sablotron XSL support... no
checking for JavaScript for Sablotron XSL support... no
configure: error: No backend specified for XSLT extension.
Can anybody give me a hint where to get this?

Thanx,

Merlin

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


[PHP] Symbol reference problem with pspell in PHP5 compile

2004-03-18 Thread electroteque
Hi there, i have tried the phpinstall list with no luck i continually get
this error on solaris for some strange reason, i had to install 2 totally
seperate libiconv's so one could sit in /usr/local as php kept trying to
look there, now i keep getting this error

Undefined   first referenced
 symbol in file
aspell_speller_store_replacementext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_add_to_session   ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
delete_aspell_speller   ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
new_aspell_config   ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_error_number ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_string_enumeration_next  ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
delete_aspell_string_enumerationext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_word_list_elements   ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
to_aspell_speller   ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_error_messageext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_save_all_word_lists  ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_error_number ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_clear_sessionext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
delete_aspell_configext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
new_aspell_speller  ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_checkext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_error_messageext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_add_to_personal  ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_speller_suggest  ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
aspell_config_replace   ext/pspell/pspell.lo  (symbol belongs to
imp
licit dependency /opt/csw/lib/libaspell.so.15)
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


any ideas ?

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



RE: [PHP] installing with XSLT

2004-03-18 Thread Thijs Lensselink
Merlin wrote on donderdag 18 maart 2004 11:24:

 Hi there,
 
 I am trying to install php with XSLT support. Somehow it does not work
 out. I installed all packages which are explained on the install page
 of XSLT. But there seems to be a backend thing missing:
 
 This is from the ./configure command:
 
 checking whether to enable xslt support... yes
 checking for XSLT Sablotron backend... no
 checking for libexpat dir for Sablotron XSL support... no
 checking for iconv dir for Sablotron XSL support... no
 checking for JavaScript for Sablotron XSL support... no
 configure: error: No backend specified for XSLT extension.
 
 Can anybody give me a hint where to get this?
 
 Thanx,
 
 Merlin

Did you include '--with-xslt-sablot=/usr/local/' when running ./configure.

MvG,
Thijs

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



[PHP] days of week

2004-03-18 Thread Diana Castillo
does anyone know of any built in php functions that can convert a day of
week that is in numeric format , e.g. 1 into a Monday (without knowing which
exact date we are talking about)


--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
  http://www.destinia.com

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



Re: [PHP] days of week

2004-03-18 Thread Richard Davey
Hello Diana,

Thursday, March 18, 2004, 11:38:55 AM, you wrote:

DC does anyone know of any built in php functions that can convert a day of
DC week that is in numeric format , e.g. 1 into a Monday (without knowing which
DC exact date we are talking about)

I can't think of a built-in function that will do this (that doesn't
rely on a date), but it's still quite easy to do:

$days =
array('','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday');

$day_of_week = $days[1]; // -- Monday

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Interbase with PHP in Mandrake 9.1 help !

2004-03-18 Thread Luiz Gustavo Sarubi Macchi
Please

I´m using Mandrake 9.1 and I need to use PHP with interbase !

So, I've been instaled the php430-devel and i built the extension of
interbase like this:
phpize
after that  ./configure --with-interbase=/opt/interbase/
and after make install
the extension was add !

so when i try to access the database, the php reports an error like:

Fatal error: Call to undefined function: ibase_connect() in... 

Is there anything else to do ?
What´s wrong ?

thanks any help !

-- 
Luiz Gustavo Sarubi Macchi [EMAIL PROTECTED]
Emar Plasticos Ltda

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



[PHP] numeric to day name in various languaes

2004-03-18 Thread Diana Castillo
Is there anything built into php that would do something like this , but in
all of the possible languages?
switch ($restriction_week_days) {
   case 1:
   $restriction_day = Monday,Lunes,Lundi;
   break;
   case 2:
   $restriction_day = Tuesday,Martes,Mardi;
   break;
   case 3:
   $restriction_day = Wednesday,Miercoles, Mercredi;
   break;
   case 4:
   $restriction_day = Thursday , Jueves, Jeudi;
   break;
   case 5:
   $restriction_day = Friday, Viernes,Vendredi;
   break;
   case 6:
   $restriction_day = Saturday, Sabado, Samedi;
   break;
   case 7:
   $restriction_day = Sunday, Domingo, Dimanche;
   break;


--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
  http://www.destinia.com

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



Re: [PHP] days of week

2004-03-18 Thread Diana Castillo
yes but I want it in various languages.

Richard Davey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello Diana,

 Thursday, March 18, 2004, 11:38:55 AM, you wrote:

 DC does anyone know of any built in php functions that can convert a day
of
 DC week that is in numeric format , e.g. 1 into a Monday (without knowing
which
 DC exact date we are talking about)

 I can't think of a built-in function that will do this (that doesn't
 rely on a date), but it's still quite easy to do:

 $days =

array('','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sund
ay');

 $day_of_week = $days[1]; // -- Monday

 --
 Best regards,
  Richard Davey
  http://www.phpcommunity.org/wiki/296.html

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



Re[2]: [PHP] days of week

2004-03-18 Thread Richard Davey
Hello Diana,

Thursday, March 18, 2004, 12:00:55 PM, you wrote:

DC yes but I want it in various languages.

Not in your *original* post you didn't (the one that I replied to).
Besides, it wouldn't be that hard to modify to make it happen.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: Re[2]: [PHP] days of week

2004-03-18 Thread Diana Castillo
I didnt want to hard code the names , so we made this up:

function getDayName($day, $lang=''){
if ($locale = Language::getLocale($lang)) {
setlocale(LC_TIME, $locale);
}
$sunday = strtotime('1 January 1995'); // That day was a Sunday
  return strftime(%A, $sunday+(3600*24*$day));
}


Richard Davey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello Diana,

 Thursday, March 18, 2004, 12:00:55 PM, you wrote:

 DC yes but I want it in various languages.

 Not in your *original* post you didn't (the one that I replied to).
 Besides, it wouldn't be that hard to modify to make it happen.

 --
 Best regards,
  Richard Davey
  http://www.phpcommunity.org/wiki/296.html

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



Re[4]: [PHP] days of week

2004-03-18 Thread Richard Davey
Hello Diana,

Thursday, March 18, 2004, 12:34:32 PM, you wrote:

DC I didnt want to hard code the names , so we made this up:

DC function getDayName($day, $lang=''){
DC if ($locale = Language::getLocale($lang)) {
DC setlocale(LC_TIME, $locale);
DC }
DC $sunday = strtotime('1 January 1995'); // That day was a Sunday
DC   return strftime(%A, $sunday+(3600*24*$day));
DC }

So despite asking for a way to do it without using dates in functions,
that's exactly what you're doing?

Heh, gotta love this list sometimes.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



RE: [PHP] Simple: Whats wrong with this?

2004-03-18 Thread Ford, Mike [LSS]
On 17 March 2004 17:09, Chris W. Parker wrote:

 
 $var++ is a post incrementer meaning the value is updated at the next
 command*.

 * i'm not exactly sure how the compiler determines when to post
 increment, but i think i'm correct.

Not quite -- the increment is performed immediately after the access -- in
fact, as part of the same operation.  So:

$x = 3;
$y = ($x++ * 2) + $x;

is likely to give you $y==10, not 9.

(I say is likely to, because you don't have any absolute cast-iron
guarantees that a compiler won't, if it thinks it has good reason, commute
the above to $x + ($x++ * 2), which would give you $y==9!  In general, it's
best to regard the value of a pre- or post-incremented variable as uncertain
in the rest of the expression containing it.)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Letter incrementing

2004-03-18 Thread Brent Clark
Hi all

Does anyone know how, or even if it is possible to increment a letter from the 
alphabet.

I know that if you use 
e.g

$o = 1;
$o++;

will result in $o ==  2,.

But I need to do a $variable = B;
and then do a $variable++ that will result in
$variable == C

Kind Regards
Brent Clark


Re: [PHP] Letter incrementing

2004-03-18 Thread Richard Davey
Hello Brent,

Thursday, March 18, 2004, 1:16:34 PM, you wrote:

BC Does anyone know how, or even if it is possible to increment a letter from the 
alphabet.

BC But I need to do a $variable = B;
BC and then do a $variable++ that will result in
BC $variable == C

Sure:

?php
 $letter = a;
 $letter++;
 echo $letter;
?

You'll get b :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Letter incrementing

2004-03-18 Thread Brent Baisley
You want to use the char() function. What you need to do is increment 
an ascii value and then convert that value to a letter. So ascii 65 is 
A.
$asciiVal = 65;
echo char($asciiVal);  A
$asciiVal++;
...

On Mar 18, 2004, at 8:16 AM, Brent Clark wrote:

Hi all

Does anyone know how, or even if it is possible to increment a letter 
from the alphabet.

I know that if you use
e.g
$o = 1;
$o++;
will result in $o ==  2,.

But I need to do a $variable = B;
and then do a $variable++ that will result in
$variable == C
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] numeric to day name in various languaes

2004-03-18 Thread Marek Kilimajer
Diana Castillo wrote:

Is there anything built into php that would do something like this , but in
all of the possible languages?
What do you want to do? Do you want to assign $restriction_day a list of 
weekday in ALL 6000+ languages? :-)

Why don't you keep $restriction_day numeric and display the weekday name 
once it's output to the browser?

switch ($restriction_week_days) {
   case 1:
   $restriction_day = Monday,Lunes,Lundi;
   break;
   case 2:
   $restriction_day = Tuesday,Martes,Mardi;
   break;
   case 3:
   $restriction_day = Wednesday,Miercoles, Mercredi;
   break;
   case 4:
   $restriction_day = Thursday , Jueves, Jeudi;
   break;
   case 5:
   $restriction_day = Friday, Viernes,Vendredi;
   break;
   case 6:
   $restriction_day = Saturday, Sabado, Samedi;
   break;
   case 7:
   $restriction_day = Sunday, Domingo, Dimanche;
   break;
--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
  http://www.destinia.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Javascript Mouseover Help NOT A JAVASCRIPT QUESTION

2004-03-18 Thread Raditha Dissanayake
Raditha Dissanayake wrote:


  


It's not a javascript question, or problem. As I said in my original 
post,
it works fine if it's a regular html file. But when I put it in a 
variable
in php, then use that variable from an included file, the javascript 
is not
executed. What can I do to fix this?
 

Like i said you have to look at the mozilla javascript console which 
you obviously have not done.

I am sorry my last mail sounded a bit snappish. Please accept my 
appologies. My point is that if you open the javascript console in 
mozilla this will point you to the exact location of the error. If 
instead you are using explorer that will either show you an error icon 
in the status bar or if you have frontpage or visual studio installed it 
may popup a debug dialog box. Since I work in linux mozzilla console is 
my preffered method.

TO back track a bit. It's is normally safer to include the javascript 
via script src='..' rather than to spit it out with PHP. Since this 
avoids all the complications and allows you to debug your javscript 
separately (perhaps using a static html).

all the best



--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

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


Re: [PHP] installing with XSLT

2004-03-18 Thread Raditha Dissanayake
Merlin wrote:

Hi there,

I am trying to install php with XSLT support. Somehow it does not work 
out. I installed all packages which are explained on the install page 
of XSLT. But there seems to be a backend thing missing:

This is from the ./configure command:

checking whether to enable xslt support... yes
checking for XSLT Sablotron backend... no
checking for libexpat dir for Sablotron XSL support... no
checking for iconv dir for Sablotron XSL support... no
checking for JavaScript for Sablotron XSL support... no
configure: error: No backend specified for XSLT extension.
Can anybody give me a hint where to get this?

Thanx,

Merlin


Are you getting compiler errors? I overcame them by adding -lstdc++ to 
the make file (EXTRA_LIBS) as someone had suggested in a forum.

all the best

--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

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


[PHP] Re: Problem with sending mail with attachment

2004-03-18 Thread Scott Fletcher
I had experience this similar problem with the attachment, as it turned out
that not all email software work out the same way, especially with
MS-Exchange which need an extra \r or \n for it to work.

For the attachment issue you have.  I don't know what Content-Type you're
using because it showed $usehtml.  The problem most likely lies with the
Content-Type that aren't specified correctly.  For text type, I use
Content-Type: text/plain; charset=\iso-8859-1\\n.  If you use html type
then it would be Content-Type: text/html; blah blah\n;  I don't know
if you need to specify the charset type for that type.

FletchSOD


Shyxu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm using Mail.php which is located in /usr/local/lib/php
 I made a mail program by php.
 Which is attaching a file.

 But I guess there's problem in MIME syntax.
 I don't know what is wrong...

 What's the problem?


 ** Below this line is php codes. **
 include Mail.php;

 // defines header
 $headers['Subject'] = $subject;
 $headers['From'] = $sender. .$senderemail.;
 $headers['Content-Type'] = multipart/related;
 $headers['Return-Path'] = .$senderemail.;
 $headers['Errors-To'] = .$senderemail.;

 // message
 $message .= --=MIME_BOUNDRY_message_parts\n;
 $message .= Content-Type: $usehtml; \n;
 $message .= Content-Transfer-Encoding: quoted-printable\n;
 $message .= \n$ment\n;
 $message .= --=MIME_BOUNDRY_message_parts--\n\n;

 // Attachments

 if ( $_FILES['attach']['error'] === 0 ) {
 //Upload and Attach
 $tmpName = $_FILES['attach']['tmp_name'];
 $fileName = $_FILES['attach']['name'];
 $filePath = ./attach/;
 $fileSize = $_FILES['attach']['size'];

 $AttmFile = $filePath.$fileName;

 move_uploaded_file( $tmpName, $AttmFile ) or die( upload
failed );

 // now we add attachments
 $message .= \n\n--=MIME_BOUNDRY_main_message\n;
 $message .= Content-Type: .$_FILES['attach']['type'].;
 name=\.$fileName.\;\n;
 $message .= Content-Disposition: attachment;
 filename=\.$fileName.\;\n\n;
 $message .= Content-Transfer-Encoding: base64;\n;
 $message .= \n;

 //file goes here
 $fd=fopen ($AttmFile, r);
 $FileContent=fread($fd,filesize($AttmFile));
 fclose ($fd);
 $FileContent=chunk_split(base64_encode($FileContent));
 $message.=$FileContent;
 $message .= \n--=MIME_BOUNDRY_main_message\n;
 }


 // SMTP Connection
 $params['host'] = $smtphost;
 $params['auth'] = true;
 $params[username] = $smtpuser;
 $params[password] = $smtppwd;
 $mailer = Mail::factory('smtp', $params);

 $email = [EMAIL PROTECTED]; # use my email address for test.


 // send and check status
 $status =$mailer-send($email, $headers, $message);
 if (PEAR::isError($status)) {
 echo fail;
 $fail++;
 } else {
 echo success;
 $success++;
 }



 ** Below this line is what I sent. **

 Return-Path: [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 Subject: C0FCC3BCB8DEC0CF C5D7BDBAB6D1
 From: C1F8C5C2 [EMAIL PROTECTED]
 Content-Type: multipart/related
 Errors-To: [EMAIL PROTECTED]

 --=MIME_BOUNDRY_message_parts
 Content-Type: text/html;
 Content-Transfer-Encoding: quoted-printable

 5G4B1d0!..
 bEW=:6Q/b

 EW=:F.6s4O1q...
 :83;Av6u8;@L_!!
 --=MIME_BOUNDRY_message_parts--



 --=MIME_BOUNDRY_main_message
 Content-Type: application/octet-stream; name=README;
 Content-Disposition: attachment; filename=README;

 Content-Transfer-Encoding: base64;


xu3B/cC6IEdMSUJDIDEuMDkgQmV0YSC59sD8IL+1ua7Gx8C7ILHiwdjAuLfOIMfPv7S9wLTPtNku

DQrC98DMwaHAuiDBtrHdu9PAzLHiILanua6/oSCwxcDHILCwtNmw7SC6uL3DuOkgtcu0z7TZLg0K

wM+53SDDpcDaIMWpseLAziBCNbfOIMbtwf3AzCC1x77uIMDWvu68rQ0Kt7nAzMD6IMfBuLDFzbfO

IMPit8LH2LytILmtwLi46SCx17Trt84gw6XAzCC1y7TPtNkuDQq/wMDaILz2waTAuiC0q7+hILbn

tMKwzSC47rCzuLggx9Egu/PFwrbzIMDawdYgurjAzMH2uLgNCrHXt7iw1CDFqyC5rsGmtMIgvvjA

u7DNILCwsO0NCsfUvPYgv+S+4CC6zrrQKMDMsMcgv7W5rsbHwMcgx9i057rOutDAuyDAzrzix9i8

rSC1obrZwMy9w7HmKSwNCsL8sO3AxyDCyrz2IMH2waSw+iDH1Lz2LCC6r7z2IElOREVYILXuwMwg

vvi9wLTPtNkuDQqx17DNtem4uCC52bfOIMDitMK02bjpIL/Puq7H2MH2sNrB9ri4DQqx17eyIL3D

sKPAzCC++LDtILbHILPKuasgwfbDxLytILj4x8+w2rG6v+QuDQqx17PJILq4vLy/5C4uLi4uLS07

DQrD4rfCx8+9xyC2qSBnbGliY3RpdC5od3AsIGdsaWJjaWR4Lmh3cCwgZ2xpYmMuaHdwuKYNCrz4

vK2067fOIMPit8LHz73DuOkgtcu0z7TZLg0Kvue46SDAzrziuKYgx8+w7SC9zcC4vcO46SAowM+5

3cD7wM4gsOa/7CkNCsOzwL2/oyDAzrzivcO/obytIMKmvPbCysC7ILjVwPogwM684sfPvcOw7Q0K

tNnAvb+hIMimvPbCysC7IMDOvOLHz73DuOkgwve3yrTrt84gs6q/zSDA1sC7sMy0z7TZLg0Ksde3

syC1tb/yILXHvMyx5iC52bb4tM+02S4NCg0KICAgICAgICAgICAgICAgICAgICBSQUdOQVJvS0Bo

aXRlbC5rb2wuY28ua3INCiAgICAgICAgICAgICAgICAgICAgwfe+vr+hvK0guvO11bTrtMIgvu62
 ssDMDQo=

 --=MIME_BOUNDRY_main_message--

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



Re: [PHP] header() vs. fsockopen for Location: http:www.d.com....

2004-03-18 Thread Scott Fletcher
Thanks...

FletchSOD

Raditha Dissanayake [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi Scott,
 This has been heavily discussed in recent weeks you will find lots of
 pointers in the archives. But in short there's no harm in
 header(Location:);

 Scott Fletcher wrote:

 Hi!
 
 Let's say there are 3 webpages with webpage #1 for customer filling
out
 the form and submit it to webpage #2 for processing and database
 insert/update then php header(Location: http://www.whatever.com;) to
 redirect the webapge to webpage #3.  (or back to webpage #1).  That way,
the
 web-browser doesn't have a history of webpage #2, so the database is
immune
 to browser's refresh/back/forward button (from database duplication).
Now I
 have people telling me that it is not healthy to use the
header(Location:
 blah blah) to force the web browser to redirect and that I should use
the
 fsockopen instead.  A fsockopen on webpage #2 on the Apache's side where
PHP
 can open a port to send a request to apache to have it to send a webpage
#3
 to the web browser.  That sound okay to me but I see one big problem.  If
 fsockopen is used on webpage #2 to emulate a webpage #3 then the web
browser
 only see webpage #2 and webpage #3 together as webpage #2.
 
 I see no idea workaround to it, in fact there is none.  So, it look
like
 I have to stick to header(Location: blah blah).  So, what is your
thought
 and opinion.  If there is a workaround them I'm all ear!.
 
 FletchSOD
 
 
 


 -- 
 Raditha Dissanayake.
 ---
 http://www.radinks.com/upload/
 Drag and Drop Upload thousands of files and folders in a single
 transfer.  (HTTP or FTP)

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



Re: [PHP] installing with XSLT

2004-03-18 Thread Ray Hunter
On Thu, 2004-03-18 at 03:24, Merlin wrote:
 I am trying to install php with XSLT support. Somehow it does not work 
 out. I installed all packages which are explained on the install page of 
 XSLT. But there seems to be a backend thing missing:
 
 This is from the ./configure command:
 
 checking whether to enable xslt support... yes
 checking for XSLT Sablotron backend... no
 checking for libexpat dir for Sablotron XSL support... no
 checking for iconv dir for Sablotron XSL support... no
 checking for JavaScript for Sablotron XSL support... no
 configure: error: No backend specified for XSLT extension.

What version of php are you trying to compile? What type of OS are you
compiling on?

It looks like a PHP4 compile and you need to install sablotron for the
XSLT backend. Check the documentation of sablotron for information on
how to install it.  You might want to look at PHP5 and see if you would
like to use libxslt.

--
Ray

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



Re: [PHP] Interbase with PHP in Mandrake 9.1 help !

2004-03-18 Thread Ray Hunter
On Thu, 2004-03-18 at 04:51, Luiz Gustavo Sarubi Macchi wrote:
 Please
 
 I´m using Mandrake 9.1 and I need to use PHP with interbase !
 
 So, I've been instaled the php430-devel and i built the extension of
 interbase like this:
 phpize
 after that  ./configure --with-interbase=/opt/interbase/
 and after make install
 the extension was add !
 
 so when i try to access the database, the php reports an error like:
 
 Fatal error: Call to undefined function: ibase_connect() in... 

did you download the source and compile it? You might want to download a
stable release of PHP and see if that works for you. There is the PHP
4.3.4 version that might work for you.

http://www.php.net/downloads.php

I would use PHP 4.3.4 and see how that works out and compile in
interbase.

Is interbase installed in /opt/interbase or /usr/interbase?

In your configure like does it make a difference is you do this
instead?:

./configure --with-interbase=/opt/interbase



--
Ray

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



[PHP] How to do this in PHP?

2004-03-18 Thread Mike Mapsnac
I have a table that has 5 cells and each cell has a  link.
So when I click on a cell , the visited cell will get background color.
In other words, when I click on the cell the color of the cell changes.
Thanks

_
Get rid of annoying pop-up ads with the new MSN Toolbar – FREE! 
http://clk.atdmt.com/AVE/go/onm00200414ave/direct/01/

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


Re: [PHP] How to do this in PHP?

2004-03-18 Thread Richard Davey
Hello Mike,

Thursday, March 18, 2004, 2:16:32 PM, you wrote:

MM I have a table that has 5 cells and each cell has a  link.
MM So when I click on a cell , the visited cell will get background color.
MM In other words, when I click on the cell the color of the cell changes.

This is an HTML (or rather, in this case a CSS) question - and I'm
afraid has nothing to do with PHP. Suggest you join a web design
mailing list for topics like this.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Possible to have Array in $_SESSION????

2004-03-18 Thread Scott Fletcher
Hi!

Is it possible to have an array that contain 2 or more segment to be put
into the $_SESSION and to retreived it back?

FletchSOD

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



[PHP] the '' character and PHP...?

2004-03-18 Thread Tristan . Pretty
I've a script that uses ''
However, if I pass that as a variable to another page, everything after 
it, gets ignored...
I've tried:

1. Esacping the character with '\'
2. Using amp;

But nothing works...
Any ideas how to include an '' in my variable?

Tris...


*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



RE: [PHP] Possible to have Array in $_SESSION????

2004-03-18 Thread Clifford W. Hansen
Scott,

Yes it is, You can also store objects in $_SESSION 

Eg.
$_SESSION['Config'] = array( DBName = Common, DBHost = localhost
);

Eg.
MySQL_Connect( $_SESSION['Config']['DBHost'] );

Till We Meet Again...

Clifford W. Hansen
Operations Support Developer
Aspivia (Pty) Ltd.

+27 (0) 11 259-1150 (Switchboard)
+27 (0) 11 259-1019 (Fax)
+27 (0) 83 761-0240 (Mobile)
[EMAIL PROTECTED] (EMail)
http://chansen.aspivia.com (Web)

Registered Linux user number 343424 on http://counter.li.org/

We have seen strange things today! Luke 5:26

This message contains information intended for the perusal, and/or use (if
so stated), of the stated addressee(s) only. The information is confidential
and privileged. If you are not an intended recipient, do not peruse, use,
disseminate, distribute, copy or in any manner rely upon the information
contained in this message (directly or indirectly). The sender and/or the
entity represented by the sender shall not be held accountable in the event
that this prohibition is disregarded.

If you receive this message in error, notify the sender immediately by
e-mail, fax or telephone and return and/or destroy the original message.

The views or representations contained in this message, whether express or
implied, are those of the sender only, unless that sender expressly states
them to be the views or representations of an entity or person, who shall be
named by the sender and who the sender shall state to represent. No
liability shall otherwise attach to any other entity or person.

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



Re: [PHP] How to do this in PHP?

2004-03-18 Thread Roger Spears
Mike Mapsnac wrote:

I have a table that has 5 cells and each cell has a  link.
So when I click on a cell , the visited cell will get background color.
In other words, when I click on the cell the color of the cell changes.
I often see post here that are not so PHP related.  This is due to the 
fact that the population of this list is so smart and experienced in all 
realms of web development.  :-)

You may wish to search at google.com for keywords such as CSS + cell 
colors or javascript + changing cell colors.

In relation to your question, check out these two sites for some tips...
http://www.faqts.com/knowledge_base/view.phtml/aid/4005/fid/192
http://www.codetoad.com/forum/20_22951.asp
GL,
Roger
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] the '' character and PHP...?

2004-03-18 Thread Raditha Dissanayake
[EMAIL PROTECTED] wrote:

I've a script that uses ''
However, if I pass that as a variable to another page, everything after 
it, gets ignored...
I've tried:

1. Esacping the character with '\'
2. Using amp;
But nothing works...
Any ideas how to include an '' in my variable?
Tris...
 

Are you trying to pass a variable to another page by making it part of 
the urls query string? In other words you using php code similar to :
 echo http://www.sungard.com/index.php?var=$var;

now you are having trouble because $var contains the  character?

if so you need to call urlencode($var)

please be more detailed in future posts.

thanx

--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

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


Re: [PHP] the '' character and PHP...?

2004-03-18 Thread Stuart
[EMAIL PROTECTED] wrote:
I've a script that uses ''
However, if I pass that as a variable to another page, everything after 
it, gets ignored...
I've tried:

1. Esacping the character with '\'
2. Using amp;
But nothing works...
Any ideas how to include an '' in my variable?
http://php.net/urlencode

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


[PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Five
I would be very interested in a solution to this problem because I have a similar one.

I stored tables on a page.

examp:

$table_1 = tabletrtd.$name./td/tr/table;
$table_2 = tabletrtd.$message./td/tr/table;
etc...

and included the page and used the variables (echo $table_1;)

The table displayed as it should,
however the variables didn't have values( for $name, $message, etc..)

I began testing for the problem by defining the string variable for the table on the 
same page as the php code

examp:

?php
$table_1 = tabletrtd.$name./td/tr/table;
$table_2 = tabletrtd.$message./td/tr/table;

$name = blah blah;

if(blah blah){
echo $table_1;}
else{
echo $table_2;}
?

Again, the tables printed fine, but the variables ($name, $message) had no values.


Most recently, I put the whole dam table in each conditional option.

if (blah blah){  echo tabletrtd.$name./td/tr/table;}

else{  echo  tabletrtd.$message./td/tr/table;}


Voila, the variables have values.

It would seem that if a solution was found for Jake's problem
it would also solve, or provide a key for solving, this one.

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



Re: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Tom Rogers
Hi,

Friday, March 19, 2004, 12:44:40 AM, you wrote:
F I would be very interested in a solution to this problem because I have a similar 
one.

F I stored tables on a page.

F examp:

F $table_1 = tabletrtd.$name./td/tr/table;
F $table_2 = tabletrtd.$message./td/tr/table;
F etc...

F and included the page and used the variables (echo $table_1;)

F The table displayed as it should,
F however the variables didn't have values( for $name, $message, etc..)

F I began testing for the problem by defining the string variable
F for the table on the same page as the php code

F examp:

F ?php
F $table_1 = tabletrtd.$name./td/tr/table;
F $table_2 = tabletrtd.$message./td/tr/table;

F $name = blah blah;

F if(blah blah){
F echo $table_1;}
F else{
F echo $table_2;}
?

F Again, the tables printed fine, but the variables ($name, $message) had no values.


F Most recently, I put the whole dam table in each conditional option.

F if (blah blah){  echo
F tabletrtd.$name./td/tr/table;}

F else{  echo  tabletrtd.$message./td/tr/table;}


F Voila, the variables have values.

F It would seem that if a solution was found for Jake's problem
F it would also solve, or provide a key for solving, this one.


You have to define variable $name before you try to use it.
The only other way would be to eval the string but that is not the way
to go :)

-- 
regards,
Tom

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



Re: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Five

 F ?php
 F $table_1 = tabletrtd.$name./td/tr/table;
 F $table_2 = tabletrtd.$message./td/tr/table;

 F $name = blah blah;

 F if(blah blah){
 F echo $table_1;}
 F else{
 F echo $table_2;}
 ?

 You have to define variable $name before you try to use it.
 The only other way would be to eval the string but that is not the way
 to go :)


Doesn't  $name = blah blah;  define it enough?

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



[PHP] OT PHP Programmers

2004-03-18 Thread Jack Sasportas
Not sure where to post this, but my company is looking to hire an
inhouse PHP programmer.
This could be part or full time depending on details.
We are not looking to contract an outside company ( doesn't work for us)
or
to get headhunters etc to call us.  If you are a good PHP/MySQL/HTML
programmer then drop me an email.
You would HAVE to work in our Miami Office ( not to far from 826  Bird
Road ).
 
Thanks!
 
Joey


Re[2]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Tom Rogers
Hi,

Friday, March 19, 2004, 1:11:52 AM, you wrote:


F Doesn't  $name = blah blah;  define it enough?


Not if it comes after   $table_1 = tabletrtd.$name./td/tr/table;
at this point $name does not exist. Try turning on E_ALL error
reporting and it will tell you things like this.

-- 
regards,
Tom

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



[PHP] How to keep a timestamp from updating?

2004-03-18 Thread Brian Dunning
I have a timestamp field that updates itself with NOW() every time I 
update the record. I don't want that to happen - I want it to remain as 
the original creation timestamp. How do I prevent this from happening?

Thanks,

- Brian

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


[PHP] ereg_replace help

2004-03-18 Thread Richard Davey
Hi all,

I'm sure this is blindingly simple, but could anyone tell me how to
get an ereg_replace() to return a string where all characters OTHER
than alpha-numerics have been stripped out?

I can do the reverse with:

$output = ereg_replace('[[:alnum:]]', '', $string);

Which will happily remove all alpha-numeric characters from $string!
But I want it to remove anything but.. suggestions please?

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] How to keep a timestamp from updating?

2004-03-18 Thread Richard Davey
Hello Brian,

Thursday, March 18, 2004, 3:17:49 PM, you wrote:

BD I have a timestamp field that updates itself with NOW() every time I
BD update the record. I don't want that to happen - I want it to remain as
BD the original creation timestamp. How do I prevent this from happening?

Two solutions:

1 - Don't use a timestamp - it's only doing what it is designed to :)
2 - Add another timestamp to your table before the one you want to
keep static, i.e. have:

modified timestamp,
created timestamp

Then when you update the table only the first timestamp (modified)
will change, created will remain the same.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] How to keep a timestamp from updating?

2004-03-18 Thread Adam Voigt
On MySQL anyway, the timestamp is by-design, a update/insert timestamp.
I quote:

The TIMESTAMP column type provides a type that you can use to
automatically mark INSERT or UPDATE operations with the current date and
time. If you have multiple TIMESTAMP columns, only the first one is
updated automatically.

I suppose if you really wanted to, you could create another timestamp
column, and this one would not be automatically updated.


On Thu, 2004-03-18 at 10:17, Brian Dunning wrote:
 I have a timestamp field that updates itself with NOW() every time I 
 update the record. I don't want that to happen - I want it to remain as 
 the original creation timestamp. How do I prevent this from happening?
 
 Thanks,
 
 - Brian
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP] How to keep a timestamp from updating?

2004-03-18 Thread John W. Holmes
From: Brian Dunning [EMAIL PROTECTED]

 I have a timestamp field that updates itself with NOW() every time I 
 update the record. I don't want that to happen - I want it to remain as 
 the original creation timestamp. How do I prevent this from happening?

Set it equal to itself or use a DATETIME field. 

---John Holmes...

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



[PHP] Problem to display the results of an exec + rsh command

2004-03-18 Thread Frédéric Martin
Hi everybody,

I'm trying to execute some commands in a remote host (a cisco router) using
rsh connection and I've problems for displaying the results.

For example if I do this:

$res = exec(rsh x.x.x.x -l username ping x.x.x.x);
echo pre $res /pre;

I cannot display the result of the ping made in the remote host.
any idea to fix that?
thank you in advance for your tips ...

fred

Frédéric MARTIN
Stagaire Service Exploitation
Email: [EMAIL PROTECTED]
-
VTX Services SA
Avenue de Lavaux, 101
CH-1009 PULLY
http://www.vtx.ch
-


[PHP] php code to connect to MS-SQL SERVER

2004-03-18 Thread Rafi Sheikh
Hello folks.

Basics: Apache 1.3.29, PHP 4.3.4, on WIN 2K-Pro 

SYS DSN=using SQL Server driver a connection exists (tested via Ms-Access)
against a SQL Server

PROBLEM: I am very new in php, therefore requesting if a simple snippet of
code can be listed showing the proper way of making a connection to a SQL
server in a PHP script.

Names to Use:
System DNS=repo
SQL Server Database name=test
User=rookie


I tried 
he manual on PHP site, and read about ODBC_connect and odbc_fetch_array but
I admit that at 1.30 in the morning I am way over my head on this.  Any
pointer to a source (beg level) or help with a code snippet is deeply
appreciated.

Regards,

RS



This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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



Re: [PHP] ereg_replace help

2004-03-18 Thread John W. Holmes
From: Richard Davey [EMAIL PROTECTED]

 I'm sure this is blindingly simple, but could anyone tell me how to
 get an ereg_replace() to return a string where all characters OTHER
 than alpha-numerics have been stripped out?

$output = ereg_replace('[^a-zA-Z0-9]','',$string);

The ^ is NOT (when the first character in a bracketed character set). So
anything NOT alphanumeric is replaced.

---John Holmes...

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



Re: [PHP] ereg_replace help

2004-03-18 Thread Chris Hayes
At 16:21 18-3-04, you wrote:

I can do the reverse with:

$output = ereg_replace('[[:alnum:]]', '', $string);

Which will happily remove all alpha-numeric characters from $string!
But I want it to remove anything but.. suggestions please?


did you try
$output = ereg_replace('[^[:alnum:]]', '', $string);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php code to connect to MS-SQL SERVER

2004-03-18 Thread Adam Voigt
mssql_connect('repo',$User,$Pass);
mssql_select_db('test');

On Thu, 2004-03-18 at 02:31, Rafi Sheikh wrote:
 Hello folks.
 
 Basics: Apache 1.3.29, PHP 4.3.4, on WIN 2K-Pro   
 
 SYS DSN=using SQL Server driver a connection exists (tested via Ms-Access)
 against a SQL Server
 
 PROBLEM: I am very new in php, therefore requesting if a simple snippet of
 code can be listed showing the proper way of making a connection to a SQL
 server in a PHP script.
 
 Names to Use:
 System DNS=repo
 SQL Server Database name=test
 User=rookie
 
 
 I tried 
 he manual on PHP site, and read about ODBC_connect and odbc_fetch_array but
 I admit that at 1.30 in the morning I am way over my head on this.  Any
 pointer to a source (beg level) or help with a code snippet is deeply
 appreciated.
 
 Regards,
 
 RS
 
 
 
 This e-mail, including attachments, may include confidential and/or
 proprietary information, and may be used only by the person or entity to
 which it is addressed. If the reader of this e-mail is not the intended
 recipient or his or her authorized agent, the reader is hereby notified that
 any dissemination, distribution or copying of this e-mail is prohibited. If
 you have received this e-mail in error, please notify the sender by replying
 to this message and delete this e-mail immediately.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re[2]: [PHP] ereg_replace help

2004-03-18 Thread Richard Davey
Hello Chris,

Thursday, March 18, 2004, 3:28:01 PM, you wrote:

CH did you try
CH $output = ereg_replace('[^[:alnum:]]', '', $string);
CH ?

Nope, because in the only reference book I had to hand it said the ^
matched the start of a string so it didn't occur to me to try it.

Thanks to John I now know when used in a block it's no longer limited
to the start of the string. The code you posted above works, thanks.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] HTML/PHP page print

2004-03-18 Thread Manisha Sathe
Hello,

I want to print a document. The values are picked up from database and then
PHP displays it is on screen. But I want to print in some predefined format
(Customer has printed stationary) by using Browser's print button.

How can avoid other stuff on my web page ? Also when i print then title of
document / page no / url / date also get displayed. How can i avoid it ?

Thanks in advance

Regards
Manisha

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



[PHP] How to edit a datetime field?

2004-03-18 Thread Brian Dunning
I'm trying to set a datetime field to 24 hours in the future...

NOW()+6000, which worked on a timestamp field, only gives 12 seconds in 
the future. Algebra suggested I try NOW()+720 which is invalid.

Any suggestions? Thanks!

- Brian

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


RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
Hi Tom,

This was a good idea...

 You might try an fsockopen() to port 3306 on the dbserver and 
 see if it works.  If not, you get a reasonably descriptive error.
 
 I just tried a couple of known servers and bogus addresses with this
 code:
 
 ?php
 $ipaddr = localhost;  # substitute the IP address here $fp 
 = fsockopen($ipaddr, 3306, $errno, $errstr, 5.0); 
 var_dump($fp, $errno, $errstr); if ($fp)
   fclose($fp);
 ?

I setup the test page and pointed to the dbserver:

IP: 192.168.1.44 
resource(2) of type (stream) int(0) string(0)  

I then pointed it at localhost:

IP: localhost 
resource(2) of type (stream) int(0) string(0)  

And then another webserver without MySQL:

IP: 192.168.1.26 
bool(false) int(146) string(18) Connection refused 

I'm sure this is good to know because it proves at least part of PHP can
reach the other machine... Which hopefully rules out a TCP/IP problem. I'm
going to enable debugging on the MySQL server and see if that tells me
anything.

Thanks,
Cameron

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



Re: Re[2]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Five

Tom Rogers [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Hi,

 Friday, March 19, 2004, 1:11:52 AM, you wrote:


 F Doesn't  $name = blah blah;  define it enough?


 Not if it comes after   $table_1 = tabletrtd.$name./td/tr/table;
 at this point $name does not exist. Try turning on E_ALL error
 reporting and it will tell you things like this.

 -- 
 regards,
 Tom

Cool, it works!
include (the file where the tables are stored) after the the variables are defined, 
and it works.
I took 3 semesters of C and C++  programming. I should have figured that out myself.

Thanks Tom. Can you steer me to where the E_ALL error reporting gets activated?
Some ini file I imagine?

And oh yeah, I don't know if it helped Jake, but it worked for me.
Thanks for starting the topic, Jake.

Dale

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



Re: [PHP] How to edit a datetime field?

2004-03-18 Thread Richard Davey
Hello Brian,

Thursday, March 18, 2004, 4:10:20 PM, you wrote:

BD I'm trying to set a datetime field to 24 hours in the future...

BD NOW()+6000, which worked on a timestamp field, only gives 12 seconds in
BD the future. Algebra suggested I try NOW()+720 which is invalid.

UPDATE table SET datefield = DATE_ADD(now(), INTERVAL 24 hour)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] installing.

2004-03-18 Thread Edward Peloke
Hello,

I know this is probably something stupid but...

I have two windows2000 machines, both with Apache 1.3.2 and PHP 4.3.  One of
the machines works fine yet the other keeps throwing the error that it can't
find the apache.dll when apache loads..

snip
Syntax error on line 989 of c:/program files/apache
group/apache/conf/httpd.conf
:
Cannot load c:/php/sapi/php4apache.dll into server: (126) The specified
module c
ould not be found:

Note the errors or messages above, and press the ESC key to exit.  13...
/snip

I have the same httpd.conf files for both, the same php folders, the .dll is
in the sapi folder, in the windows system directory, etc.  What could be the
problem?

Thanks,
Eddie


 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

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



[PHP] Turn on E_ALL Error Reporting

2004-03-18 Thread Roger Spears
Hello,

I changed the title of this email so it doesn't thread hijack...

I use a simple function like this to turn on and show warnings and 
errors.  It's my understanding though, if the error is catastrophic, it 
will not be displayed on the screen no matter what you do.  Not sure 
about that though...

I did not create this function, nor am I taking credit for it.  I'm 
sharing it.  I think it came from one of my many PHP books, possibly the 
PHP Cookbook...

?php
function pc_error_handler($errno, $error, $file, $line, $context)
  {
$message = [ERROR][$errno][$error][$file:$line];
print p$messagebr;
?
pa href=mailto:[EMAIL PROTECTED]?php print 
$message; ?email this error/a
?php
print /p;
  }

error_reporting(E_ALL);
set_error_handler('pc_error_handler');
?
This will show the warning/error on the screen and provide a link for 
the viewer to use to report said error.  You must replace 
[EMAIL PROTECTED] with your email address.

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


Re: Re[2]: [PHP] ereg_replace help

2004-03-18 Thread trlists
On 18 Mar 2004 Richard Davey wrote:

 Nope, because in the only reference book I had to hand it said the ^
 matched the start of a string so it didn't occur to me to try it.
 
 Thanks to John I now know when used in a block it's no longer limited
 to the start of the string. The code you posted above works, thanks.

The '^' has a totally different meaning inside a character class than 
its meaning outside the class.  It's not a amtter of it being limited 
so much as just different (actually I guess overloaded is the real 
term).

--
Tom

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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread trlists
On 18 Mar 2004 Cameron B. Prince wrote:

 I'm sure this is good to know because it proves at least part of PHP can
 reach the other machine... Which hopefully rules out a TCP/IP problem. I'm
 going to enable debugging on the MySQL server and see if that tells me
 anything.

Ah, that's good.  Then it is just a problem of MySQL.

Have you tried accessing a remote machine running MySQL 3.2x instead of 
4.0?  That seems like an obvious potential culprit.

Note that the standard MySQL extension carries this note:

This MySQL extension will not work with MySQL versions greater
than 4.1.0. For that, use MySQLi. 

--
Tom

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



Re[4]: [PHP] Re: Javascript Mouseover Help

2004-03-18 Thread Tom Rogers
Hi,

Friday, March 19, 2004, 2:26:06 AM, you wrote:

F Tom Rogers [EMAIL PROTECTED] wrote in message
F news:[EMAIL PROTECTED]

F Cool, it works!
F include (the file where the tables are stored) after the the
F variables are defined, and it works.
F I took 3 semesters of C and C++  programming. I should have figured that out myself.

F Thanks Tom. Can you steer me to where the E_ALL error reporting gets activated?
F Some ini file I imagine?

F And oh yeah, I don't know if it helped Jake, but it worked for me.
F Thanks for starting the topic, Jake.

F Dale

For permenent settings it is done in php.ini   ('error_reporting')
while developing you can put this at the top of each page:

error_reporting(E_ALL);

-- 
regards,
Tom

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



RE: [PHP] Problem to display the results of an exec + rsh command

2004-03-18 Thread Chris W. Parker
Frédéric Martin mailto:[EMAIL PROTECTED]
on Thursday, March 18, 2004 7:31 AM said:

 $res = exec(rsh x.x.x.x -l username ping x.x.x.x);
 echo pre $res /pre;
 
 I cannot display the result of the ping made in the remote host.
 any idea to fix that?
 thank you in advance for your tips ...

i don't have any idea why it's not working and i've never used exec(), but maybe you'd 
have better luck with the back tick operator (at least i think it's an operator)?

$res = `rsh x.x.x.x -l username ping x.x.x.x`;


chris.

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



Re: [PHP] HTML/PHP page print

2004-03-18 Thread Jason Giangrande
Manisha Sathe wrote:
How can avoid other stuff on my web page ?
I assume you want to only print the information and not the page header, 
footer, navigation, etc.  There are several ways to do this.  The best 
way is with CSS.  However, if you have not created your page primarily 
with CSS this won't work real well.  The second step is to simply remove 
 any headers or footers that you are including in your page when you 
want to print.  In others words create a link on the page that says 
print that when clicked will not load any footers or headers.  If you 
don't include any footers or headers, you could create a script that 
would remove img tags and some others in order to print only the 
relevant material.

Also when i print then title of document / page no / url / date also get displayed.
How can i avoid it ?
This kind of information is usually from the OS, browser or printer 
driver.  Therefore, it would be very hard if not impossible to turn off 
through server-side scripting or even with JavaScript.

--
Jason Giangrande [EMAIL PROTECTED]
http://www.giangrande.org
http://www.dogsiview.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Letter incrementing

2004-03-18 Thread Justin Patrin
echo char(ord('A') + 1);

Brent Baisley wrote:

You want to use the char() function. What you need to do is increment an 
ascii value and then convert that value to a letter. So ascii 65 is A.
$asciiVal = 65;
echo char($asciiVal);  A
$asciiVal++;
...

On Mar 18, 2004, at 8:16 AM, Brent Clark wrote:

Hi all

Does anyone know how, or even if it is possible to increment a letter 
from the alphabet.

I know that if you use
e.g
$o = 1;
$o++;
will result in $o ==  2,.

But I need to do a $variable = B;
and then do a $variable++ that will result in
$variable == C


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


RE: [PHP] Simple: Whats wrong with this?

2004-03-18 Thread Chris W. Parker
Ford, Mike LSS
on Thursday, March 18, 2004 5:02 AM said:

 Not quite -- the increment is performed immediately after the access
 -- in fact, as part of the same operation.  So:
 
 $x = 3;
 $y = ($x++ * 2) + $x;
 
 is likely to give you $y==10, not 9.

i see. good example.



chris.

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



Re: [PHP] HTML/PHP page print

2004-03-18 Thread Filip de Waard
On Mar 18, 2004, at 4:52 PM, Manisha Sathe wrote:
Hello,

I want to print a document. The values are picked up from database and 
then
PHP displays it is on screen. But I want to print in some predefined 
format
(Customer has printed stationary) by using Browser's print button.

How can avoid other stuff on my web page ? Also when i print then 
title of
document / page no / url / date also get displayed. How can i avoid it 
?
This has nothing to do with PHP, but more with presentation (client 
side). I would like to recommend 
http://www.alistapart.com/articles/goingtoprint/, which is an excellent 
article written by CSS guru Eric Meyer about printing from the web.

Regards,

Filip de Waard

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


RE: [PHP] Re: Global variables in a class? Nested classes VS inheritance...

2004-03-18 Thread Chris W. Parker
 I make a database connection outside of my classes... lets call it
 $myDBConnection. I need to use this connection in a class nested in a
 class... Was wondering the most efficient way of doing this? I don't
 want to create a new db connection in the class. I want to use the
 existing one...

this is really a non-issue if you set up your classes correctly. your
base class should be the one that handles all the database interaction.
this class should have a member that stores the connection.

your extended class should be the one that is more specific to the task
at hand, i.e. managing a user.

the extended class can access all the members of the parent class the
same as if it were it's own.

?php

class DB
{
  var $connection;

  function set_conn()
  {
$this-connection = hello;
  }
}

class User extends DB
{
  function get_connection()
  {
return $this-connection;
  }
}

?

 Any thoughts? Would it make things easyer if the base class
 inherited all nested classes instead of nesting them?
 
 Any help would be appreciated.

hopefully i've sufficiently answered your question.




chris.

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



Re: [PHP] Turn on E_ALL Error Reporting

2004-03-18 Thread Roger Spears
Also, when I use that code in my scripts, if there are any variables 
(arrays too) that are in existence with no value:

$someVariable = ;

it will throw a warning on the screen.

First time I saw that I went into panic mode thinking that I had a huge 
amount of errors/warnings...

You are also going to see some numbers associated with the 
errors/warnings.  You can find out what they mean by going here:
http://us2.php.net/manual/en/function.error-reporting.php

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


[PHP] too much trimming

2004-03-18 Thread Ivan Sergio Borgonovo
I've simple code like this:

-- begin --
#!/usr/bin/php -q
?
$pippo='goofy'
?

hey my name is ?= $pippo ?
and
I feel good
-- end --

I would expect this output:

-- begin --

hey my name is goofy
and
I feel good
-- end --

but I obtain this:
-- begin --

hey my name is goofyand
I feel good
-- end --

Lines are indented with tabs.
I suspect something related to -w flag, but I haven't been able to
switch this behaviour off.

thx

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



[PHP] putting selected text in textarea i a string

2004-03-18 Thread R.G. Vervoort
Is it possible to change selected text in a textarea without using java and
only php or html.

There are lots of solutions in a javascript but i would like to try it
without. If it is possible to place the in a textarea selected text in the
return of a function i like to believe is can be done. So how kan i put
selected text in a string.

tanks

roy

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



Re: [PHP] Re: Global variables in a class? Nested classes VS inheritance...

2004-03-18 Thread Justin Patrin
Chris W. Parker wrote:

I make a database connection outside of my classes... lets call it
$myDBConnection. I need to use this connection in a class nested in a
class... Was wondering the most efficient way of doing this? I don't
want to create a new db connection in the class. I want to use the
existing one...


this is really a non-issue if you set up your classes correctly. your
base class should be the one that handles all the database interaction.
this class should have a member that stores the connection.
your extended class should be the one that is more specific to the task
at hand, i.e. managing a user.
the extended class can access all the members of the parent class the
same as if it were it's own.
?php

class DB
{
  var $connection;
  function set_conn()
  {
$this-connection = hello;
  }
}
class User extends DB
{
  function get_connection()
  {
return $this-connection;
  }
}
?

Any thoughts? Would it make things easyer if the base class
inherited all nested classes instead of nesting them?
Any help would be appreciated.


hopefully i've sufficiently answered your question.



chris.
You may want to take a look at static variables.
http://php.net/variables.scope
Look for static. Static vars may also be in classes.
--
paperCrane Justin Patrin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Get form name after submission

2004-03-18 Thread Jonathan Villa
Is there a way to get the name of the form once it's submitted

like $_POST['form1'] or something.

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



[PHP] Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Chris de Vidal
Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be
able to log into our MySQL-authenticated website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2displaylang=en

Microsoft won't put out this patch into the regular XP updates (I guess
because many websites use an alternate method and it doesn't impact as
many people).  You have to download it manually.

Of course, this is generating many complaints and we even lost a few
customers; people believe we're requring them to install software just to
log in, when we're really just requiring they fix something Microsoft
broke.

So I really need an alternate MySQL-authenticated method.  Surely they exist?

I have a login page on an SSL-enabled Apache server that (I don't admin).

Here's my code (you can download a complete copy from
http://devidal.tv/~chris/mysql_auth.tar.bz2, including the SQL to create
the members table).

login.php:
==
html
head
?php
if ($_GET[login_failed])
{
?
script language=JavaScript
!--
alert (Incorrect email address or password!);
// --
/script
?php
}
?
/head
body
form method=post action=edit_agent.php
input type=text name=email
input type=password name=password
input type=submit value=Log in
/form
/body
===

edit_agent.php:
===
?php
require_once (open_db.php);
require_once (check_login.php);

echo You won't be able to see this unless you have a valid login.;

require_once (close_db.php);
?
==

check_login.php:

?php
require_once (valid_email.php);
$email = $_POST[email];
if (!valid_email ($email))
{
require_once (close_db.php);
header (Location: login.php?login_failed=true);
exit;
}

// Only alphanumeric
$password = preg_replace (/[^\w]/, , $_POST[password]);

$query = 
SELECT ID
FROM members
WHERE Email = '$email'
AND Password = PASSWORD('$password')
AND Active = '1'
;

$result = @mysql_query ($query);

// Only if we have matching records
if ([EMAIL PROTECTED] ($result) = 1)
{
require_once (close_db.php);
header (Location: login.php?login_failed=true);
exit;
}
?
=

valid_email.php:

?php
function valid_email($email)
{
if (ereg (^([^[:space:]]+)@(.+)\.(.+)$, $email))
{
return TRUE;
} else {
return FALSE;
}
}
?
=

open_db.php is just mysql_connect and mysql_select_db, while close_db.php
is just mysql_free_result and mysql_close.  I've included them in the
tarball above as well as the SQL you will need if you want to try this for
yourself.

Again, this code worked well until Microsoft broke IE.  It still works if
you apply the patch that Microsoft isn't rolling out to everyone.

I'd considered using Apache's .htaccess files, but I haven't tried
connecting that to MySQL for authentication.  And I don't have admin
access on the box to install anything on the server.

Ideas??
/dev/idal
GNU/Linux is free freedom. -- Me

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



Re: [PHP] putting selected text in textarea i a string

2004-03-18 Thread Richard Davey
Hello R.G.,

Wednesday, March 17, 2004, 9:18:53 PM, you wrote:

RGV Is it possible to change selected text in a textarea without using java and
RGV only php or html.

RGV There are lots of solutions in a javascript but i would like to try it
RGV without. If it is possible to place the in a textarea selected text in the
RGV return of a function i like to believe is can be done. So how kan i put
RGV selected text in a string.

Erm, your post doesn't make a great deal of sense - but just to
clarify, no you cannot modify the contents of a live textarea from a
PHP function for the simple reason that what you want is a CLIENT-SIDE
change and PHP is 100% SERVER-SIDE. Try using a JavaScript function to
modify a live textarea field.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Get form name after submission

2004-03-18 Thread Richard Davey
Hello Jonathan,

Thursday, March 18, 2004, 5:24:29 PM, you wrote:

JV Is there a way to get the name of the form once it's submitted
JV like $_POST['form1'] or something.

Good question, but the answer is no - I don't believe you can. You
could try passing the form name as a hidden form value? Or name your
submit button accordingly?

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Adam Voigt
What exactly is breaking? If it's the header to redirect, you could just
issue a meta refresh, or a javascript one.


On Thu, 2004-03-18 at 12:38, Chris de Vidal wrote:
 Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be
 able to log into our MySQL-authenticated website:
 http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2displaylang=en
 
 Microsoft won't put out this patch into the regular XP updates (I guess
 because many websites use an alternate method and it doesn't impact as
 many people).  You have to download it manually.
 
 Of course, this is generating many complaints and we even lost a few
 customers; people believe we're requring them to install software just to
 log in, when we're really just requiring they fix something Microsoft
 broke.
 
 So I really need an alternate MySQL-authenticated method.  Surely they exist?
 
 I have a login page on an SSL-enabled Apache server that (I don't admin).
 
 Here's my code (you can download a complete copy from
 http://devidal.tv/~chris/mysql_auth.tar.bz2, including the SQL to create
 the members table).
 
 login.php:
 ==
 html
 head
 ?php
 if ($_GET[login_failed])
 {
 ?
 script language=JavaScript
 !--
 alert (Incorrect email address or password!);
 // --
 /script
 ?php
 }
 ?
 /head
 body
 form method=post action=edit_agent.php
 input type=text name=email
 input type=password name=password
 input type=submit value=Log in
 /form
 /body
 ===
 
 edit_agent.php:
 ===
 ?php
 require_once (open_db.php);
 require_once (check_login.php);
 
 echo You won't be able to see this unless you have a valid login.;
 
 require_once (close_db.php);
 ?
 ==
 
 check_login.php:
 
 ?php
 require_once (valid_email.php);
 $email = $_POST[email];
 if (!valid_email ($email))
 {
 require_once (close_db.php);
 header (Location: login.php?login_failed=true);
 exit;
 }
 
 // Only alphanumeric
 $password = preg_replace (/[^\w]/, , $_POST[password]);
 
 $query = 
 SELECT ID
 FROM members
 WHERE Email = '$email'
 AND Password = PASSWORD('$password')
 AND Active = '1'
 ;
 
 $result = @mysql_query ($query);
 
 // Only if we have matching records
 if ([EMAIL PROTECTED] ($result) = 1)
 {
 require_once (close_db.php);
 header (Location: login.php?login_failed=true);
 exit;
 }
 ?
 =
 
 valid_email.php:
 
 ?php
 function valid_email($email)
 {
 if (ereg (^([^[:space:]]+)@(.+)\.(.+)$, $email))
 {
 return TRUE;
 } else {
 return FALSE;
 }
 }
 ?
 =
 
 open_db.php is just mysql_connect and mysql_select_db, while close_db.php
 is just mysql_free_result and mysql_close.  I've included them in the
 tarball above as well as the SQL you will need if you want to try this for
 yourself.
 
 Again, this code worked well until Microsoft broke IE.  It still works if
 you apply the patch that Microsoft isn't rolling out to everyone.
 
 I'd considered using Apache's .htaccess files, but I haven't tried
 connecting that to MySQL for authentication.  And I don't have admin
 access on the box to install anything on the server.
 
 Ideas??
 /dev/idal
 GNU/Linux is free freedom. -- Me
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP] str_replace or regex

2004-03-18 Thread Adam Williams
Hi, I was wondering if I can get some help with either a str_replace or a 
regex.  I have some data and it always begins with $$ but it can end with 
any letter of the alphabet.  so sometimes its $$a and sometimes its $$b 
and sometimes $$c all the way to $$z. $$a all the way to $$z needs to 
be changed to a /  So is there a way to do this?  I was thinking of a 
str_replace but since the letter always changes I'm not so sure.  Any help?

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



[PHP] Anybody using Ensim Pro 3.5, help badly needed (0T)

2004-03-18 Thread Ryan A
Hey,
If anybody uses ensim please help with the below problem...am going totally
nuts.
I reciently tried to upgrade mysql from 3.23 to 4.0 and in the process had
to take out this rpm
phpMyAdmin-2.3.2-ensim2.rpm
and these files:

php-mysql-4.3.3-0ensim2
perl-DBD-MySQL-1.2219-6
MySQL-python22-0.9.1-1ensim1

via
rpm -e phpMyAdmin-2.3.2-ensim2
rpm -e php-mysql-4.3.3-0ensim2
rpm -e perl-DBD-MySQL-1.2219-6
rpm -e MySQL-python22-0.9.1-1ensim1

via instructions of a dude on the mysql list (i dont know linux)

And now I am unable to get into my control ensim panel, I have joined the
mysql list to try to get 4.0 working
but how do I get ensim working again?
How do I put back these files?

Thanks,
-Ryan

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



[PHP] Re: str_replace or regex

2004-03-18 Thread Justin Patrin
Adam Williams wrote:

Hi, I was wondering if I can get some help with either a str_replace or a 
regex.  I have some data and it always begins with $$ but it can end with 
any letter of the alphabet.  so sometimes its $$a and sometimes its $$b 
and sometimes $$c all the way to $$z. $$a all the way to $$z needs to 
be changed to a /  So is there a way to do this?  I was thinking of a 
str_replace but since the letter always changes I'm not so sure.  Any help?
$replacedText = preg_replace('/\$\$[a-z]/', '/', $text);

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


Re: [PHP] Get form name after submission

2004-03-18 Thread Robert Cummings
On Thu, 2004-03-18 at 12:24, Jonathan Villa wrote:
 Is there a way to get the name of the form once it's submitted
 
 like $_POST['form1'] or something.

Include a hidden field with the name of the form for it's value.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] How to edit a datetime field?

2004-03-18 Thread John W. Holmes
From: Brian Dunning [EMAIL PROTECTED]

 I'm trying to set a datetime field to 24 hours in the future...
 
 NOW()+6000, which worked on a timestamp field, only gives 12 seconds in 
 the future. Algebra suggested I try NOW()+720 which is invalid.

field = NOW() + INTERVAL 1 DAY

or

field = NOW() + INTERVAL 24 HOUR

---John Holmes...

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



Re: [PHP] Get form name after submission

2004-03-18 Thread John W. Holmes
From: Jonathan Villa [EMAIL PROTECTED]

 Is there a way to get the name of the form once it's submitted

 like $_POST['form1'] or something.

No. You'd have to use javascript to set a variable upon submission and then
find that variable.

---John Holmes...

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



Re: [PHP] str_replace or regex

2004-03-18 Thread Richard Davey
Hello Adam,

Thursday, March 18, 2004, 6:06:06 PM, you wrote:

AW Hi, I was wondering if I can get some help with either a str_replace or a
AW regex.  I have some data and it always begins with $$ but it can end with
AW any letter of the alphabet.  so sometimes its $$a and sometimes its $$b
AW and sometimes $$c all the way to $$z. $$a all the way to $$z needs to
AW be changed to a /  So is there a way to do this?  I was thinking of a
AW str_replace but since the letter always changes I'm not so sure.  Any help?

If I read that correctly, you want to replace $$ with /, yes?
In which case a str_replace will do that just fine. Ignore the final
letter of the string and just search for $$ and replace with a /.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Alex Hogan
Hi All,

 

I am parsing data returned from a field that looks like this;

 

6-8-3-5-10-9-6__7-5-9--etc...

 

The code below parses out the data they way I want it but only returns the
first row.  I need to compare all rows and return an average from each of
the parsed out numbers.  Where have I made a mistake?

 

$i = 0;

$total = array();

while($row = mssql_fetch_array($result)){

$thearray = explode('__', $row[$i]);

$n = 0; 

foreach($thearray as $topelement){

   foreach(explode('--', $topelement) as $element){

if(is_numeric($element)) {  

$total[$n] += $element;

echo $element;

$n++;

}

}

$i++;

}

$avg = array();

$num = count($total);

for($x = 0; $num  $x; $x++) {

$avg[] = $total[$x] / $i;

echo br;

echo $avg[$x];

}

}

 

Thanks,

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] str_replace or regex

2004-03-18 Thread John W. Holmes
From: Adam Williams [EMAIL PROTECTED]

 Hi, I was wondering if I can get some help with either a str_replace or a
 regex.  I have some data and it always begins with $$ but it can end with
 any letter of the alphabet.  so sometimes its $$a and sometimes its $$b
 and sometimes $$c all the way to $$z. $$a all the way to $$z needs to
 be changed to a /  So is there a way to do this?  I was thinking of a
 str_replace but since the letter always changes I'm not so sure.  Any
help?

$output = preg_replace('/\$\$[a-z]/','/',$string);

If you wanted to use str_replace, then:

$array = array('$$a','$$b','$$c','$$d'...);
$output = str_replace($array,'/',$string);

---John Holmes...

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



Re: [PHP] str_replace or regex

2004-03-18 Thread Firman Wandayandi
eregi_replace('(\$\$)([a-z].+)', '\1z', '$$a');

Maybe i'm wrong, please crosscheck.

Regards,
Firman

- Original Message -
From: Adam Williams [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 19, 2004 1:06 AM
Subject: [PHP] str_replace or regex


 Hi, I was wondering if I can get some help with either a str_replace or a
 regex.  I have some data and it always begins with $$ but it can end with
 any letter of the alphabet.  so sometimes its $$a and sometimes its $$b
 and sometimes $$c all the way to $$z. $$a all the way to $$z needs to
 be changed to a /  So is there a way to do this?  I was thinking of a
 str_replace but since the letter always changes I'm not so sure.  Any
help?

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



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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
Hi Tom,

 
 Ah, that's good.  Then it is just a problem of MySQL.
 
 Have you tried accessing a remote machine running MySQL 3.2x 
 instead of 4.0?  That seems like an obvious potential culprit.

I just finished doing that on a third machine that didn't have a previous
MySQL installation. I installed the same version that the webserver has. I
had the same results.

I was also disappointed to find that the binary distribution I'm using is
not compiled with debugging support. We've also had another thought... The
webservers are load balanced with a Cisco Local Director. This piece of
equipment is between the webserver and the dbserver. So I am now going to
install the same version of MySQL on another server on the same side of the
Local Director and see if that makes a difference. If not, I plan to
recompile MySQL with debugging and continue.

This really blows and I hope I find the solution soon.

 Note that the standard MySQL extension carries this note:
 
 This MySQL extension will not work with MySQL versions greater
 than 4.1.0. For that, use MySQLi. 
 

Not sure what MySQLi is, but I had thought since the 4.x mysql client worked
from the console, that there was no version problem because it would be
using the same client libraries that PHP is using. Is that not the case?

Thanks,
Cameron

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



Re: [PHP] OT PHP Programmers

2004-03-18 Thread Chris Shiflett
--- Jack Sasportas [EMAIL PROTECTED] wrote:
 Not sure where to post this, but my company is looking to hire an
 inhouse PHP programmer.

You might consider here:

http://www.phpcommunity.org/wiki/Home/PHPJobs

This may potentially turn into a full-fledged PHP job site, depending on
interest.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] Get form name after submission

2004-03-18 Thread Roger Spears
You assign it to a hidden field in your form

input type=hidden name=formName value=actualFormName

in your PHP:
$formName = $_POST['formName'];
of course, this would have to be accomplished BEFORE the form is 
submitted.  Not sure if that is what you are looking for or not...

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


RE: [PHP] too much trimming

2004-03-18 Thread Chris W. Parker
Ivan Sergio Borgonovo mailto:[EMAIL PROTECTED]
on Thursday, March 18, 2004 9:22 AM said:

 but I obtain this:
 -- begin --
 
 hey my name is goofy  and
   I feel good
 -- end --
 
 Lines are indented with tabs.
 I suspect something related to -w flag, but I haven't been able to
 switch this behaviour off.

all i can suggest is that you try putting an extra carriage return in
your code and see what that does. you might also try ?= $var.\n ?.


chris.

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



[PHP] How to LogOut ?

2004-03-18 Thread Labunski
I made Login page using http auth method ($PHP_AUTH_USER), and it's workong
fine.
But how to LogOut user?


Thanks for all the answers.
Lab.

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



Re: [PHP] Get form name after submission

2004-03-18 Thread trlists
On 18 Mar 2004 Richard Davey wrote:

 Good question, but the answer is no - I don't believe you can. You
 could try passing the form name as a hidden form value? Or name your
 submit button accordingly?

I have done this with the Submit button but I find that the results 
vary.  If you click Submit it always works, but for example, with the 
versions I have here, the Submit button value is not posted if you 
press Enter from within a form field in IE, whereas it is in Mozilla.

--
Tom

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



RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread trlists
On 18 Mar 2004 Cameron B. Prince wrote:

 I just finished doing that on a third machine that didn't have a previous
 MySQL installation. I installed the same version that the webserver has. I
 had the same results.

I'm losing track here -- are you saying you can't connect to another 
machine running MySQL 3.x from PHP but you can from the mysql command 
line client?  So this behavior is verified against both a MySQL 3.x and 
4.x server?

If so I agree, getting the router / firewall out of your way is a good 
idea, though why it would matter if you can open a socket connection, I 
don't know.

  Note that the standard MySQL extension carries this note:
  
  This MySQL extension will not work with MySQL versions greater
  than 4.1.0. For that, use MySQLi. 
  
 
 Not sure what MySQLi is, but I had thought since the 4.x mysql client worked
 from the console, that there was no version problem because it would be
 using the same client libraries that PHP is using. Is that not the case?

I'm not at all clear on that.  For one thing it depends if the various 
pieces were built dynamic or static.  I would not make this assumption.

I thought you said the web server had MySQL 3.23 on it -- do you also 
have a MySQL 4 client there?

--
Tom

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



[PHP] Re: Thank you, Microsoft! Now I need an alternate login method

2004-03-18 Thread Andre Cerqueira
try absolute urls on 'Location' headers
if thats the problem, ie is not exactly broken, just making some 
(questionable) standards mandatory

Chris De Vidal wrote:
Microsoft broke IE 6.0 SP1 on XP in January, requiring this patch to be
able to log into our MySQL-authenticated website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=254EB128-5053-48A7-8526-BD38215C74B2displaylang=en
Microsoft won't put out this patch into the regular XP updates (I guess
because many websites use an alternate method and it doesn't impact as
many people).  You have to download it manually.
Of course, this is generating many complaints and we even lost a few
customers; people believe we're requring them to install software just to
log in, when we're really just requiring they fix something Microsoft
broke.
So I really need an alternate MySQL-authenticated method.  Surely they exist?

I have a login page on an SSL-enabled Apache server that (I don't admin).

Here's my code (you can download a complete copy from
http://devidal.tv/~chris/mysql_auth.tar.bz2, including the SQL to create
the members table).
login.php:
==
html
head
?php
if ($_GET[login_failed])
{
?
script language=JavaScript
!--
alert (Incorrect email address or password!);
// --
/script
?php
}
?
/head
body
form method=post action=edit_agent.php
input type=text name=email
input type=password name=password
input type=submit value=Log in
/form
/body
===
edit_agent.php:
===
?php
require_once (open_db.php);
require_once (check_login.php);
echo You won't be able to see this unless you have a valid login.;

require_once (close_db.php);
?
==
check_login.php:

?php
require_once (valid_email.php);
$email = $_POST[email];
if (!valid_email ($email))
{
require_once (close_db.php);
header (Location: login.php?login_failed=true);
exit;
}
// Only alphanumeric
$password = preg_replace (/[^\w]/, , $_POST[password]);
$query = 
SELECT ID
FROM members
WHERE Email = '$email'
AND Password = PASSWORD('$password')
AND Active = '1'
;
$result = @mysql_query ($query);

// Only if we have matching records
if ([EMAIL PROTECTED] ($result) = 1)
{
require_once (close_db.php);
header (Location: login.php?login_failed=true);
exit;
}
?
=
valid_email.php:

?php
function valid_email($email)
{
if (ereg (^([^[:space:]]+)@(.+)\.(.+)$, $email))
{
return TRUE;
} else {
return FALSE;
}
}
?
=
open_db.php is just mysql_connect and mysql_select_db, while close_db.php
is just mysql_free_result and mysql_close.  I've included them in the
tarball above as well as the SQL you will need if you want to try this for
yourself.
Again, this code worked well until Microsoft broke IE.  It still works if
you apply the patch that Microsoft isn't rolling out to everyone.
I'd considered using Apache's .htaccess files, but I haven't tried
connecting that to MySQL for authentication.  And I don't have admin
access on the box to install anything on the server.
Ideas??
/dev/idal
GNU/Linux is free freedom. -- Me
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Letter incrementing

2004-03-18 Thread David Otton
On Thu, 18 Mar 2004 15:16:34 +0200, you wrote:

But I need to do a $variable = B;
and then do a $variable++ that will result in
$variable == C

for ($i = 0; $i  26; $i++)
{
  echo (chr($i + ord('A')));
}


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



Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Chris de Vidal
Adam Voigt said:
 What exactly is breaking? If it's the header to redirect, you could just
 issue a meta refresh, or a javascript one.

The only time redirects are sent is when there is a failure.  Otherwise
it's a simple post operation to a PHP file with an include.

Have another look at the code.  Try it on your server if you'd like.  You
can replicate the problem with an XP box that's recently (this month) been
automatically updated.

CD

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



Re: [PHP] Thank you, Microsoft! Now I need an alternate loginmethod

2004-03-18 Thread Adam Voigt
 Have another look at the code.  Try it on your server if you'd like.  You
 can replicate the problem with an XP box that's recently (this month) been
 automatically updated.

If I ran XP I might be able to do that. From reading the security
release my MS, it sounds like some times the POST request gets b0rked,
if this is the case, I'm not sure there's much that can be done about
it.


-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread Chris W. Parker
Alex Hogan mailto:[EMAIL PROTECTED]
on Thursday, March 18, 2004 10:39 AM said:

 Hi All,
 
 
 
 I am parsing data returned from a field that looks like this;
 
 
 
 6-8-3-5-10-9-6__7-5-9--etc...
 
 
 
 The code below parses out the data they way I want it but only
 returns the first row.  I need to compare all rows and return an
 average from each of the parsed out numbers.  Where have I made a
 mistake? 
 
 
 

thanks for all the white space. one blank line isn't enough for my brain
to properly separate the different parts of your email. but now, thanks
to your extra white space i don't have a headache anymore. thanks again!
it really helps!

and now to more serious matters... ;)

 while($row = mssql_fetch_array($result)){

you're grabbing the entire result set all at once so you'll only execute
this while statement once. that's why it only does the first line. do
the the following instead:

$entire_recordset = mssql_fetch_array($result);

foreach($entire_recordset as $row)
{
// looping code goes here
}

this is just my take on your code at first glance.


hth,
chris.

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



Re: [PHP] Parsing recordsets - only first row returned

2004-03-18 Thread John W. Holmes
From: Alex Hogan [EMAIL PROTECTED]

 I am parsing data returned from a field that looks like this;

  6-8-3-5-10-9-6__7-5-9--etc...

Wow... you're totally missing the point of a database when you store data
like this.

 The code below parses out the data they way I want it but only returns the
 first row.  I need to compare all rows and return an average from each of
 the parsed out numbers.  Where have I made a mistake?



 $i = 0;

 $total = array();

 while($row = mssql_fetch_array($result)){

So how many times does the while() loop execute? How many rows is your query
actually returning? What does the output actually look like and what should
it look like.

---John Holmes...

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



[PHP] date()

2004-03-18 Thread Khalid Judeh
hello all,
i am new to php, i am trying to call the date  function this way:
?php echo date(d/m/y); ?
and the result i get is: object18/03/04
any help would be appreciated
 



Khaled Jouda 

cell. phone: 0163-2382758 
fax: 1(801)439-1253 
alternative email: [EMAIL PROTECTED]
_


Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam

  1   2   >