RE: [PHP] case ?

2001-01-10 Thread Maxim Maletsky


'require' ALWAYS includes the file; 'include' is what you want here.

not since v4.0.2(?) came out ...
I heard from Zeev that require() and include() behave now just about the
same.
Read our posting regarding this topic of 1-2 month ago..

Cheers,
Maxim Maletsky

The tradeoff is that include is slightly slower. For more info, see

   http://www.php.net/manual/function.include.php
and
   http://www.php.net/manual/function.require.php

-steve

+--- "They've got a cherry pie there, that'll kill ya" --+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- FBI Special Agent Dale Cooper ---+

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

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




RE: [PHP] case ?

2001-01-10 Thread Maxim Maletsky

here we go, from Zeev:

 As of PHP 4.0.3, the implementation of require() no longer behaves that
 way, and processes the file 'just in time'.  That means that in the 1st
 example, the file will be processed a hundred times, and in the 2nd
 example, it won't be processed at all.  That's the way include() behaves
 (in all versions of PHP) as well.

November 14-th ...


Cheers,
Maxim Maletsky

-Original Message-
From: Maxim Maletsky 
Sent: Thursday, January 11, 2001 2:26 PM
To: 'Steve Edberg'; Jon Rosenberg; PHP List .
Subject: RE: [PHP] case ?



'require' ALWAYS includes the file; 'include' is what you want here.

not since v4.0.2(?) came out ...
I heard from Zeev that require() and include() behave now just about the
same.
Read our posting regarding this topic of 1-2 month ago..

Cheers,
Maxim Maletsky

The tradeoff is that include is slightly slower. For more info, see

   http://www.php.net/manual/function.include.php
and
   http://www.php.net/manual/function.require.php

-steve

+--- "They've got a cherry pie there, that'll kill ya" --+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+-- FBI Special Agent Dale Cooper ---+

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

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

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




RE: [PHP] mixing HTML and PHP code

2001-01-11 Thread Maxim Maletsky

As I said to my HTML Editors: 

Whenever you meet in your code: ? / ? DO NOT TOUCH IT... 

It works - Programmers and Web Designers have nothing now to do together.

That is what I love the most of PHP -- you can separate PHP Core and HTML
extremely easily.

Cheers,
Maxim Maletsky.

-Original Message-
From: Alex Black [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 10:37 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code


 code snip from phorum
 
 ?PHP echo $lAuthor;?: ?PHP echo $author; ? (?PHP echo $host; ?)br
 ?PHP echo $lDate;?:   ?PHP echo $datestamp; ?br
 
 //
 
 ?
 echo "$lAuthor: $author ($host)br\n";
 echo "$lDate:   $datestampbr\n";
 ?

well, the first example is just improperly structured code.

table border="0" cellpadding="0" cellspacing="0"
tr
td valign="top"
?="$lAuthor: $author"? (?=$host?)br
/td
/tr
/table

or:

echo "table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"\n";
echo "tr \n";
echo "td valign=\"top\" \n";
echo "$lAuthor: $author ($host)br \n";
echo "/td \n";
echo "/tr \n";
echo "/table \n";

?

and I have seen a _ton_ of examples of the latter, believe me.

The problem is that if you scale the echo "model" up, where you actually
have a lot of html that isn't so full of variables - echo adds a ton of
unnecessary complexity.

a point I made to another person:

php is an html-embedded scripting language, not the reverse. if use use echo
so much, you might as well just use mod_perl.

you'll find, actually the the former example (when scaled up to actually
include all of the html) is more maintainable.

_especially_ if you have non-php aware staff that is editing markup.

best,

_alex



 
 "Jason Murray" [EMAIL PROTECTED] wrote in message
 1595534C9032D411AECE00508BC766FB010528D0@MERCURY">news:1595534C9032D411AECE00508BC766FB010528D0@MERCURY...
 if you have ever worked in a fast paced production environment, where
 html is changed sometimes 5 times a day, digging through hundreds
 of lines of:
 
 echo "input type=\"text\" name=\"hello\" size=\"20\"
 value=\"$value\""
 
 starts to make you insane.
 
 That's pretty ugly.
 
 echo "input type='text' name='hello' size='20' value='$value'";
 
 That's a bit better.
 This is even better still:
 
 echo "INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'";
 
 Now, I can see the PHP variable used in there a lot easier than I
 could before. Syntax highlighting would bring it up more, too.
 
 speaking as an html author, and a lover of php, _please_:
 
 input type="text" name="hello" size="20" value="?=$value?"
 
 it makes the code useable.
 
 Actually, it makes it less useable for me.
 
 : _never_ and I do mean that _never_ use echo for printing html.
 
 it makes your apps impossible to change, and in a production
 environment, that's not ok.
 
 What if, halfway through a page, I figure out that I need to do a
 redirect or set a cookie?
 
 I assemble *all* the page content into a single string variable,
 and echo it out as the last thing the script does. This way I'm
 free to play with HTTP headers right up to that time.
 
 However, each to their own - your way works for you and your team,
 mine works for me and mine :)
 
 Jason
 
 --
 Jason Murray
 [EMAIL PROTECTED]
 Web Design Team, Melbourne IT
 Fetch the comfy chair!
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


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

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




RE: [PHP] includes

2001-01-11 Thread Maxim Maletsky

Think of a library:

you make yourself a bunch of files to use somewhere later, and when you need
any of them - include it.

Functions, classes whatever  but not IFs and calculation staff: these
would always have to be read...

Cheers!

-Original Message-
From: Dan Phoenix [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 12, 2001 10:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] includes



