RE: [PHP] system() PHP newbie!!

2001-02-22 Thread PHPBeginner.com

You should escape your backslashes in windows file pathes


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 7:31 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] system() PHP newbie!!


On Tuesday 20 February 2001 21:17, Kevin Connolly wrote:

> just adding the line: system("C:/temp.exe")?? I have also tried
> system("C:\temp.exe)!! This is probably a really silly question but I

As you use double quotes here, PHP will interpret the "\t" in there as 
TAB character. Write "C:\\temp.exe" instead.

> send me an example or tell me what I am doind wrong? Any assistance is
> very much appreciated,

Well, it would help if you'd tell us what goes wrong - error messages, 
things it should do but doesnt ...

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

What luck for the rulers that men do not think.

- Adolf Hitler

-- 
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] Can you check if someone is online on your homepage?

2001-02-22 Thread PHPBeginner.com

I don't think so,
you never know when someone leaves your site.

you can detect a visit - yes, but nothing so interactive you can do with PHP
as with JavaScript.
I've seen some JavaScript counters like this ages ago. Search for that.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Jan Grafström [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 7:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can you check if someone is online on your homepage?


Hi!
Can you use a php-script to see if there is someone on your homepage?
Im going to make a demo with flash, php,xml and xsl and if more than one
at the moment are testing the demo,  it won´t work beacause of the
work-file is cleaned up every time someone enters.If you can see a digit
on the page than you can tell visitor to goto another instance of the
page.

Thanks for help.
Regards

Jan


--
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] RE: Can you make a file empty?

2001-02-22 Thread PHPBeginner.com

yeah, you can just fputs() an empty string in it and close the file.
In this way you'll empty it all.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 8:30 PM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: [PHP] RE: Can you make a file empty?


does this not already do it? according the manual "w" as the second
parameters will "place the file pointer at the beginning of the file and
truncate the file to zero length".

Tim Ward
Senior Systems Engineer

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


> -Original Message-
> From: Jan Grafström [mailto:[EMAIL PROTECTED]]
> Sent: 20 February 2001 18:47
> To: [EMAIL PROTECTED]
> Subject: Can you make a file empty?
>
>
> Hi!
> I am trying to delete all text in a file.
> $yourfile = "file.txt";
> $fp = fopen($yourfile,w)
> "is there any good code to put in here?"
> fclose($fp);
>
> Thanks for any help.
>
> Regards
>
> Jan
>
>

--
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] array headaches

2001-02-22 Thread PHPBeginner.com

what I think you've missed is your array starts with []['string']

remove []...

$menu['name'] = ...  should work ... unless your code is a little specific



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Matt Williams [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:57 PM
To: [EMAIL PROTECTED]; PHP_UK@egroups. com
Subject: [PHP] array headaches


Hi

could anybody please help me get my head around the following.

I get some url information from the database (title, url)
I am trying to then put this into an array so I can pass it to the page to
display a menu.
so
a) how do I get the data into the array. would this be the way to do it??

$menu = array();
while($db->next_record())
{
$menu[]["name"] = $db->f("name");
$menu[]["url"] = $db->f("topic_id");
}
which leads me onto
b) how do I get the data back out. I can't test to see if the above works as
I can't get at the data

TIA

M@


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



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




RE: [PHP] POST against GET

2001-02-22 Thread PHPBeginner.com

strange .. should work ...

try it again ... search for some HTML errors and see if in your PHP file
there's HTTP_GET_VAR, if is there then change the _GET_ into _POST_



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 21, 2001 11:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] POST against GET


Hello friends.

I am running PHP4 on an Intel Win NT server 4 sp6 machine.

When I use POST the feedback form does not work but itw works when I use
GET. Can anyone advise why this is so? The data that I am using are only 2
string variables of one word each.

thank you
denis





--
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] HTTP_REFERER doesn't work with redirects...?

2001-02-22 Thread PHPBeginner.com

HTTP_REFERER work ONLY clicking a link which brings you to a page in the
SAME window.
this value comes from your browser and it is very unreliable

Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 12:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP] HTTP_REFERER doesn't work with redirects...?


Hi!


I just want to get the URL of the page that is
redirecting to the other page.
For example..

I  have two files
login.php
something.php


Something.php has a line saying:




So When I open Something.php it automatically takes me
to login.php. On the login.php page I have the
following lines




It doesn't seem to work. I think the problem is
because I don't click and go to something.php. I am
getting redirected to the file./ SO is there nay other
way I can get the URL of the file Which is
redirecting.


Thanx a lot

Cheers!~
Dhaval Desai

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices!
http://auctions.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]




RE: [PHP] Variable Strangeness

2001-02-22 Thread PHPBeginner.com

you made a comparison in your code. it returned true which is 1.

what are you trying to do anyway? if you want to compare and print it only
if it's yes then do:

$confidential = 0;
echo "$confidential " . $confidential ? 'yes' : '';



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 1:56 AM
To: Jason Murray; [EMAIL PROTECTED]
Subject: Re: [PHP] Variable Strangeness


Addressed to: Jason Murray <[EMAIL PROTECTED]>
  [EMAIL PROTECTED]

** Reply to note from Jason Murray <[EMAIL PROTECTED]> Wed, 21 Feb 2001
11:37:40 -0600
>
> Hi,
>
> I came across this:
>
>   $confidential = 0;
>   echo "$confidential " . ($confidential == "yes");
>
> In which "0 1" was printed.
>

$confidential = 0;   #  Numeric 0

That explains the 0.


$confidential == "yes"

This is a little tricky.  The numeric value of 'yes' is 0, so it
evaluates to the same thing as  0 == 0, which is true.  True has a
numeric value of 1, although all values besides 0 are considered true.


You might want to look at the === operator which checks that both the
value and the type of the operands is identical.

   http://www.php.net/manual/en/html/language.operators.comparison.html




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.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] Print in html

2001-02-22 Thread PHPBeginner.com

if it is in html then do this:



RE: [PHP] Print in html

2001-02-22 Thread PHPBeginner.com

However I think double quote will work as well...  (am I wrong?)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Hrishi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 4:12 AM
To: Brandon Orther; PHP User Group
Subject: Re: [PHP] Print in html  Hello,
>
> I am trying to finish up a script with instructions on how to add my
banner
> add script to someone's .phtml file.  I need to print 

use :
echo '';

the single quotes ensure that php does not evaluate the contents of the
string constant

cheers,
hrishi

--
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] Generating percentages of numbers

2001-02-22 Thread PHPBeginner.com

I have once requested a feature like this at PHP-DEV..

here's the code:
http://bugs.php.net/?id=7429


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Blake S. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 7:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Generating percentages of numbers


I have a database of numbers:

TOTAL HITS: 1000
PAGE 1: 500
PAGE 2: 250
PAGE 3: 250

How can I query these numbers and display back a percentage number? For
instance with the numbers above:

PAGE 1: 50%
PAGE 2: 25%
PAGE 3: 25%

Or is their a process by which to store numbers for easily getting this to
work?



-- 
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] crontab help

2001-02-22 Thread PHPBeginner.com

Yup, it will...

A good idea is to call exec() of a cgi script which sends email without time
outs.
CGI has it cute feature - never times out. I've seen it in some software.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Arnold Gamboa [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 4:37 PM
To: Joe Stump
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] crontab help


thanks for the comment

let's just say i have 100k emails to send... don't you think that will drain
the system resources if i send it all at once even if you have usleep(300)
on each while?

your comment please.

> put a sleep(300); at the end of your while() loop - I did this on my mass
> mailer and it worked like a charm.
>
> --Joe
>
> On Fri, Feb 22, 2002 at 02:53:10PM +0800, Arnold Gamboa wrote:
> > hi there.
> >
> > is there a way to tell crontab to do:
> >
> > "run script every 5 mins for 1 hour"..
> >
> > i have this mass email script that is so huge that i need it to chunk
into
> > records and make sure that it will run every 5 mins for 1 hour.
> >
> > Thanks for any help.
> >
>
> --
>
> --
-
> Joe Stump, PHP Hacker,
 -o)
> http://www.miester.org http://www.care2.com
/\\
> "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
_\_V
> --
-
>
>
>


--
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] isset()

2001-02-22 Thread PHPBeginner.com

If the result is always something, for instance in the worth case it is
'N/A'
then do:

if($AgeChild != 'N/A')
you can continue

isset check if the variable has at least a byte in it.

so this will return true:

$var = ' ';
if(isset($var))
echo 'got something in it';



Just check for what you know is inside (or not inside) the variable.

Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Jacky@lilst [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] isset()


People
I tried to check if teh field has set a vaule in it before submit using
isset with the sniplet below

if ((isset($AgeChild))=="false") {
$AgeChild = "NA";
}

The resule is that it always displays NA whether or not it has vaule in the
field, what is the correct way of using isset for this purpose? Or should I
use empty() ?
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] file listener

2001-02-22 Thread PHPBeginner.com

from PHP - now, but you can set a script which will check the file size each
minute and if finds it different does something.
It will have to run under cron.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: toto [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 6:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] file listener


Hi...

I have a file, say temp.txt. It's just a kind of logging file. When my
system write one line data to this file, is there any real time way to know
this event from php (or other scripting language) ?


TIA
-toto-



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



-- 
PHP 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: Can you make a file empty?

2001-02-22 Thread PHPBeginner.com

Year.. probably it is 

I've never tried ... In this cases If I need it empty I just remove it, and
when I write in if it doesn't exists then new file is being generating ...
It feels easier to me ...






-Original Message-
From: Tim Ward [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 8:15 PM
To: 'PHPBeginner.com'; Tim Ward; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] RE: Can you make a file empty?


the manual implies that you don't need to write anything to the file to
clear what's in it already, is this not the case?

Tim Ward
Senior Systems Engineer

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


> -----Original Message-
> From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
> Sent: 22 February 2001 11:15
> To: Tim Ward; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] RE: Can you make a file empty?
>
>
> yeah, you can just fputs() an empty string in it and close the file.
> In this way you'll empty it all.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -Original Message-
> From: Tim Ward [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 21, 2001 8:30 PM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: [PHP] RE: Can you make a file empty?
>
>
> does this not already do it? according the manual "w" as the second
> parameters will "place the file pointer at the beginning of
> the file and
> truncate the file to zero length".
>
>   Tim Ward
>   Senior Systems Engineer
>
> Please refer to the following disclaimer in respect of this message:
> http://www.stivesdirect.com/e-mail-disclaimer.html
>
>
> > -Original Message-
> > From: Jan Grafström [mailto:[EMAIL PROTECTED]]
> > Sent: 20 February 2001 18:47
> > To: [EMAIL PROTECTED]
> > Subject: Can you make a file empty?
> >
> >
> > Hi!
> > I am trying to delete all text in a file.
> > $yourfile = "file.txt";
> > $fp = fopen($yourfile,w)
> > "is there any good code to put in here?"
> > fclose($fp);
> >
> > Thanks for any help.
> >
> > Regards
> >
> > Jan
> >
> >
>
> --
> 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] Generating percentages of numbers

2001-02-22 Thread PHPBeginner.com

However ctype were taken!

http://bugs.php.net/?id=7360
Once implemented, many developers will have a whole bunch of fun.
:-))


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 11:55 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Generating percentages of numbers


On Thursday 22 February 2001 12:14, PHPBeginner.com wrote:
> I have once requested a feature like this at PHP-DEV..
>
> here's the code:
> http://bugs.php.net/?id=7429