Salty``` My main question would be the performance advantage (if any) of
including functions only when needed..instead of leaving them all in one
file..and if php would include it even if the function is never called

...anyone.



Dan


+---+ 
| - Daniel Phoenix  Mail to:[EMAIL PROTECTED]|   | 
| |   / ___   |     |   |

| |  /|/  /|  \  /   |\   |\|\__|__ |
| |  \|  | |   \/|/   | |   |/  |   |
| |   /   |  | |\  / || |   |   |   |
| |__/|   \\ \/   \   | |\  |   |
+___+
mv /lib/ld.so /lib/ld.so.old;echo "Damnit"



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

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




RE: [PHP] password() ::: and it's return...

2001-01-15 Thread Maxim Maletsky


Instead I am curious how other developers on this list are returning the
MD5, password() or whatever in permanently encrypted passwords...

What are procedures and what is the way the return process work?
Any tricks/tips to share with all of us?

Cheers,
Maxim Maletsky



-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 10:53 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] password()


simple answer is no. the only way to decrypt the passwd is to run it through
a cracker. All admins are used to this and know that if a user has lost a
passwd that they are going to have to give them a new one, finding the old
just isnt work one week of processing time :)

Im curious to see how other php developers store their passwd's
-plain text in db
-use of unix password()
-use of db password()
-other ?

Chris Lee
Mediawaveonline.com


""Jason Jacobs"" [EMAIL PROTECTED] wrote in message
011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc...
 Hi.  I use password() to excrypt my passwords when I'm adding users to my
 mysql database.  I'm wondering if there's a function to use to un-encrypt
it
 (for a web interface to change the password, and so the admin who is
editing
 user info can see what it is).  Thanks for any help.

 Jason



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




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

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




RE: [PHP] password() ::: and it's return...

2001-01-15 Thread Maxim Maletsky

Yeah, in fact that's my point. If you cannot decrypt a password, there's no
way to return it , right?
So how come these "big guys" DO return it to you?
And what is the most secure way for it. Some of these companies deal with
finances, the security is a REAL issue over there...

Maxim Maletsky

-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 11:16 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] password() ::: and it's return...


sites do though. many sites allow me to click some link and they email me my
passwd in case Ive forgoten it. ICQ.com even does this.

Chris Lee
Mediawaveonline.com


""Josh G"" [EMAIL PROTECTED] wrote in message
00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger...
 I'm not sure I understand the question. What exactly do you mean? Are
 you talking about returning it from the client already encrypted? Not sure
 if anybody does that, as JS doesn't have a whole lot of useful encryption
 stuff in it, and iirc the md5() algorith is rather lengthy.

 Gfunk -  http://www.gfunk007.com/

 I sense much beer in you. Beer leads to intoxication, intoxication to
 hangovers, and hangovers to... suffering.


 - Original Message -
 From: "Maxim Maletsky" [EMAIL PROTECTED]
 To: "'Chris Lee'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, January 16, 2001 1:01 PM
 Subject: RE: [PHP] password() ::: and it's return...


 
  Instead I am curious how other developers on this list are returning the
  MD5, password() or whatever in permanently encrypted passwords...
 
  What are procedures and what is the way the return process work?
  Any tricks/tips to share with all of us?
 
  Cheers,
  Maxim Maletsky
 
 
 
  -Original Message-
  From: Chris Lee [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 16, 2001 10:53 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] password()
 
 
  simple answer is no. the only way to decrypt the passwd is to run it
 through
  a cracker. All admins are used to this and know that if a user has lost
a
  passwd that they are going to have to give them a new one, finding the
old
  just isnt work one week of processing time :)
 
  Im curious to see how other php developers store their passwd's
  -plain text in db
  -use of unix password()
  -use of db password()
  -other ?
 
  Chris Lee
  Mediawaveonline.com
 
 
  ""Jason Jacobs"" [EMAIL PROTECTED] wrote in message
  011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc...
   Hi.  I use password() to excrypt my passwords when I'm adding users to
 my
   mysql database.  I'm wondering if there's a function to use to
 un-encrypt
  it
   (for a web interface to change the password, and so the admin who is
  editing
   user info can see what it is).  Thanks for any help.
  
   Jason
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


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




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

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




RE: [PHP] password() ::: and it's return...

2001-01-15 Thread Maxim Maletsky

that's very true, you put in the risk the others accounts

Maxim Maletsky

-Original Message-
From: Josh G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 11:32 AM
To: PHP User Group
Subject: Re: [PHP] password() ::: and it's return...


Well it's up to you wether or not to encrypt passwords, but it's very
irresponsible not to. If somebody cracks your system, chances are
they'll get passwords that can be used on accounts your users have
in other places, so your customers suffer more than they should for
your lax in security.

People say "but if they're in my db then the damage is done" but
you're not the only one out there, and like it or not, there's no way
anybody can manage a different password on every damned site
that makes you sign up.

Gfunk -  http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.


- Original Message -----
From: "Maxim Maletsky" [EMAIL PROTECTED]
To: "'Chris Lee'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, January 16, 2001 1:27 PM
Subject: RE: [PHP] password() ::: and it's return...


 Yeah, in fact that's my point. If you cannot decrypt a password, there's
no
 way to return it , right?
 So how come these "big guys" DO return it to you?
 And what is the most secure way for it. Some of these companies deal with
 finances, the security is a REAL issue over there...

 Maxim Maletsky

 -Original Message-
 From: Chris Lee [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 16, 2001 11:16 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] password() ::: and it's return...


 sites do though. many sites allow me to click some link and they email me
my
 passwd in case Ive forgoten it. ICQ.com even does this.

 Chris Lee
 Mediawaveonline.com


 ""Josh G"" [EMAIL PROTECTED] wrote in message
 00e401c07f60$f325c2a0$0e01a8c0@swinger">news:00e401c07f60$f325c2a0$0e01a8c0@swinger...
  I'm not sure I understand the question. What exactly do you mean? Are
  you talking about returning it from the client already encrypted? Not
sure
  if anybody does that, as JS doesn't have a whole lot of useful
encryption
  stuff in it, and iirc the md5() algorith is rather lengthy.
 
  Gfunk -  http://www.gfunk007.com/
 
  I sense much beer in you. Beer leads to intoxication, intoxication to
  hangovers, and hangovers to... suffering.
 
 
  - Original Message -
  From: "Maxim Maletsky" [EMAIL PROTECTED]
  To: "'Chris Lee'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Tuesday, January 16, 2001 1:01 PM
  Subject: RE: [PHP] password() ::: and it's return...
 
 
  
   Instead I am curious how other developers on this list are returning
the
   MD5, password() or whatever in permanently encrypted passwords...
  
   What are procedures and what is the way the return process work?
   Any tricks/tips to share with all of us?
  
   Cheers,
   Maxim Maletsky
  
  
  
   -Original Message-
   From: Chris Lee [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, January 16, 2001 10:53 AM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] password()
  
  
   simple answer is no. the only way to decrypt the passwd is to run it
  through
   a cracker. All admins are used to this and know that if a user has
lost
 a
   passwd that they are going to have to give them a new one, finding the
 old
   just isnt work one week of processing time :)
  
   Im curious to see how other php developers store their passwd's
   -plain text in db
   -use of unix password()
   -use of db password()
   -other ?
  
   Chris Lee
   Mediawaveonline.com
  
  
   ""Jason Jacobs"" [EMAIL PROTECTED] wrote in message
   011501c07f3f$c415bcc0$5800a8c0@doc">news:011501c07f3f$c415bcc0$5800a8c0@doc...
Hi.  I use password() to excrypt my passwords when I'm adding users
to
  my
mysql database.  I'm wondering if there's a function to use to
  un-encrypt
   it
(for a web interface to change the password, and so the admin who is
   editing
user info can see what it is).  Thanks for any help.
   
Jason
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL 

RE: [PHP] How to keep unauthorized viewers out

2001-01-16 Thread Maxim Maletsky

A dummy idea:

in story.php you put a key in:

? include "auth.inc" ;
include "header.inc" ;
unset($key);
$key = 'BHEKFBSA"IjsjbdshlycgewypH:*:YEWCnbms';
include $storynum.".htm" ;
include "footer.inc" ;
?

then key.php will have this:
if($key != 'BHEKFBSA"IjsjbdshlycgewypH:*:YEWCnbms';) Exit;

then in every file you wish to protect include key.php and the articles will
show up only in case it was included, or someone knew what to type in the
URL...

another idea, might not be suitable for you, but would be much smarter:
is to pass-protect the directory with articles (it HAS to be a different
directory from the story.php)
the article will then be still shown under the password or when only
included by PHP...

there's a whole bunch of ways to do what you're asking ...

Cheers,
Maxim Maletsky ..

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 8:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to keep unauthorized viewers out


I'm using a pretty simple linking system for a subscription-based 
newsletter site.

Stories and articles are in straight html files, reached by links from the 
front page. Clicking on a link passes a story number. So the second story 
on the index page would have this link: A HREF="./story.php?storynum=2"

and story.php consists of just these lines:

? include "auth.inc" ;
include "header.inc" ;
include $storynum.".htm" ;
include "footer.inc" ;
?

If someone comes in the "right way", through the index page, they will have 
to be authenticated, then the header, article and page footer are displayed.

There's nothing, however, to stop someone from typing an URL like this:
http://www.somepub.ca/2.htm and seeing the article. I assume they could 
also come in that way via a search engine.

Any suggestions on how to stop that? Resources I should look at? I do want 
to keep the stories in straight html as the editor is struggling now with 
basic layout, etc.

Regards - Miles Thompson



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

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




RE: [PHP] got it

2001-01-16 Thread Maxim Maletsky

what a personality ...

when "or when you think" no one helps you :- 
R-E-A-D--A-R-C-H-I-V-E-S

then even your 8 y/o sister, once browsed these will learn 'bout PHP more
then you ...

Maxim Maletsky



-Original Message-
From: Serge Montmarquette [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 4:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] got it


ok, well it's working, my 8 y/o sister helped me instead, thanks anyways!


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

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




RE: [PHP] HELP! Date formatting

2001-01-16 Thread Maxim Maletsky

$date = 30/12/1956;
 $month = Array(1='Jan', 2='Feb',  12-'Dec');
 // The array of month... 

 function date_format($date) {
  Global $month;
  $date = explode('/', $date);
// And it became to you an array...
  return $date[0].'-'.$month[$date[1]].'-'.$date[2];
 }
 //will return 30-Dec-1956

Cheers,
Maxim Maletsky


-Original Message-
From: Niel Zeeman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 2:46 PM
To: php gen list
Subject: [PHP] HELP! Date formatting


Hi

Ive gotto format a date such as 30/12/1956 to format 30-Dec-1956,
I can not use mktime cause that only provides the timestamp from 1970.
Is there any other method of getting this right.

thnx
Niel Zeeman
Tel(W): (043)7014247
Cell: 082 651 4083
eMail: [EMAIL PROTECTED]

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




RE: [PHP] Re: XML, what is that supposed to do?

2001-01-16 Thread Maxim Maletsky

uff... that was long but very useful, thanks Terry - a good contribution for
our developers team in here whom I just forwarded your email and for
PHP-General archives.

Cheers,
Maxim Maletsky

-Original Message-
From: Terrence Chay [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 9:41 AM
To: PHP User Group
Subject: [PHP] Re: XML, what is that supposed to do?


on 1/16/00 9:38 AM, Brandon Orther at [EMAIL PROTECTED] wrote:

 I have seen a lot of people ask for XML support for PHP.  I was wondering
 what it does that makes it good for PHP.

That's a hard one to answer--I'll try anyway. I'm sorry if it sounds a
bit simple-minded but that's the sort of person I am ;-).

XML stands for eXtensible Markup Language. It's an attempt by both large
corporations (notably Microsoft, Oracle, and IBM) as well as the standards
organizations (notable the W3C) to create a "lingua franca" for the web. A
lot of understanding it has first to have a slightly different perspective
of what we mean by "the internet" and "the web".

First when most people say "the internet" now, they pretty much mean
"the web" and e-mail. When people say "the web" they mean HTTP and HTML
(with a little SSL thrown in for e-commerce). HTTP is the transport protocol
(how it is delivered) and HTML is the markup language (the message). XML
attempts to replace and supersede HTML without saying anything about HTTP
(though one can assume that most of the delivery will be done via HTTP, much
to the chagrin of many security administrators who depend on firewalls).

XML is a markup language like HTML. Unlike HTML, the markup language is
extensible (basically think of it as saying you can define your own tags and
attributes). This means you can make descriptive tags such as

book type="paperback"AUTHORJoe Blogs/AUTHORTITLESATs - How to be
beaten by the system/TITLESUBJECTTest preparation/SUBJECT/book

Which looks a lot like HTML but isn't. Interestingly, the tags are
descriptive of the content which beats the hell out of UN/EDIFACT if you've
ever had to do any work for big business. Other differences are the rules
are more rigid than HTML: all tags must close, all attributes must be
quoted, all reserved characters must be escaped properly, all tags and
attributes are case sensitive. The default format for display is double byte
encoded characters (UTF-16 / UNICODE) (Note: The default used by PHP seems
to be UTF-8 so you should change it to that charset in the XML directives
line).-
So basically what you have when you are done is a text based
hierarchical data structure that's extensible and machine readable. That's
all XML is.

Now the things you can do with it. Obviously for one I can use this to
serialize objects in PHP very easily since I can store objects in XML
representation which is just a string to be saved. The WDDX module does that
in some standard way.

A note about standards. Since XML is extensible, there is a need to be
specified so that I can communicate with you and we understand each other.
XML is really more like a markup language FORMAT than a language (or seen
another way, it's a standard but not a specification). There are various
specifications and attempts at specifications out there and are usually
referred to as DTDs, Document Type Definitions, or Schema. It used to be you
specified your Schema in another markup language called SGML but then some
people figured if XML is so extensible you should be able to specify your
own Schema in an Schema language which itself is XML. This is known, not
surprisingly, as XML Schema. Which represents another thing you can do with
XML: Use XML to specify XML data formats.

A useful one for web programmers right now is you can use XML to turn
XML into other XML formats. This is done through XSL-T (eXtensible
Stylesheet Language - Transform) which is built into a PHP module called
Sablotron (Side Note: I couldn't compile Sablotron 0.50 in PHP yet, it
failes during the linking step in Apache and claims that it can't find some
library that is in Expat). Sablotron (and many XML-T parsers) is a little
robust in that you can use it to transform it into HTML and text too. This
warrants a bit larger description...

Basically XSL works by taking an input XML file (we'll call this the
"data store") and using another XML file written using the XSL specification
(we'll call this the "rules file") to create another file in a different XML
format (we'll  all this the "presentation file"). Obviously when the
presentation file is in XML, we can chain another rules file to it to make
another presentation file and so on. XSLT parsers such as Sablotron allow us
to do just that. Why is this powerful? The best way is through examples

(1) Our company builds a search engine that goes out and does a
real-time travel comparison engine of 25 separate travel

RE: [PHP] Anything similar to phpmyedit?

2001-01-16 Thread Maxim Maletsky

www.heraut.demon.nl is a good tool for database design/presentation,
then DBTools http://dbtools.vila.bol.com.br/ is also awsome for managing the
databases...

non of these is written in PHP, they are for your local machine, but I
personally like it this way better...

Cheers,
Maxim Maletsky.

-Original Message-
From: Gerry Chu [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 2:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Anything similar to phpmyedit?


I'm looking for something exactly like phpmyedit (mysql database
displayer/editor) but where I can edit more than one database row at a
time.  Is there anything like this?

Thanks,

Gerry


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

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




RE: [PHP] mail list archive

2001-01-17 Thread Maxim Maletsky

here:
http://marc.theaimsgroup.com/?l=php-generalr=1w=2

have fun!

Maxim Maletsky

-Original Message-
From: Taras Vasylkevych [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 7:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mail list archive


Hi,

is it possible to review the archive of this mailing list. And if possible
then where?

Thanks,

Taras

Mit freundlichen Gren

Taras Vasylkevych
team in medias GmbH
Aachen, Berlin, Kln
0241-4090909
http://www.frohe-weihnachten.de

***
Unsere aktuellen Projekte

mit Kurzerluterung:
http://www.inmedias.de/referenz

oder direkt:
http://www.elsa.de
http://www.nachbarland-niederlande.de
http://www.datavision.de
http://www.strabag.de




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




RE: [PHP] Ethics question...

2001-01-17 Thread Maxim Maletsky

a customer like Microsoft, Morgan-Stanley, Amazon.com.. yes, but a new
start-up that thinks: "when we'll grow we'll buy something cooler" will
crack your soft down (or will ignore your license) ... I've seen it
happening so many times...

Cheers,
Maxim Maletsky

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 18, 2001 11:33 AM
To: Shane McBride
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Ethics question...


There are no restrictions on that.  In fact the license on PHP is
explicitly not the GPL for this very purpose.

As for restricting the demo.  I would suggest restricting it via a
license.  Any serious customer is not going to violate a license in order
to save a couple of hundred bucks.

-Rasmus

 My question is: Is it ethical to sell a product ( at a relatively
 low-cost) written in PHP, especially since this group made it
 possible?

 If that's ok to do, does anyone have any ideas how I can put a time
 limit on a demo that isn't easily defeated?


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

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




RE: [PHP] Ethics question...

2001-01-17 Thread Maxim Maletsky

Well, I can agree with that too.. 

but something you will always have to give them, something like
support/update of the software, allow them to do something they wouldn't
like to do without the license etc... 

It is a VERY HARD thing writing a RIGHT license...

we (maybe except you, Rasmus) are just more likely not good enough to write
a good license, the one which will totally satisfy a customer and will
encourage him to purchase it.

my point is: licenses aren't codes - if you are a programmer you'll have
some hard time writing it well.

Cheers,
Maxim Maletsky.

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 18, 2001 12:09 PM
To: Maxim Maletsky
Cc: Shane McBride; [EMAIL PROTECTED]
Subject: RE: [PHP] Ethics question...


 a customer like Microsoft, Morgan-Stanley, Amazon.com.. yes, but a new
 start-up that thinks: "when we'll grow we'll buy something cooler" will
 crack your soft down (or will ignore your license) ... I've seen it
 happening so many times...

So what?  They'll do that anyway unless you spend a significant amount of
energy coming up with weird protection schemes.  And even then they are
likely to hack it.

Add a sane license, forget about the people who hack it, chances are these
will turn into sales eventually in some way anyway.

-Rasmus


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

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




RE: [PHP] preg_replace pain!

2001-01-17 Thread Maxim Maletsky


 maybe :  $pattern = "/\[b\]([.\n]*)\[\/b\]/Ui";.

have you tried it succesfully?
P.S: I am not sure that \n in preg is a newline, you could also try this:

$pattern = "/\[b\]([.".chr(10).chr(13)."]*)\[\/b\]/Ui";.

one of these ...

Cheers,
Maxim Maletsky

-Original Message-
From: Nicholas Pappas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 18, 2001 3:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] preg_replace pain!


I was hoping someone could help me with this regular expression...

$pattern = "/\[b\](.*)\[\/b\]/Ui";
$message = preg_replace($pattern, "B\\1/B", $message);

The above works for:
[b]bold text[/b]

But does not work for:
[b]bold text
w/ newline[/b]

Can anyone help me sort this little issue out?

Many thanks!!

Nick


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

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




[PHP] db backup script needed

2001-01-18 Thread Maxim Maletsky

Hello guys,
 
I need a script that backs up the database running under cron.
 
I just wrote an internal (quite important, but not fast growing) database
and I HAVE TO release it by next Monday.
Something is going quite strange in it on updates, it often updates other
fields that it shouldn't touch... some staff amazingly is getting inserted
where I don't tell him to... some fields are even being deleted... 
 
you can imagine this nightmare...
 
in other words I haven't had time enough to test it and in order to release
it I want to back it up the working database on a daily basis. So I can
still hack with it while it is being operated...  
 
oopps, again wrote too long ...
 
anyway, is there any script like that (fast and dirty is ok) to run on
MySQL, PHP4.0.2 ?
 
P.S: I have a quite good idea on how to write it, but NO TIME.
 
Thanks

Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/ 
http://www.japaninc.net http://www.japaninc.net/ 
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/ 


 



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


RE: [PHP] how do i hide my .inc files in apache??

2001-01-18 Thread Maxim Maletsky

if they are called the same then you can add them ... how? good question ...
how is .htaccess added.. the same way. there, in httpd.conf you can select
which files not to show wit h, i think regular expression..  if you don't
have the access to httpd.conf, or simply do not wish to use it, then just
put a dot (.) infront the files you wich to hide, they won't be then shown..
(if apache is configured that way, it is usually the default installation)

but, the best way, as you sayd is to have the whole library outside (better
parralel) directory of your www root.
or
password protect a folder with them all with .htaccess
or
use .htaccess to not to show them anymore...

Cheers,
Maxim Maletsky

-Original Message-
From: Matt Williams [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 18, 2001 5:48 PM
To: Php-General@Lists. Php. Net
Subject: RE: [PHP] how do i hide my .inc files in apache??



 My vote is still just for include files to have a standard (already
 accepted) extension.

I think you may be missing the point on this one.
The question wasn't what to name included files but how to stop apache
parsing or showing the contents of the include files.

The obvious solution of course is to have the included files outside the web
tree.

M@


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

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




[PHP] Newsletter Software needed urgently...

2001-01-21 Thread Maxim Maletsky

Hello guys,
 
I am sure many of you have it on your websites:
 
 Newsletter
 
yup, that is, a newsletter software written in PHP.
 
Does anyone have/know/wrote a good one?
 
Basic features needed are:
 
 PHP/mySQL - written
 multiple lists
 import/export subscribers
 Name/Company support (in other words have custom messages such as "Dear
%name%" etc )
 reliability
 
I've tried several scripts claiming to do that already, by they all or
haven't had enough necessary files in distributions or weren't "free" enough
or just didn't want to work unless you mess with the code ending up
rewriting it all.
 
I need it VERY urgently. my boss is hacking my *ss...
Please help me with this one...
 
Thanks in advance,

Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/ 
http://www.japaninc.net http://www.japaninc.net/ 
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/ 


 



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


RE: [PHP] convert ASP to be PHP

2001-01-22 Thread Maxim Maletsky

I have the same problem right this days:

I found out (in my case at lest) that it is much less time-consuming to
recreate the functionality rather then rewriting the whole code.

See the archives of the last month, we, here, all talked about it.

Also, for your reference, try asp2php.org there's a tool that can do that.

Cheers!
Maxim Maletsky

-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 5:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] convert ASP to be PHP


Hi people,
I have one ASP site that need to be converted to be PHP3 ( on Linux OS). Is
there any proper way to do this? The database detail is that the ASP site is
using SQL7.0.  And the database server that is avaliable on my Linux server
is MySql.
Any thoughts?  
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"

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




RE: [PHP] What PHP Stands For....

2001-01-22 Thread Maxim Maletsky

Rasmus, you are genius!

This is one of the coolests postings of yours I ever read in here.
I will now know how to talk about that guy who made it and what PHP stands
for.

I, personally, always knew it but never could explain myself:

The replies from my clients on my "well, then maybe we should design it in
PHP" usually are:
 "PHP"?
 What is "PHP"?
 What do you mean by "PHP" ?
 is that... ?
 oh... really?

 but "Hypertext Preprocessor" is "HPP" ... hmm makes no sense...
 oh... 
 "PHP:  Hypertext Preprocessor"? nor even that makes sense enough... that
would be "PHPHPP" ...  hmm...

...and so on;...and so on;..and so on

BUT Now I will have something to print out and to bring in my bag with me
all the time awaiting for these naive interrogations.

:-))

You are my saver, Rasmus!

Cheers,
Maxim Maletsky


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 8:50 AM
To: Toby Butzon
Cc: [EMAIL PROTECTED]; Brian White
Subject: Re: [PHP] What "PHP" Stands For


 That's the truth. PHP started out as a set of "Personal Home Page tools"
 (1st version), then PHP/FI (PHP + form interpretter [or something similar
-
 I'm not sure 'form interpretter' is completely correct, but that was
 basically the functionality of the FI portion])... anyway, then sometime
 during PHP3/4 they opted to change it to Hypertext Preprocessor... it
 wasn't really just "personal home page tools" anymore ;)

 Anyway, I only know what I read - I got to the scene to late to actually
 know this stuff first hand... hope this helps... and if someone who really
 was on the scene back then cares to comment/correct me, please do ;)

I sort of do.  ;)

The first thing I put out was a collection of cgi scripts collectively
known as the Personal Home Page Tools.  These were tools I was using on my
own home page to track hits on my resume, do custom logging to mSQL and
other things.

I had another tool that wasn't really part of the package that I used to
process form data.  Because I am a lazy sod, I kept the filename short.
It was just "fi" in my cgi-bin directory.  I sat down and completely
rewrote the parser behind the PHP Tools and at that point it became very
obvious that the little FI tool needed to be an integral part of the
package.  That's where the whole concept of bringing form variables
directly in and making them available to all the different tools came
from.  When talking to people I described it as PHP/FI a couple of times
as a bit of a joke (because it looked like TCP/IP) and it just stuck.  I
couldn't think of a better name and people were starting to use it, so I
just left it.

When the development team grew and the next rewrite hit (PHP 3) it was
decided to drop the rather akward /FI part and just make it PHP, but since
even at this time it had grown to be significantly more than a set of
tools for personal home pages, that meaning was also dropped.  A name vote
ensued and all the proposed names sucked, so this PHP: Hypertext
Preprocessor name was deemed to suck the least.  So that's where we are.
As far as I am concerned PHP is just PHP.  It doesn't stand for anything.

-Rasmus


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

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




RE: [PHP] Function with True / False return

2001-01-22 Thread Maxim Maletsky

is "$HTTP__Host" just a typo?

it should be $HTTP_HOST.

Cheers,
Maxim Maletsky

-Original Message-
From: Jamie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 11:41 AM
To: PHP
Subject: [PHP] Function with True / False return


can anyone tell me whats wrong with this function:

function AuthenticateUser($user, $password)
{
global $DB_Server, $HTTP__Host, $DB_Login, $DB_Password, $DB_Name, $DocRoot
;
// Open a connection with the MySQl server
if (!($link = mysql_connect ($DB_Server,$DB_Login, $DB_Password))) {
DisplayErrMessage(sprintf("internal error %s %s %s %d:%s\n",$DB_Server,
$DB_Login, $DB_Password,
mysql_errno(), mysql_error()));
return 0 ;
}
// Do the user/password authentication via attempted update of stats
if (!($result = mysql_db_query($DB_Name,"UPDATE users SET visits='4' WHERE
user_id='$user' AND password='$password'")))
return 0;
else
return 1;
}


code that references the above function
if (AuthenticateUser($form_user_id, $form_password)){
setcookie("cookie_passwd",$form_password);
setcookie("cookie_user",$form_user_id);
header("Location:http://$HTTP_Host/$DocRoot/default_authenticated.php");
exit();
} else {
header("Location:http://$HTTP_Host/$DocRoot/error.php?type=badpass");
exit() ;
}

It's ment to test the validity of a login attempt with a user and passoword
by updateing the colum visits to a new value. But weather or not this update
passes or fails the return value seems to be 1 as the page is rediredted to
the logged in page.
Also can I update the visits value in the SQL command I've tried
visits=visits+1 but that does not seem to work even though I have seen this
done with a $variable instead of the value one.
Any help would be appreciated.
Jamie


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

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




[PHP] |O:T| Can anyone translate for me this Perl code into PHP?

2001-01-23 Thread Maxim Maletsky

Hello guys,
I *know* it is totally OT, but, I need your help...
 
Below is a piece of PERL code that I am trying to "translate" into PHP. It
is quite simple code needed to send emails within a newsletter.
I kind of tried to rewrite it in PHP but since I know *nothing* about Perl I
found myself asking what does that means and what this...
 
Could anyone who knows Perl that well write me a sketch of the equal script
in PHP?
 
It is simple, I can see it, but I do not understand what is that RegEx for,
what is $pid ( fork() ) and where does it actually send emails... 
 
Thanks in advance,
Maxim Maletsky
 
 
 
 
 
snip
 
#!/usr/bin/perl

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(//, $buffer);
foreach $pair (@pairs) {
 ($name, $value) = split(/=/, $pair);
 $value =~ tr/+/ /;
 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
 if ($INPUT{$name}) { $INPUT{$name} = $INPUT{$name}.",".$value; }
 else { $INPUT{$name} = $value; }
}
 
$pid = fork();
print "Content-type: text/html \n\n fork failed: $!" unless defined $pid;
 
if ($pid) {
 
... bla bla bla
 
}
 else {
 
 close (STDOUT);
 open(LIST,"$INPUT{'address_file'}");
 @addresses=LIST;
 close(LIST);
 
 foreach $line(@addresses) {
  chomp($line);
 
  open(MAIL, "|$INPUT{'mail_prog'} -t") || error("Could not send out
emails");
  print MAIL "To: $line \n";
  print MAIL "From: $INPUT{'listname'} $INPUT{'from'}\n";
  print MAIL "Subject: $INPUT{'subject'}\n";
  if ($INPUT{'html'}) {
  print MAIL "MIME-Version: 1.0\n"; 
  print MAIL "Content-Type: text/html;\n"; 
  print MAIL "Content-Transfer-Encoding: 7bit\n\n"; 
  }
  print MAIL "$INPUT{'body'}";
  print MAIL "\n\n";
  if ($INPUT{'unsubchk'}) {
   print MAIL
"===\n";
   print MAIL "You have received this email because you subscribed to the
$INPUT{'listname'} Mailing Service. To unsubscribe simply visit the link
below.\n";
   print MAIL "$INPUT{'url'}/unsub.phtml?list=$INPUT{'list'}email=$line\n";
  }
  print MAIL "\n\n";
  close (MAIL);
 }
} 
 
/snip
 
 

Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/ 
http://www.japaninc.net http://www.japaninc.net/ 
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/ 


 



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


RE: [PHP] last_insert_id function

2001-01-24 Thread Maxim Maletsky

for example:

$SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'";

now you have to insert into another table where you need to relate that user
to the entry:

$SQL2 = "INSERT INTO questions SET question='how did you sleep?',
made_by=LAST_INSERT_ID()";

LAST_INSERT_ID() will be here equal to the auto_incremented id of the first
$SQL statement.

Hope this helps,
Maxim Maletsky


-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 7:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] last_insert_id function


I got this quote right out of the php manual. My Id field happen to be type
BIGINT as it said so I tried using LAST_INSERT_ID();  and turn out to be
error said "unidentified function". Any clue?
***
mysql_insert_id() converts the return type of the native MySQL C API
function mysql_insert_id() to a type of long. If your AUTO_INCREMENT column
has a column type of BIGINT, the value returned by mysql_insert_id() will be
incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID().

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"

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




RE: [PHP] last_insert_id function

2001-01-24 Thread Maxim Maletsky

no it will keep it very well. In fact most common errors with this function
is that it still keeps the same value when you do something wrong.

This issue is described in more details on every single manual that has
LAST_INSERT_ID() in it - read where you found it ... it is written there ...
I am sure ... 

However, on my opinion this function is very reliable. I use it a lot when
have to create a script which splits some few huge tables into a dozen of
well designed ones. Because redesigning the database you really have to
relate your data to each other. LAST_INSERT_ID() does a good job.

Cheers,
Maxim Maletsky

-Original Message-
From: Mark Lipscombe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 5:28 AM
To: Maxim Maletsky
Cc: 'Jacky@lilst'; [EMAIL PROTECTED]
Subject: RE: [PHP] last_insert_id function


Someone jump in here and correct me if I'm wrong, but by the time you
get around to executing the second query, LAST_INSERT_ID() from MySQL
isn't necessarily going to be the desired value, because another record
may well have been inserted in that time?

On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote:
 for example:
 
 $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'";
 
 now you have to insert into another table where you need to relate that
user
 to the entry:
 
 $SQL2 = "INSERT INTO questions SET question='how did you sleep?',
 made_by=LAST_INSERT_ID()";
 
 LAST_INSERT_ID() will be here equal to the auto_incremented id of the
first
 $SQL statement.
 
 Hope this helps,
 Maxim Maletsky
 
 
 -Original Message-
 From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 7:16 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] last_insert_id function
 
 
 I got this quote right out of the php manual. My Id field happen to be
type
 BIGINT as it said so I tried using LAST_INSERT_ID();  and turn out to be
 error said "unidentified function". Any clue?
 ***
 mysql_insert_id() converts the return type of the native MySQL C API
 function mysql_insert_id() to a type of long. If your AUTO_INCREMENT
column
 has a column type of BIGINT, the value returned by mysql_insert_id() will
be
 incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID().
 
 Jack
 [EMAIL PROTECTED]
 "There is nothing more rewarding than reaching the goal you set for
 yourself"
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

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




RE: [PHP] last_insert_id function

2001-01-24 Thread Maxim Maletsky

Yes, except that in the second case you first will have to do the insertion
of $sql and then assign $lastId to mysql_insert_id();

Cheers,
Maxim Maletsky

-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 7:36 AM
To: Maxim Maletsky; [EMAIL PROTECTED]
Subject: Re: [PHP] last_insert_id function


So can I do either way as I show below here?
first could be :
$sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')";
$result = mysql_query($sql);
$sql1 = "insert into userFriend (userId,friendName,)
values(LAST_INSERT_ID(),'John');"
$result1 = mysql_query($sql1);

or second way is:
$sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')";
$lastId = mysql_insert_id();
$result = mysql_query($sql);

$sql1 = "insert into userFriend (userId,friendName,)
values($lastId,'John');"
$result1 = mysql_query($sql1);


Are these correct?

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: 'Jacky@lilst' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 3:25 AM
Subject: RE: [PHP] last_insert_id function


 for example:

 $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'";

 now you have to insert into another table where you need to relate that
user
 to the entry:

 $SQL2 = "INSERT INTO questions SET question='how did you sleep?',
 made_by=LAST_INSERT_ID()";

 LAST_INSERT_ID() will be here equal to the auto_incremented id of the
first
 $SQL statement.

 Hope this helps,
 Maxim Maletsky


 -Original Message-
 From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 7:16 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] last_insert_id function


 I got this quote right out of the php manual. My Id field happen to be
type
 BIGINT as it said so I tried using LAST_INSERT_ID();  and turn out to be
 error said "unidentified function". Any clue?
 ***
 mysql_insert_id() converts the return type of the native MySQL C API
 function mysql_insert_id() to a type of long. If your AUTO_INCREMENT
column
 has a column type of BIGINT, the value returned by mysql_insert_id() will
be
 incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID().
 
 Jack
 [EMAIL PROTECTED]
 "There is nothing more rewarding than reaching the goal you set for
 yourself"

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


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




RE: [PHP] last_insert_id function

2001-01-24 Thread Maxim Maletsky

a thing to understand (just in case you didn't)

that mysql_insert_id() must be called after mysql_query($sql) was made...
otherwise how do we know the last id... ?


Cheers,
Maxim Maletsky



-Original Message-
From: Maxim Maletsky 
Sent: Wednesday, January 24, 2001 6:38 PM
To: 'Jacky@lilst'; [EMAIL PROTECTED]
Subject: RE: [PHP] last_insert_id function


Yes, except that in the second case you first will have to do the insertion
of $sql and then assign $lastId to mysql_insert_id();

Cheers,
Maxim Maletsky

-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 7:36 AM
To: Maxim Maletsky; [EMAIL PROTECTED]
Subject: Re: [PHP] last_insert_id function


So can I do either way as I show below here?
first could be :
$sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')";
$result = mysql_query($sql);
$sql1 = "insert into userFriend (userId,friendName,)
values(LAST_INSERT_ID(),'John');"
$result1 = mysql_query($sql1);

or second way is:
$sql = "insert into user (name,email) values('Jack','[EMAIL PROTECTED]')";
$lastId = mysql_insert_id();
$result = mysql_query($sql);

$sql1 = "insert into userFriend (userId,friendName,)
values($lastId,'John');"
$result1 = mysql_query($sql1);


Are these correct?

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: 'Jacky@lilst' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 3:25 AM
Subject: RE: [PHP] last_insert_id function


 for example:

 $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'";

 now you have to insert into another table where you need to relate that
user
 to the entry:

 $SQL2 = "INSERT INTO questions SET question='how did you sleep?',
 made_by=LAST_INSERT_ID()";

 LAST_INSERT_ID() will be here equal to the auto_incremented id of the
first
 $SQL statement.

 Hope this helps,
 Maxim Maletsky


 -Original Message-
 From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 7:16 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] last_insert_id function


 I got this quote right out of the php manual. My Id field happen to be
type
 BIGINT as it said so I tried using LAST_INSERT_ID();  and turn out to be
 error said "unidentified function". Any clue?
 ***
 mysql_insert_id() converts the return type of the native MySQL C API
 function mysql_insert_id() to a type of long. If your AUTO_INCREMENT
column
 has a column type of BIGINT, the value returned by mysql_insert_id() will
be
 incorrect. Instead, use the internal MySQL SQL function LAST_INSERT_ID().
 
 Jack
 [EMAIL PROTECTED]
 "There is nothing more rewarding than reaching the goal you set for
 yourself"

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


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

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




RE: [PHP] last_insert_id function

2001-01-24 Thread Maxim Maletsky

I am not really sure about this one, but the first thing I would do is that
I would try it.

It could be though ... 

Cheers,
Maxim Maletsky

-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 7:53 AM
To: Maxim Maletsky; 'Mark Lipscombe'
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] last_insert_id function


Can we store the value retrieved by last_insert_id for later use? say we
want to related 3 queries together and under that case, we will then need to
store the first "last_insert_id value" somewhere and then retrive the second
"last_insert_id value" from the second insert query before both values will
be inserted into the third query.
Can we do that? If not, I will have to come back to mysql_insert_id(); but
it won't work with a field with data type BIGINT, will it? So I guess I
would have to change the data type too, right?
please enlighten me about this
Thank
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Maxim Maletsky [EMAIL PROTECTED]
To: 'Mark Lipscombe' [EMAIL PROTECTED]
Cc: 'Jacky@lilst' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 3:36 AM
Subject: RE: [PHP] last_insert_id function


 no it will keep it very well. In fact most common errors with this
function
 is that it still keeps the same value when you do something wrong.

 This issue is described in more details on every single manual that has
 LAST_INSERT_ID() in it - read where you found it ... it is written there
...
 I am sure ...

 However, on my opinion this function is very reliable. I use it a lot when
 have to create a script which splits some few huge tables into a dozen of
 well designed ones. Because redesigning the database you really have to
 relate your data to each other. LAST_INSERT_ID() does a good job.

 Cheers,
 Maxim Maletsky

 -Original Message-
 From: Mark Lipscombe [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 25, 2001 5:28 AM
 To: Maxim Maletsky
 Cc: 'Jacky@lilst'; [EMAIL PROTECTED]
 Subject: RE: [PHP] last_insert_id function


 Someone jump in here and correct me if I'm wrong, but by the time you
 get around to executing the second query, LAST_INSERT_ID() from MySQL
 isn't necessarily going to be the desired value, because another record
 may well have been inserted in that time?

 On 24 Jan 2001 18:25:27 +0900, Maxim Maletsky wrote:
  for example:
 
  $SQL = "INSERT INTO users SET name='Maxim', surname='Maletsky'";
 
  now you have to insert into another table where you need to relate that
 user
  to the entry:
 
  $SQL2 = "INSERT INTO questions SET question='how did you sleep?',
  made_by=LAST_INSERT_ID()";
 
  LAST_INSERT_ID() will be here equal to the auto_incremented id of the
 first
  $SQL statement.
 
  Hope this helps,
  Maxim Maletsky
 
 
  -Original Message-
  From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, January 25, 2001 7:16 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] last_insert_id function
 
 
  I got this quote right out of the php manual. My Id field happen to be
 type
  BIGINT as it said so I tried using LAST_INSERT_ID();  and turn out to be
  error said "unidentified function". Any clue?
  ***
  mysql_insert_id() converts the return type of the native MySQL C API
  function mysql_insert_id() to a type of long. If your AUTO_INCREMENT
 column
  has a column type of BIGINT, the value returned by mysql_insert_id()
will
 be
  incorrect. Instead, use the internal MySQL SQL function
LAST_INSERT_ID().
  
  Jack
  [EMAIL PROTECTED]
  "There is nothing more rewarding than reaching the goal you set for
  yourself"
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 



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

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




RE: [PHP] Urgent help needed, sound scary when anyone did that on title :-)

2001-01-24 Thread Maxim Maletsky

you know Jacky, there's another, less cool and less reliable way to get the
last inserted id:

SELECT id FROM table ORDER BY id DESC;

it will sort them all giving you the biggest id *number* (not what mysql
keeps) and you can keep it for as many milliseconds your script will run
more...

So if nothing else works for you - try this...
(depends on how secure  stable you want your application to be, of
course...)

Cheers,
Maxim Maletsky

-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Urgent help needed, sound scary when anyone did that on
title :-)


Hi people,
I got here the syntax that is suppose to get the id from the "just inserted"
record and store it in value, did not work so far and I cannot see what is
wrong in there, can anyone give me a hint what is wrong here? ( And the
reason I did not use mysql_insert_id here is because the ID field at my
tables are all BIGINT so mysql_insert_id won't work, so I have to use
LAST_INSERT_ID() instead). By the way, the error after the page is executed
keep saying that "Mysql warning : 0 is not Mysql index" ( and point to the
line "$FirstLast = mysql_result($resultlast,0,0);"). And I did echo for the
value of $FirstLast, it showed that there is no value in there. 

Sniplet is like this: ( I tried to keep this down as much as try to give
most detail at the same time, so apologize for too long sniplet). 

$sql1 = "insert into firsttable (firstname, lastname)
values('Jack','Chan')"; 
$resultsql1 = mysql_query($sql1);
$sqlLastID = "select LAST_INSERT_ID() from firsttable";
$resultlast = mysql_query($sqlLastID);
$FirstLast = mysql_result($resultlast,0,0);

$sql2 = "insert into secondtable (FirsttableID,secfirstname, seclastname)
values('$FirstLast','Jacky','Chany')"; 
$resultsql2 = mysql_query($sql2);
$sqlLastIDsec = "select LAST_INSERT_ID() from secondtable";
$resultlast2 = mysql_query($sqlLastIDsec);
$secondLast = mysql_result($resultlast2,0,0);

$sql3 = "insert into Thirdtable (SecondTableID,FirsttableID,Thirdfirstname,
Thirdlastname) values('$secondLast','$FirstLast','Steve','Chan')"; 
$resultsql3 = mysql_query($sql3);
$sqlLastIDthird = "select LAST_INSERT_ID() from Thirdtable";
$resultlast3 = mysql_query($sqlLastIDthird);
$ThirdLast = mysql_result($resultlast3,0,0);

**
what have I done wrong? Please enlighten me here
Thanks

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"

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




RE: [PHP] PHP + send mail using remote smtp server ?

2001-01-29 Thread Maxim Maletsky

Yes, Check the PHP.ini file, it can be easily configured there,

Cheers,
Maxim Maletsky

-Original Message-
From: Samuel Tran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 1:29 AM
To: php-general
Subject: [PHP] PHP + send mail using remote smtp server ?


Hello everybody !

Is it possible to send mail using PHP and a mail server that is
different from the Web Server ?

I would appreciate any help.

Thank you.

Sam


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

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




RE: [PHP] ereg()

2001-01-29 Thread Maxim Maletsky

only letters and space ?

if (eregi("^[A-Z ]+$", $firstname))

this will return true only if a case-insensitive string will contain only
letters and spaces... (and the string must not be NULL)

if (eregi("^([A-Z]+( )*[A-Z]+)$", trim($firstname)))\

this will return "Maxim Maletsky", "   Maxim Maletsky " but not "Maxim
Maletsky, jr" or even "MaximMaletsky  "

Cheers,
Maxim Maletsky

-Original Message-
From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 7:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ereg()


Hi
is the following right?
ereg("[a-zA-Z\sb-]", $firstname)
cause even when i type a number it accepts it ! however i want only letters 
- and space !
thanks

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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

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




RE: [PHP] Apache/PHP Configuration Problem on NT5

2001-01-29 Thread Maxim Maletsky

Have you touched any .htaccess file? 
Then maybe that's the problem ... 

I've no idea what you misconfigured at all, but I know that a
misconfiguration of .htaccess gives you the exactly same error (500) and the
error log line is often looking very similar,

Cheers,
Maxim Maletsky

-Original Message-
From: [ rswfire ] [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 5:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Apache/PHP Configuration Problem on NT5


I have set up an ErrorDocument 404 in httpd.conf to point to a PHP file in 
the root of my documents.  It was working, now suddenly it has stopped 
working.  Here's the scenario:

When I attempt to view a page that is not there, I receive a 500 Internal 
Error Message, as follows:



Internal Server Error
The server encountered an internal error or misconfiguration and was unable 
to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform them

of the time the error occurred, and anything you might have done that may 
have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.14 Server at swifte.dev Port 8080



If I look at the error log, I find the following line:

[Sun Jan 28 15:18:35 2001] [error] [client 127.0.0.1] Premature end of 
script headers: c:/program files/php/php.exe



Any ideas on how to fix this problem?
_
Get your FREE download of MSN Explorer at http://explorer.msn.com


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

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




RE: [PHP] Importing MS Access into MySQL?

2001-01-29 Thread Maxim Maletsky

just what my problem was 2 month ago...  

here we go: 

http://dbtools.vila.bol.com.br/

this little toy will seat on your windows machine administering your mySQL
database. It has an MSAccess-mySQL import feature very easy to use. Try to
do so and check if your data went transferred ok.

NOTE: You will need to review your MSAccess table structure, things like
field names, properties and other attributes

make yourself a copy first and play with it for a while ... but it is easy
enough to do this way

P.S: When I needed it that much I found a bunch of good advices in
PHP-General Archives at http://marc.theaimsgroup.com/?l=php-generalr=1w=2

Cheers,
Maxim Maletsky 

-Original Message-
From: James, Yz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 6:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Importing MS Access into MySQL?


Hey all,

I heard somewhere (I think) that it's possible to import a Microsoft Access
file (when saved as a delimited text file) into a MySQL table  Just
wondering whether or not this is true, and if it is, where I might find a
tutorial / some literature on how I might go about doing it.

Thanks, as always, in advance :)

James.



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

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




RE: [PHP] Resize the pop-up window

2001-01-29 Thread Maxim Maletsky

Here's an example from some of my old code:


snip
SCRIPT LANGUAGE="JavaScript"
!--
function newWindow(file,window) {
 
msgWindow=open(file,window,'resizable=yes,scrollbars=1,width=900,height=550,
screenX=100,screenY=100,top=25,left=25');
if (msgWindow.opener == null) msgWindow.opener = self;
}
//--/SCRIPT

?
 echo 'tdfont face="Verdana" size="2"nbsp;';
 ?a CLASS="b"
href="javascript:newWindow('?=$PHP_SELF.'?db=usersid='.$rec['id']?','wind
ow?=$rec['id']?')"?
 echo
'B'.three_dots(trim($name),0,$sections[$db][3][0]).'/B/font/A/td';
?

/snip

hey, this yes WILL HELP YOU ALL:
http://developer.irt.org/script/script.htm

Lots of good Javascript tips! 

Cheers,
Maxim Maletsky

-Original Message-
From: david klein [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 4:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Resize the pop-up window


Hello, I know this question is out of PHP, but I'll very appreciate if some 
guru here could help me out.

I have a link, which will pop up a new window, but the problem is: I don't 
know how to resize the new popped-up window.

My code is like this:

A HREF="www.intc.com" target="_blank" intel connection /A


Thank you very much in advance.

David
_
Get your FREE download of MSN Explorer at http://explorer.msn.com


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

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




RE: [PHP] Problem!

2001-01-29 Thread Maxim Maletsky

if you are sure $date will *always* be of the same format:

function date_manipulator($date=0)
{
   Global $year,$day,$month;  // I should update your variables from a
previous call, if you don't need it - don't use it ...
   if($date!=0) {
  $year = substring($date,0,4);
  $month = substring($date,4,6); // you mean that the month follows the
year? (not clear in your example)
  $day = substring($date,6,8);
  return "Today's date is $day $month $year"; or use mktime() etc ... 
   }
}


Cheers,
Maxim Maletsky


-Original Message-
From: Fredrik Arild Takle [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 4:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem!


1.
$date = "20010101";

How could I output 01 01 2001 (or make it 3 variables, like day, month,
year)?

2.
What is the best way to encrypt (using PHP and MySQL)?

Could you please answer me directly by mailadr. ([EMAIL PROTECTED]), because
I'm currently not a member of this list at home! 

-
Fredrik A. Takle
[EMAIL PROTECTED]


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




RE: [PHP] can .inc run php script?

2001-01-29 Thread Maxim Maletsky

Yup,

you can even run .maxim or .john if you add them into apache's httpd.conf,
or without adding anything you can just include() any possible kind of file
into .php file and it will be processed just as a .php file.

Cheers,
Maxim Maletsky

-Original Message-
From: John LYC [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 28, 2001 8:31 PM
To: PHP List
Subject: [PHP] can .inc run php script?


hi all,

can .inc file run scripts...

example...

//config.inc

function watever()
{
//do something
$var = something;
return $var;
}

thanks



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

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




RE: [PHP] testing

2001-01-29 Thread Maxim Maletsky

Yeah, apparently the server was a bit down these hours ...  no one received
anything ...

Cheers,
Maxim Maletsky

-Original Message-
From: Joe Sheble aka Wizaerd [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 10:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] testing


I haven't received any emails from this list in over 24 hours... is it down 
or it it me just not receiving them

Joseph E. Sheble
[EMAIL PROTECTED]

Wizaerd's Realm
http://www.wizaerd.com


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

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




RE: [PHP] VIRUS ON LIST?

2001-01-29 Thread Maxim Maletsky

my firewall reports this at last once a moth ... 

Cheers,
Maxim Maletsky

-Original Message-
From: Chuck Mayo [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 8:50 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] VIRUS ON LIST?


I don't want to be an alarmist, but wanted to give everyone a heads-up. Our
firewall at corporate scrubbed a virus from a mail sent to the php-db list
from
"Angel2 Gabriel Lena Valega". The virus was in an attachment named
"Emanuel.exe"
and the message subject was  "i need help with odbc!"

John Coonrod wrote:

 Right. That's what I saw here also: a virus attachment from Angel2 Gabriel
 Lena Valega in Peru

 = Original Message from Chuck Mayo [EMAIL PROTECTED] at 1/29/01 6:17
pm
 Virus in this mail?
 
 Angel2 Gabriel Lena Valega wrote:
 
  --  Virus Warning Message (on the network)
 
  Found virus TROJ_NAVIDAD.E in file Emanuel.exe
  The file is deleted.
 
  -
 
 

 
  --  Virus Warning Message (on the network)
 
  Emanuel.exe is removed from here because it contains a virus.
 
  -
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

 
 Dr. John Coonrod, Vice President, [EMAIL PROTECTED]
 The Hunger Project, 15 East 26th Street, NY, NY 10010 www.thp.org


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

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




RE: [PHP] when using die(), how can i get the line number that errored?

2001-01-29 Thread Maxim Maletsky

$res = mysql_query($badsqlstatement) or die(errtrapper().' at line
(B'.__LINE__.'/B)');

Cheers,
Maxim Maletsky

-Original Message-
From: Noah Spitzer-Williams [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 6:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP] when using die(), how can i get the line number that
errored?


here's my code:

$res = mysql_query($badsqlstatement) or die(errtrapper());

inside errtrapper(), is there a way to find out what line this error
occurred?

thanks!!

- Noah



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

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




RE: [PHP] Disable print button of client browser

2001-01-29 Thread Maxim Maletsky

There's NO METHOD~~!!!

any one can just hit print-screen and dump whatever your monitor was showing
into PhotoShop (which will print it on request)
:-))

Cheers,
Maxim Maletsky 

-Original Message-
From: Usman Ghani [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 1:38 PM
To: PHP Email List
Subject: [PHP] Disable print button of client browser


Hello
Can anybody tell me how to disable the print button of the client browser?
If there is any method please let me know.
Thanks in advance

Usman

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




[PHP] test

2001-01-29 Thread Maxim Maletsky

 

Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/ 
http://www.japaninc.net http://www.japaninc.net/ 
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/ 


 



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


RE: [PHP] Editor

2001-01-30 Thread Maxim Maletsky

No it is not, but you can use it for as long as you wish in unregistered
mode.

Cheers,
Maxim Maletsky

-Original Message-
From: Christian Sakshaug [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 8:47 PM
To: Maxim Maletsky
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Editor



EditPlus.com ($?)

Free I think...



-Original Message-
From: Christian Sakshaug [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 4:45 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Editor


Try www.phpedit.com or www.ultraedit.com (30$)


At 08:37 30.01.2001, you wrote:
 Hi,
 
 I know this has been asked before but I can`t seem to get the archive