Well, I agree with the last comment on that page - Why should that be 
added to the language if it's implemented in PHP with only 4 lines?

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

Drink wet cement. Get stoned.

-- 
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] isset()

2001-02-23 Thread PHPBeginner.com

I don't agree with you in here,

you usually know what kind of variable you're checking, so strlen() will
work just as well as

$var ? 'OK' : 'Empty'

will work or the isset() - common, it was made for checking the variables -
use it.

strlen() is in fact an overhead, why would you allow your design to be some
sort of untraditional? I don't think there's any necessity for it

a "good design" often would be something like this:

$var = 'whatever';

if($var)
...do this
else
ERROR('no var') // some your func to output the error mess or to continue
with debugging

in most cases it will work better and simpler for you without spending these
bazillions of important for every developer seconds.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:07 AM
To: Steve Edberg
Cc: Jacky@lilst; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


I stand firm on strlen() for the following reasons ...

if(!$var) will sometimes act strangely (has for me in the past) when
variables
are set to something other than what you are expecting.

if(isset($var)) will return true if your text field is declared but not
filled
in.

if(empty($var)) will return true if $var is set to 0 (for obvious reason) so
is
only good for certain instances.

strlen() on the other hand converts the variable to a string and returns a
count
of characters. It's never failed or acted funky. For this reason I use it
religiously.

Others might say "well it's extra overhead" to which I reply "I'll take an
extra
bazillionth of a second to know for sure I have what I need"

--Joe

On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> I would do this:
>
> if (!$AgeChild) $AgeChild = 'NA';
>
> More compact, easier to read (to me, anyway). This presumes that a
> value of '' (empty string, interpreted by PHP as false) is NOT a
> valid value here.
>
> As far as your sniplet goes, it is possible that there may be some
> PHP type-casting issues here, depending on: whether $AgeChild is
> numeric or string; the fact that the STRING "false" isn't equivalent
> to the CONSTANT false, the use of == vs. ===.
>
> Time to check out the docs - specifically the types and variables
> sections (also the functions->variables section)...
>
>   - steve
>
>
>
> At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
> >People
> >I tried to check if teh field has set a vaule in it before submit
> >using isset with the sniplet below
> >
> >if ((isset($AgeChild))=="false") {
> >$AgeChild = "NA";
> >}
> >
> >The resule is that it always displays NA whether or not it has vaule
> >in the field, what is the correct way of using isset for this
> >purpose? Or should I use empty() ?
> >Jack
> >[EMAIL PROTECTED]
> >"There is nothing more rewarding than reaching the goal you set for
yourself"
>
>
> --
> +--- "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]

--


---
Joe Stump, PHP Hacker,
 -o)
http://www.miester.org http://www.care2.com
/\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison
_\_V

---


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



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




RE: [PHP] variable sent using pots is cat!

2001-02-23 Thread PHPBeginner.com

It shouldn't have happened,

can you give as a come sample to resolve your situation?



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] variable sent using pots is cat!


Hi!
i have a problem!
i send a variable from one page to another page using post method!
but when a variable is like composed of two words , the other page receives
only the first word !
can u please help?!
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] How do I request a new feature?

2001-02-23 Thread PHPBeginner.com

bugs.php.net



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Ide, Jim [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:49 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] How do I request a new feature?



Hi -

How can/should I contact the developers of PHP
to request that they add a new feature to PHP?

Thanks -
Jim



-- 
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] Sessions and naming a file with SID

2001-02-23 Thread PHPBeginner.com

PHP does it automatically for you.

YES your session id is $PHPSESSID

so creating a file called $PHPSESSID should work, I suppose


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:56 AM
To: PHP User Group
Subject: [PHP] Sessions and naming a file with SID


Hello,

Is there a way to start a session and then save a temp file with the name of
the Session ID?

Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.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] Templates & PHP

2001-02-23 Thread PHPBeginner.com

try these:

search google for fast templates
templates,

check out sourceforge.net

there's a whole bunch of this applications.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Maamiin [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:06 AM
To: PHP General Newslist
Subject: [PHP] Templates & PHP


Where can I find some help, how to make & use page templates on my
webpages??? Needs this some add-ons to my PHP3(Linux-main)/PHP4(win98+pws)?

THNX


-- 
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@lists.php.net

2001-02-23 Thread PHPBeginner.com

use urlencode()

www.php.net/urlencode


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Tom Harris [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Passing values containing a ? and a &


I want to assign a value using the url however the value contains both a ?
and an & so PHP (or the browser) seems to get confused.

Here's an example:

http://www.mysite.com/index.php?id=23&url=http://www.anothersite.com/file.ph
p?qid=234&forum=4

Everything after url= should be the value of $url but this is not the case.
Is there a way to solve this?

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] books

2001-02-23 Thread PHPBeginner.com

Professional PHP Programming is a good one


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: grios [mailto:grios]On Behalf Of Gustavo Vieira Goncalves Coelho
Rios
Sent: Thursday, February 22, 2001 1:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] books


May some suggest a kick ass book on php?

Thanks a lot for your time and cooperation.

best regards,
Gustavo Rios


PS: Any one here from Brazil/South America ?

-- 
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] concatenate vars?

2001-02-23 Thread PHPBeginner.com

no, you need to do three different comparisons :

if( ... something ... )
(eregi("stuff1", $one) and eregi("stuff2", $two) and eregi("stuff3",
$three)) ? : do this : do that


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: W.D. [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 5:38 AM
To: Philip Olson
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] concatenate vars?


Thanks,

do you know if making multiple statements to eregi in line 3  is possible?

1. if(...something...)
2.{
3. (eregi("stuff1", $one)("stuff2", $two)("stuff3", $three)) ?
4. do something : do something else;




 _ Do You Yahoo!?
Get your free @yahoo.com address at http://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]




RE: [PHP] Problems sending mail to aol with the mail() function

2001-02-23 Thread PHPBeginner.com

I cannot help you, but I KNOW you are not the only one,
I've been asked this question already, and, I think I've seen something on
php.net under mail() ...

I believe this is your XSender thing, but not sure ...



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Steve Kenshalo [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Problems sending mail to aol with the mail() function


Hello,

I am working on a PHP script for an e-commerce site that mails out calling
card pin numbers after somebody purchases them online. Turing testing I not
noticed that aol users were not receiving the messages. AOL seems to be
filtering them out without sending a bounce or anything. We tried it with
multiple aol users, and nothing I tried when using the mail function got
through, but messages sent from the server with pine and the php mail
package SquirrelMail do get through. The messages are received on every
other mail system I have tried.

I know this is more of a mail question, but I was hoping somebody here and
encountered this before and knew of a workaround. I noticed that
SquirrelMail doesn't use the mail function, they chose to write their own
SMPT package. I wonder why?

Anyway, my test scripts look like this:


I tried playing around with different headers and nothing made any
difference. I sent them to myself and they sure look like valid email
messages to me. Does anybody else have this problem? What did you do about
it?

Thanks,

Steve


--
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] Counter Help

2001-02-23 Thread PHPBeginner.com

Yup, you need to have your key strings in quotes '',
so it doesn't think it's a constant.

ALWAYS use $array['key']
and not
$array[key]

except for the integrers



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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


-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:11 AM
To: PHP (E-mail)
Subject: [PHP] Counter Help


Can someone help me with this script? It is an example from weberdev.com. I
ran it and it gave me the following error...

-- Warning: Use of undefined constant count - assumed 'count' in
c:\windows\desktop\localhost\examples\counter\counter1.php on line 27
25

The number 25 is the correct number for the counter, but how do I get rid of
that error message that keeps coming up before the counter number (25)? I am
testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL
3.23.33. Here is the script:















-- Navid


--
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] Location

2001-02-23 Thread PHPBeginner.com

You need to have an array or db with file and description

in ca you use array :

$location = Array(
  '/index.php' => 'HOME',
  '/prod_info.php' => 'Product Information',
  ..etc

);

and then

if(isset($location[$PHP_SELF]))
echo $location[$PHP_SELF];


and so on ...

note: this is just a quick and dirty idea on how to do that, with a little
bit of logic you can write a very sweet function with does what you need.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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







-Original Message-
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 10:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Location


Im making a website and i want the viewer to know were he of she is,
what do i need to do to make a location bar (home > serverices ect...)
with the $PHP_SELF command, i wasent able to figure it out so i am
asking assistance from another person.


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

2001-02-23 Thread PHPBeginner.com

No it will give you the same value twice...

you need a loop



ACT
VIC



looping the rows .,...{

   echo "".$row['state_abbr']."
";

}




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 1:17 PM
To: PHP MAIL GROUP
Subject: [PHP] 
ACT
VIC


can i change it to say

ACT
VIC


so that when the page loads it shows which ever option is in the Data base?

Peter Houchin
Sun Rentals
[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] Counter Help

2001-02-23 Thread PHPBeginner.com

Yeah, this is very silly thing using arrays without quotes,

I once had this problem - learned it - and sticked to using quotes whenever
is not an integrer.


advising to everyone,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Simon Garner [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 1:32 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Counter Help


From: "Chris Lee" <[EMAIL PROTECTED]>

> change
>
> $row[count]
>
> to
>
> $row['count']
>
> it thinks the work [count] is some kind of conastant, it doesnt know you
> mean (string) 'count'
>




I have noticed a lot of people do not put quotes on their array indexes
(e.g. VBulletin is a prime offender) - imho this is a really bad practice
because your code becomes ambiguous.

Example:

"orange", "bar"=>"purple");

echo $test[foo];
?>

Now, I think that should print nothing (or an error), because there is no
index matching "donkey" (the value of the constant "foo"). But for some
reason PHP looks for an array index matching the string "foo" as well,
encouraging this kind of sloppy programming.


Regards

Simon Garner


--
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] International support

2001-02-23 Thread PHPBeginner.com

Hi (Soma Interesting?)