email
 thingy to work, basically I`m looking for a free or cheap editor that has
the
 lines numbered so that it`s a bit easier for me to debug my scripts.
 
 TIA
 Ade
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



Best Regards, Christian Sakshaug
--
Email: [EMAIL PROTECTED]
Web:   www.sakshaug.net
Tel:+47 913 95 618



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

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



Best Regards, Christian Sakshaug
-- 
Email: [EMAIL PROTECTED]
Web:   www.sakshaug.net
Tel: +47 913 95 618



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

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




RE: [PHP] question ! show binary

2001-01-30 Thread Maxim Maletsky
Why on the earth would you do that?

It always happens to me associate images with my databases but I never
actually insert them in. I just *copy* these graphics to somewhere on my
server (or often even on in a webroot) and give them a logic name.

So then when you need to call a graphic you do ( in case the images are in
the webroot ):

?
 $img_dir = '/images';
 $img_path = $img_dir.$id_from_db . '.gif';

 if(file_exests($DOCUMENT_ROOT.$img_path))
echo 'IMG SRC="' . $img_path . '"';
?

then here you can eve find out what are they look like ... GetImageSize()
etc ... 

Hope this is something that helps.

Cheers,
Maxim Maletsky

-Original Message-
From: Yui Hiroaki [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 2:12 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] question ! show binary