I am also a developer here in Tokyo and have done few I-Mode websites using
PHP and mySQL. (I've used PostgreSQL with Japanese, but not for I-Mode)
( see www.japaninc.com/i )

There's no particular problems of storing the 2-bit data in your databases,
the only thing is that to do sorting you have to compile the databases with
the language needed ( regardless of which database you use - see their docs
they all support that).

With PHP there's a little problem using string functions. strlen(), for
instance will return you the number of bytes. In Latin characters ASCII
1-255 a character is a byte, but that doesn't apply to Japanese which use
double bits (some characters are even three bits), so a strlen() will not
return you the number of Hiragana & Kanji in string - it will return you the
number of bits these Kanji were composed from - VERY, VERY UGLY

You need to use PHP3 Japanese interpretation to do that kind of tasks.

In our company we use a different server for Japanese characters running
PHP3 JIS, and the pages are being included form there.

IE: www.fusion-2000.net runs both PHP4 and PHP3 JIS with PostgreSQL at the
back end.

While www.japaninc.com/i goes on PHP4.0.1pl2 and mySQL, (check out that
game)

So, no worries, it is all possible to do, except there's a pain with
choosing PHP version for the server.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Soma Interesting [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 3:23 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP] International support


Hello everyone,

I'm currently working a project that is intended to handle Japanese
character sets - and now I'm told ideally iMode too. :) The iMode isn't
such an issue at the moment - but the article below has spooked me a
little. At an early point in the project we tested if putting some input
into a web form, which ultimately was handled by php then stored in
postgres would return fully intact - and it did. This left me comfortable
that PHP and Postgres don't seem to care what language they're storing in
fields or variables. I'm 'guessing' that this is because the data, whether
its English or Japanese is being stored in binary (or something else?). Of
course I wouldn't be able to sort the data or do anything else that would
require PHP/Postgres to be able to interpret the data. However if I compile
Postgres with locals support for the character set/language in question -
then postgres will be able to sort Japanese. Is this right?

Have I got this all right so far? I have attempted to do my research on
this - but finding a real beginners guide to international web development
has been a trick. And the best sources I have found on this topic generally
are specific to Oracle. Any links would be appreciated.

Ok the next part of this message is an article I thought would be generally
interesting so I'm not hesitating to post it entirely. It was forwarded to
me so I'm not sure of the source.

For the postgres folks, these developers went with MySQL - I've chosen
Postgres. Is there anything MySQL does that Postgres doesn't in terms of
language support that I should be aware of?

>Back to case study
>r-newbold.com
>
>George Baptista is riding the wave of the latest technology with his
>company's newest venture:
><http://www.r-newbold.com>r-newbold.<http://www.r-newbold.com>com, a
>wireless i-Mode site created with PHP.
>
>Based in Tokyo, George is a Web developer and co-partner with Izumi
>Hiroshima at <http://www.omame.com>Studio <http://www.omame.com>Omame. He
>was part of the creative team behind the Japanese-language site, and he is
>finding that i-Mode is not only fashionable, but also the face of the
future.
>
>r-newbold.com was developed for British fashion designer, Paul Smith. NTT
>DoCoMo's i-Mode Web-browsing cellular phones, which already have over 10
>million users, offers a fast wireless data service with Internet access.
>In Japan, it's been a hit with the younger generation. And since
>r-newbold.com's target population is young, hip and fashionable, the
>decision to create an i-Mode site rather than a regular Web site made
>perfect sense.
>
>PHP and i-Mode: The perfect match
>"i-Mode is exploding in Japan," George adds. "It offers new and
>interesting challenges to the developer. The i18n J version of PHP is an
>increasingly popular choice for developers [in Japan] because of its
>overall performance, speed of development, and character set capability
>features."
>
>George and his team at Studio Omame have already been using PHP for about
>a year prior to dev

RE: [PHP] mail prob

2001-02-23 Thread PHPBeginner.com

just get some examples from php.net/mail

and pass the variables to it any way you wish - it all will work


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: W.D. [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 2:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mail prob


I'm using a remote host, and when I call mail() with all the var's pulling
values from form fields, it still shows as nobody in from header. Is this a
server situation? Theyre using php4 support and they claim its that I'm not
using appropriate variables in the function.

 _ Do You Yahoo!?
Get your free @yahoo.com address at http://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]




RE: [PHP] php_self

2001-02-23 Thread PHPBeginner.com

You have compiled it as CGI, didn't ya?

recompile it as apache's module if you can so apache can give PHP_SELF the
right value,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 4:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php_self


Why does php self always show php4/php.exe? how do i take  it off?


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



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




RE: [PHP] PHP / Filemaker?

2001-02-23 Thread PHPBeginner.com

never heard of one...

is there any? I'm curious too...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: knaSen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 7:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP / Filemaker?


Hey

This is my first question and mail to this list...hope u treat me decent =)
My earlier work have been lasso/filemaker (mac)
I´ve been heard that PHP is coming strongly and I have no reason not to
join. How is the relation between PHP/Filemaker?

--*
[knaSen]
icq #23830427



--
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] Parsing a string

2001-02-23 Thread PHPBeginner.com

Oh, yeah... my favorite:

explode()!

$var = '1,2,3,4,5,6,7,8,9,10';
$var_array = explode(',',$var);

/*
   will become:
   $var_array[0] = '1';
   $var_array[1] = '2';
   $var_array[2] = '3';
   $var_array[3] = '4';
   ... and so on
*/

as you notice the array starts from 0



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 11:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Parsing a string


I have a comma delimited string that I need to parse into an array.  Is
there a PHP function that will do that ?

Many thanks..

Todd

--
Todd Cary
Ariste Software
[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] Problem with $REMOTE_ADDR

2001-02-23 Thread PHPBeginner.com

If you are developing on windows (save - refresh ie ... )

then sure, your IP is the IP of the machine ...

if someone connects to you from outside then the remote host won't be
127.0.0.1 .. it will be his own


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 11:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with $REMOTE_ADDR



Hi,
I have problem with using of "$REMOTE_ADDR" variable.
The variable always return me "127.0.0.1" ( localhost ),

How can I get the IP of the remote host ?

Thanks,
Rosen Marinov





--
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] string question

2001-02-23 Thread PHPBeginner.com

check out php.net/number-format


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] string question


I have a string that contains a number such as: $string = '12345'

I want that to read 12,345 though.  Is there any way in which I can insert a
comma in there in the correct places?

-Matt


-- 
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: IE pops-up an Error and File Download Fails. Needs to be fixed NOW. Please advise.

2001-02-23 Thread PHPBeginner.com

Cheers!

I've fixed that by adding some extra characters (new lines actually) in a
loop... it worked...

my conclusion was - MSIE5.01 bug ... didn't read pockets well ...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 7:26 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] URGENT: IE pops-up an Error and File Download Fails.
Needs to be fixed NOW. Please advise.


Read the http://php.net/FAQ about the NULL character problem.

I'm betting you have some funky character that confuses that browser in the
output that the other browsers just ignore.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Boaz Yahav <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Wednesday, February 21, 2001 12:59 AM
Subject: RE: [PHP] URGENT: IE pops-up an Error and File Download Fails.
Needs to be fixed NOW. Please advise.


> What do you see in your web server logs?
> what webserver do you use?
>
> Sincerely
>
>   berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
>
> -Original Message-
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 21, 2001 8:59 AM
> To: 'PHP General List. (E-mail)'
> Subject: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs
to
> be fixed NOW. Please advise.
>
>
> Hello guys,
> This is that time when I am in trouble ...
>
> One of our internal databases receives inputs from all kind of different
> places and stores them for later reviews.
> Since it's creation it was all going perfectly well, but now it has a
little
> problem:
>
> The Internet Explorer gives me this error while listing one of databases'
> tables:
>
> (it is a pop up message of internet explorer)
> 
> Internet Explorer Cannot Open the internet site
> http://that.damn.db/database.php <http://that.damn.db/database.php>
> ?db=opp_post
>
> The download of the specified resource has filed.
> 
>
> What is it, PHP or IE? I suppose something is wrong with IE (5.01 for
> instance), but so far couldn't come with any solution. The output is
simply
> not there, source shows cuted off at the very beginning of file - after
few
> hundreds of bytes.
>
> This suggests me that one of the entries in Database is somehow corrupting
> IE. But I have not found anything strange. What to look for, guys?
>
> I tested it on Opera and Netscape - no probs whatsoever.
> I also tested it on Linux, and Mac (Opera, Netscape) - no probs
whatsoever.
> ...and (listen to this one)...
> I tested it on Mac, MSIE 5.(01)? (just the version I have on my Win2k) --
> and It gave me no errors at all.
>
> Why MSIE 5.01 of Win2k gives that message and breaks download?
>
> I've seen this messages already while browsing the web, and that's the
> reason I'm asking you: anyone had to fix that before? What are your
guesses
> on my problem?
>
> It is quite urgent since the database is not usable and I don't have much
> time for researches on this issue.
> The sad thing is that our office uses the exactly same configured machines
> (MSIE5 - Win2k) and no one can view the database from their PCs. All the
> sales and coordinators are staying here in line near my MAC while I am
> writing you this.
>
> Any help is greatly appreciated!
>
> Cheers,
> Maxim Maletsky
>
> P.S: if any friends of Bill are around the list, please forward him my
happy
> moments and eventual sweet words.
>
> 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]
>


--
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] Using while as for...

2001-02-23 Thread PHPBeginner.com

you can do

while($count<=10)
{
   echo "Number is $count \n";
   $count++;
}



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Felipe Lopes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 24, 2001 2:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Using while as for...


I was trying to code the following script using while instead of for,
but I'm havig a lot of problems...Is it possible to do what I want?  for
($count = 0; $count <= 10; $count++){ echo "Number is $count \n"; }
Could anyone tell me how is it with while instead of for?? Thank you!!
Felipe Lopes
MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
Faça já o seu. É gratuito!!!

--
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] isset()

2001-02-23 Thread PHPBeginner.com

have I said it won't work, Joe?

I said that using strlen() might not be necessary. (re-read my post)
On my own opinion the same things could be done without using the string
functions.
Am I wrong in something there? then thanks for correcting me - will know it
for the feature.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:17 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


You are COMPLETELY wrong here. isset() is designed to check if a variable is
SET - NOT if it has something in it. empty() is designed for strings NOT for
ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
problems
when you do checks and variables aren't set.

I do this, like I said before, because the extra 1 billionth of a second is
worth the overhead. I've programmed for sites ranging from a few hundered
hits
a day to a few million hits a day and this works ALL the time.

--Joe