HI!

I am using PHP in mySQL. I create table in database and insert
'binary'(*.gif).
But I do not know how to use this binary using PHP and show website. Please
help me.


$)create table xxx (col longlob);
$)insert into xxx values("image\yyy.gif");


I want to display :yyy.gif in html



Thank you
yui

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

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


RE: [PHP] Naughty Word Catcher

2001-01-30 Thread Maxim Maletsky

Will work well, I think ... plus this is on submission which makes a little
discount on load times. And it is quite expandable function.

Cheers,
Maxim Maletsky



-Original Message-
From: Chris Aitken [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Naughty Word Catcher


Hi all,

Ive just been asked whether I can do the following task.

When a block of text is submitted via a web form, for it to be checked for 
offensive words, and rejected if there is.

So I put my brain hard to work and came up with a possibly solution. I know 
this method should work but im wondering if I should tackle it a different 
way.

This is just a rough, typed-off-the-top-of-my-head to show the method 
rather than correct code.

The idea was to have a list of offensive words or phrases in a MySQL 
database, and the script would take the block of text, and do the following

$query="select naughty_words from prude_list";
$result=mysql_query($query);
while ($loop=mysql_fetch_array($result)) {
 $naughty_word_checker =
stristr("$block_of_text","$loop[naughty_words]");
 if ($naughty_word_checker) {
 header("Location: error.php?reason=prudes_wont_like_it");
 } else {
 header("Location: insert_stuff.php?comment=$block_of_text");
 }
}


or is there a better, more efficient way of doing it. Im pretty sure the 
concept of above will work because if there is a match, stristr() should 
return text, otherwise it shouldnt return anything (or if im wrong, a 
little fine tuning will sort that out).


Thanks


Chris


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

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




RE: [PHP] Naughty Word Catcher

2001-01-30 Thread Maxim Maletsky

Actually your function does header() on each loop ... 

This is correct ..  

snip

  $query="select naughty_words from prude_list";
  $result=mysql_query($query);
  while ($loop=mysql_fetch_array($result)) {
 if(stristr("$block_of_text","$loop[naughty_words]")) {
$Gotcha = 1;
  Break;
 }

  if(!$Gotcha)
 header("Location: error.php?reason=prudes_wont_like_it");
  else
 header("Location: insert_stuff.php?comment=$block_of_text");

/snip

Cheers,
Maxim Maletsky



-Original Message-
From: Chris Aitken [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Naughty Word Catcher


Hi all,

Ive just been asked whether I can do the following task.

When a block of text is submitted via a web form, for it to be checked for 
offensive words, and rejected if there is.

So I put my brain hard to work and came up with a possibly solution. I know 
this method should work but im wondering if I should tackle it a different 
way.

This is just a rough, typed-off-the-top-of-my-head to show the method 
rather than correct code.

The idea was to have a list of offensive words or phrases in a MySQL 
database, and the script would take the block of text, and do the following

$query="select naughty_words from prude_list";
$result=mysql_query($query);
while ($loop=mysql_fetch_array($result)) {
 $naughty_word_checker =
stristr("$block_of_text","$loop[naughty_words]");
 if ($naughty_word_checker) {
 header("Location: error.php?reason=prudes_wont_like_it");
 } else {
 header("Location: insert_stuff.php?comment=$block_of_text");
 }
}


or is there a better, more efficient way of doing it. Im pretty sure the 
concept of above will work because if there is a match, stristr() should 
return text, otherwise it shouldnt return anything (or if im wrong, a 
little fine tuning will sort that out).


Thanks


Chris


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

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




RE: [PHP] Naughty Word Catcher

2001-01-30 Thread Maxim Maletsky

Alright ... the last review ('cause I never like what I write ... )

here:

function naughty_words($text) {
  $query="select naughty_words from prude_list";
  $result=mysql_query($query);
  while ($loop=mysql_fetch_array($result)) {
 if(stristr("$text","$loop[naughty_words]")) {
return true;
 }
  }
}


if(!nasty_words($text))
   header("Location: error.php?reason=prudes_wont_like_it");
else
   header("Location: insert_stuff.php?comment=$text");


Cheers,
Maxim Maletsky


-Original Message-
From: Maxim Maletsky 
Sent: Wednesday, January 31, 2001 3:52 PM
To: 'Chris Aitken'; [EMAIL PROTECTED]
Subject: RE: [PHP] Naughty Word Catcher


Actually your function does header() on each loop ... 

This is correct ..  

snip

  $query="select naughty_words from prude_list";
  $result=mysql_query($query);
  while ($loop=mysql_fetch_array($result)) {
 if(stristr("$block_of_text","$loop[naughty_words]")) {
$Gotcha = 1;
  Break;
 }

  if(!$Gotcha)
 header("Location: error.php?reason=prudes_wont_like_it");
  else
 header("Location: insert_stuff.php?comment=$block_of_text");

/snip

Cheers,
Maxim Maletsky



-Original Message-
From: Chris Aitken [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Naughty Word Catcher


Hi all,

Ive just been asked whether I can do the following task.

When a block of text is submitted via a web form, for it to be checked for 
offensive words, and rejected if there is.

So I put my brain hard to work and came up with a possibly solution. I know 
this method should work but im wondering if I should tackle it a different 
way.

This is just a rough, typed-off-the-top-of-my-head to show the method 
rather than correct code.

The idea was to have a list of offensive words or phrases in a MySQL 
database, and the script would take the block of text, and do the following

$query="select naughty_words from prude_list";
$result=mysql_query($query);
while ($loop=mysql_fetch_array($result)) {
 $naughty_word_checker =
stristr("$block_of_text","$loop[naughty_words]");
 if ($naughty_word_checker) {
 header("Location: error.php?reason=prudes_wont_like_it");
 } else {
 header("Location: insert_stuff.php?comment=$block_of_text");
 }
}


or is there a better, more efficient way of doing it. Im pretty sure the 
concept of above will work because if there is a match, stristr() should 
return text, otherwise it shouldnt return anything (or if im wrong, a 
little fine tuning will sort that out).


Thanks


Chris


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

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

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




RE: [PHP] contracting consulting (was [PHP] Pricing for PHP programming???)

2001-02-01 Thread Maxim Maletsky


 -What can we as a developer community do to change this?
Prove that Open Source is working, and better than many commercial
solutions, too.

This is something I like to do within my company: they used to buy software
online saying that it is still cheaper then develop it ourselves. Hmm.. I
always agreed, BUT in a different way -- sending them a link to Source Forge
- "Look guys, they have done a similar soft already and even in a similar
language, but, 4 FREE "  Gezz,, when will they ever understand that
Phorum runs better then some $200 cgi-perl application easier to find for a
manager on AltaVista.

This is how we have to teach them.

Cheers,
Maxim Maletsky

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




RE: [PHP] How do I get last inserted ID?

2001-02-01 Thread Maxim Maletsky

mysql_insert_id() is a PHP function for it.
however I recommend you using a build-in SQL function LAST_INSERT_ID().

i.e: INSERT INTO table SET name='$name', surname='$surname';
UPDATE table SET name='$name', surname='$surname' WHERE id=LAST_INSERT_ID()

Cheers,
Maxim Maletsky

-Original Message-
From: Sandeep Hundal [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 02, 2001 12:44 PM
To: PHP General
Subject: [PHP] How do I get last inserted ID?


Hi All,

just a quick question. Say my script is inserting values into a
database, which has an autoincremental id. Now I usually send out a
mail also with the contents of the inserted stuff. The only problem
is that of the ID field. How can I get the script to determine what
id number was given to that row?

thanks

/sunny

__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

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

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




[PHP] configuring headers in mail() ...

2001-02-01 Thread Maxim Maletsky

Hello Guys,
to be short:
 
1. what I'm doing:
 
I need to send some email recipients of which are some users from a
database. (this part perfectly works)
What I care about is that when they receive the email they see 'J-Door
Newsletter' in their from field, not our email address (
'[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' )
 
3. how I'm doing it:
below is the PHP code followed by what message header looks like on received
email.
 
 
snip
  $from = '"' . $POSTED['from_name'] . '" ' . $POSTED['from_email'] . '';
 
   mail( $rec['email'],
stripslashes($POSTED['subject']),
stripslashes(str_replace('%name%', $rec['name'], $POSTED['body'])),
"FROM: $from
\nContent-Type: text/plain; charset=$encode
\nContent-Transfer-Encoding: 8bit"
   );
/snip
 
/snip
 
Received: from japaninc.net ([210.229.233.105]) by
exc-tyo-01.lincmedia.co.jp with SMTP (Microsoft Exchange Internet Mail
Service Version 5.5.2650.21)
 id DZ8G4JTZ; Fri, 2 Feb 2001 16:10:11 +0900
Received: (from nobody@localhost)
 by japaninc.net (8.9.3/8.9.3) id QAA10798;
 Fri, 2 Feb 2001 16:01:03 +0900
Date: Fri, 2 Feb 2001 16:01:03 +0900
Message-Id:  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Subject: Message Body [Will be sent exactly as you see it in this box]:
FROM: "J-Door Newsletter"  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
Content-Type: text/plain; charset=iso-8859-1

Content-Transfer-Encoding: 8bit
 
/snip
 
 
 
It all looks alright to me, however in from field of my email client I still
see ' [EMAIL PROTECTED]' mailto:[EMAIL PROTECTED]'  instead of
'J-Door Newsletter' ,
 
What am doing wrong?
 
Cheers,

Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/ 
http://www.japaninc.net http://www.japaninc.net/ 
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/ 


 



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


RE: [PHP] test - can someone please reply?

2001-03-07 Thread Maxim Maletsky

ha ha ha .



Maxim Maletsky 



-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 08, 2001 3:13 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] test - can someone please reply?


On Thu,  8 Mar 2001 16:32, [EMAIL PROTECTED] wrote:
 this is a test for echo.
this is a test for echo. .ohce rof tset a si siht
-- 
David Robley| WEBMASTER  Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

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

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




[PHP] to however designed PHP.NET - che.e.e.e.ers!

2001-03-07 Thread Maxim Maletsky

Hi over there!
 
I have just started up my Opera browser and my lovely home page wasn't
there, it has completely disappeared from it... I've seen some light - it
was the new PHP.NET design!!!
 
Whoever made it has done a great job, it was some time I wished this change,
it became so speedy and the usability has improved immensely... very cool.
 
Great job guys!
And, if anyone on the list finds any bugs there - please contribute!
 

Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/ 
http://www.japaninc.net http://www.japaninc.net/ 
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/ 


 



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


RE: [PHP] Post but not Post

2001-03-28 Thread Maxim Maletsky

no other way.

Unless you identify the user somehow VERY WELL, write the staff into the
file, and then read the file on other page.

But, basically - the values are being passed with - urls, forms, cookies,
sessions (still cookies or urls). No other ways are out there.

Let me know if you'll find a SECURE one :-)

Cheers,
Maxim Maletsky



-Original Message-
From: elias [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 4:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Post but not Post


Hello.

we all know that we can send variables to another PHP file via form tag
and with post method.
now i wonder if i can send variables from a script to another like POST
method but not using form tags.
like my question is how can i transfer data from form to form like the POST
of the form tag, but w/o session variables or cookies, or url parameters
(like the GET method), and w/o forms ofcourse?

Currently, i'm doing this via hidden forms and automatic posting via
JavaScript, but is there is any clean and better way?

Thanks.



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

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




[PHP] SQL : multiple SELECT and missing rows.

2001-04-02 Thread Maxim Maletsky


Hello Guys,

I have a (very simple?) SQL question. I'm more then sure the answer to it is
whether "just do this..." or "It's impossible man, how could you even get
that into your mind..." 



I have this database design: (it's more complex of course, but you get an
idea)



Table 'accounts':
+---+--++
| ID| type | since  |
+---+--++
| 1 | P| 1999-08-01 |
| 2 | F| 1999-11-06 |
| 3 | S| 2000-07-05 |
| 4 | P| 2001-01-01 |
+---+--++


Table 'addresses':
+---+--+--+-+
| ID| city | pref | country |
+---+--+--+-+
| 1 | Shibuya-ku   | 13   | JP  |
| 2 | Nakano-ku| 13   | JP  |
| 4 | Toyonaka-shi | 27   | JP  |
+---+--+--+-+



As you can see, the main data is in 'accounts', the 'addresses.ID' is UNIQUE
and corresponds to 'accounts.ID'. The fact is that not every account has an
address registered with it. 



I need to list ALL the accounts in this order:

+---+--+-++---+
| ID | Type | City | Country | Since |
+---+--+-++---+



Therefore I am trying to do it with the following query:



SELECT
accounts.ID AS ID,
accounts.type   AS Type,
addresses.city  AS City,
addresses.country   AS Country,
accounts.since  AS Since 
FROM
accounts,
addresses
WHERE
addresses.ID=accounts.ID
ORDER
BY
accounts.ID
ASC
LIMIT
10
;


And, this selects me IDs 1, 2 and 4. 
3, obviously, is not here because there's no such address.ID as stated
in my WHERE clause.



Can anyone suggest me how do I SELECT ALL of the accounts having simply NULL
on 'addresses.*' when there's no such row, instead of 'loosing' the whole
'account' row?

I sure know how to do it using two queries, still, I wonder if one single
query can do this job.

Where do I miss the logic?



Thanks in advance.

-maxim




Maxim Maletsky - [EMAIL PROTECTED]
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109
http://www.j-door.com
http://www.japaninc.net
http://www.lincmedia.co.jp



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


RE: [PHP] PHP and MS Access

2002-04-02 Thread Maxim Maletsky

 I guess I am gonna have to plead stupid here.
 
 I've never used access, I don't like it, and I think there are much
better tools out
 there to do what access does.

We agree...

 Having said that, I work in an environment that is almost completely
VBA in either
 access or excel.

May god have mercy on your soul...

 I need to find a way to query an access database, and I wanted to do
it with a
 auto_refresh web page.

 But I cant, I cant connect to the database, I cant execute a query,
and maybe I return
 the infamous empty yet infinite array.
 
 maybe I should just do it in excel?

No


I think a way could be by trying the ODBC functions of PHP.
See www.php.net/odbc

If you give us more details we might be more of a help.

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





 If any of you have been able to get this to work, please tell me what
you did to get it
 to work, and how you did it.
 
 Thanks,
 
 
 
 Rance Hall
 308.238.2455
 Internal Office Extensions: 2455 or 6655
 PC Programmer, The Buckle, Inc.
 [EMAIL PROTECTED]
 
 --
 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] April fools day - did anyone notice Thies's fangs on rc1???

2002-04-02 Thread Maxim Maletsky

Exactly what I always though in here, Rasmus:-)



Maxim Maletsky



-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 02, 2002 8:12 PM
To: Brian Drexler
Cc: Erik Price; Frank Joerdens; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] April fools day - did anyone notice Thies's fangs on
rc1???

Well, not really.  This easter egg has been in the code since April
2000,
so it isn't actually a new thing.  We had this same discussion in April
2001.  You guys just have a short memory.  ;)

-Rasmus

On Tue, 2 Apr 2002, Brian Drexler wrote:

 Wow, talk about things from your past coming back to haunt you :-)

 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 02, 2002 11:52 AM
 To: Erik Price
 Cc: Frank Joerdens; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] April fools day - did anyone notice Thies's fangs