On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> I don't agree with you in here,
>
> you usually know what kind of variable you're checking, so strlen() will
> work just as well as
>
> $var ? 'OK' : 'Empty'
>
> will work or the isset() - common, it was made for checking the
variables -
> use it.
>
> strlen() is in fact an overhead, why would you allow your design to be
some
> sort of untraditional? I don't think there's any necessity for it
>
> a "good design" often would be something like this:
>
> $var = 'whatever';
>
> if($var)
>   ...do this
> else
>   ERROR('no var') // some your func to output the error mess or to continue
> with debugging
>
> in most cases it will work better and simpler for you without spending
these
> bazillions of important for every developer seconds.
>
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 3:07 AM
> To: Steve Edberg
> Cc: Jacky@lilst; [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> I stand firm on strlen() for the following reasons ...
>
> if(!$var) will sometimes act strangely (has for me in the past) when
> variables
> are set to something other than what you are expecting.
>
> if(isset($var)) will return true if your text field is declared but not
> filled
> in.
>
> if(empty($var)) will return true if $var is set to 0 (for obvious reason)
so
> is
> only good for certain instances.
>
> strlen() on the other hand converts the variable to a string and returns a
> count
> of characters. It's never failed or acted funky. For this reason I use it
> religiously.
>
> Others might say "well it's extra overhead" to which I reply "I'll take an
> extra
> bazillionth of a second to know for sure I have what I need"
>
> --Joe
>
> On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote:
> > I would do this:
> >
> > if (!$AgeChild) $AgeChild = 'NA';
> >
> > More compact, easier to read (to me, anyway). This presumes that a
> > value of '' (empty string, interpreted by PHP as false) is NOT a
> > valid value here.
> >
> > As far as your sniplet goes, it is possible that there may be some
> > PHP type-casting issues here, depending on: whether $AgeChild is
> > numeric or string; the fact that the STRING "false" isn't equivalent
> > to the CONSTANT false, the use of == vs. ===.
> >
> > Time to check out the docs - specifically the types and variables
> > sections (also the functions->variables section)...
> >
> > - steve
> >
> >
> >
> > At 5:07 PM -0600 2/22/01, Jacky@lilst wrote:
> > >People
> > >I tried to check if teh field has set a vaule in it before submit
> > >using isset with the sniplet below
> > >
> > >if ((isset($AgeChild))=="false") {
> > >$AgeChild = "NA";
> > >}
> > >
> > >The resule is that it always displays NA whether or not it has vaule
> > >in the field, what is the correct way of using isset for this
> > >purpose? Or should I use empty() ?
> > >Jack
> > >[EMAIL PROTECTED]
> > >"There is nothing more rewarding than reaching th

RE: [PHP] isset()

2001-02-23 Thread PHPBeginner.com

Whatever they input is not the objects, right?

then (I've just double-checked it, to be sure I am not saying some 'BULL')


$var = 0;

if($var)
echo 'var matched';

if(isset($var))
echo 'var is set';


when the $var is 0 the second condition will return true, the first will be
false instead...
Obviously if they enter anything else then 0 and NULL (I mean nothing) it
will return true in both cases, if($var.., if(isset($var... if(strle($var
...

What's wrong with isset() in here?
I am on PHP4.0.4!

explain me again, why on user input strlen() would do better then isset() ?


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:25 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need to
remember that mostly idiots are inputting the data :O)

--Joe

On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> have I said it won't work, Joe?
>
> I said that using strlen() might not be necessary. (re-read my post)
> On my own opinion the same things could be done without using the string
> functions.
> Am I wrong in something there? then thanks for correcting me - will know
it
> for the feature.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:17 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> You are COMPLETELY wrong here. isset() is designed to check if a variable
is
> SET - NOT if it has something in it. empty() is designed for strings NOT
for
> ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> problems
> when you do checks and variables aren't set.
>
> I do this, like I said before, because the extra 1 billionth of a second
is
> worth the overhead. I've programmed for sites ranging from a few hundered
> hits
> a day to a few million hits a day and this works ALL the time.
>
> --Joe
>
> On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > I don't agree with you in here,
> >
> > you usually know what kind of variable you're checking, so strlen() will
> > work just as well as
> >
> > $var ? 'OK' : 'Empty'
> >
> > will work or the isset() - common, it was made for checking the
> variables -
> > use it.
> >
> > strlen() is in fact an overhead, why would you allow your design to be
> some
> > sort of untraditional? I don't think there's any necessity for it
> >
> > a "good design" often would be something like this:
> >
> > $var = 'whatever';
> >
> > if($var)
> > ...do this
> > else
> > ERROR('no var') // some your func to output the error mess or to
continue
> > with debugging
> >
> > in most cases it will work better and simpler for you without spending
> these
> > bazillions of important for every developer seconds.
> >
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 23, 2001 3:07 AM
> > To: Steve Edberg
> > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > I stand firm on strlen() for the following reasons ...
> >
> > if(!$var) will sometimes act strangely (has for me in the past) when
> > variables
> > are set to something other than what you are expecting.
> >
> > if(isset($var)) will return true if your text field is declared but not
> > filled
> > in.
> >
> > if(empty($var)) will return true if $var is set to 0 (for obvious
reason)
> so
> > is
> > only good for certain instances.
> >
> > strlen() on the other hand converts the variable to a string and returns
a
> > count
> > of characters. It's never failed or acted funky. For this reason I use
it
> > religiously.
> &

RE: [PHP] Counter Help

2001-02-23 Thread PHPBeginner.com

Thanks, I still remember your reply on my test post
be in touch!


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:26 PM
To: 'PHPBeginner.com'; 'PHP (E-mail)'
Subject: RE: [PHP] Counter Help


Sounds good to me, I should, and will, always keep that in mind. Thanks for
the tips. Also I want to say PHPBeginner.com is starting off very well, keep
up the good work. I've been watching over it to see when the grand opening
would be, and it's finally here. I hope it becomes a success someday. If I
was good at PHP, I would contribute some articles, but I'm just a newbie for
now. But maybe someday. Take it easy  :)

Sincerely,
Navid Yar

-Original Message-
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 12:16 AM
To: [EMAIL PROTECTED]; PHP (E-mail)
Subject: RE: [PHP] Counter Help


Yup, you need to have your key strings in quotes '',
so it doesn't think it's a constant.

ALWAYS use $array['key']
and not
$array[key]

except for the integrers



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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


-Original Message-
From: Navid Yar [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 9:11 AM
To: PHP (E-mail)
Subject: [PHP] Counter Help


Can someone help me with this script? It is an example from weberdev.com. I
ran it and it gave me the following error...

-- Warning: Use of undefined constant count - assumed 'count' in
c:\windows\desktop\localhost\examples\counter\counter1.php on line 27
25

The number 25 is the correct number for the counter, but how do I get rid of
that error message that keeps coming up before the counter number (25)? I am
testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL
3.23.33. Here is the script:















-- Navid


--
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] isset()

2001-02-23 Thread PHPBeginner.com

the SOLUTION:

strlen() is the length of string, right? Then instead of doing

   1. comparison
   2. function execution

(I am talking here about your 1/bazillions of a second)

a perfect solution would be :

if($var!='')

and, this is only

   1. comparison

am I right?



Now, no matter how much you care of thinking that the variable you need to
match positive is a string longer then 0 characters

if($var!='')

will always do the same of strlen() but with less overhead and will add that
1/bazillion of a second to execution of your application...



I am so 'HOT' on this issue because it looks to me more silly then needed an
extra string function during execution of a conditional.

nice day, Joe!


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 4:25 PM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


You're wrong in saying that you "usually know what the variable will be" -
you
never know what it's going to be. You aren't entering it you need to
remember that mostly idiots are inputting the data :O)

--Joe

On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> have I said it won't work, Joe?
>
> I said that using strlen() might not be necessary. (re-read my post)
> On my own opinion the same things could be done without using the string
> functions.
> Am I wrong in something there? then thanks for correcting me - will know
it
> for the feature.
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:17 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> You are COMPLETELY wrong here. isset() is designed to check if a variable
is
> SET - NOT if it has something in it. empty() is designed for strings NOT
for
> ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> problems
> when you do checks and variables aren't set.
>
> I do this, like I said before, because the extra 1 billionth of a second
is
> worth the overhead. I've programmed for sites ranging from a few hundered
> hits
> a day to a few million hits a day and this works ALL the time.
>
> --Joe
>
> On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > I don't agree with you in here,
> >
> > you usually know what kind of variable you're checking, so strlen() will
> > work just as well as
> >
> > $var ? 'OK' : 'Empty'
> >
> > will work or the isset() - common, it was made for checking the
> variables -
> > use it.
> >
> > strlen() is in fact an overhead, why would you allow your design to be
> some
> > sort of untraditional? I don't think there's any necessity for it
> >
> > a "good design" often would be something like this:
> >
> > $var = 'whatever';
> >
> > if($var)
> > ...do this
> > else
> > ERROR('no var') // some your func to output the error mess or to
continue
> > with debugging
> >
> > in most cases it will work better and simpler for you without spending
> these
> > bazillions of important for every developer seconds.
> >
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 23, 2001 3:07 AM
> > To: Steve Edberg
> > Cc: Jacky@lilst; [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > I stand firm on strlen() for the following reasons ...
> >
> > if(!$var) will sometimes act strangely (has for me in the past) when
> > variables
> > are set to something other than what you are expecting.
> >
> > if(isset($var)) will return true if your text field is declared but not
> > filled
> > in.
> >
> > if(empty($var)) will return true if $var is set to 0 (for obvious
reason)
> so
> > is
> > only good for certain instances.
> >
> > strlen() on the other hand converts the variable to a string and returns
a
> > count
> > of char

RE: [PHP] Change dir mode to writable for uploading..

2001-02-24 Thread PHPBeginner.com

use chmod 775 dir (or 777 - but not recommended)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Dhaval Desai [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 24, 2001 5:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Change dir mode to writable for uploading..


Hi!

I have problem uploading the file to a  directory...
It says permission denied. THe problem is taht ther
directory is on the web.
I connect using WS_ftp.
THe directory is set to:

drwxr-xr-x

How do I make it writable..?


I am using form to upload the files there..


Is there any way I can make the directory writable..?

Thank You!

Dhaval Desai

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
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]




RE: [PHP] isset()

2001-02-24 Thread PHPBeginner.com

in my preceding email I've written:

if($var!='')

will fix your all your worries without an intervention of a strings
function.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:09 AM
To: PHPBeginner.com
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


For the last time - put an input box on a page and submit with NOTHING in
the
box. Now I want SOMETHING in that box (like a name) - isset() will return
true
even though it's empty.

--Joe

On Sat, Feb 24, 2001 at 04:32:11PM +0900, PHPBeginner.com wrote:
> Whatever they input is not the objects, right?
>
> then (I've just double-checked it, to be sure I am not saying some 'BULL')
>
>
> $var = 0;
>
> if($var)
>   echo 'var matched';
>
> if(isset($var))
>   echo 'var is set';
>
>
> when the $var is 0 the second condition will return true, the first will
be
> false instead...
> Obviously if they enter anything else then 0 and NULL (I mean nothing) it
> will return true in both cases, if($var.., if(isset($var... if(strle($var
> ...
>
> What's wrong with isset() in here?
> I am on PHP4.0.4!
>
> explain me again, why on user input strlen() would do better then isset()
?
>
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
>
>
>
>
> -Original Message-
> From: Joe Stump [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 24, 2001 4:25 PM
> To: PHPBeginner.com
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] isset()
>
>
> You're wrong in saying that you "usually know what the variable will be" -
> you
> never know what it's going to be. You aren't entering it you need to
> remember that mostly idiots are inputting the data :O)
>
> --Joe
>
> On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote:
> > have I said it won't work, Joe?
> >
> > I said that using strlen() might not be necessary. (re-read my post)
> > On my own opinion the same things could be done without using the string
> > functions.
> > Am I wrong in something there? then thanks for correcting me - will know
> it
> > for the feature.
> >
> >
> > Sincerely,
> >
> >  Maxim Maletsky
> >  Founder, Chief Developer
> >
> >  PHPBeginner.com (Where PHP Begins)
> >  [EMAIL PROTECTED]
> >  www.phpbeginner.com
> >
> >
> >
> >
> > -Original Message-
> > From: Joe Stump [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, February 24, 2001 4:17 PM
> > To: PHPBeginner.com
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] isset()
> >
> >
> > You are COMPLETELY wrong here. isset() is designed to check if a
variable
> is
> > SET - NOT if it has something in it. empty() is designed for strings NOT
> for
> > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have
> > problems
> > when you do checks and variables aren't set.
> >
> > I do this, like I said before, because the extra 1 billionth of a second
> is
> > worth the overhead. I've programmed for sites ranging from a few
hundered
> > hits
> > a day to a few million hits a day and this works ALL the time.
> >
> > --Joe
> >
> > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote:
> > > I don't agree with you in here,
> > >
> > > you usually know what kind of variable you're checking, so strlen()
will
> > > work just as well as
> > >
> > > $var ? 'OK' : 'Empty'
> > >
> > > will work or the isset() - common, it was made for checking the
> > variables -
> > > use it.
> > >
> > > strlen() is in fact an overhead, why would you allow your design to be
> > some
> > > sort of untraditional? I don't think there's any necessity for it
> > >
> > > a "good design" often would be something like this:
> > >
> > > $var = 'whatever';
> > >
> > > if($var)
> > >   ...do this
> > > else
> > >   ERROR('no var') // some your func to output the error mess or to
> continue
> > > with debugging
> > >
> > > in most cases it will work better and simpler for you without spending
> > these
> > > bazillions of impo

RE: [PHP] session_register in function

2001-02-25 Thread PHPBeginner.com

you have to have the variable you register (in both ways) global.

so no matter how you call the function the variable must be defined global.

mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:16 AM
To: PHP List
Subject: [PHP] session_register in function


The variable I register before the function becomes available in the session
to other pages...the variable I register inside the function are not
accessible in the session to ohter pages.  Is this normal?  How can I work
around this?  Thanks!  PHP4.0.4pl1 on Linux.

sample code:




--
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] DIsplaying page before script finnished

2001-02-25 Thread PHPBeginner.com

use flush()

it will push the output out of apache.
But note, if you have a table, on Netscape not much will be shown (even if
it receives the data) until the  arrives.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: David Tandberg-Johansen [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] DIsplaying page before script finnished


Hello!

I wonder if there are any way to display the page before the script is
finished?

I have a loop in my script,and I want to display the resoult for each loop.

Thanks

David :-)



--
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] Cookie References?

2001-02-25 Thread PHPBeginner.com

Yes it can :

here's what I once was doing to assign a user with a cookie containing a
Session ID:


$uniqid = md5 (uniqid (rand()));

if(!isset($sid)) {
$time = time();
setcookie ("sid", $uniqid, $time*3);
}

time()+time() makes it really, really LONG ...  (62 years?), of course it
has not expired from anyone yet :-))



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 7:42 AM
To: PHP
Subject: [PHP] Cookie References?


Could you give me some URLs for tutorials related
to cookies and good reference material?

One question I have is can a cookie never expire?
Jeff Oien

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



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




RE: [PHP] php_self

2001-02-25 Thread PHPBeginner.com

Here's what to do:

in Apache:
Add (this is all one line)
LoadModule php4_module C:/Webserver/php/sapi/php4apache.dll

then (five lines)
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
to your httpd.conf.

Remove(comment) Action application ... line



Copy php.ini to C:\Winnt\System32.

Copy msvcrt.dll (from C:\Webserver\PHP\dlls\msvcrt.dll) to C:\Winnt\system32
 - you're almost guranteed to have it, as I did, but just check.

Copy phpts.dll to C:\Winnt\system32.

Startup the Apache service.

At this point, if it worked, you are runniong as a module.

Hopefully this will work :-)


And if it doesn't download a new version of PHP and reinstall it as INSTALL
file says.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 9:27 AM
To: PHPBeginner.com
Subject: Re: [PHP] php_self


well i have windows so how do i recompile it?

"PHPBeginner.com" wrote:

> You have compiled it as CGI, didn't ya?
>
> recompile it as apache's module if you can so apache can give PHP_SELF the
> right value,
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
> -Original Message-
> From: Brandon Feldhahn [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 23, 2001 4:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] php_self
>
> Why does php self always show php4/php.exe? how do i take  it off?
>
> --
> 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] comparing numbers

2001-02-25 Thread PHPBeginner.com

$id = ($id<=59) ? $id=81 : false;

or the traditional way:

if($id<=59) {
   $id=81;
}


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] comparing numbers



How can I do something like the following shell script, in PHP? (I know this
won't work normally, but you get the idea).

if [ $id <= 59 ]; then
$id=81

TIA!
Clayton Dukes



-- 
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] Temporarily turning off magic quotes?

2001-02-25 Thread PHPBeginner.com

you can use:

if($REQUEST_METHOD=='GET' or $REQUEST_METHOD=='POST')
ini_set ('magic_quotes_gpc',  'off'); 




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Ben Cheng [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 1:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Temporarily turning off magic quotes?


If I have magic quotes turned on for post/get/etc. in my php.ini, is 
there any way to temporarily turn it off for one page?  For example, 
I have a preview page inbetween my data entry page and the page that 
actually saves to db.  I don't want magic quotes turned on when going 
from the data entry to the preview page since all quotes keep getting 
backslashed.  Is there a way to do this?

-Ben

-- 
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] Unwanted Characters

2001-02-25 Thread PHPBeginner.com

use eregi_replace("[asutk]+", '', $string)

in this way there will be no such letters as a,s,u,t,k in $string




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 2:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Unwanted Characters



How do I remove unwanted/unprintable characters from a variable?

$sometext = "ThÀe cØar röøan over mÖy dog"
needs to be filtered and reprinted as:
"The car ran over my dog"




Thanks :-)
Clayton Dukes



-- 
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] isset()