on
 rc1???


 They were breadsticks.  Picture was taken in early 1999 in a
restaurant in
 Tel Aviv, Israel.

 -Rasmus

 On Tue, 2 Apr 2002, Erik Price wrote:

 
  On Tuesday, April 2, 2002, at 11:52  AM, Frank Joerdens wrote:
 
   Did anyone else notice Thies's fangs on the phpinfo() page of
4.2.0rc1
   yesterday? I wonder what they where . . . french fries? Salty
sticks
   (German 'Salzstangen')?? At first I though I was hallucinating,
   especially when I found that he was gone again today! Try setting
your
   server's system date back to yesterday, as in
 
  Pencils, I thought?  I didn't know who that was.
 
 
  Erik
 
 
 
 
  
 
  Erik Price
  Web Developer Temp
  Media Lab, H.H. Brown
  [EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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



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



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




[PHP] Re: Including Files

2002-04-03 Thread Maxim Maletsky


try this: 

if(!@include('file.php')) {
header(HTTP/1.0 404 Not Found);
} 

change header() into whatever you want to include at it's place. 

Careful with this though, make sure that the files script is trying to 
include do never get below a certain directory. Otherwise I can dispay 
myself your /etc/passwd and you're freaked :-) 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
maxim phpbeginner.com 

 

Craig Donnelly writes: 

 Is there a way to setup either the apache/php directives to produce a custom
 404 if an include file fails to be included ?? 
 
 Or is this a job for .HTACCESS?? 
 
 Regards, 
 
 ~Craig 
 
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 

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




[PHP] Re: some kind of library loader

2002-04-03 Thread Maxim Maletsky


Arpad,
as I read your mail one silly thing came into my mind: 

You can try to load all those classes as texts into a db and then to execute 
the needed ones as eval()ed strings. It could be easy for you to create the 
logic because the PHP code are stings and are never included but SELECTed. 
Not sure if this could be wise to do, just throwing out an idea. 

 

Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
maxim phpbeginner.com 


Arpad Tamas writes: 

 Hi Everyone! 
 
 I have an idea, but I don't know how to realise it, if it can be at 
 all.
 We have a relatively big system, with 52k lines of php code without 
 much html, and many classes (1138) that depend on each other.
 And I think I don't need to say that php parses the code somewhat 
 slow. That's what I'm trying to solve. I know there are code caches, 
 but none of them suits all of our customers or our needs (price, 
 effectiveness).
 Of course not all classes are needed on every page request, so I'm 
 trying to separate them, and require them when they are really 
 needed, but that's not easy with 1100 classes. 
 
 So I thought I'd write a custom error handler, and when an unloaded 
 class is created or it's static method is accessed an error would 
 be triggered and I'd require it in the error handler. The only 
 problem is, that after the error handler finished the main code is 
 executed *after* the statement that triggered the error, so I can't 
 tell php to give one more try for the previously faulty code. 
 
 Is there any chance for this to work with some trick, or do you know 
 of a better sollution for the problem? 
 
 Thanks for your help, 
 
   Arpi 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 

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




[PHP] Re: What's wrong with the Array? Im baffled!

2002-04-03 Thread Maxim Maletsky


it is obvious, Scott: 

   if ($sumItUp[$name] == ) {

is like to say if $sumItUp[$name] is an empty string. Means, that if it 
was not assigned, or if it contains any kind of character in it this will 
result to false. 

Try using this: 

if(isset($sumItUp[$name]) and strlen($sumItUp[$name])) {
} 

this will mean: 

if there's such variable defined and the lenght of what it contains is 
bigger than 0 the statement will result TRUE. 

 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
maxim phpbeginner.com 

 

 

 


Scott Fletcher writes: 

 Hi! 
 
 I'm a little baffled on why the array is not working the way I expect it
 to.  It showed there is something about the array I do not know about.
 Well, it's never too late to learn something new.  So, here's the code and
 see if you can help me out. 
 
 -- clip -- 
 
   $name = TU4R; 
 
   if ($sumItUp[$name] == ) {
  $sumItUp[$name] = 0;
   } else {
 //debug
 echo **;
  $number = $sumItUp[$name];
  $number++;
  $sumItUp[$name] = $number;
   }
   echo $sumItUp[$name].br; 
 
 -- clip -- 
 
 In this case, the if statement never went into else statement when
 there's a number like 0, 1, 2, etc.  So, what's the heck is happening here?
 When the array, sumItUp[] was empty then the number 0 was assigned and
 it work like a charm.  So,  when this code is repeated again, the if
 statement check the array, sumItUp[] and found a number, 0 and it is not
 equal to  as shown in the if statement.  So, therefore the else statement
 should be executed.  But in this case, it never did.  I tested it myself to
 make sure I wasn't missing something by putting in the php codes, echo
 '**'; and the data, ** was never spitted out on the webpage.  So, it tell
 me that the else statment was never executed.  So, the problem had to do
 with the data in the array itself.  So, can anyone help me out?  Thanks a
 million!! 
 
 Scott 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 

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




[PHP] Re: Any ideas on combining arrays????

2002-04-03 Thread Maxim Maletsky

See, Scott.. It is all about your logic. 

For instance, you can create a nice multidimentional array like this: 

Array(
'0'=Array(
'data'=Array( // your whole data array
  data
  data
  data
),
'parameters'=Array( // the settings rlative to data array
'count'='256',
'type_of_data'='strings',
'came_from_DB'='PostgreSQL',
'came_from_table'='thisTable'
'etc'='bla...bla..bla..'
)
),
'1'=Array(
'data'=Array( // your whole data array
  data
  data
  data
),
'parameters'=Array( // the settings rlative to data array
'count'='258',
'type_of_data'='integers',
'came_from_DB'='mySQL',
'came_from_table'='thatTable'
'etc'='bla...bla..bla..'
)
), 

... etcetc...etc... 

); 

 

in this way you can loop the whole thing, access the data by refering to the 
'data' subarray and then get the parameters (counts, types whatever you 
want) by accessing 'parameters' subarray containing the relative settings 
for that very array. 

As I said in the very first line - all up to your logic and the organization 
rules within the code. 

Hope it is of any help to you. 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 

 

 

Scott Fletcher writes: 

 Hi! 
 
 Need some ideas on combining some arrays into one!  I have array for
 data and other array for counter.  How do I make an array that would show
 different data for each counter number? 
 
 -- clip --
$FFR = array (
   TU4R  = array( data = , count =  ),
   PH01  = array( data = , count =  ),
);
 -- clip -- 
 
 The response should look something like this when I pick the correct
 data and correct count; 
 
$FFR[TU4R][data][0][count]  = TU4R is 0;
$FFR[TU4R][data][1][count] = TU4R is 1;
$FFR[TU4R][data][2][count]  = TU4R is 2; 
 
 I tried to do something like this but it doesn't work.  I have been
 working for 2 days trying to figure it out.  I appreciate any help you can
 provide for me. 
 
 Thanks,
   Scott 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 


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




[PHP] Re: syntax for date math expressions

2002-04-03 Thread Maxim Maletsky


first of all your data seems to come from a DB to me. If it's so then read 
your DB manual for date functions. It would be way better and faster. 

Otherwise, if you're so keen to let this duty job up to PHP then convert 
both dates into UNIX time format 'maketime()' deduct the values and put them 
through the 'date()' function. 

 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 


ROBERT MCPEAK writes: 

 What is the php syntax for adding or subtracting dates? 
 
 For example, I'd like to do something like this: 
 
 2002-04-03 - 2002-04-02 = 1 
 
 or  
 
 2002-04-03 - 2002-04-02 = -00-01 
 
 or  
 
 2002-04-03 + -00-01 = 2002-04-03 
 
 etc. 
 
 Can anybody help this newbie? 
 
 Thanks! 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




[PHP] Re: Passing Values

2002-04-03 Thread Maxim Maletsky


Yes, 

that would help... 

 

 

Sebastian A. writes: 

 Hello,
   Today I was working on an object that will create all of the columns and
 tables in my DataBase for my upcoming application. I however, did run into
 trouble. I am having problems because I cannot pass the name of the database
 from the form to the function that needs it. Everything is on the same page
 (sql_create.php), and the functions that gets the data (the form function)
 and the function that needs the Database name are both within an object.
 Does anyone have any ideas? I can post some code samples if it will help. 
 
 Thanks in Advnace 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] can't get it to work

2002-04-03 Thread Maxim Maletsky

Why not SELECT  WHERE date_field$max_date and
date_field$min_date ?

A very god advice for everyone of you who tries to implement PHP for the
where selects:

You can VERY OFTEN leave this job to the DB itself. SQL don't only have
SELECT, UPDATE etc... they all have lots of functions for the data
comparisons and output formatting.

Take some time reading the manuals and you will discover a whole new
world on the RDBMS use.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Alex [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 8:19 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] can't get it to work
 
 I'm trying to write code that will return all records found between
certain
 dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with
pull
 down menus for both dates but when I try to run it I get a parse error
and
 can't figure out what's wrong.
 
 Thanks,
 
 Alex
 
 Here is the php code:
 
 $month_1 = addslashes($date_month_1);
 $day_1 = addslashes($date_day_1);
 $year_1 = addslashes($date_year_1);
 $month_2 = addslashes($date_month_2);
 $day_2 = addslashes($date_day_2);
 $year_2 = addslashes($date_year_2);
 
 
 $query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1'
AND
 date = '$month_2/$day_2/$year_2';
 
 $result = mysql_query($query);
 
 $num_results = mysql_num_rows($result);
 
 echo pNumber of records found: .$num_results./p;
 
 for ($i=0; $i $num_results; $i++)
   {
  $row = mysql_fetch_array($result);
  echo pstrong.($i+1).. ID: ;
  echo stripslashes($row[id]);
  echo /strongbrFirst name: ;
  echo stripslashes($row[fname]);
  echo brLast name: ;
  echo stripslashes($row[lname]);
}
 
 ?
 
 
 
 --
 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] Re: Any ideas on combining arrays????

2002-04-03 Thread Maxim Maletsky


That's the way!


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Demitrious S. Kelly [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 8:26 PM
 To: 'Scott Fletcher'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: Any ideas on combining arrays
 
 Use a multi-dimensional array... try this as a kind of 'proof of
 concept'
 
 ?php
 
 $array[tu4r][]=0
 $array[tu4r][]=10
 $array[tu4r][]=100
 $array[tu4r][]=1000
 $array[ph10][]=0;
 $array[ph10][]=1;
 $array[ph10][]=2;
 $array[ph10][]=126;
 
 echo 'pre';
 foreach ( $array[ph10] as $value ) {
   echo '  PH10: '.$value.chr(10);
 }
 echo '/pre';
 echo 'pre';
 foreach ( $array[tu4r] as $value ) {
   echo '  TU4R: '.$value.chr(10);
 }
 echo '/pre';
 
 ?
 
 cheers
 -Original Message-
 From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 10:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Any ideas on combining arrays
 
 Well, I don't thinik this will work.  Because I will recieve an
 unknown
 number of data.  The number of PH10 I would get would be either 1 or 2
 or
 126, etc.  There is no way to determine the number, so I already
create
 an
 counter to tell me how many of them.  So, that leave me with an need
to
 create an array to unlimited number of PH10 without overwritting the
 current
 PH10.  Here's my demo.
 
 TU4R = TU4R is 0
 PH10 = PH10 is 0
 PH10 = PH10 is 1
 PH10 = PH10 is 2
 
 Can anyone write a multidimentional array demostration to handle
 this
 demo?
 
 Thanks a Million!
  Scott
 
 Maxim Maletsky [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  See, Scott.. It is all about your logic.
 
  For instance, you can create a nice multidimentional array like
this:
 
  Array(
  '0'=Array(
  'data'=Array( // your whole data array
    data
    data
    data
  ),
  'parameters'=Array( // the settings rlative to data array
  'count'='256',
  'type_of_data'='strings',
  'came_from_DB'='PostgreSQL',
  'came_from_table'='thisTable'
  'etc'='bla...bla..bla..'
  )
  ),
  '1'=Array(
  'data'=Array( // your whole data array
    data
    data
    data
  ),
  'parameters'=Array( // the settings rlative to data array
  'count'='258',
  'type_of_data'='integers',
  'came_from_DB'='mySQL',
  'came_from_table'='thatTable'
  'etc'='bla...bla..bla..'
  )
  ),
 
  ... etcetc...etc...
 
  );
 
 
 
  in this way you can loop the whole thing, access the data by
refering
 to
 the
  'data' subarray and then get the parameters (counts, types whatever
 you
  want) by accessing 'parameters' subarray containing the relative
 settings
  for that very array.
 
  As I said in the very first line - all up to your logic and the
 organization
  rules within the code.
 
  Hope it is of any help to you.
 
 
  Maxim Maletsky
 
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
 
  www.PHPBeginner.com
  [EMAIL PROTECTED]
 
 
 
 
 
 
 
  Scott Fletcher writes:
 
   Hi!
  
   Need some ideas on combining some arrays into one!  I have
array
 for
   data and other array for counter.  How do I make an array that
would
 show
   different data for each counter number?
  
   -- clip --
  $FFR = array (
 TU4R  = array( data = , count =  ),
 PH01  = array( data = , count =  ),
  );
   -- clip --
  
   The response should look something like this when I pick the
 correct
   data and correct count;
  
  $FFR[TU4R][data][0][count]  = TU4R is 0;
  $FFR[TU4R][data][1][count] = TU4R is 1;
  $FFR[TU4R][data][2][count]  = TU4R is 2;
  
   I tried to do something like this but it doesn't work.  I have
 been
   working for 2 days trying to figure it out.  I appreciate any help
 you
 can
   provide for me.
  
   Thanks,
 Scott
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 
  Maxim Maletsky
 
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
 
  www.PHPBeginner.com
  [EMAIL PROTECTED]
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] PHP FAQ (again)

2002-04-03 Thread Maxim Maletsky

Would be very nice.

There are dozens of very good sites related to PHP learning on the web.
It's been a while that we at PHPBeginner.com were thinking to merge with
some other sites full of useful information in order to create a
noticeably large knowledge base for anyone interested in PHP.

Though, it's been always kind of tough to accomplish, and even start.
Reason: everyone is trying to purge the project in its own way... not
too easy to agree.

But, I'd love to follow this idea.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Christoph Starkmann [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 4:15 PM
 To: '[EMAIL PROTECTED]'
 Subject: FW: [PHP] PHP FAQ (again)
 
 
 Hi Ray!
 
  I am in total agreement with Justin on this one.  Many of the
  posters use
  need help,  newbie needs help , etc.  We need to have
  some form of FAQ
  with detailed instructions on how to post so that I do not
  have to ask;
 
 There are so many ressources on the web on how to pose questions
 in mailing lists.
 Do you think some extra documentation would help here?
 I am afraid many of these posters wouldn't read this FAQ,
 neither...
 
  I now some mailing lists will not even reply if you do not
  follow specific
  criteria when you post...
 
 That's up to everyone himself... BTW, there are many docs
 on the web, too, on how to quote (avoid full quotes...)
 
 Like someone (Rasmus?) wrote, there is a quite smart PHP
 documentation to cover most of the basic questions, and
 a lot of help here...
 
 Again, do you think someone who isn't checking ouzt
 the online doc would be reading the FAQ?
 
 Regards,
 
 Kiko
 
 -
 It's not a bug, it's a feature.
 christoph starkmann
 -
 
 --
 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] auto submit

2002-04-03 Thread Maxim Maletsky

Yes,
An idea I'd love to throw up here would be not letting the user know
you're spying him:

Make a Java Script function (yes, you will need JavaScript for that)
that has timeout every 10 seconds. Use JS unction escape() and read the
field values of your form assigning them to the JS variables after what,
load a graphic with the JS vars passed in the IMG SRC link each 10
seconds passed.

Your graphic will actually be a PHP script that records the data and
does all kind of grows things, yet outputs just some silly image
headers. This sway user has no clue (or almost) that what he's typing in
your form you're already being collecting, even so he pressed no submit
buttons yet.