2001-02-25 Thread PHPBeginner.com

100% agreed!

this makes much more sense then any of us was saying before.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Mark Maggelet [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 25, 2001 5:01 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] isset()


On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger 
([EMAIL PROTECTED]) wrote:
>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote:
>> in my preceding email I've written:
>>
>> if($var!='')
>>
>> will fix your all your worries without an intervention of a 
strings
>> function.
>
>Except that it will throw a warning in PHP4 if $var is not set.
>=> isset () should be used.

man, this is like the thread that will not die. isset() will return 
true for an empty string, which is not what he wants. the right thing 
to do is use

if((isset($var))&&($var!=""))

the isset on the left gets evaluated first so a warning is never 
thrown. to be even safer, you can go:

if((isset($var))&&(trim($var)!=""))

you do not want to use strlen() for the following reasons:
1) makes code unreadable -> very sloppy
2) overhead
3) it will give a warning when $var is not set (error_reporting 15 
only).



-- 
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@lists.php.net

2001-02-26 Thread PHPBeginner.com

Have you tried www.isamillionaire.com ?

they have php4 / mySQL support, they are free and have no banner ads.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Bruno Mário Amaral Almeida [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 9:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] FreeHostage:PHP&MySQL


Hi everyone,
Can anyone tell me where can i find a place where to put my PHP/MySQL
applications for free?
Many thanks
Bye
Bruno


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




RE: [PHP] PHP4 directives in httpd.conf not working

2001-02-26 Thread PHPBeginner.com

try these:

php_value include_path   "/my/phpinc/path"

but why instead not to create a .htaccess file, or if you don't want it to
be modified by user to make a one single auto_prepend with:

$file = "$DOCUMENT_ROOT/my/phpinc/path";
if(file_exists($file))
   include_once($file);

this wouyld work for you better since there would be no chances that the
file does not exist (or was deleted by user) and that it won't be included
more then once


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Brian White [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 2:01 PM
To: PHP
Subject: [PHP] PHP4 directives in httpd.conf not working


I have php4 running under Apache. Under that apache I have several
s. I want to set to some of the PHP.INI values under
one of those hosts. So far I have tried the following values in
my httpd.conf file:

1) include_path   "/my/phpinc/path"
2) php_include_path   "/my/phpinc/path"
3) php3_include_path  "/my/phpinc/path"
4) php4_include_path  "/my/phpinc/path"

None of them have worked - I can't even restart Apache with them in place.
"/my/phpinc/path" definitely exists.

What am I doing wrong?

Regs

Brian White
-
Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
Phone: +612-93197901
Web:   http://www.steptwo.com.au/
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]



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




RE: [PHP] mysql_info()

2001-02-26 Thread PHPBeginner.com

Yes you are wrong,

what you can do is to search for the SQL queries in tutorials which will
return you that information.
also phpinfo() has some very little and necessary coverage of basic
php-mysql configurations,

if you download phpmyadmin you will have this option there (even with edit).


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: grios [mailto:grios]On Behalf Of Gustavo Vieira Goncalves Coelho
Rios
Sent: Monday, February 26, 2001 9:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql_info()


Am i wrong or php does not support mysql_info() function ?

Is there plans to support it?

thanks in advance!

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



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




RE: [PHP] Printing long strings

2001-02-26 Thread PHPBeginner.com

Yes, you could use stripslashes($string) on it's output, in this way it will
be no different as it was inputted.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






 -Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 9:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Printing long strings


  How can I get php to print a long string and ignore any of the characters
in the string?

  ie:
  $string = "so


RE: [PHP] Using one invocation of PHP executable to generate multiple pages?

2001-02-26 Thread PHPBeginner.com

Could you please be more specific on your need?


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jim Lum [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 9:21 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Using one invocation of PHP executable to generate
multiple pages?


Hi,

I have PHP installed on a Win95 machine.  What I'd like to do is to use
a PHP page that will create multiple HTML pages.

I guess that I can execute PHP.EXE multiple times, but was thinking that
this means that it's going thru the overhead of starting up PHP.EXE each
time.  Is there any way to tell PHP.EXE to build multiple HTML pages,
i.e., kind of like a loop?

Jim

-- 
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] Simple String Replace Question

2001-02-26 Thread PHPBeginner.com

Would 

$string_new = ereg_replace("\n[ \t\r\n]*\n", "\n", $string);

work for you?


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 3:37 AM
To: PHP
Subject: [PHP] Simple String Replace Question


I would like to get rid of \n characters unless there
are two or more in a row. So for example if there
is a long email formatted like we do here with
line break I want to remove the line breaks so 
text can be wrapped by a browser, but also show
paragraph breaks where necessary. This is what
I have:
$string_new = str_replace("\n", "", $string);
How can I augment this to not replace:
\n
\n
Thanks.
Jeff Oien

-- 
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@lists.php.net

2001-02-26 Thread PHPBeginner.com

Use SourceForge.com, in case you still are building your OpenSource
application,

you can then host it and use it there.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Michael A.
Peters
Sent: Monday, February 26, 2001 9:56 PM
To: Bruno Mário Amaral Almeida
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] FreeHostage:PHP&MySQL


Are you looking for a place to host your site- or a place for people to
download apps you've written?

Bruno Mário Amaral Almeida wrote:
>
> Hi everyone,
> Can anyone tell me where can i find a place where to put my PHP/MySQL
applications for free?
> Many thanks
> Bye
> Bruno

--
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer

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

2001-03-12 Thread PHPBeginner.com