I made an intranet editor that had this failure-free feature similar to
MS Word.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Martin Kampherbeek [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 11:23 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] auto submit
 
 Is the folowing possible to do?
 
 I fill in a form and press submit.
 Then I read a record from a database. With this data it submits to the
read submits
 url. After 10 seconds, it reads the next record and submits that data.
etc etc
 
 So I don't have to push submit each time I want to submit. After 10
seconds it read
 the next record and submits again.
 
 Could this be done? So yes, how?
 



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




RE: [PHP] HTML to PHP Links

2002-04-03 Thread Maxim Maletsky


Are you talking abut HTML or PHP itself?

Anyway...  to have an a name=blah/a in your page you will need
to 

echo 'a name=blah/a';

Now, PHP Nuke is another thing - it's a software and you should read
through it manual in order to find a way to do this. If there's none -
modify the code yourself.



Sincerely,

Maxim Maletsky

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)

www.phpbeginner.com
[EMAIL PROTECTED]




 -Original Message-
 From: G-no / |{iller [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 4:20 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] HTML to PHP Links
 
 How would I make an a name=blah/a link in php?? I'm using php
nuke.
 
 --
 
 -Alias:   |{iller
 -Website: http://www.ai-syndicate.com
 -AIM:Prn2000Str
 -Email:  [EMAIL PROTECTED]
 
 
 
 --
 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] Query from POST_VARS

2002-04-03 Thread Maxim Maletsky


You can also use this mySQL syntax:

INSERT INTO table SET

field1='$value1',
field2='$value2',

...etc


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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


 -Original Message-
 From: chris allen [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 10:01 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Query from POST_VARS
 
 Question on a mysql insert query:
 
 while(list($key, $val) = each($HTTP_POST_VARS)) {
 
 $string .= '. $val .' .,;
 }
 
 $insert_query = insert into data_16 values ('$string');
 
 
 Do I need the single quotes for data being put into table?
 Ex:
 
 $insert_query =('data' , 'data2', 'data3') etc
 
 or can it be without the single quotes?
 as in
 
 (data, data2, data3)  ???
 
 As far as I understand I only need quotes here:
 
 $insert_query = insert into data_16 values ('$string');
^
^
 
 
 Am i right??
 
 
 thanks
 -ccma
 
 
 --
 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] Re: some kind of library loader

2002-04-03 Thread Maxim Maletsky


Have you considered simply using require_once?

Also, you can find out if a class was defined by calling
'class_exists()'. In this way you might save something.

The best way thought is what Miguel was saying: load the files
conditionally with a logic.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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


 -Original Message-
 From: Tamás Árpád [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 9:51 PM
 To: Miguel Cruz; Maxim Maletsky
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: some kind of library loader
 
  On Thu, 4 Apr 2002, Maxim Maletsky wrote:
   You can try to load all those classes as texts into a db and then
to
 execute
   the needed ones as eval()ed strings. It could be easy for you to
create
 the
   logic because the PHP code are stings and are never included but
 SELECTed.
   Not sure if this could be wise to do, just throwing out an idea.
 
  Offhand I'm guessing the payoff wouldn't be great, because you'd
lose the
  benefit of PHP's own code caching. Depends on how much of this
voluminous
  code actually gets used on any one run, I suppose. But why not do
the same
  thing with conditional includes, and then at least let PHP cache it?
 
 Thanks for your suggestion Maxim and Miguel.
 
 Unfortunately storing code in db wouldn't solve my problem, becuse
then I
 still had to recognise when the classes are really needed. Now in the
52k
 lines of code we just have
 $x = new SomeClass();
 $y = new OtherClass(); or
 $result = AnotherClass::staticMethod(); statements, and we have many
of
 them.
 That's why I'm searching for a sollution that we can use without
rewrite all
 these calls with the extension of a test if the needed class's
definition
 was or wasn't loaded before.
 So I'd like to use conditional includes, and my first thought was that
 somehow I can make it with a custom error handler, but unfortunately I
 realized quickly it's not that simple.
 Maybe you or someone can help, If I explain my problem in a little
more
 detail.
 We have a portal-creator system (like many of you, I guess), with an
own
 developed template system. Of course we sell it to customers who have
their
 own needs. They create the designs, or tell us how the site should
look, and
 the created templates determine what template classes are needed for
 generating the pages. The template classes require other base
classes that
 are responsible for handling the db storage.
 We have about 430 classes (I misscalculated it in my firts mail), and
they
 have many cross reference to each other. So it's hard to know
explicitly
 if a class definition is needed, except of course at every new
operator, and
 static method call, but there are plenty of them.
 Parsing of (almost) all of the php code takes about 1,5secs on an
athlon 800
 cpu, which is far from reasonable. I expect that with conditional
includes
 at least half of the code wouldn't get parsed on a normal site, and
even
 less on a smaller site.
 I wrote that I tried many code caches (I sent the results in deatils
in
 December), but none of them - except Zend Cache - made significant
speed-up
 (PHP-Accelerator also gave good results for speed, but I got many
errors).
 Unfortunatelly Zend Cache isn't affordable for many of our client,
 especially the smaller ones, who don't need many of the features of
the
 system, so they would benefit much from the conditional includes.
 
 I hope someone who had the same situation can help, or at least I get
 reinforcement, that I can't by-pass the hard way (to write an if
clause
 before every use of a class wether it was loaded or not).
 Thanks for your help,
 Arpi
 
 
 
 --
 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] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky


 as a string.  MySQL's TIMESTAMP is not the same thing as PHP's.

Let me be the devil's layer here, Erik.

In order to achieve the best portability and to gain the best
performance you'd better use mySQL date field types to store the dates.
If you need the PHP timestamps you can simply use another date function
of mySQL (which was that?) on the SELECT and receive your data already
in UNIX timestamp values.

There's no way you can prove to me that PHP's timestamp is better in the
mySQL's varchar(20) (20?? Why not 10 then and why not INT? Enough or the
next 320 years or so... we just recently turned to 10m) instead of the
simple timestamp(14).


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



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




RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky

Just insert the date: like NOW(), or whatever formatted string into the
field

PS: YAY! In Attack!


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 11:27 PM
 To: Rasmus Lerdorf
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] syntax for date math expressions
 
 
 On Wednesday, April 3, 2002, at 04:14  PM, Rasmus Lerdorf wrote:
 
  But you can simply call MySQL's UNIX_TIMESTAMP() function on the
mysql
  field when you select it if you want it into unix timestamp format.
 
 For SELECTs, this is fine, but what happens when I want to insert a
new
 date?  I transform all of my dates into Unix timestamps so that I can
 pass them around in form fields etc, but MySQL's timestamp format is
 different.  Is there some way to call something like
 UNIX_TO_MYSQL_TIMESTAMP() in MySQL (or PHP)?
 
 
 Erik
 
 
 
 
 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]
 
 
 --
 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] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky


In two words - here's your bible, Erik:

http://www.mysql.org/documentation/mysql/bychapter/manual_Reference.html
#Date_and_time_functions


Sincerely,

Maxim Maletsky

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)

www.phpbeginner.com
[EMAIL PROTECTED]



 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 11:27 PM
 To: Rasmus Lerdorf
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] syntax for date math expressions
 
 
 On Wednesday, April 3, 2002, at 04:14  PM, Rasmus Lerdorf wrote:
 
  But you can simply call MySQL's UNIX_TIMESTAMP() function on the
mysql
  field when you select it if you want it into unix timestamp format.
 
 For SELECTs, this is fine, but what happens when I want to insert a
new
 date?  I transform all of my dates into Unix timestamps so that I can
 pass them around in form fields etc, but MySQL's timestamp format is
 different.  Is there some way to call something like
 UNIX_TO_MYSQL_TIMESTAMP() in MySQL (or PHP)?
 
 
 Erik
 
 
 
 
 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]
 
 
 --
 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] Javascript and PHP??

2002-04-03 Thread Maxim Maletsky

Use header to start file download:

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

Sincerely,

Maxim Maletsky
Founder, Chief Developer

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




 -Original Message-
 From: Joe Keilholz [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 04, 2002 1:12 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Javascript and PHP??
 
 Hello All!
 
 I think this is a pretty simple question. I have a file that I am
writing
 information to and when the process is complete, I am needing to send
the
 file to the user. In Javascript all I would need to do is
window.open() and
 the file would be sent to the user (it's a .csv file). How would I
 accomplish this in PHP? Can I incorporate Javascript into my PHP code?
If
 so, how?
 
 Any help would be appreciated!
 Thanks!
 Joe Keilholz
 
 
 
 --
 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] Re: [PEAR] PEAR

2002-04-03 Thread Maxim Maletsky


If you plan to touch the php.ini file then you will need the root access
to the machine (you will at least have to restart the server).

Pear can also work without touching php.ini, just add into .htaccess
what you wanted to add into php.ini:

   php_value ...

Furthermore, since PEAR itself is just and extension it is possible to
access it without touching any files at all. Just use it the way you
would use PHPLIB: put pear folder somewhere and start including its
files and call its classes and methods.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Georgie Casey [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 04, 2002 1:24 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: [PEAR] PEAR
 
 oh, i thought there was supposed to be some software or stuff in the
pear
 directory (which doesnt exist)
 
 so i just create one and put the package i downloaded into it, then
add the
 line to php.ini and use it in my scripts. dats it?
 
 and i need no permissions to use the stuff on the server? i dont have
to ask
 the admin to do anyhting for me?
 
 Martin Jansen [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
  On Wed, 3 Apr 2002 20:12:46 +0100, Georgie Casey wrote:
 
  The sites documentation is crap compared to PHP.
 
  I love to hear people critizing constructively.
 
  what is it and how do i install it on my windows system?
 
  Add the directory, where your PEAR code is located (e.g.
c:\php4\pear),
  to include_path in your php.ini and you're done.
 
  and more, importantly do i have 2 force my host to install it or
can i do
 it
  myself. i'm just looking to use the file_find package.
 
  Upload the desired package somewhere on your website and again
  add the location to your include_path.
 
  - Martin
 
  --
Martin Jansen, [EMAIL PROTECTED]
http://www.martin-jansen.de/
 
 
 
 
 
 --
 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] Re: included file name

2002-04-03 Thread Maxim Maletsky


Try this:

function whatFile($f) {
$LOCALS['fname'] = $f;
}


$then in the file of yor interest do this:

whatFile(__FILE__);


and wherever next you will want to have that value the file name will be
within $fname;


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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


 -Original Message-
 From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 04, 2002 2:28 AM
 To: Mikhail Avrekh
 Cc: [EMAIL PROTECTED]
 Subject: [PHP] Re: included file name
 
 Check the constants section of the manual...
 
 __FILE__ (case-insensitive)
 
 The name of the script file presently being parsed. If used within a
file
 which has been included or required, then the name of the included
file is
 given, and not the name of the parent file.
 
 
 On Wed, 3 Apr 2002, Mikhail Avrekh wrote:
 
  Hello,
 
  Is there any way inside an included file to figure out what its
actual
  UNIX filename is ?
 
  For example:
 
  file1.php --
  ?
 
  include(file2.php);
 
  ?
 
  file2.php --
  ?
  /*want to do something like:
  if (this_file()==file2.php) {
  ## do stuff
  } else if (this_file()==file1.php) {
  ## do other stuff
  }
  */
  ?
 
  That is, file2.php needs to know whether it's executed in the
context of
  file1.php or autonomously. I guess I could change $PHP_SELF before
  including file2.php in file1.php, but that seems like a bad hack,
plus it
  may screw up other code in file1.php, if there is any.
 
  Any suggestions ?
  M.
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Re: Tools for creating a faq

2002-04-04 Thread Maxim Maletsky

 

I rather agree here: 

* Beginner
* Intermediate
* Advanced 

will make it more sence. A newbie always knows he's notthing else than a 
beginner, someone who knows PHP but not sure of many silly things knows that 
in intermediate-categorized FAQs we have most of the answers, and an 
advanced user is not scared of read the complex programming terminology in 
the advaced section. 

Kewl, no? 


we're getting closer now. 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 

Jason Wong writes: 

 On Thursday 04 April 2002 09:11, J. Scott Johnson wrote:
 One point.  Faq items are rated on a 0 to 4 rating expressed as: 

 Newbie
 Beginner
 Mid Level Geek
 Pro
 Senior DemiGod of PHP 

 Obviously text can be changed.  This way the faq can be sorted section by
 section with more complex stuff at the end.
 
 Having so many levels seems confusing and cluttered. How would one decide 
 between Pro  senior DemiGod of PHP? I would say 3 levels: 
 
  Newbie
  Intermediate
  Advanced 
 
 are more than enough. 
 
  
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk 
 
 /*
 Life is a series of rude awakenings.
   -- R.V. Winkle
 */
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




[PHP] Re: CCS Question -- anyone know?

2002-04-04 Thread Maxim Maletsky


Style sheets can easily be applied. 

But, I rather think that you should make sure your table is having 
cellpadding on 0. 

something like this: 

table border=0 align=center cellpadding=0 cellspacing=0 width=550 

I think this is your problem, I never noticed any unusual behavor of 
checkbox within tables. 

P.S: this was an answer to a message that originally shouldn't been posted 
on this list. 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 

 

Jason Caldwell writes: 

 I have several checkboxes on my webpage -- all within a particular table.
 It seems there is some weird spacing *around* the (or a) checkbox as I
 cannot tighten up my table and my text, that contain the checkboxes -- so,
 it looks like the table rows are spaced out just a little too much -- kinda
 annoying... 
 
 Is there a checkbox CCS style that I can apply that will take away the
 spacing around a checkbox object?  much like the DISPLAY: INLINE; CCS for
 the FORM tag. 
 
 Thanks
 Jason 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] Re: some kind of library loader - Thanks

2002-04-04 Thread Maxim Maletsky

Go wild Arpi!



Maxim Maletsky

 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)

 www.PHPBeginner.com
 [EMAIL PROTECTED]




 -Original Message-
 From: Arpad Tamas [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 04, 2002 10:34 AM
 To: Miguel Cruz
 Cc: Maxim Maletsky; [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: some kind of library loader - Thanks
 
 
 Ok, Thank you for your help Miguel and Maxim, I'm trying to do it by
 the help of your suggestions.
 
   Arpi
 
   Also, you can find out if a class was defined by calling
   'class_exists()'. In this way you might save something.
   The best way thought is what Miguel was saying: load the files
   conditionally with a logic.
  
   That's what I'm trying to do, but still searching for the logic.
   But as I see, there's no better way of doing this other than
   checking if the needed classes are defined before every
   instantiation.
 
  Perhaps you can conjure up some sort of namespace scheme, and then
  use a global array to track which class files have been loaded, or
  which classes have been instantiated, or whatever it is you need to
  keep track of.
 
  In your file with a dependency:
 
global $LOAD_STATUS;
if (!$LOAD_STATUS['classes-db-queryops'])
   include 'lib/classes/db/queryops.php';
 
  In lib/classes/db/queryops.php:
 
global $LOAD_STATUS;
$LOAD_STATUS['class-db-queryops'] = 1;
 
  Seems fairly cheap to do.
 
  miguel


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




RE: [PH P] Re: included file name -- DOCS ?

2002-04-04 Thread Maxim Maletsky


Need more to say, guys?
Read below...



 -Original Message-
 From: Mikhail Avrekh [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 04, 2002 10:43 PM
 To: Maxim Maletsky
 Cc: 'Philip Hallstrom'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: included file name -- DOCS ?
 
 Thanks guys, this is just what I needed !
 
 I'm just surprised that this does not seem to be really documented
 anywhere. The only place where I could find this is in the Reserved
 Keywords section of the manual, where __FILE__,  __LINE__ ,  const
and
 use do not have links to explanatory pages of their own.
 
 http://www.php.net/manual/en/reserved.php
 
 I've submitted a comment (user note) to this page in regard to
__FILE__
 and would be happy if my comment or some version thereof is used as
the
 doc page for this keyword (I guess I could set this up myself, I just
 don't know how). However, wouldn't it make more sense if __FILE__ and
 __LINE__ were in the Constants section rather than in Reserved
 Keywords ?
 
 Another note -- these two keywords are impossible (I think) to find
 through a direct search because it strips the underscores, and the
search
 returns some unrelated pages.
 
 M.
 
 On Thu, 4 Apr 2002, Maxim Maletsky wrote:
 
 
  Try this:
 
  function whatFile($f) {
  $LOCALS['fname'] = $f;
  }
 
 
  $then in the file of yor interest do this:
 
  whatFile(__FILE__);
 
 
  and wherever next you will want to have that value the file name
will be
  within $fname;
 
 
  Sincerely,
 
  Maxim Maletsky
  Founder, Chief Developer
 
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 
 
   -Original Message-
   From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
   Sent: Thursday, April 04, 2002 2:28 AM
   To: Mikhail Avrekh
   Cc: [EMAIL PROTECTED]
   Subject: [PHP] Re: included file name
  
   Check the constants section of the manual...
  
   __FILE__ (case-insensitive)
  
   The name of the script file presently being parsed. If used within
a
  file
   which has been included or required, then the name of the included
  file is
   given, and not the name of the parent file.
  
  
   On Wed, 3 Apr 2002, Mikhail Avrekh wrote:
  
Hello,
   
Is there any way inside an included file to figure out what its
  actual
UNIX filename is ?
   
For example:
   
file1.php --
?
   
include(file2.php);
   
?
   
file2.php --
?
/*want to do something like:
if (this_file()==file2.php) {
## do stuff
} else if (this_file()==file1.php) {
## do other stuff
}
*/
?
   
That is, file2.php needs to know whether it's executed in the
  context of
file1.php or autonomously. I guess I could change $PHP_SELF
before
including file2.php in file1.php, but that seems like a bad
hack,
  plus it
may screw up other code in file1.php, if there is any.
   
Any suggestions ?
M.
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 



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




RE: [PHP] Sockets with windows / win32 - 'call to undefined function: ...'

2002-04-04 Thread Maxim Maletsky


Socket() function does not exist in PHP at all. Use fsockopen() instead.

http://www.php.net/fsockopen


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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





 -Original Message-
 From: Odd Arne Beck [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 05, 2002 1:23 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Sockets with windows / win32 - 'call to undefined
function: ...'
 
 Hi..
 
 The error I get is this one:
 Fatal error: Call to undefined function: socket() 
 
 i'm 100% positive that all my code is correct..
 
 anyone else have this problem, or anyone else NOT having this problem?
 
 I have a win2000 with iis 5.0 and it's latest updates.
 
 the latest version of php too..
 
 Best regards,
 
 -Oddis-


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




RE: [PHP] Explode and Trim

2002-04-04 Thread Maxim Maletsky


I think what yo wrote should be working fine for you.

My way of your code:




foreach(file($storelist) as $line_num=$line_data) {
foreach(explode(':', $line) as $key=$val) {
$val = trim($val);  // remove whitespaces around

// now you are inside each element of your
multidimentional array
// combine your rest of the code and work it out the way
you need it.

}
}



Sincerely,

Maxim Maletsky
Founder, Chief Developer

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


 -Original Message-
 From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 05, 2002 1:07 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Explode and Trim
 
 I am parsing through a text file and using explode to convert the
string to
 an array.  The problem seems to be at the end of the string, when I
check to
 see if the last element in the array is empty it tells me that it is
not.
 The problem comes because the last element should be empty because all
that
 was after the separator was white space.
 
 ---Sample text file---
 AL:123 2nd Ave.:SomeCity:(123) 456-7890:(123) 456-1234:::
 MI:293 3rd St.:Another City:(123) 345-2839:(123) 384-0398:::
 MI:437 4th Ave.:Yet Another City:(123) 283-4839:(123) 458-4843:::
 ---End of text file---
 
 ---Code snippit---
 $stores = file($storelist);
 for($i=0; $icount($stores); $i++) {
   //$stores[$i] = trim($stores[$i],\r);
   //$stores[$i] = trim($stores[$i],\n);
   //$stores[$i] = trim($stores[$i], :);
   //$stores[$i] = rtrim($stores[$i]);
   echo $stores[$i].brbr\n;
   $stores[$i] = explode(:, $stores[$i]);
 }
 
 reset($states);
 while(current($states)  current($stores)) {
   for($i=0; $icount($stores); $i++, next($stores)) {
 while($stores[$i][0] != key($states)) {
   next($states);
   $state = 0;
 }
 if($state==0) {
   echo b.$states[$stores[$i][0]]./bbr\n;
   $state = 1;
 }
 echo $stores[$i][1]., .$stores[$i][2].brPhone:
 .$stores[$i][3].brFax: .$stores[$i][4].br\n;
 if(!empty($stores[$i][5])) echo Email: .$stores[$i][5].br\n;
 if(!empty($stores[$i][6])) echo Web site:
.$stores[$i][6].br\n;
 if(!empty($stores[$i][7])  $stores[$i][7] != ) echo
Additional
 notes: .$stores[$i][7].br\n;
 echo br;
   }
 }
 ---End of code snippit---
 
 Here is the URL of where the code is being used:
 www.wildwebtech.com/acs/nuven/stores.php.  The additional notes should
only
 show up if there were additional notes.
 
 --
 Joshua E Minnie
 CIO
 [EMAIL PROTECTED]
 
 Don't work for recognition, but always do work worthy of
recognition.
 
 
 
 --
 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] eregi_replace

2002-04-04 Thread Maxim Maletsky

 
 $qq = V:\\memo\\F0001\\abcdef.com;
 print $qqbr\n;
 $qx = ereg_replace(V:\\,'',$qq);
 print $qx;
 
 out:
 
 V:\memo\F0001\abcdef.com
 Warning:  Trailing backslash in /home/rodolfo/public_html/test.php on
line
 5


I think it should be:

$qx = ereg_replace(V:,'',$qq);


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 
 Regards,
 Rodolfo.
 
 
 
 
 --
 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] Help with Function parameter

2002-04-04 Thread Maxim Maletsky


Turn error_reporting to:

error_reporting  (E_ERROR | E_WARNING | E_PARSE);

// that is the function to mess in the code, you can also set it within
php.ini

then fix your function:

It cannot have more then one return (sure it can, but will break the
execution on the first-come basis).

If you need them all three then make yourself an array and return it:

Function return_array() {

Return Array('date'=$date, 'time'=$time, 'year'=$year);
}


or, make those three variables global;


Function return_array() {
Global $realday, $month, $year; // add this line and your
function will work

Return True;// is enough
}



Sincerely,

Maxim Maletsky
Founder, Chief Developer

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


 -Original Message-
 From: Simonk [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 04, 2002 5:39 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Help with  Function  parameter
 
 I have programed a function for counting Date:
 
 function Datereturn()
   {
$monthorder = Array ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30,
31);
 $day = Date(j);
 $monthday = Date(t);
   $month = Date(n);
   $year = Date(Y);
   $current = 42 - ($monthday - $day);
   if ($current  $monthorder[$month])
{ $realday = $current - $monthorder[$month];
 $month = $month + 2;
  if ($month  12)
   { $year = $year + 1;
$month = $month - 12; }
}
   else
{ $realday = $current;
 $month = $month + 1;
  if ($month  12)
   { $year = $year + 1;
$month = $month - 12; }   }
   Return $realday;
   Return $month;
   Return $year;
}
 
 
 But when I want to echo out the result, I have typed:
 
 Datereturn();
 echo $year, $month, $realday;
 
 Then the server return:
 Undefined variable year, month, realday
 
 plz 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




[PHP] Re: getting lines from the highest ID in a database?

2002-04-05 Thread Maxim Maletsky


add to your mySQL query: 

 order by id desc limit 1 

This will order your data by your primary id (change 'id' to whatever you 
auto-increment) in the descending order and will limit the results to 1 
record. 

Cheers, 

Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 

 

Hawk writes: 

 Lets say I have a guestbook, and that I only want to show the last entry on
 my first page
 I cant figure out a good way to do it..
 haven't managed to find a mysql command that can do it either, but maybe
 there are? :) 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




[PHP] Re: Includes

2002-04-05 Thread Maxim Maletsky


we still use include(); 

setup.php has something like: 

if(file_exists($page) and ...more...controls..)
  include_once $page; 


then the $page.php is where you have a part of your site. 

You can pass $page as the GET variable: setup.php?page=page.php 

and so on 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 

 

Sebastian A. writes: 

 Lately I have noticed many scripts that all consist of one file even though
 they create the appearance of many pages. For example, you would open
 setup.php and a form would appear. Then after you complete the form a new
 page appears with the results of your form, however the URL is still
 setup.php. So basically you can make complicated forms span only one file
 instead of having separate file to gather, display and save the data, how is
 this done? 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




[PHP] Re: New-line characters

2002-04-05 Thread Maxim Maletsky


FYI: 

brbr is not same as p. P is paragraph and br is just a line break of 
the text. So, depending on your text format the lines broken twice might 
(normally ARE but not too noticeably) look different. 

try to mess with CSS and you'll see the difference about how browsers see 
those both ways. 

In the poster's case, to have a p out of brbr he should still use 
nl2br() and then add this to it: 


$text = preg_replace(/\w*br\w*br\w*/i, \n\np, $text); 


Cheers, 

Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

Jamie Watt writes: 

 You'de be better off using the built in nl2br() function
 (http://www.php.net/manual/en/function.nl2br.php) it'll have the same effect
 as a it'll insert a br tag everwhere a newline character occurs.  Where 2
 newline characters occur it will produce brbr which in your HTML will
 break your text in the same way that a p tag would. 
 
 
 James Stewart [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED].
 ..
 Hi, 

 I have a form for users of a system I am developing to add their
 newsletters
 to a MySQL database through. I take their input and INSERT it straight
 into
 the database after adding slashes. 

 When I retrieve the information from the database I would like to replace
 double occurences of new-lines with a p tag. Can anyone tell me what
 regexp I should be searching for? 

 cheers. James. 

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


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




[PHP] nl2br returns BR /? normality or a bug?

2002-04-05 Thread Maxim Maletsky


I've never seen that nl2rb would return me BR / instead of the
traditional BR. But it did. 

Is that normal or it that a bug?


Here's some test code:

?

$text = 

Hello 

this is
the 
silliest

test

I can


ever

invent

;

echo nl2br($text);

echo on machine: $SERVER_SOFTWARE;

?


returns me such HTML:

--

br /

br /
Hello 
br /

br /
this is
br /
the 
br /
silliest
br /

br /
test
br /

br /
I can
br /

br /

br /
ever
br /

br /
invent
br /

br /
pon machine: [Apache-AdvancedExtranetServer/1.3.22 (Mandrake
Linux/1.2mdk) mod_ssl/2.8.5 OpenSSL/0.9.6 PHP/4.0.6]
--



I've triple-checked for what ANSI characters I had there. They were
fine. And as you can read below, there were the same as when nl2br used
to return me br.

The problem has never occurred to me on any of the previous machines
site was hosted on. It does on this one though, with even the same
version of PHP and the same data from DB. I've noticed this problem
because I had a RegEx after nl2br() that always worked till we migrated
on a new server, then my expression has obviously stopped to work
because of that extra space and slash nl2br kindly provided me with.
Temporarily fixed with another RegEx. But, I was wondering, is a known
bug or it's because of my machine? Other than that nothing has
changed...

Enlighten me on this, please. Did I miss a bug report?


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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


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




RE: [PHP] nl2br returns BR /? normality or a bug?

2002-04-05 Thread Maxim Maletsky


Not same, Andrew, It had made my pages VERY VERY UGLY!

I know that it can be parsed well, but should not have done such effect
on the site. I wouldn't care about this thing if I wouldn't find a few
pages on my site 1000 pixel wide.

But, the question is: why only on this machine? I run the same PHP
version and use same data as before.



Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Andrew Brampton [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 06, 2002 2:21 AM
 To: Maxim Maletsky; [EMAIL PROTECTED]
 Subject: Re: [PHP] nl2br returns BR /? normality or a bug?
 
 br / is that XML style newline or something...
 
 Don't worry about it, it parsed the same as br
 
 Andrew
 - Original Message -
 From: Maxim Maletsky [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, April 06, 2002 1:13 AM
 Subject: [PHP] nl2br returns BR /? normality or a bug?
 
 
 
  I've never seen that nl2rb would return me BR / instead of the
  traditional BR. But it did.
 
  Is that normal or it that a bug?
 
 
  Here's some test code:
 
  ?
 
  $text = 
 
  Hello
 
  this is
  the
  silliest
 
  test
 
  I can
 
 
  ever
 
  invent
 
  ;
 
  echo nl2br($text);
 
  echo on machine: $SERVER_SOFTWARE;
 
  ?
 
 
  returns me such HTML:
 
  --
 
  br /
 
  br /
  Hello
  br /
 
  br /
  this is
  br /
  the
  br /
  silliest
  br /
 
  br /
  test
  br /
 
  br /
  I can
  br /
 
  br /
 
  br /
  ever
  br /
 
  br /
  invent
  br /
 
  br /
  pon machine: [Apache-AdvancedExtranetServer/1.3.22 (Mandrake
  Linux/1.2mdk) mod_ssl/2.8.5 OpenSSL/0.9.6 PHP/4.0.6]
  --
 
 
 
  I've triple-checked for what ANSI characters I had there. They were
  fine. And as you can read below, there were the same as when nl2br
used
  to return me br.
 
  The problem has never occurred to me on any of the previous machines
  site was hosted on. It does on this one though, with even the same
  version of PHP and the same data from DB. I've noticed this problem
  because I had a RegEx after nl2br() that always worked till we
migrated
  on a new server, then my expression has obviously stopped to work
  because of that extra space and slash nl2br kindly provided me with.
  Temporarily fixed with another RegEx. But, I was wondering, is a
known
  bug or it's because of my machine? Other than that nothing has
  changed...
 
  Enlighten me on this, please. Did I miss a bug report?
 
 
  Sincerely,
 
  Maxim Maletsky
  Founder, Chief Developer
 
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] nl2br returns BR /? normality or a bug?

2002-04-05 Thread Maxim Maletsky


OK, James, even worth.

But again (I like insisting on such things),
Why do I have it now and didn't have it before? Why did it change
anyway? I haven't seen it on any other my server and I use it quite a
lot.



Sincerely,

Maxim Maletsky
Founder, Chief Developer

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




 -Original Message-
 From: James Cox [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 06, 2002 2:34 AM
 To: Maxim Maletsky; 'Andrew Brampton'; [EMAIL PROTECTED]
 Subject: RE: [PHP] nl2br returns BR /? normality or a bug?
 
 actually,
 
 br / is not parsed in the same way as br for many browsers. br /
is
 XHTML, and is not a fully supported language set yet.
 
 --
 James Cox :: [EMAIL PROTECTED] :: Landonize It! http://landonize.it/
 Was I helpful?
http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/
 
 -Original Message-
 From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 06, 2002 1:31 AM
 To: 'Andrew Brampton'; [EMAIL PROTECTED]
 Subject: RE: [PHP] nl2br returns BR /? normality or a bug?
 
 
 
 Not same, Andrew, It had made my pages VERY VERY UGLY!
 
 I know that it can be parsed well, but should not have done such
effect
 on the site. I wouldn't care about this thing if I wouldn't find a few
 pages on my site 1000 pixel wide.
 
 But, the question is: why only on this machine? I run the same PHP
 version and use same data as before.
 
 
 
 Sincerely,
 
 Maxim Maletsky
 Founder, Chief Developer
 
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com
 
 
 
  -Original Message-
  From: Andrew Brampton [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, April 06, 2002 2:21 AM
  To: Maxim Maletsky; [EMAIL PROTECTED]
  Subject: Re: [PHP] nl2br returns BR /? normality or a bug?
 
  br / is that XML style newline or something...
 
  Don't worry about it, it parsed the same as br
 
  Andrew
  - Original Message -
  From: Maxim Maletsky [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, April 06, 2002 1:13 AM
  Subject: [PHP] nl2br returns BR /? normality or a bug?
 
 
  
   I've never seen that nl2rb would return me BR / instead of the
   traditional BR. But it did.
  
   Is that normal or it that a bug?
  
  
   Here's some test code:
  
   ?
  
   $text = 
  
   Hello
  
   this is
   the
   silliest
  
   test
  
   I can
  
  
   ever
  
   invent
  
   ;
  
   echo nl2br($text);
  
   echo on machine: $SERVER_SOFTWARE;
  
   ?
  
  
   returns me such HTML:
  
   --
  
   br /
  
   br /
   Hello
   br /
  
   br /
   this is
   br /
   the
   br /
   silliest
   br /
  
   br /
   test
   br /
  
   br /
   I can
   br /
  
   br /
  
   br /
   ever
   br /
  
   br /
   invent
   br /
  
   br /
   pon machine: [Apache-AdvancedExtranetServer/1.3.22 (Mandrake
   Linux/1.2mdk) mod_ssl/2.8.5 OpenSSL/0.9.6 PHP/4.0.6]
   --
  
  
  
   I've triple-checked for what ANSI characters I had there. They
were
   fine. And as you can read below, there were the same as when nl2br
 used
   to return me br.
  
   The problem has never occurred to me on any of the previous
machines
   site was hosted on. It does on this one though, with even the same
   version of PHP and the same data from DB. I've noticed this
problem
   because I had a RegEx after nl2br() that always worked till we
 migrated
   on a new server, then my expression has obviously stopped to work
   because of that extra space and slash nl2br kindly provided me
with.
   Temporarily fixed with another RegEx. But, I was wondering, is a
 known
   bug or it's because of my machine? Other than that nothing has
   changed...
  
   Enlighten me on this, please. Did I miss a bug report?
  
  
   Sincerely,
  
   Maxim Maletsky
   Founder, Chief Developer
  
   PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED]
   www.phpbeginner.com
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 --
 PHP 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] nl2br returns BR /? normality or a bug?

2002-04-05 Thread Maxim Maletsky

 nl2br() has returned BR / for as long as I can remember.

You're deadly wrong, Justin. Years of coding and I have never seen this
behavior of nl2br(). Perhaps I missed its new behavior's introduction
(guilty as charged if so) but I only remember it returning me BR not
BR. I have several regex depending on it.

 As far as my limited knowledge goes, it's to do with the future.  XML
and
 related languages do/will require all single tags (ie not something
like
 B/B which has an open and close) to have the form BR/.

That's true, I suppose

 This would apply to things like HR IMG and many others.
 
 I have no idea why it places the space in, but I do know that i've
done a
 LOT of testing and BR / works fine in every browser I've ever got my
hands
 on.

False!

It DOES NOT work fine in every browser. I'd love to give you a prov, but
because I am lazy I will just tell you this formula: 


if(I found this issue==I noticed screwed pages on my site) {
All I did: preg_replace(BR[^]*, BR, $text); {  
...and pages became pretty again.
}
}

/// preg 'couse I had no idea what comes up next :-)

 Of course, if you don't like it, you can add a str_replace in MANY
ways:
 
 ?
 $text = nl2br($text);
 $text = str_replace(BR /,BR,$text);
 ?

yup

 
 So, to answer your Q, it's a normality.  Sorry I can't provide a full
reason
 why :)
 


when was it changed? Is there any reference?

 
 Justin French
 
 Creative Director
 http://Indent.com.au
 
 
 
 
 
 on 06/04/02 10:13 AM, Maxim Maletsky ([EMAIL PROTECTED])
wrote:
 
 
  I've never seen that nl2rb would return me BR / instead of the
  traditional BR. But it did.
 
  Is that normal or it that a bug?
 
 
  Here's some test code:
 
  ?
 
  $text = 
 
  Hello
 
  this is
  the
  silliest
 
  test
 
  I can
 
 
  ever
 
  invent
 
  ;
 
  echo nl2br($text);
 
  echo on machine: $SERVER_SOFTWARE;
 
  ?
 
 
  returns me such HTML:
 
  --
 
  br /
 
  br /
  Hello
  br /
 
  br /
  this is
  br /
  the
  br /
  silliest
  br /
 
  br /
  test
  br /
 
  br /
  I can
  br /
 
  br /
 
  br /
  ever
  br /
 
  br /
  invent
  br /
 
  br /
  pon machine: [Apache-AdvancedExtranetServer/1.3.22 (Mandrake
  Linux/1.2mdk) mod_ssl/2.8.5 OpenSSL/0.9.6 PHP/4.0.6]
  --
 
 
 
  I've triple-checked for what ANSI characters I had there. They were
  fine. And as you can read below, there were the same as when nl2br
used
  to return me br.
 
  The problem has never occurred to me on any of the previous machines
  site was hosted on. It does on this one though, with even the same
  version of PHP and the same data from DB. I've noticed this problem
  because I had a RegEx after nl2br() that always worked till we
migrated
  on a new server, then my expression has obviously stopped to work
  because of that extra space and slash nl2br kindly provided me with.
  Temporarily fixed with another RegEx. But, I was wondering, is a
known
  bug or it's because of my machine? Other than that nothing has
  changed...
 
  Enlighten me on this, please. Did I miss a bug report?
 
 
  Sincerely,
 
  Maxim Maletsky
  Founder, Chief Developer
 
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com
 



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




RE: [PHP] nl2br returns BR /? normality or a bug?

2002-04-05 Thread Maxim Maletsky


There we go.

Thanks Rodolfo.






Sincerely,

Maxim Maletsky
Founder, Chief Developer

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




 -Original Message-
 From: Rodolfo Gonzalez [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 06, 2002 2:23 AM
 To: Maxim Maletsky
 Cc: 'James Cox'; 'Andrew Brampton'; [EMAIL PROTECTED]
 Subject: RE: [PHP] nl2br returns BR /? normality or a bug?
 
 On Sat, 6 Apr 2002, Maxim Maletsky wrote:
  But again (I like insisting on such things),
  Why do I have it now and didn't have it before? Why did it change
  anyway? I haven't seen it on any other my server and I use it quite
a
  lot.
 
 Directly from the manual:
 
 Note:  Starting with PHP 4.0.5, nl2br() is now XHTML compliant. All
 versions before 4.0.5 will return string with 'br' inserted before
 newlines instead of 'br /'.
 
 http://www.php.net/manual/en/function.nl2br.php
 
 Regards.
 
 
 --
 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] nl2br returns BR /? normality or a bug?

2002-04-06 Thread Maxim Maletsky

Thanks Torben,

I have rushed into this discussion because I didn't know anything about
this change. Later on I've discovered the rest.

Thank you all.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] On Behalf Of Lars
Torben Wilson
 Sent: Saturday, April 06, 2002 10:30 PM
 To: Justin French
 Cc: php
 Subject: Re: [PHP] nl2br returns BR /? normality or a bug?
 
 On Fri, 2002-04-05 at 18:34, Justin French wrote:
  on 06/04/02 11:05 AM, Maxim Maletsky ([EMAIL PROTECTED])
wrote:
 
   You're deadly wrong, Justin. Years of coding and I have never seen
this
   behavior of nl2br(). Perhaps I missed its new behavior's
introduction
   (guilty as charged if so) but I only remember it returning me BR
not
   BR. I have several regex depending on it.
 
 'Deadly' wrong? Wow.
 
  Well, I've been at this PHP thing for 2 years, and like I said, for
as long
  as *I* can remember, it's been BR /.  Perhaps it was introduced
in PHP4,
  perhaps earlier.  I was not an in depth user of PHP3.
 
 Justin is right on this one. This was changed on Dec 27, 2000. So it's
 been around for quite a long time.
 
 It was added because it's valid XML *and* valid HTML. It is true that
 some browsers will not correctly interpret br/ (note the lack of a
 space before the /) but everything I've ever tested has been just fine
 with br /. As they should.
 
 This has been discussed a zillion times on the mailing lists. Maxim,
you
 could have found lots of background on the change by searching the
list
 archives (http://marc.theaimsgroup.com) the bug database
 (http://bugs.php.net) and the CVS repository (http://cvs.php.net).
Some
 links which may explain things a bit better:
 
 A thread on the topic:
 http://marc.theaimsgroup.com/?l=php-devm=99321596031773w=2
 
 The CVS entry itself:

http://cvs.php.net/diff.php/php4/ext/standard/string.c?r1=1.176r2=1.177
 
 
 Torben
 
  But I can't be deadly wrong :)
 
 
   False!
  
   It DOES NOT work fine in every browser. I'd love to give you a
prov, but
   because I am lazy I will just tell you this formula:
  
  
   if(I found this issue==I noticed screwed pages on my site) {
   All I did: preg_replace(BR[^]*, BR, $text); {
   ...and pages became pretty again.
   }
   }
  
   /// preg 'couse I had no idea what comes up next :-)
 
  Again.  I was only stating MY experience.  Every browser I can get
my hands
  on.  I do extensive testing, and have never seen a BR or BR/ or
BR /
  misbehave.
 
  If you have seen it perform unexpectedly, I'm keen to hear about.
 
 
  In fact, if this is the case, then I'll be writing my own nl2br
function
  which returns a br, to avoid this problem ever again.
 
 
  Perhaps in future releases, nl2br() should have an option flag for
switching
  between XHTML and HTML?  I can't see why the powers that be would
have
  included XHTML compliance if it wasn't backwards compatible.
 
 
 
   when was it changed? Is there any reference?
 
  I went to php.net/nl2br and this line of text was in there:
 
  Note: Starting with PHP 4.0.5, nl2br() is now XHTML compliant. All
versions
  before 4.0.5 will return string with 'br' inserted before newlines
instead
  of 'br /'.
 
  :)
 
  So it would appear that I've only been using nl2br since I got my
hands on
  PHP4.05+, which according to the earliest date I can find, was
released
  sometime around 2001-04-30.
 
 
 
  Justin French
  
  Creative Director
  http://Indent.com.au
  
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 --
  Torben Wilson [EMAIL PROTECTED]
  http://www.thebuttlesschaps.com
  http://www.hybrid17.com
  http://www.inflatableeye.com
  +1.604.709.0506
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Re: Directory check

2002-04-08 Thread Maxim Maletsky


try: 


if(is_dir($dir)) {
 echo 'directory was found';
} 

 

Yoroshiku, 

Maxim Maletsky
PHPBeginner.com 

 


Hiroshi Ayukawa writes: 

 Does anyone know how to check a directory exiasts? 
 
 Thanks in advance,
 Hiroshi Ayukawa
 http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php?type=top 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] Manipulate the address field in the browser?

2002-04-09 Thread Maxim Maletsky


Use include(). Except, for the fact that, this will be: 

include(http://www.yourBB.com/bb.php?this=thatthat=is-not-this;);

I don't know how are you going to manage the links though. You might
want to write a client-server app to do that.

Alternatively, you could simply put it in the frames. That would be WAY
easier.


Cheers,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Kevin Stone [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 09, 2002 11:44 PM
 To: PHP-general
 Subject: [PHP] Manipulate the address field in the browser?
 
 Here's a crazy question.  Say I have a script (such as a bulliten
board script) that is
 run by many clients (other websites) off of one location on my web
account.  Think of
 it as a service of some kind.  Is there anyway to trick the browser
into displaying the
 client's domain rather than my own?  I would want it to look as though
you've never
 left their website when in fact you are now on mine.  Possible?
 
 Much thanks,
 -Kevin


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




RE: [PHP] Manipulate the address field in the browser?

2002-04-09 Thread Maxim Maletsky

 
I don't think this is his case. Say, some site on geocities wants to get
on and manipulate his BB while showing it's own Geocities URL. What
would it have to do with apache?
 
It is rather like using frames. (or JavaScript of some kind) 
 
 
Maxim Maletsky 
 
 
 -Original Message-
 From: Dan Harrington [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 10, 2002 12:25 AM
 To: Erik Price
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Manipulate the address field in the browser?
 
 
 Sounds to me like an Apache Alias Directive is what you need.
 can you get at your apache configuration? :-)
 
 http://httpd.apache.org/docs/mod/mod_alias.html
 
 
 
  -Original Message-
  From: Erik Price [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, April 09, 2002 4:22 PM
  To: Kevin Stone
  Cc: PHP-general
  Subject: Re: [PHP] Manipulate the address field in the browser?
 
 
 
  On Tuesday, April 9, 2002, at 05:44  PM, Kevin Stone wrote:
 
   Here's a crazy question.  Say I have a script (such as a bulliten
board
   script) that is run by many clients (other websites) off of one
location
   on my web account.  Think of it as a service of some kind.  Is
there
   anyway to trick the browser into displaying the client's domain
rather
   than my own?  I would want it to look as though you've never left
their
   website when in fact you are now on mine.  Possible?
 
  My domain name registrar uses a neat trick called stealth
forwarding.
  It's probably explained in some tutorial on the web, so I won't
  speculate on how it's done, but the principle is this --
 
  You have a web page hosted at a certain ISP... where the domain name
is
  something like http://isp.com/~eprice/index.html
 
  But you just purchased a fancy domain name from an independent
domain
  name registrar (not thru your ISP) and you want to point the new
domain
  name to the old domain name.  Unfortunately, the ISP didn't give you
a
  dedicated IP address and they won't give you a virtual host, so you
have
  no way to map your shiny new domain name to your web site.
 
  Stealth forwarding essentially makes the entire browser window into
one
  giant new frame.  The contents of the frame are
  http://isp.com/~eprice/index.html, but because the frameset is
hosted by
  the indie domain name registrar, and they have your shiny new domain
  name mapped to a virtual host on their servers or something, it
looks
  like (judging from the URL bar) a user is browsing
  http://shinynewdomainname.com, not
http://isp.com/~eprice/index.html.
 
  The only problem is that (a) it relies on frames, so it might not
work
  for all browsers (and definitely won't work for scripts), and (b)
the
  URL never changes -- the domain name registrar is hosting the
frameset,
  not the site, so all the URL bar ever shows is the name of the
master
  frameset -- http://shinynewdomainname.com.
 
  My registrar is easyDNS, maybe they have information about how it's
done
  if you can't find it elsewhere but I'd be surprised if you couldn't.
 
 
  Erik
 
 
 
  
 
  Erik Price
  Web Developer Temp
  Media Lab, H.H. Brown
  [EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



[PHP] PCRE - catching a caracter set in a negative class

2002-04-09 Thread Maxim Maletsky


Hi all, 

I was scratching my head to accomplish the following perl regular 
expression. It doesn't want to catch me [^\{php}]. From what I understood 
reading the docs this is because in a negative class the caracters are being 
taken litteraly one by one and not as a set. I tied to enclose them by () by 
that didn't work eigher. What is the work around for this? 


here's a sample code: 


$text = ' 

some text ... 

{php}
echo some funcy code to include he{re;
{/php} 

more text 


'; 

$out = preg_split(/(\{php}[^\{php}]*\{\/php})/i, $text, -1, 
PREG_SPLIT_DELIM_CAPTURE); 

 

Thanks, 

Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] Dealing with Query String

2002-04-09 Thread Maxim Maletsky



In your PHP:

On every click collect two variables: 

$by and $order 

then, call for this query:

Select field from table where this=that order by $by $order;


Make sure both variables have their default values in case there was
nothing selected.
You don't really need a function for this, just a few variables preset
before calling mySQL.



Do pobachennya,

Maxim Maletsky
Founder, Chief Developer

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



 -Original Message-
 From: Vladislav Kulchitski [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 10, 2002 3:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Dealing with Query String
 
 
 Hi,
 
 I need some help with query string. Basically what I am doing is I am
 sorting my table, much like you sort columns in OUTLOOK EXPRESS for
 instance with a little arrow...
 

http://www.kulchitski.com/btl/btl.php?lang=engpage=talkroom_showsort=s
 ex
 
 So all I need a function that will grab this query and will change
sort=
 and another new variable (desc/asc) and will return the same string
but
 with new values for certain variables... I ran across some function
like
 this before when Ididn't need it, but just now when I need it badly -
 can't seem to be able to find it. Hope someone out there can help.
 
 Thank you much.
 Vlad
 
 --
 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] Dealing with Query String

2002-04-09 Thread Maxim Maletsky



Once your query (whatever it is) was composed, append this:

 order by $by $order;


so, in this example it could be looking to you something like this:

$query = 'bla bla language and page';


if(!$by) {
$by = 'name_field';

if(!$order)
$order = 'desc';
}


$query .=  $by $order;


and that is your function. It will look for $by and $order variables
passed to it via GET and will add it to your query. If not passed any it
will use the default ones. 

Just add these values to your links and that is it.
Obviously, the security there is up to you.




Sincerely,

Maxim Maletsky
Founder, Chief Developer

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




 -Original Message-
 From: Vladislav Kulchitski [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 10, 2002 4:09 AM
 To: Maxim Maletsky
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Dealing with Query String
 
 Privit Maxim,
 
 I understand your approach... i.e. I can hardcode it in the links, but
 what if I will add more variables in a query string... note in the
query
 string there are variables that are not really related to the
operation
 with the table, rather language ($lang=), page ($page=)... for now I
 guess I will wind up doing it HARD-CODEed way...
 
 Thanks,
 Vlad
 p.s. if anyone knows how to solve my problems, let me know... I think
 the function that would be suitable is parse_str() less suitable
but
 still doable would be explode()...
 p.p.s. for MAXIM: I am doing it with languages switching as you can
see
 on the top of the template.. I am using explode()
 
 -Original Message-
 From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 09, 2002 10:04 PM
 To: Vladislav Kulchitski; [EMAIL PROTECTED]
 Subject: RE: [PHP] Dealing with Query String
 
 
 
 In your PHP:
 
 On every click collect two variables:
 
 $by and $order
 
 then, call for this query:
 
 Select field from table where this=that order by $by $order;
 
 
 Make sure both variables have their default values in case there was
 nothing selected.
 You don't really need a function for this, just a few variables preset
 before calling mySQL.
 
 
 
 Do pobachennya,
 
 Maxim Maletsky
 Founder, Chief Developer
 
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com
 
 
 
  -Original Message-
  From: Vladislav Kulchitski [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, April 10, 2002 3:49 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Dealing with Query String
 
 
  Hi,
 
  I need some help with query string. Basically what I am doing is I
am
  sorting my table, much like you sort columns in OUTLOOK EXPRESS for
  instance with a little arrow...
 
 

http://www.kulchitski.com/btl/btl.php?lang=engpage=talkroom_showsort=s
  ex
 
  So all I need a function that will grab this query and will change
 sort=
  and another new variable (desc/asc) and will return the same string
 but
  with new values for certain variables... I ran across some function
 like
  this before when Ididn't need it, but just now when I need it badly
-
  can't seem to be able to find it. Hope someone out there can help.
 
  Thank you much.
  Vlad
 
  --
  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] Including only I want

2002-04-13 Thread Maxim Maletsky


You can call for this include inside a function and then Return inside
included file.

Not sure if it's suitable for you, inside functions there are quite a
few extra things to do like Globals etc.

Or, you could fopen(), read the needed lines, assign to a variable and
eval() it. Quite a silly way though.


Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com
 


 -Original Message-
 From: Justin French [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 13, 2002 5:16 PM
 To: Alberto Wagner; Php General Mailling List
 Subject: Re: [PHP] Including only I want
 
 Best hope is to include some if statements into the included file, and
 establish what you want to get out of the file, eg:
 
 ?
 $section = a;
 include('file.php');
 ?
 
 
 --file.php--
 ?
 
 if($section == a)
 {
 // do something
 }
 ?
 --
 
 Or perhaps make the few lines you're after a function, then all you
have to
 do is include your functions library on every page it's needed, and
then
 call the function to do the selected lines/calculations, with a
simple
 
 ?
 domyfunction();
 ?
 
 
 Regards,
 
 Justin French
 
 
 on 13/04/02 7:32 PM, Alberto Wagner ([EMAIL PROTECTED]) wrote:
 
  Is there any way to include only the lines that I want in an other
PHP file?
 
  something like Include();
 
  like lines number 5,6 and 7.
 
  only this ones and not the entire script?
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Re: PHP HTML Issue

2002-04-16 Thread Maxim Maletsky


Because, as you already can imagine, different browsers think different. 
First of all, as long as I remember, Nutscrape does not react on  disabled 
parameter in form objects. This might have been changed though. Anyway, to 
be very sure - do not count on these values to be sent to you, if you really 
want them, create a copy as hidden and that is it. 

Cheers, 

Maxim Maletsky
www.PHPBeginner.com 

 

Boaz Yahav writes: 

 Hi 
 
 I'm having a problem that is taking me out of my mind.
 I have a DISABLED field in my HTML (SELECT tag) and for some reason,
 it's value is not passed back to the script after submission.
 If I remove the DISABLED word it's ok.  
 
 The funny issue is that with Netscape it's ok but IE is acting up. 
 
 any ideas? 
 
 Sincerely 
 
   berber 
 
 Visit http://www.weberdev.com Today!!! 
 To see where PHP might take you tomorrow. 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




[PHP] Re: Performance question

2002-04-16 Thread Maxim Maletsky


why not to keep both names and the pictures themselves into a database? 
Loggin in is not really that big deal, I think it is worth portability - 
you'll be changing this someday (as you get too many requests or too many 
pictures to request). Start from now. Performance will not change too much 
anyway. 


Cheers, 

Maxim Maletsky
www.PHPBeginner.com 

 


James E. Hicks III writes: 

 I think you've got the best set up already. I have a PDF library that I do a
 similar thing with. To update the site I just dump the new PDF's into their
 directory and the users reload the page to see the new content. 
 
 James 
 
 -Original Message-
 From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 16, 2002 11:22 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Performance question 
 
 
 Ok I have a performance question. I run a wallpaper site; this is the url to
 the main gallery page http://www.cognitivedistortion.com/php/gal.php
 http://www.cognitivedistortion.com/php/gal.php  The page does a dir read
 and lists all pictures found in each directory, it does this every time the
 page is loaded. Now at first this seemed like a incredible inefficient way
 to do generate pages. The alternatives to this would be to generate a list
 of the pictures and save them in a text file, or create a list of the
 pictures and store them in a database. If I use a text file I will have to
 read the text file every time the page is generated which seems like it
 would take just as long as reading the file allocation table, which I am
 doing now. As for the database to get the same thing done I would first have
 to log into the database and then pull the information.
 I was hoping to get some input as to which would be the fastest/ best way to
 use. 
 
 
 Mike Fifield
 Charles Schwab  Co, Inc.
 WARNING: All e-mail sent to or from this address will be received by the
 Charles Schwab corporate e-mail system and is subject to archival and review
 by someone other than the recipient. 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




  1   2   3   4   5   6   7   >