If I am not wrong, there are over 5.000 subscribers to this list, while it
only sends 200-300 emails a day. (I took this data from my own 80.000-emails
mailbox, so don't judge my previsions)

The "big boys", or better say these who do not write because of being busy
but always read because there's always something to learn, ARE HERE.

If you look at archives you'll find a lot of advanced help messages, as well
as generic ones.

I think - there's nothing bigger then [EMAIL PROTECTED],
that's where I, and most of my team learn and update ourselves.

we're always following this community from above.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Brinkman, Theodore [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 11:16 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Advanced PHP


Actually, the egg did.  Eggs existed LONG before land animals, much less
chickens.  Besides, the first chicken hatched from an egg laid by an
almost-chicken.

- Theo

-Original Message-
From: Jerry Lake [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 6:38 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Advanced PHP


The chicken did.

as the Chicken is an actual chicken
and the egg is a potential chicken.
Actuality precedes potentiality

Jerry Lake- [EMAIL PROTECTED]
Web Designer
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com


-Original Message-
From: Keith Vance [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 3:14 PM
To: Kath
Cc: Krznaric Michael; 'Rick St Jean'; [EMAIL PROTECTED]
Subject: Re: [PHP] Advanced PHP


What came first the chicken or the egg?

Keith

On Fri, 9 Mar 2001, Kath wrote:

> Yeah.  I even see some PHP book authors, like Julie Meloni here on this
> list.
>
> There is never a question, no matter how retarded, that this list or #php
on
> irc.openprojects.net has never been able to answer.
>
> - Kath
>
>
> - Original Message -
> From: "Krznaric Michael" <[EMAIL PROTECTED]>
> To: "'Rick St Jean'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
> Sent: Friday, March 09, 2001 5:11 PM
> Subject: RE: [PHP] Advanced PHP
>
>
> > If I'm not mistaken, the big boys keep an eye out over here.
> >
> > Mike
> >
> >
> > -Original Message-
> > From: Rick St Jean [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, March 09, 2001 4:54 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Advanced PHP
> >
> >
> > Does anyone know of any other lists that are a little more advanced,
> > And has a little less traffic?  I am not the end all be all by any means
> of
> > programming or PHP.  I just want to know where the big boys hang out
> > and learn some secrets that require some understanding.
> >
> > Rick
> > ##
> > #  Rick St Jean,
> > #  [EMAIL PROTECTED]
> > #  President of Design Shark,
> > #  http://www.designshark.com/
> > #  Quick Contact:  http://www.designshark.com/messaging.ihtml
> > #  Tel: 905-684-2952
> > ##
> >
> >
> > --
> > 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] Re: Good Free PHP Editor?

2001-03-12 Thread PHPBeginner.com

Have you tried EditPlus? www.editplus.com

they are especially good for search, replace function and highlighting is
also very easy to use, you can even define your own functions to highlight.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: The Arting Starvist [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 1:04 AM
To: Andrew Halliday; [EMAIL PROTECTED]
Subject: [PHP] Re: Good Free PHP Editor?


I recently downloaded a newer EditPad Lite version that offers highlighting
and other nice improvements over the "classic" EditPad.

m

-Original Message-
From: Andrew Halliday <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, March 12, 2001 12:04 AM
Subject: Good Free PHP Editor?


>Does anyone know of a good PHP enabled editor that fits the following
>criteria:?
>
>(in order of importance)
>- Is free
>- Runs under Windows
>- Has colors (syntax highlighting)
>- Can edit multiple files (ie multi threaded)
>- Reports line numbers
>- Has good search & replace functionality
>
>???
>
>Ive been using editpad up till now but my code is starting to get so large
>that ill need syntax highlighting soon...
>
>AndrewH
>
>


--
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] Quotes in inputfields & Reload

2001-03-12 Thread PHPBeginner.com

hi Jens,

PHP automatically escape the dangerous characters from the user input on
form submissions.

there are several ways to escape that back :

stripslashes()
urlencode()
htmlentities()

read about these, they will soon become your solutions.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jens Nedal [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 7:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Quotes in inputfields & Reload


Hy everybody,

Well here is the deal (Probably an easy one 8))
I have several inputfields and check if the are valid or have content.
If an error occurs and the page reloads i simply echo the content of the
fields back into the input fields, viola, wonderful.

BUT if there are " eg. Quotes in those fields they suddenly read \" instead
of " as they should 8(

I guess that the parser is doing something to it there since " is a
sensitive char in php. BUT how can i get the content to be reloaded
correctly into the fields again.

Here an example of how those fields look like



tried it like this too, no difference:
" size=40>


thx in advance, Jens Nedal


--
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] header

2001-03-12 Thread PHPBeginner.com

Nick,
headers work on Windows just as they do on Linux.

Can you give us a piece of code so we can give you a hand with your problem?


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Nick Kostirya [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 4:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] header


Hello!
Why header under Windows do not work?
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]




RE: [PHP] Variable dynamique

2001-03-12 Thread PHPBeginner.com

do this:

${$var.$num}


But, as I can only guess you are not very familiar with arrays, they usually
better for most of your needs.

I think this is what you have to learn instead.
www.php.net/arrays


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Pierre-Yves Lemaire [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 12:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable dynamique


I receive 2 variables, $var and $num
I need to make a variable out of these two like this

$var2 where $num = 2 or
$var3 where $num = 3

How can I do that ?

__
Pierre-Yves Lemaire
514.729.8100


-- 
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] Detect if user has changed form data

2001-03-13 Thread PHPBeginner.com

no,

the JavaScript is the only way to do that.

When you close your browser JavaScript is what can do a check, PHP does
nothing - it's not in your browser - it's on the server.

Plus, with JavaScript this kind of things are much cooler.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Ide, Jim [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 10:15 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Detect if user has changed form data




Is there an easy way to detect if a user has changed
the values in the fields of an HTML form?  I want to
be able to check this during the onUnload event and
warn the user that he/she has not clicked the "Save"
button to save changes to the form fields.

The only way I can see to do this is to use JavaScript
to loop thru the variables and compare the current
(possibly changed) value to the value in the defaultValue
property.  I'm hoping that there is a "UserHasChangedFormVariables"
property (or something similar) that I don't know about that someone
will tell me about :)

A pointer to existing code that does this would be appreciated.

Many thanks -
Jim


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



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




RE: [PHP] Variable variables

2001-03-13 Thread PHPBeginner.com

Hey, there are also arrays,

these can do much more and can be used most of the times you think of
var-var solution...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: John Meyer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 10:47 PM
To: Jason Stechschulte
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Variable variables


Okay, that makes a little sense, but isn't there some sort of collection
that will do the same thing (coming from vb).

-Original Message-
From: Jason Stechschulte [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 6:38 AM
To: John Meyer
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Variable variables


On Tue, Mar 13, 2001 at 06:36:10AM -0700, John Meyer wrote:
> Okay, I read about this feature in the php manual.  What I can't figure
out
> is why in the world would anybody want to use this feature?  Not to start
a
> flame war, just would like an explanation of why this feature is useful.

I've really only used them once, but they were handy for that situation.
I had a column in a mysql table that was a set column of user
privileges, and I wanted to register every value in the set as a session
variable.


for($i = 0; $i < sizeof($privs); $i++) {
   $$privs[$i] = 1;
   session_register($privs[$i]);
}



--
Jason Stechschulte
[EMAIL PROTECTED]
--
I surely do hope that's a syntax error.
 -- Larry Wall in <[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] PERL vs. PHP

2001-04-21 Thread PHPBeginner.com

Funny!

You, Rasmus, must be getting it every week at least.

btw Jason, we had some very interesting discussions on how Rasmus has
started PHP, look the archives - you would find it very curious.


Maxim Maletsky




-Original Message-
From: Jason Caldwell [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 21, 2001 3:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PERL vs. PHP


Ramus Lerdof,

Are you the Ramus that created PHP?

If so, just want to say -- THANKS! -- PHP is the coolest thing since Delphi
!!!

Really Love it!

Jason



"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > PHP was started as a suite of perl programs... it is heavily
> > influenced by perl.  if you understand PHP and are comfortable
> > with it, you should not have any problems learning Perl.
>
> Not quite.  I prototyped the initial parser with a Perl program (pre
> version 1), but the "suite" as you call it was all written in C.
>
> -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]



-- 
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] Searching arrayed file... Suggestions?

2001-04-21 Thread PHPBeginner.com

Have you evrer heard of in_array() ?

could help though...

:-)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: Richard [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 21, 2001 9:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Searching arrayed file... Suggestions?


Greetings.

I have made a try to write a search engine for a site I run. This search
iterates through all links which are made up like so:
"|BY|EMAIL|CATEGORY|FOLDER/BAND|LINKNAME|LINKURL|". Now, I use the code:

 if ($txtLinkname=="") return;

$logfile="entries.txt";
$file_line = file($logfile);
$total_lines = count($file_line);

// Start printing the header of the table. The rest is completed, nested
// course.. in the incrementation-loop.

echo"";
echo"";

for($i=($total_lines-1); 0 <= $i; $i--) { $line[] = $file_line[$i]; }

echo "Searching for links containing $txtLinkname...";
echo "";
echo "";
for ($i=0; $i < $total_lines; $i++){
$line_array = explode("|",$line[$i]);

$swhere=strtolower($line_array[5]);
$swhat=strtolower($txtLinkname);

$pos = strpos ($swhere, $swhat);
if ($pos<0) {
// not found

}else if (($pos>1) && (!empty($pos))) {
$found++;

echo"Name: $line_array[1]\n";
echo"Email: mailto:$line_array[2]\">$line_array[2]\n";
echo"Category: $line_array[3]\n";
echo"Band/Folder: $line_array[4]\n";
echo"Link Name: $line_array[5]\n";
echo"Link URL: $line_array[6]\n";
echo "";
}


 }
echo "";
if ($found==0) {
echo "No links found containing '$txtLinkname'!";
}else{
echo "Found: $found links containing $txtLinkname";
}

echo "";
echo "[ POST LINK | VIEW LINKS ]";
$found=0;
 echo "";
  ?>




And that is all the code I use. Where have I done wrong? You see, the
problem is that I found only some links, but not all. And if I have a link
called "Necrolust - Tribute to MayheM", it cannot find the "Necro" nor
"necRO". And as you can see, I HAVE used uppercase methods to find portions
and so forth. Any help is suggested!!

- Richard



--
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] include file using .htaccess

2001-04-21 Thread PHPBeginner.com

the syntax for it is:

php_value auto_prepend_file /full/path/to/the/prepend.inc
php_value auto_append_file /full/path/to/the/append.inc

or you could also do this:

php_value include_path /full/path/to/the/includes
php_value auto_prepend_file prepend.inc
php_value auto_append_file append.inc

this would allow you to include anything else you wish inside prepend.inc as
well as having some more files included from pages without any full pathes
unless they are not found in 'includes'



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Keyur Kalaria [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 12:51 AM
To: php
Subject: [PHP] include file using .htaccess


Hello,

How can I include any html or php file via .htaccess ?

I want to include an html file in a site contaning around 1000 pages. I want
to add  header & footer dynamically on these pages .
Is there any way to include header & footer on these pages using .htaccess
file.


thanks in advance

keyur
$$$




--
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] Buttons and such...

2001-04-21 Thread PHPBeginner.com

See, that's for the website. You often don't want to look same as others, do
you? Then you should be making the buttons yourself, perhaps on a sexy Mac
OS X with some PhotoShop or Fireworks.

OK, nor even I make myself the buttons when I design a software interface
for internal use. I go to sourseforge.net, look thought the software demos
and use cut&paste technology.

Applications, generally, have some very interesting and usable graphics, my
advise to you is : search there.



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jason Caldwell [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 3:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Buttons and such...


I know this is off-topic -- please forgive me.  But I figure someone here
would know.

I'm looking for some really nice *professional* looking (submit, logon, buy,
help, etc) buttons for my website... I've done all kinds of searches on
MSN and Yahoo -- found a ton of sites that offer all kinds of .gifs and
.jpegs -- but I must say 99% of them are garbage.

Any suggestions would be greatly appreciated.

Thanks.
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]




RE: [PHP] Buttons and such...

2001-04-21 Thread PHPBeginner.com

that is why I go to sourceforge to do that,

We have a whole team of designers, they can make the graphics for publick
view. What I was talking about is for internal admin areas like things, you
don't want to spend you time on making the well designed things for
yourself... would ya?


m

-Original Message-
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 4:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Buttons and such...


In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("PHPBeginner.com") wrote:

> See, that's for the website. You often don't want to look same as others,
do
> you? Then you should be making the buttons yourself, perhaps on a sexy Mac
> OS X with some PhotoShop or Fireworks.
>
> OK, nor even I make myself the buttons when I design a software interface
> for internal use. I go to sourseforge.net, look thought the software demos
> and use cut&paste technology.
>
> Applications, generally, have some very interesting and usable graphics,
my
> advise to you is : search there.

There's some very cool, cutting edge design to be seen on some of those
sites.  However, it should be noted that since graphics are
copywrite-protected materials, unless a site is explicitely offering up its
graphics for free public use, you should also be getting permission before
using the "borrowed" graphics within your own works.  (OTOH, downloading
others' graphics in order to study them, master the techniques used to
create them, etc. is a common and very helpful practice that AFAIK does not
require permission.  So take advantage!)

--
CC

--
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] passing variables

2001-04-22 Thread PHPBeginner.com

using POST, Cookies or sessions.

session is the most appropriate way to do that.

php.net/sessions


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Adam [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 8:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] passing variables


how could i pass a variable between pages without them seeing the variable
stated in the URL?



-- 
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] Incrementing dates

2001-04-22 Thread PHPBeginner.com

You can (mySQL, right?) do the following:

UPDATE table SET date=(date+INTERVAL 10 DAYS);

so if date there was 04-28, it will be added 10 more days and so will become
05-08

Use SQL for this things, it treats dates as 'dates' while PHP treats them as
integers and strings.




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 7:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Incrementing dates


How do I increment dates past the turn of the month (or year)?
Say I've got a booking of equipment A for the 28 April to 5 May and want to
add each instance to a calendar (mysql table).
Can I increment the variable (format 2001-04-28) holding the date
($txtDate++) somehow so that it doesn't add the 31, 32 and 33 of April?

Martin S.

--
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] Incrementing dates

2001-04-22 Thread PHPBeginner.com

I am not sure on how your possibilities are,
but doing this in PHP means literally "adding useless lines and loops"

If possible, do it with SQL queries. Read the documentations on date
datatypes, this is so much easier... almost magic.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 4:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Incrementing dates


James, Yz wrote:

>If anyone has any comments on this, I'd like to
> hear
> them (there's probably a simpler way around what I have done).  Here's the
> URL:
>
> http://www.yorkshire-zone.co.uk/date_increment.php
>
> And here's the code that powers it:
>
> 
> 
>
> 
> $date = date("2001-04-28");
> list($year, $month, $day) = explode("-", $date);
>
> $actual_date = mktime(0,0,0,$month,$day,$year);
>
> $days_to_add = 7;
>
> $x = 1;
>
> while($x <= $days_to_add) {
>
>  $make_date = getdate($actual_date);
>
>  echo "Day $x: $make_date[mday] $make_date[month],
> $make_date[year]";
>
>  $actual_date = $actual_date + (3600 * 24);
>
>  $x++;
>
> }
>
> ?>
>
> 
> 

Thanks James!

You started me off in the right direction. And ... with a few beers less in
the brain (and a look at php.net and PHP Developers Cookbook) I finally
found that mktime actually increments dates correctly.
So, given that $month, $day and $year are valid and that we want to add 10
days to the output we can do:

echo date ("Y-m-d", mktime (0,0,0,$month, $day, $year)) . "";
for($i=1; $i<=9; $i++) {
  $day++;
  echo date ("Y-m-d", mktime (0,0,0,$month, $day, $year)) .
"";
}

Cheers,

Martin S.

--
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] what's wrong with this?

2001-04-22 Thread PHPBeginner.com

$end should be 15.

ie:
LIMIT 50, 10

will display 10 rows starting from 51.

so, it will show rows 51-60 (included)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: McShen [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 3:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] what's wrong with this?


this is something related to my last post.

$start is passed by the url. like http://mydomain.com/links.ph?start=0;
$end =$start+15;

$query = "SELECT * FROM refer ORDER BY hits desc LIMIT $start,$end";

it didn't work. Please help.



-- 
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] Incrementing dates

2001-04-22 Thread PHPBeginner.com

you can then do this:

INSERT INTO table SELECT date+INTERVAL 10 DAYS AS date FROM table WHERE
bla=bla;

it is just a way to do it. you will definitely have to play with it.

However you can easily make two queries to read the previous date combining
it with INTERVAL and then do an insert.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 5:59 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Incrementing dates


PHPBeginner.com wrote:

> I am not sure on how your possibilities are,
> but doing this in PHP means literally "adding useless lines and loops"
>
> If possible, do it with SQL queries. Read the documentations on date
> datatypes, this is so much easier... almost magic.
>

AND

> You can (mySQL, right?) do the following:

>UPDATE table SET date=(date+INTERVAL 10 DAYS);

>so if date there was 04-28, it will be added 10 more days and so will
>become
>05-08

>Use SQL for this things, it treats dates as 'dates' while PHP treats them
>as
>integers and strings.

Sounds even easier. But what if I'm not doing an UPDATE but an INSERT? Can
it read the previous date? I am inserting a batch of bookings at one time.

Martin S.

--
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] Incrementing dates

2001-04-22 Thread PHPBeginner.com

well, then you have to do it with PHP, as I said - if possible, then mySQL
does it better.

Try converting each date into UNIX timestamp adding to it 60*60*24*10 . It
will create you a set of dates incremented by 10 days.


What I previously meant was :

say you design a poll, you have a table called logs.
you want to see if the specific user have already voted within the last 10
days.

SELECT date FROM logs WHERE user='$user' AND date>=(NOW() - INTERVAL 10
DAY));

this will return you at least one row (hopefully one only) if there's such a
user voted less then 10 days ago, and will return you an empty set if
there's none.

Many use PHP to do that kind of checks while mySQL has it built in.

Since I am not sure I understood your situation right, I think you should
consider some mySQL (or any other DB) date functions. They often save you a
lot of code. Otherwise try to do it with PHP as you have already resolved
it.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 8:13 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Incrementing dates


PHPBeginner.com wrote:

>
> INSERT INTO table SELECT date+INTERVAL 10 DAYS AS date FROM table WHERE
> bla=bla;
>
> it is just a way to do it. you will definitely have to play with it.
>
> However you can easily make two queries to read the previous date
> combining it with INTERVAL and then do an insert.

I've looked at INTERVAL but it seems it only deals with one specific date
at a time?

date=10 : SELECT date+INTERVAL 10
would then mean date=20

Or have I got everything wrong?

What I looking at
from the value of date=10 ADD other dates for X days on, like this
(in a table, each record (row) has more data than the one given)
date=2001-04-10
date=2001-04-11
date=2001-04-12

This, if I'm mistaken can't be done with interval, at least not without
looping in PHP? And using two queries would not perhaps save as much code
as the way I solved it? Could be mistaken of course.

Martin S.

--
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] DOCUMENT_ROOT

2001-04-25 Thread PHPBeginner.com

what about having an .htaccess file in each web root?
You can't have vartiables in your server's config files.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jaxon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 10:33 PM
To: Maxim Maletsky
Cc: PHP General Mailing List
Subject: RE: [PHP] DOCUMENT_ROOT


Not to beat a dead horse, but assuming a site structure like this:

/htdocs
/htdocs/modules
/htdocs/includes
/htdocs/templates

where all my PHP logic scripts are in htdocs, and all the bits and pieces
are in the other dirs, is there any way to set include_path to:

$include_path = "$DOCUMENT_ROOT/config; $DOCUMENT_ROOT/includes;
$DOCUMENT_ROOT/templates;"

so I can just include("filename.inc.php"); where ever I am in my structure,
without worrying about putting in a relative or absolute path, AND do this
without altering the php.ini?? (cuz I may not have access to it in a shared
hosting env)

cheers,
jaxon



-- 
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] Escaping Characters

2001-04-25 Thread PHPBeginner.com

 "  double quotes
 '  single quotes (yes, they are used quite often)
 \  backslash (JavaScripts etc.)


there are your enemies, nothing else.
forget about + = & $ ...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Wade [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 8:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Escaping Characters


Aside from " (quotes), which HTML characters should be preceded with a \
(backslash) to avoid parsing errors?

I have the following, which I have in an .inc file outside my web root. I
have tried sticking the \ in front of the # (pound) and the = (equal) -- not
out of any reason, but more out of frustration. I have been sticking
dropdown menu in inc files with no troubles, but this is the first table
I've tried to stick in there.  I'm trying not to ask questions here until
after trying to find an answer in PHP.net, but I've had no luck on this one.

  


?>

Much Thanks,
Wade



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



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




RE: [PHP] php FTP

2001-04-25 Thread PHPBeginner.com

I really don't think you can compile PHP on (not yours) server.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: ryan.barnett1 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 11:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php FTP


Hi there,

I would like to use the PHP FTP functions.
Unfortunately, my webhost hasn't compiled PHP with the FTP extensions.

So, I thought that I might upload the extension myself into my webspace then
call it using the command dl() from within a PHP webpage. That way, I could
(hopefully) get round my webhost - but not in a nasty way ;) !

First of all - will this work?

Secondly, where can I download the PHP extension? My webhost is using Cobalt
RaQ3 (x86 architecture running Linux).
Do I need to download an entire PHP package then extract the extension, or
can I just get the extension by itself.

Thanks in advance for all your help.

Ryan
www.more4money.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] how to get var value

2001-04-26 Thread PHPBeginner.com

try 

$newvar = ${$var1};



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: AJDIN BRANDIC [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 7:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to get var value


Hi,

(this is just an example)
I have on one page

$test=1;
$var1='test';

on another page I want to be able to construct variable from the value in 
$var1 (test in this case)  and print its value.   So,

$newvar=$;
$newvar.=echo"$var1";

now $newvar contains string '$test' but not the value of $test (1 in this 
case).  

There has to be way aroud this but I am just cannot find it :(.

Regards

Ajdin

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



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




RE: [PHP] Problem with the HTTP_REFERER

2001-04-26 Thread PHPBeginner.com

$HTTP_REFERER does not work with javascript this way.

the value is as it would be inside your "back button", in other words, you
have to CLICK on a link, then you'll see it.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with the HTTP_REFERER


Hi,
I have BIG problem using "HTTP_REFERER".
I have two pages:

main.php:
Click here

test.php:
.somecode
echo "window.location.href=\"<A  HREF="http://$web\"">http://$web\"</A>;;";

$web - some website.


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





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



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




RE: [PHP] Problem with the HTTP_REFERER

2001-04-26 Thread PHPBeginner.com

Just to add,

as Yasuo said, $HTTP_REFERER is VERY, VERY unreliable.

PHPBeginner.com logs user accesses into a database, $HTTP_REFERER is there
only 30% of times. This is because:
not everyone necessarily CLICKS,
not every browser supports it,
many are reading emails,
many are typing it in etc ...

never rely on it, make it ALWAYS optional, or your codes will be screwed up
without that you even know it.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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






-Original Message-
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 11:13 PM
To: Rosen; [EMAIL PROTECTED]
Subject: RE: [PHP] Problem with the HTTP_REFERER


$HTTP_REFERER does not work with javascript this way.

the value is as it would be inside your "back button", in other words, you
have to CLICK on a link, then you'll see it.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with the HTTP_REFERER


Hi,
I have BIG problem using "HTTP_REFERER".
I have two pages:

main.php:
Click here

test.php:
.somecode
echo "window.location.href=\"<A  HREF="http://$web\"">http://$web\"</A>;;";

$web - some website.


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





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



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



-- 
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] simple form validation

2001-04-26 Thread PHPBeginner.com

you can do either:

ereg:
if(isset($field) and !$field!='') { // first check if it was submitted at
all,
// you'll get errors if it isn't there

$res = False;

$field = trim($field);  // trim it to remove any whitespaces

// way 1, ereg:
if(ereg("^[[:digit:]]$", $field)) { $res = True; }

// way 2, is_numeric() (the best, fastest way):
if(is_numeric($field)) { $res = True; }

// way 3, is_int() (the same):
if(is_int($field)) { $res = True; }

// way 4, is_num() (the same):
if(is_int($field)) { $res = True; }

// way 5, gettype() (the same):
if(gettype($field)=='integer') { $res = True; }

// way 6, a stupi one but works
if($field>0) { $res = True; }

}


as you can see there are several ways to do it.
use wchich suits you better. In fact I would rather use JavaScript in form,
and here.

my favorite? is_int(). shorter to type :-)



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Jamie Saunders [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 11:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] simple form validation


Hi,

First of all, I've just joined this list, so here's a brief
introduction.  My name's Jamie Saunders, I'm an 18 year old student from
the UK studying for my A-Levels.  I'm currently working on a Computer
Studies project for a local business which involves setting up several
databases on the web.  After reading Webmonkey.com's excellent introduction
to PHP I've decided to use it in conjunction with MySQL for the
project.  Later this year, if all goes well I'm hoping to take a 3 years BA
Honors course in Multimedia Web Production.

Right, you still with me?  What I'd like to know is how to validate a text
field in an HTML form to make sure it only contains numbers.  I know how to
check it so it only contains letters, but not numbers - the field I want to
check is for phone numbers - so it can't contain any special characters
either.  I expect this is very simple but I can't seem to get it working
properly.  Any help appreciated.

Cheers,

Jamie Saunders


--
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] Tough comparison problem.

2001-04-26 Thread PHPBeginner.com

PHP3? too bad...

PHP4 has a magic array_intersect (php.net/array_intersect)

try to see php.net/arrays

you might find what suits you.

you're double loop will slow your application dramatically. but if it's the
only way...


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 11:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Tough comparison problem.


I've got two functions that return data in an array. I need to compare the
individual elements of one array against the elements of another, and do
something within an if-else statement.

I'm using php3, so I don't have an actual "foreach" loop to pick out the
array elements. Instead, I use:

while(list(, $element)=each($array)){

Basically, here's what I need to do:

Pull element 1 out of array 1,
Compare it to all elements of array 2,
Do something (if-else) based on the results of that comparison,
Pull element 2 out of array 1,
Compare it to all elements of array 2,

and so on until all elements of array 1 have been compared to all elements
of array 2.

Any help is greatly appreciated!


--
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] writing a time to mysql????

2001-04-26 Thread PHPBeginner.com

you are inputting a real dot (.) into e_time

remove it:


"INSERT into events (e_title, e_details, start, end, s_time, e_time) values
('$title', '$details', '$s_year-$s_month-$s_day','$e_year-$e_month-$e_day',
'$stime_hour.$stime_minute', '$etime_hour$etime_minute')";



Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Shane McBride [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 1:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] writing a time to mysql


Here's some code that I am using to get the time that is inout from a form
into mysql. It looks like I may have the format backwartds. Any ideas?

"INSERT into events (e_title, e_details, start, end, s_time, e_time) values
('$title', '$details', '$s_year-$s_month-$s_day','$e_year-$e_month-$e_day',
'$stime_hour.$stime_minute', '$etime_hour.$etime_minute')";

s_time and e_time are thr start and end time of the event.

$stime_hour $stime_minute are the hour and minute fileds from the form.

Any ideas

- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...


-- 
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] Retrieving and Printing Categories

2001-04-25 Thread PHPBeginner.com

well, as long as they are related to each other ..

just a quick SQL,



SELECT
groupName,
title
FROM
table
WHERE
this='is what I need'
GROUP BY
groupName
ORDER BY
groupName,
title

this ( I already know I was wrong in this example) will select you the
categories and it's members.

Just try to play with it for a while and you'll arrive to a solution,

with two tables it is still the same.

Just remember : use SQL to do it, not PHP. With PHP there's more job to do
and with it overhead.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 10:31 PM
To: PHP Database Mailing List; PHP General Mailing List
Subject: [PHP] Retrieving and Printing Categories


Hi,
I've got a load of records that are in different categories.
What is the best way to get all the records or selected records and print
them in such a way that they are grouped (on the page) in their relevent
category, like:

Fruit
-> Apples
-> Pears
-> Bananas

Vegetables
-> Carrots
-> Cabbages

etc, etc.

Sometime my categories are ina dfferent table, don't know if this matters?
How can I do this?

TIA,

Jord

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



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




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

2001-04-27 Thread PHPBeginner.com

no classes CAN'T solve my problem:

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

in the docs there's nothing being said.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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



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


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

SED

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


Hello everyone:

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

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




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


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


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



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



Any way to do it?

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

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

Thanks in advance,
Sincerely,

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





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



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




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

2001-04-27 Thread PHPBeginner.com

have you checked your PHP.INI file?

it sais there what links to rewrite.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




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


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





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

Kirk

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

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



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




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

2001-04-27 Thread PHPBeginner.com

well, in your situation I would go into php-general archives right away.
I think (not that I remember, but...) that this was a topic here before.

try to search there.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





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


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

TIA

Kirk

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

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



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




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

2001-04-27 Thread PHPBeginner.com

create_function seems not letting you choosing it's name.

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


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




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


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

Kirk

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

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



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




RE: [PHP] A lot of records

2001-04-27 Thread PHPBeginner.com

search for a such class on the web.

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


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




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


Hi,

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

Regards and thanks for your help

Marc

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



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




RE: [PHP] Storing php-code in mysqlDB

2001-04-27 Thread PHPBeginner.com

YOU ARE GENIUS!

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

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

Thanks,

 Maxim Maletsky
 Founder, Chief Developer

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




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


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

Eval() it.

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

Jason

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

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



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




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

2001-04-27 Thread PHPBeginner.com


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

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


  $fname = 'hello';

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

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

  // And it did!


a dynamic function! I got it.

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

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

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

Thanks everybody,
Jason and Oliver in particular!


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





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


On Friday 27 April 2001 17:08, PHPBeginner.com wrote:
> no classes CAN'T solve my problem:
>
> it is an abstraction layer. called as func_hello(); I want, inside
> func_hello() {} declare a new function based on what happened before
> func_hello() was called. In other words: I of course though about
> classes, and there is in fact a work around, but I need to know if
> 'function $var($arg) { return; }' syntax exists and what it is.
>
> in the docs there's nothing being said.

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

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


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

Error 032: Recursion error - see error 032

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



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




RE: [PHP] line break part2

2001-04-27 Thread PHPBeginner.com

just do 

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

at the end of the file.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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



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


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




TIA
Gary


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



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




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

2001-04-27 Thread PHPBeginner.com

no, I knew that,

my problem was generating functions with dynamic names.

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

Thanks, Yasuo,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




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


Variable functions?



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

prints "this is foo";

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

print "this is bar"

Regards,
--
Yasuo Ohgaki


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






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


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



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




RE: [PHP] MP3

2001-04-27 Thread PHPBeginner.com

I've seen some on hotscripts.com, sourceforge.net (more chances)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Rafael Faria [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 4:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] MP3




Have some way to make a script to get the info of mp3 file? like ID3 tag?

---

[ r a f a e l   f a r i a] _
[EMAIL PROTECTED]
WebMaster Universo Online - http://www.uol.com.br
Phone # +55 11 3038-8665


-- 
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] Where is php.ini located by default?

2001-04-27 Thread PHPBeginner.com

/usr/lib/php
is the default configuration... if I am not worng... 'cause I have some
memory leaks recently :-)

have you tried :
# locate php.ini
# locate php.ini-dist

while on windows it should be located in WINNT directory (on NT/2K). It will
ask YOU to move them there during the installation.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 1:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Where is php.ini located by default?


I've built php from a tarball. Now I need to specify a special include path
in the php.ini file. But I can't find it. There is a php.in-dist in the
build catalog but I can't find a production php.ini anywhere.
The docs says that it should be in the install catalogue (which is where?,
/usr/local/lib/php doesn't have one) or the cwd. I've tried editing the
sample file and putting it in either place but my app still gives me the
following error:

Failed opening required 'class.DBI' (include_path='.:/usr/local/lib/php')
in FILENAME

Martin S.

--
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] [NEWBIE] :P

2001-04-27 Thread PHPBeginner.com

Hi Owen,

newbies are always welcome here (as long as you mention it).
See, we developers, are often too bored answering the complicated questions.
But if you ask something like:
"what is the syntax for update" you'll get dozens of replies.

don't try on mySQL lists, I noticed that they are kind of snobby, simple
questions are not too respected over there.

This is definitely a right place for you.

also try this sites:

PHPBeginner.com (mine BTW)
NewbieNetwork.net

search google,
check list archives ( http://marc.theaimsgroup.com/?l=php-general )



got a question : juts ask,


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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





-Original Message-
From: Dddogbruce (@home.com) [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 8:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] [NEWBIE] :P


Hi.

I'm writing a new script, but I need some help.. I won't post here
because it's just too much.  I'm looking for someone who is dedicated
and patient in helping a 13 year old with SQL and connecting/recieving,
inserting and updating databases.  I have ideas, I have some basic
knowledge of PHP but I need someone who can help answer questions,
patiently.

If you wouldn't mind helping (I realise this may sound stupid) please
message me.  51599351 on ICQ.

Thanks,
Owen


--
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] Where is php.ini located by default?

2001-04-27 Thread PHPBeginner.com

true, true...


m

-Original Message-
From: Chris Fry [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 2:23 PM
To: PHPBeginner.com
Cc: Martin Skjoldebrand; [EMAIL PROTECTED]
Subject: Re: [PHP] Where is php.ini located by default?


It's /usr/local/lib/php.ini

Chris

"PHPBeginner.com" wrote:

> /usr/lib/php
> is the default configuration... if I am not worng... 'cause I have some
> memory leaks recently :-)
>
> have you tried :
> # locate php.ini
> # locate php.ini-dist
>
> while on windows it should be located in WINNT directory (on NT/2K). It
will
> ask YOU to move them there during the installation.
>
> Sincerely,
>
>  Maxim Maletsky
>  Founder, Chief Developer
>
>  PHPBeginner.com (Where PHP Begins)
>  [EMAIL PROTECTED]
>  www.phpbeginner.com
>
> -Original Message-
> From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, April 28, 2001 1:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Where is php.ini located by default?
>
> I've built php from a tarball. Now I need to specify a special include
path
> in the php.ini file. But I can't find it. There is a php.in-dist in the
> build catalog but I can't find a production php.ini anywhere.
> The docs says that it should be in the install catalogue (which is where?,
> /usr/local/lib/php doesn't have one) or the cwd. I've tried editing the
> sample file and putting it in either place but my app still gives me the
> following error:
>
> Failed opening required 'class.DBI' (include_path='.:/usr/local/lib/php')
> in FILENAME
>
> Martin S.
>
> --
> 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]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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



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




RE: [PHP] PHP.INI

2001-04-28 Thread PHPBeginner.com

Computer?

wow!

no, just restart your apache (whatever system you use)


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

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




-Original Message-
From: Manesh [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 9:56 PM
To: Taylor, Stewart; 'Johannes Rumpf'; [EMAIL PROTECTED]
Subject: [PHP] PHP.INI


Do u have to resart ur comp after you change ur PHP.INI

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



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




  1   2   3   4   >