[PHP] Outputing XML to browser???

2002-02-15 Thread Jim Hankins

I'm attempting to do some dynamic XML output to an xml capable browser.  Can
someone give me an example?  I'm using .php files currently. Tried xml files
and the tags were messing up my xml output or if I used http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] modular programming

2002-02-15 Thread Peter Janett

Check out http://www.Fusebox.org.  Fusebox is a programming methodology,
originally written for Cold Fusion.  Don't let the Cold Fusion scare you,
it's really not about the language, but rather it's about modular
programming, and may be exactly what you are looking for.  Once you get what
the methodology is about, you can go the site dedicated to Fusebox with PHP,
http://bombusbee.com.

There is a whole "Fusebox Community", which is built around the methodology.
Pretty good stuff, will save lots of time.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.0.6, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]

- Original Message -
From: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>
To: "php-list" <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 9:24 PM
Subject: [PHP] modular programming


> hey,
> does anyone know of any good papers on modular programing? I have been
able
> to make my code modular, but I am not satisfied with it. I am trying to
make
> my program work the "plug in" way.. where i can just add more modules on
the
> fly... any tips? :)
> Regards,
> Kunal Jhunjhunwala
>
> "Minds think with ideas, not information. No amount of data, bandwidth, or
> processing power can substitute for inspired thought." - Clifford Stoll
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] modular programming

2002-02-15 Thread Eugene Lee

On Sat, Feb 16, 2002 at 09:54:40AM +0530, Kunal Jhunjhunwala wrote:
: 
: does anyone know of any good papers on modular programing? I have been able
: to make my code modular, but I am not satisfied with it. I am trying to make
: my program work the "plug in" way.. where i can just add more modules on the
: fly... any tips? :)

You're talking about a nice, OO framework.  Outside of university
computer science ivory tower environments like Smalltalk, and besides
NeXTSTEP/OPENSTEP/Cocoa of Mac OS X, your best bet is to make more OO
classes and learn to abstract consistent pieces.  Try taking a look at
"Design Patterns: Elements of Reusable Object-Oriented Software" by
Gamma, Helm, Johnson, Vlissides.

Also, from the ColdFusion world, there are framework architectures like
Fusebox whose concepts are supposed to be language-independent.


-- 
Eugene Lee
[EMAIL PROTECTED]

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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread Peter J. Schoenster

On 15 Feb 2002, at 23:12, michael kimsal wrote:

> Tom Rogers wrote:
> > Hi
> > It uses cookies and only cookies and it seems that sessions are
> > started on every access but can be turned off on individual pages if
> > required. Tom
> 
> Sorry Tom, but the application object has nothing to do with cookies.
> It is a 'global' session, for lack of a better term, and doesn't need
> to concern itself with cookies or other means of identifying specific
> users, because nothing in the application object is specific to users
> - it is data specific to the total application itself.

> Hope that helps.

The original guy wrote:

> > > to all instances and sessions. It is for example very useful to
> > > track different users at the same time, or to send messages from
> > > one session to another, or the likes.

Well it started from the above where some guy said this magic 
could track users. I assumed the cookies and if it's tracking users 
it uses a session id in the url or a cookie, I know of no other way 
and would really appreciate the education.

> Tom Rogers wrote:

> - it is data specific to the total application itself.

But how does it carry from one click to the next?

Peter


http://www.readbrazil.com/
Answering Your Questions About Brazil

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




Re: [PHP] modular programming

2002-02-15 Thread Kunal Jhunjhunwala

Hi,
I agree with everything you have said, it will come with evolution of the
program. But there are times, when evolution may require re-coding over
10,000lines of code. Not a very good place to be in then :)

So, if I started right, i would end and evolve right.. know what i mean?
Regards,
Kunal Jhunjhunwala

"Minds think with ideas, not information. No amount of data, bandwidth, or
processing power can substitute for inspired thought." - Clifford Stoll
- Original Message -
From: "Steven Walker" <[EMAIL PROTECTED]>
To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>
Cc: "php-list" <[EMAIL PROTECTED]>
Sent: Saturday, February 16, 2002 11:11 AM
Subject: Re: [PHP] modular programming


> Dear Kunal,
>
> I don't know of any papers... I'd be interested in what you find.
>
> In my experience, 'modular coding' is entirely a process of evolution.
> It's impossible to sit down and design software on paper. Every piece of
> code I write is under constant evaluation. Each time a weakness is
> exposed, I rethink my strategy. Often there is no 'perfect' solution,
> since each presents a different set of compromises. Devoting yourself to
> endlessly rewriting and structuring your code will, in the long term,
> yield better code than anyone can advise in a book or paper.
>
> Over modulation of code has drawbacks too. Sometimes the simple solution
> is the one to use, even if it means rewriting the same thing every once
> in a while. When people start creating classes and polymorphic
> interfaces to their code needlessly, performance is compromised.
>
> Perhaps what you are looking for is also a reference for good
> programming practice. For C++, I really liked the books by Scott Meyers:
> 'Effective C++', first and second edition. Here he sets out some
> fundamental 'guidelines' for coding. You may like to check it out, even
> thought it doesn't apply to PHP directly.
>
> Of what it's worth, that's my two cents :) I'd be interested in what
> others think on this matter.
>
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
>
> On Friday, February 15, 2002, at 08:24  PM, Kunal Jhunjhunwala wrote:
>
> > hey,
> > does anyone know of any good papers on modular programing? I have been
> > able
> > to make my code modular, but I am not satisfied with it. I am trying to
> > make
> > my program work the "plug in" way.. where i can just add more modules
> > on the
> > fly... any tips? :)
> > Regards,
> > Kunal Jhunjhunwala
> >
> > "Minds think with ideas, not information. No amount of data, bandwidth,
> > or
> > processing power can substitute for inspired thought." - Clifford Stoll
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


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




[PHP] Sessions and templating help

2002-02-15 Thread Justin Deutsch

Hi All,

I am running Apache with PHP4 as a module.  I have also written a script 
(template.php) that sets up the default envrionment, like the CSS and navigation etc.  
The script also reads in a file, as defined by the ?path= of the URL.  The file it 
reads in must have the sections (includes, header and body,  as defined by /*** ***/ 
and /*** end ***/ pairs).  The file is the split into these sections and along with 
the templated bits of the page compile into a single string which is the executed 
using the eval().  Now this all works fine, but I also want to use sessions.  The 
first session from the index.html file, which is first acessed as a login page, stores 
the player class fine, but when I go to the next page (player_login.html) I seem to 
loose the session.

You might ask why I don't just use an existing templating system, well it's because I 
think that you should only have to write the template once and not have to touch it 
again.  The templating systems I have come across force you to include a file at the 
top and bottom of the code you are writing.  The one down side to the way I am doing 
it is that I have had to force the other file into a include, header and body section, 
but this is a trivial formatting issue.

Is there something I'm missing?  I have included the code for the three scripts below.


template.php


";
if(file_exists($filename))
{
$page_code = file($filename);
foreach ($page_code as $line)
{
$file_content .= $line;
}
//print "$file_content";
$file_read = true;
}
else
{
$file_content = '
File Not Found
Could not find , please let the Web 
Administrator
know
';
}
}

/* Get the index information */

read_file($NAV_COLUMN);
$navigation = $file_content;

/* 
 * garentee that if the user gives no file name then they will get the
 * index file
 */
if(strcmp(basename($path), "") == 0)
{
if(!preg_match("/\/$/", $path))
{
$path .= "/";
}
$path .= "index.html";
}
/* Get the Header information and the content of the body */
$file_name = "$CONTENT_PATH/$path";
read_file($file_name);
if($file_read)
{
//print "$file_name";

/* Grab the HTTP header stuff from the file. This includes any
 * session information.
 *
 * The header section is defined by 
 * <*** header ***> and <*** end header ***> at the start of the
 * file.
 */
$section = preg_split("/\s*<\*{3}\s*end\s*header\s*\*{3}>\s*/im",
$file_content,
2
);
if(count($section) == 2)
{
$content_header = $section[0];
$content_header = preg_replace("/<\*{3}\s*header\s*\*{3}>/im",
"",
$content_header,
1
);
$body = $section[1];

/* get the includes section */
$section = preg_split("/\s*<\*{3}\s*end\s*includes\s*\*{3}>\s*/im",
$content_header,
2
);
if(count($section) == 2)
{
$include_files = $section[0];
$include_files = preg_replace("/<\*{3}\s*includes\s*\*{3}>/im",
"",
$include_files,
1
);
$content_header = $section[1];

}

}
else
{
$body = $section[0];
}
}
else
{
$body = $file_content;
}

if(isset($include_files))
{
$page .= $include_files."\n";
}

$page .= '
';

if(isset($content_header))
{
$page .= $content_header."\n";
}


$page .= '
display()
?>'."\n";
//$header->display();
//print ":$title";

/*
print "header";
highlight_string($content_header);
*/

$page .= ''."\n";
$page .= ''."\n";
$page .= '  '."\n";
$page .= $navigation;
//$page .= "fred \n";
$page .= '  '."\n";
$page .= '  '."\n";

/*
$page .= "body";
highlight_string($body);
*/

$page .= $body."\n";

$page .= '';
$page .= '';

$page .= '  '."\n";
$page .= ''."\n";
$page .= ''."\n";

$page .= 'display();?>'."\n";

print eval("?>".$page);
if($DEBUG)
{
?>Debuging Information Follows
 
Base Name = ".basename($path)."";
/* 
 * This section adds line numbers to the string so you can make
 * sense out of the eval line numbers when an error is produced.
 *
 

Re: [PHP] modular programming

2002-02-15 Thread Steven Walker

Dear Kunal,

I don't know of any papers... I'd be interested in what you find.

In my experience, 'modular coding' is entirely a process of evolution. 
It's impossible to sit down and design software on paper. Every piece of 
code I write is under constant evaluation. Each time a weakness is 
exposed, I rethink my strategy. Often there is no 'perfect' solution, 
since each presents a different set of compromises. Devoting yourself to 
endlessly rewriting and structuring your code will, in the long term, 
yield better code than anyone can advise in a book or paper.

Over modulation of code has drawbacks too. Sometimes the simple solution 
is the one to use, even if it means rewriting the same thing every once 
in a while. When people start creating classes and polymorphic 
interfaces to their code needlessly, performance is compromised.

Perhaps what you are looking for is also a reference for good 
programming practice. For C++, I really liked the books by Scott Meyers: 
'Effective C++', first and second edition. Here he sets out some 
fundamental 'guidelines' for coding. You may like to check it out, even 
thought it doesn't apply to PHP directly.

Of what it's worth, that's my two cents :) I'd be interested in what 
others think on this matter.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 15, 2002, at 08:24  PM, Kunal Jhunjhunwala wrote:

> hey,
> does anyone know of any good papers on modular programing? I have been 
> able
> to make my code modular, but I am not satisfied with it. I am trying to 
> make
> my program work the "plug in" way.. where i can just add more modules 
> on the
> fly... any tips? :)
> Regards,
> Kunal Jhunjhunwala
>
> "Minds think with ideas, not information. No amount of data, bandwidth, 
> or
> processing power can substitute for inspired thought." - Clifford Stoll
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] suscribir

2002-02-15 Thread MAURICIO

 
 

_
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

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




Re: [PHP] COOKIE HEADER????

2002-02-15 Thread Michael Sims

At 02:33 PM 2/15/2002 +0100, marcbey wrote:
>i dont know how i have to send it back, because i dont kown where and how to
>put the
>ASPSESSIONIDKJHKJHHKJH=HJVHJGHJGJGHJGJHGKJ information (in the header?)

This document may help:

http://developer.netscape.com:80/docs/manuals/js/client/jsref/cookies.htm


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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread Tom Rogers

Hi
Yes you are right ... i had my head tied up with sessions :)
Tom

At 02:12 PM 2/16/02, michael kimsal wrote:
>Tom Rogers wrote:
>>Hi
>>It uses cookies and only cookies and it seems that sessions are started 
>>on every access but can be turned off on individual pages if required.
>>Tom
>
>
>Sorry Tom, but the application object has nothing to do with cookies. It 
>is a 'global' session, for lack of a better term, and doesn't need to
>concern itself with cookies or other means of identifying specific users, 
>because nothing in the application object is specific to users - it is 
>data specific to the total application itself.
>
>You may be thinking of sessions themselves - the 'session' object and the 
>'application' object are treated similarly from a programmatic standpoint 
>but are pretty different underneath in terms of operation and purpose.
>
>Hope that helps.
>
>Michael Kimsal
>http://www.tapinternet.com/php
>PHP training courses
>734-480-9961
>
>


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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread Joshua Hoover

One way to simulate an application object is to use the php.ini
"auto_prepend_file" option.  Set the file with your application variables to
be the file you want to prepend to every file in your application.  Now, the
only part that you don't have is an easy way to add/update/delete these
variables.  I suppose you could write a fairly simple class that allowed you
to manipulate the file line by line, which would essentially give you access
to all the variables for add/update/delete functionality.

I use "auto_prepend_file" quite a bit for my applications and it acts just
like an application object.  I haven't found a time where I need/want to
manipulate the variables "on the fly" within code.  Most of the variables
being set are simply configuration settings for the application, not
variables needing to change and be shared across the application.

Hope that helps some,

Joshua Hoover


> > For those of you not familiar with ASP, the lowdown is this: The
> > application object acts like a global session. You assign it variables
> > and values like you would a session, but those variables are available
> > to all instances and sessions. It is for example very useful to track
> > different users at the same time, or to send messages from one session
> > to another, or the likes.




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




[PHP] modular programming

2002-02-15 Thread Kunal Jhunjhunwala

hey,
does anyone know of any good papers on modular programing? I have been able
to make my code modular, but I am not satisfied with it. I am trying to make
my program work the "plug in" way.. where i can just add more modules on the
fly... any tips? :)
Regards,
Kunal Jhunjhunwala

"Minds think with ideas, not information. No amount of data, bandwidth, or
processing power can substitute for inspired thought." - Clifford Stoll


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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread michael kimsal

Tom Rogers wrote:
> Hi
> It uses cookies and only cookies and it seems that sessions are started 
> on every access but can be turned off on individual pages if required.
> Tom
> 


Sorry Tom, but the application object has nothing to do with cookies. 
It is a 'global' session, for lack of a better term, and doesn't need to
concern itself with cookies or other means of identifying specific 
users, because nothing in the application object is specific to users - 
it is data specific to the total application itself.

You may be thinking of sessions themselves - the 'session' object and 
the 'application' object are treated similarly from a programmatic 
standpoint but are pretty different underneath in terms of operation and 
purpose.

Hope that helps.

Michael Kimsal
http://www.tapinternet.com/php
PHP training courses
734-480-9961



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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread Tom Rogers

Hi
It uses cookies and only cookies and it seems that sessions are started on 
every access but can be turned off on individual pages if required.
Tom


At 07:44 AM 2/16/02, Peter J. Schoenster wrote:
>On 15 Feb 2002, at 14:43, Bendik Simonsen wrote:
>
>
> > I have however, noticed one feature that ASP has that I have not found
> > an equal for in PHP: the "application" object.
> >
> > For those of you not familiar with ASP, the lowdown is this: The
> > application object acts like a global session. You assign it variables
> > and values like you would a session, but those variables are available
> > to all instances and sessions. It is for example very useful to track
> > different users at the same time, or to send messages from one session
> > to another, or the likes.
> >
> > Anything like this in PHP, or will I have to find a workaround for it,
> > or *ick* do that little sniplet in ASP?
>
>Well how does it work? Is it advertised as M$ magic in the class?
>Is http not stateless?
>
>I don't follow your description and I don't believe in magic.
>
>Is it using cookies? If not what? It must be using something?
>
>I bet it's using cookies. Sounds a lot like what you normally do with
>sessions. I don't follow the "send message from one session to
>another" ... is this not just normal course for sessions?  I'd like
>more explanation before I believe that this is any more than just a
>module.
>
>Peter
>http://www.readbrazil.com/
>Answering Your Questions About Brazil
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] extract nouns

2002-02-15 Thread Heiko Spallek

Hi,

I am looking for some non-fancy language processing: I just want to
extract all nouns from a free text.

Is there anything available doing this. I guess it needs to have a
dictionary as part of the solution, but I don't know.

Thanks for suggestions!

Heiko



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




[PHP] PHP phone consultations :)

2002-02-15 Thread michael kimsal

Michael Sims wrote:
>> I can also be reached at 734-480-9961 if you've questions that might
>> be faster talking about than emailing, and my AIM is 'mgkimsal' is 
>> you're on that and need some help.
>>
>> That goes for anyone else on the list too...
> 
> OMG you may end up regretting that.  I'm putting you on my speed dial 
> right now... :-P  Yeah, it's not toll-free but as They say "it's free if 
> you call from work"

Hi Michael:

Not to turn this into too much of a sales pitch, but... :)

1.  We do offer hourly consulting for one-offs, so if you're in a pinch
and just HAVE to get something done, we can help.  Many times
you only need a small push in the right direction, not entire 
outsourcing of a project.

2.  That doesn't mean that every call is charged.  Got a question?  Give 
a call in.  I'm normally pretty open to discuss PHP and web matters, and
often can spare some time to help through problems - that's what we do 
at our monthly PHP user group meeting, and on the user group mailing 
list (sempug at yahoo groups!).  However, realize that I (or others at 
the office) might not be able to sit down and chat for hours at a 
stretch gratis.  :)

Don't let that put you off calling if you've got questions - often times 
questions that can have you stumped are things that we (or others) have 
faced in the past and solved already.

Michael Kimsal
http://www.tapinternet.com/php
PHP Training Courses
734-480-9961



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




Re: [PHP] scheduled tasks

2002-02-15 Thread Michael Sims

At 10:03 AM 2/15/2002 -1000, Rodney Davis wrote:
>Is currently anyway of doing scheduled tasks with PHP (without using
>crontab)?  For example, using an email script to send out e-mail
>reminders every Monday or something like that?

What's wrong with using cron?


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




Re: [PHP] Re: The ASP "application" object in PHP?

2002-02-15 Thread Michael Sims

At 02:21 PM 2/15/2002 -0500, Michael Kimsal wrote:
>I've been here all along!  :)
>
>Seriously, we cover some of this in our class as well, and at our monthly 
>PHP user group meetings.  I'm actually writing up a small paper
>on this and other topics.  If you're interested in it, let me know.
>
>I can also be reached at 734-480-9961 if you've questions that might
>be faster talking about than emailing, and my AIM is 'mgkimsal' is you're 
>on that and need some help.
>
>That goes for anyone else on the list too...

OMG you may end up regretting that.  I'm putting you on my speed dial right 
now... :-P  Yeah, it's not toll-free but as They say "it's free if you call 
from work"


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




[PHP] popen

2002-02-15 Thread Lau NH

Hi, is anyone know how to make popen command to read and write to a process at the 
same time?  My php script need to call linux command which requires interactive 
action, or anyone know other possible way of doing it?


Regards,
Lau NH




RE: [PHP] What Do You Think?

2002-02-15 Thread Jeff Sheltren

Sign me up, too!  I'd love to help with any site that promotes good beer! =)

Perhaps we start a database of pubs/bars and they can be browsed from a 
map, or a user can search for bars by name/location/rating(maybe), and they 
can also search by beers on tap.  Sounds like quite a fun project to me!

Jeff

At 04:08 PM 2/15/2002 -0600, Gonzalez, Zara E wrote:
>I'd love a site like this. Let's do it quick before I go off traveling in May
>(so I can find some great pubs to visit ;)
>
>Seriously though, I haven't done much with GD (nor do I have a great deal of
>freetime) but I'd be willing to help out as much as I could on this project if
>anyone is serious about it.
>
>Zara
>
>-Original Message-
>From: hugh danaher [mailto:[EMAIL PROTECTED]]
>Sent: Friday, February 15, 2002 3:14 PM
>To: php
>Subject: Re: [PHP] What Do You Think?
>
>I didn't intend to start a beer discussion, but last Friday Arik was asking
>for a project to do, and I was just reminding him of my suggestion.
>If I can work the bugs out of my image code, I might just put up a site
>where php people can input their local brewery/pub/whatever and see the
>results worldwide.  It would certainly show the scope and level of
>penetration of php.  Anyone out there know much about the
>imagecreatefromjpeg() function?
>Hugh



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




Re: [PHP] Looking for optimal coding

2002-02-15 Thread Peter J. Schoenster

On 14 Feb 2002, at 22:18, Phillip S. Baker wrote:

> This is not a big thing.
> But I am looking at this thinking there is a way to make the code take
> up even less lines. Just want to stick this in my cap for future
> reference.
> 
> for($i=01;$i<=50;$i++)  {
>  if (!empty($content))   {
>  if ($row[$content]==$states[$i])
>  echo " selected>$nstates[$i]\n";
>  else
>  echo "  value=\"$states[$i]\">$nstates[$i]\n";
>  }
>  else{
>  if ($dstate == $states[$i])
>  echo " selected>$nstates[$i]\n";
>  else
>  echo "  value=\"$states[$i]\">$nstates[$i]\n";
>  }
> }
> 
> Basically I want to check for two possible conditions to make an item
> selected. If the first one is valid then do not check for the other.

Hi, I'm not sure about the "two possible conditions". Seems 
arbitrary but you could do it with my suggestion by just passing an 
array with one value rather than more than one.

Warning, I've only programmed in PHP for about a month now. 

What I would do if you, what I do when programming, is ask myself 
if I can abstract the code I'm writing. Might I reach out of the 
particular instance and see if there is something common in what 
I'm doing here. It can take a little longer initially but you can then 
use what you've created over and over again. What you wanted to 
do sounds like something I've done in Perl so I just re-wrote it in 
PHP.  I have a module of common routines I nearly always use in 
forms and I have the function below in that module (in Perl).

I put it all in a php contstruct so you could test it in your browser. 
Pardon all the data. I would not have used the values as the "key" 
for the $states array but it did not work unless I put something 
there. You can use this for any 2 sets of arrays (states, cities, 
colors, sizes, etc).  I have common sets of arrays in my module 
as well.


array(display=>'Montana',value=>'mt',),'mi'=>array(displ
ay=>'Michigan',value=>'mi',),'md'=>array(display=>'Maryland',value=
>'md',),'tx'=>array(display=>'Texas',value=>'tx',),'nm'=>array(display
=>'New 
Mexico',value=>'nm',),'ut'=>array(display=>'Utah',value=>'ut',),'pa'=>
array(display=>'Pennsylvania',value=>'pa',),'ne'=>array(display=>'Ne
braska',value=>'ne',),'az'=>array(display=>'Arizona',value=>'az',),'mp
'=>array(display=>'Mariana 
Islands',value=>'mp',),'wy'=>array(display=>'Wyoming',value=>'wy',),
'ia'=>array(display=>'Iowa',value=>'ia',),'ar'=>array(display=>'Arkans
as',value=>'ar',),'la'=>array(display=>'Louisiana',value=>'la',),'id'=>arr
ay(display=>'Idaho',value=>'id',),'al'=>array(display=>'Alabama',valu
e=>'al',),'co'=>array(display=>'Colorado',value=>'co',),'ma'=>array(di
splay=>'Massachusetts',value=>'ma',),'nc'=>array(display=>'North 
Carolina',value=>'nc',),'ny'=>array(display=>'New 
York',value=>'ny',),'dc'=>array(display=>'District Of 
Columbia',value=>'dc',),'ca'=>array(display=>'California',value=>'ca',)
,'vt'=>array(display=>'Vermont',value=>'vt',),'mo'=>array(display=>'M
issouri',value=>'mo',),'tn'=>array(display=>'Tennessee',value=>'tn',),'
or'=>array(display=>'Oregon',value=>'or',),'sc'=>array(display=>'Sou
th 
Carolina',value=>'sc',),'wa'=>array(display=>'Washington',value=>'w
a',),'in'=>array(display=>'Indiana',value=>'in',),'ks'=>array(display=>'
Kansas',value=>'ks',),'oh'=>array(display=>'Ohio',value=>'oh',),'hi'=>
array(display=>'Hawaii',value=>'hi',),'nv'=>array(display=>'Nevada',va
lue=>'nv',),'nh'=>array(display=>'New 
Hampshire',value=>'nh',),'wv'=>array(display=>'West 
Virginia',value=>'wv',),'wi'=>array(display=>'Wisconsin',value=>'wi',),'
nj'=>array(display=>'New 
Jersey',value=>'nj',),'ak'=>array(display=>'Alaska',value=>'ak',),'mh'=
>array(display=>'Marshall 
Islands',value=>'mh',),'fm'=>array(display=>'Micronesia',value=>'fm',)
,'as'=>array(display=>'American 
Samoa',value=>'as',),'mn'=>array(display=>'Minnesota',value=>'mn',
),'ct'=>array(display=>'Connecticut',value=>'ct',),'me'=>array(display
=>'Maine',value=>'me',),'de'=>array(display=>'Delaware',value=>'de',
),'sd'=>array(display=>'South 
Dakota',value=>'sd',),'ok'=>array(display=>'Oklahoma',value=>'ok',),'
il'=>array(display=>'Illinois',value=>'il',),'gu'=>array(display=>'Guam',
value=>'gu',),'nd'=>array(display=>'North 
Dakota',value=>'nd',),'va'=>array(display=>'Virginia',value=>'va',),'ky'
=>array(display=>'Kentucky',value=>'ky',),'ri'=>array(display=>'Rho
de 
Island',value=>'ri',),'ms'=>array(display=>'Mississippi',value=>'ms',),'
pw'=>array(display=>'Palau',value=>'pw',),'ga'=>array(display=>'Geo
rgia',value=>'ga',),'fl'=>array(display=>'Florida',value=>'fl',),);

// what you would get from the form or use as a default
$value_array = array("al","az");

$a =& SelectSelect($value_array,$states);
sort($a);

// let's test it
echo "";
while (list ($key,$row) = e

Re: [PHP] how to send variable with direct link?

2002-02-15 Thread Tyler Longren

Server";
?>

Whatever value $ip_from_mysql holds will be accesible on page.php as the $ip
variable.

Tyler
- Original Message -
From: "Hawk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 4:45 PM
Subject: [PHP] how to send variable with direct link?


> I have a database with gameservers, and I am planning to make them to open
a
> popup window where the ip I clicked on will be used as a variable for a
> explorer plugin that checks servers, my problem is I don't know how to get
a
> url to send a variable specified from the database.
> Don't know if this sounded completly wierd, but I'm bad at explaining :)
>
> Hawk
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] how to send variable with direct link?

2002-02-15 Thread Hawk

I have a database with gameservers, and I am planning to make them to open a
popup window where the ip I clicked on will be used as a variable for a
explorer plugin that checks servers, my problem is I don't know how to get a
url to send a variable specified from the database.
Don't know if this sounded completly wierd, but I'm bad at explaining :)

Hawk



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




RE: [PHP] What Do You Think?

2002-02-15 Thread Gonzalez, Zara E

I'd love a site like this. Let's do it quick before I go off traveling in May
(so I can find some great pubs to visit ;)

Seriously though, I haven't done much with GD (nor do I have a great deal of
freetime) but I'd be willing to help out as much as I could on this project if
anyone is serious about it.

Zara

-Original Message-
From: hugh danaher [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 15, 2002 3:14 PM
To: php
Subject: Re: [PHP] What Do You Think?

I didn't intend to start a beer discussion, but last Friday Arik was asking
for a project to do, and I was just reminding him of my suggestion.
If I can work the bugs out of my image code, I might just put up a site
where php people can input their local brewery/pub/whatever and see the
results worldwide.  It would certainly show the scope and level of
penetration of php.  Anyone out there know much about the
imagecreatefromjpeg() function?
Hugh

- Original Message -
From: "Richard Crawford" <[EMAIL PROTECTED]>
To: "Miles Thompson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 12:31 PM
Subject: Re: [PHP] What Do You Think?


> Hmm, let's not forget Sam Adams Triple Bock, if you can find it.  I've
> got a bottle that a friend of mine gave me for my birthday three years
> ago...  I'm still waiting for the perfect reason to drink it (my wife
> doesn't drink and I just don't like to drink alone).  Some of my best
> work has been done with the help of Triple Bock.
>
>
> On Fri, 2002-02-15 at 12:24, Miles Thompson wrote:
> > Friday afternoon -- one can tell!
> >
> > My votes are for Propellor Bitter or Garrison Red, both brewed here in
Hfx,
> > NS. Availability of the former more or less determines where we have our
> > weekly Linux get-togethers.
> >
> > It's now 4:30, so I'm raising one to you all - Miles
> >
> > At 11:56 AM 2/15/2002 -0800, Richard Crawford wrote:
> > >Tetley's is good stuff.
> > >
> > >Try Old Nick.  Only beer I've found that needs a chaser.
> > >
> > >
> > >On Fri, 2002-02-15 at 11:52, Erik Price wrote:
> > > >
> > > > On Friday, February 15, 2002, at 02:40  PM, Richard Crawford wrote:
> > > >
> > > > > Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in
your
> > > > > zip code, and you get a list of all of the pubs and bars in your
area
> > > > > that serve draft Guinness.  I could support a site like that, or
help
> > > > > build one.
> > > > >
> > > >
> > > > Guiness lovers have it easy.  My favorite beer, of all time, which I
> > > > love with a passion far greater than the zeal of any Guinness
drinker on
> > > > this list, is Tetley's English Ale.  I live for that stuff.
> > > >
> > > > Not only can I hardly find a place with Tetley's on tap, I can
hardly
> > > > find it in stores!
> > > >
> > > >
> > > > LOVE Tetley's.
> > > >
> > > >
> > > > Erik
> > > >
> > > >
> > > > 
> > > >
> > > > Erik Price
> > > > Web Developer Temp
> > > > Media Lab, H.H. Brown
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >--
> > >Sliante,
> > >Richard S. Crawford
> > >
> > >mailto:[EMAIL PROTECTED]  http://www.mossroot.com
> > >AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
> > >MSN:  [EMAIL PROTECTED]
> > >
> > >"It is only with the heart that we see rightly; what is essential is
> > >invisible to the eye."  --Antoine de Saint Exupery
> > >
> > >"Push the button, Max!"
> > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> Sliante,
> Richard S. Crawford
>
> mailto:[EMAIL PROTECTED] http://www.mossroot.com
> AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
> MSN:  [EMAIL PROTECTED]
>
> "It is only with the heart that we see rightly; what is essential is
> invisible to the eye."  --Antoine de Saint Exupery
>
> "Push the button, Max!"
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

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




[PHP] Strange behaviour : php accessing Oracle (PLS-00553: character set name)

2002-02-15 Thread Robert Mena

Hi,
Ie developed some scripts to access oracle.  Using my
development machine it works great.

When I switch to the production server I keep getting

Warning: OCIStmtExecute: ORA-06550: line 3, column 33:
PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0: PL/SQL: Compilation unit
analysis terminated in /var/www/html/test.php on line
35
 
This only happens with stored procedures.  Regular
selects work fine.

Since the same production server is used by many
delphi applications I may be doing something wrong.

Any tips will be appreciated.

If this is considered off-topic please email me
directly.

Regards,

__
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

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




[PHP] php 4.0.6, apache problem

2002-02-15 Thread Pushkar Pradhan

Hi,
I've installed php 4.0.6 since I am working with mapserver which works
with 4.0.6 only.
This is my configuration:
./configure  --prefix=/rstc/user1/erc/pushkar/php-4.0.6
--with-apxs=/rstc/user1/erc/pushkar/apache_1.3.22/bin/apxs
After this I add the foll. to my httpd.conf file of apache (1.3.22),
solaris, sparc.
LoadModule php4_module libexec/libphp4.so
AddModule /rstc/user1/erc/pushkar/php-4.0.6/sapi/apache/mod_php4.c
During php install. libphp4.so got copied to the libexec dir. of apache
correctly, however mod_php4.c is in php dir. to where I have given the
path.
My apache config is:
./configure --with-layout=Apache
--prefix=/rstc/user1/erc/pushkar/apache_1.3.22 --enable-module=so
However when I try to start up apache I get the foll. error:
Banshee[540] pushkar$ apachectl start
Syntax error on line 205 of
/rstc/user1/erc/pushkar/apache_1.3.22/conf/httpd.conf:
Cannot load /rstc/user1/erc/pushkar/apache_1.3.22/libexec/libphp4.so into
server: ld.so.1: /rstc/user1/erc/pushkar/apache_1.3.22/bin/httpd: fatal:
relocation error: file
/rstc/user1/erc/pushkar/apache_1.3.22/libexec/libphp4.so: symbol
ap_block_alarms: referenced symbol not found
./apachectl start: httpd could not be started
Can anybody suggest what is wrong, I tried the mailing list but the solns.
didn't work.
Thanks,

--
PUSHKAR S. PRADHAN
Research Assistant
MISSISSIPPI STATE UNIVERSITY,
STARKVILLE, MS 39759.

Engineering Research Center
Box 9627
Mississippi State, MS 39762-9627
--



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




[PHP] Re: The ASP "application" object in PHP?

2002-02-15 Thread Philip Hallstrom

Not that I'm an ASP expert, but I asked someone about this once and was
told that the application object is really just a session for that section
of the website.

In other words you configure IIS so that say "/foobar" is an application.
Then in /foobar/global.asa you do some stuff that sets up this application
object.  Now anyone who accesses /foobar has access to that object.  So
using this you could keep track of how many people are on the site ,etc...

While it's magic in ASP land, it is easily done with a bit of work in
PHP..

On Fri, 15 Feb 2002, Peter J. Schoenster wrote:

> On 15 Feb 2002, at 14:43, Bendik Simonsen wrote:
>
>
> > I have however, noticed one feature that ASP has that I have not found
> > an equal for in PHP: the "application" object.
> >
> > For those of you not familiar with ASP, the lowdown is this: The
> > application object acts like a global session. You assign it variables
> > and values like you would a session, but those variables are available
> > to all instances and sessions. It is for example very useful to track
> > different users at the same time, or to send messages from one session
> > to another, or the likes.
> >
> > Anything like this in PHP, or will I have to find a workaround for it,
> > or *ick* do that little sniplet in ASP?
>
> Well how does it work? Is it advertised as M$ magic in the class?
> Is http not stateless?
>
> I don't follow your description and I don't believe in magic.
>
> Is it using cookies? If not what? It must be using something?
>
> I bet it's using cookies. Sounds a lot like what you normally do with
> sessions. I don't follow the "send message from one session to
> another" ... is this not just normal course for sessions?  I'd like
> more explanation before I believe that this is any more than just a
> module.
>
> Peter
> http://www.readbrazil.com/
> Answering Your Questions About Brazil
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] What Do You Think?

2002-02-15 Thread hugh danaher

I didn't intend to start a beer discussion, but last Friday Arik was asking
for a project to do, and I was just reminding him of my suggestion.
If I can work the bugs out of my image code, I might just put up a site
where php people can input their local brewery/pub/whatever and see the
results worldwide.  It would certainly show the scope and level of
penetration of php.  Anyone out there know much about the
imagecreatefromjpeg() function?
Hugh

- Original Message -
From: "Richard Crawford" <[EMAIL PROTECTED]>
To: "Miles Thompson" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 12:31 PM
Subject: Re: [PHP] What Do You Think?


> Hmm, let's not forget Sam Adams Triple Bock, if you can find it.  I've
> got a bottle that a friend of mine gave me for my birthday three years
> ago...  I'm still waiting for the perfect reason to drink it (my wife
> doesn't drink and I just don't like to drink alone).  Some of my best
> work has been done with the help of Triple Bock.
>
>
> On Fri, 2002-02-15 at 12:24, Miles Thompson wrote:
> > Friday afternoon -- one can tell!
> >
> > My votes are for Propellor Bitter or Garrison Red, both brewed here in
Hfx,
> > NS. Availability of the former more or less determines where we have our
> > weekly Linux get-togethers.
> >
> > It's now 4:30, so I'm raising one to you all - Miles
> >
> > At 11:56 AM 2/15/2002 -0800, Richard Crawford wrote:
> > >Tetley's is good stuff.
> > >
> > >Try Old Nick.  Only beer I've found that needs a chaser.
> > >
> > >
> > >On Fri, 2002-02-15 at 11:52, Erik Price wrote:
> > > >
> > > > On Friday, February 15, 2002, at 02:40  PM, Richard Crawford wrote:
> > > >
> > > > > Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in
your
> > > > > zip code, and you get a list of all of the pubs and bars in your
area
> > > > > that serve draft Guinness.  I could support a site like that, or
help
> > > > > build one.
> > > > >
> > > >
> > > > Guiness lovers have it easy.  My favorite beer, of all time, which I
> > > > love with a passion far greater than the zeal of any Guinness
drinker on
> > > > this list, is Tetley's English Ale.  I live for that stuff.
> > > >
> > > > Not only can I hardly find a place with Tetley's on tap, I can
hardly
> > > > find it in stores!
> > > >
> > > >
> > > > LOVE Tetley's.
> > > >
> > > >
> > > > Erik
> > > >
> > > >
> > > > 
> > > >
> > > > Erik Price
> > > > Web Developer Temp
> > > > Media Lab, H.H. Brown
> > > > [EMAIL PROTECTED]
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >--
> > >Sliante,
> > >Richard S. Crawford
> > >
> > >mailto:[EMAIL PROTECTED]  http://www.mossroot.com
> > >AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
> > >MSN:  [EMAIL PROTECTED]
> > >
> > >"It is only with the heart that we see rightly; what is essential is
> > >invisible to the eye."  --Antoine de Saint Exupery
> > >
> > >"Push the button, Max!"
> > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> Sliante,
> Richard S. Crawford
>
> mailto:[EMAIL PROTECTED] http://www.mossroot.com
> AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
> MSN:  [EMAIL PROTECTED]
>
> "It is only with the heart that we see rightly; what is essential is
> invisible to the eye."  --Antoine de Saint Exupery
>
> "Push the button, Max!"
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread Peter J. Schoenster

On 15 Feb 2002, at 14:43, Bendik Simonsen wrote:


> I have however, noticed one feature that ASP has that I have not found
> an equal for in PHP: the "application" object.
> 
> For those of you not familiar with ASP, the lowdown is this: The
> application object acts like a global session. You assign it variables
> and values like you would a session, but those variables are available
> to all instances and sessions. It is for example very useful to track
> different users at the same time, or to send messages from one session
> to another, or the likes.
> 
> Anything like this in PHP, or will I have to find a workaround for it,
> or *ick* do that little sniplet in ASP?

Well how does it work? Is it advertised as M$ magic in the class? 
Is http not stateless? 

I don't follow your description and I don't believe in magic.

Is it using cookies? If not what? It must be using something?

I bet it's using cookies. Sounds a lot like what you normally do with 
sessions. I don't follow the "send message from one session to 
another" ... is this not just normal course for sessions?  I'd like 
more explanation before I believe that this is any more than just a 
module.

Peter
http://www.readbrazil.com/
Answering Your Questions About Brazil

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




RE: [PHP] Novice question

2002-02-15 Thread Rick Emery

$element[0] = "-".$element[0];
$element[1] = "-".$element[1];
$element[2] = "-".$element[2];
$element[3] = "-".$element[3];

-Original Message-
From: brendan conroy [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Novice question


Hi,thanks for reading this!
This problem has got me beat! I cant figure out how to insert a minus sign 
into each element in an array of strings.
I keep getting the error that the first element in array_push has to be an 
array, no matter what method I've tried, and I cant think of any more!
Im trying to isolate terms in polynommials, which Ive stored in an array m[]

like this:


$m[0]="-3x_1^6/7-4x_2^3/5";
$m[1]="-4x_3^2/3-7x_4/7";


/*Each element in m has two terms, and I want to isolate these by exploding 
on the minus sign, thus giving me four elements, which then need to have a 
minus inserted into them.


I take one of the four elements in $ss, and for each character I push it 
into a temporary storage array $test, then I reverse $test so the term is in

the correct order, and then I insert the minus sign at the start. But 
funnily enough, there seems to be a flaw in my logic or code. What Ive 
written so far is*/

$ss=explode("-",$m);

for($cnt=1;$cnthttp://mobile.msn.com


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

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




[PHP] Novice question

2002-02-15 Thread brendan conroy

Hi,thanks for reading this!
This problem has got me beat! I cant figure out how to insert a minus sign 
into each element in an array of strings.
I keep getting the error that the first element in array_push has to be an 
array, no matter what method I've tried, and I cant think of any more!
Im trying to isolate terms in polynommials, which Ive stored in an array m[] 
like this:


$m[0]="-3x_1^6/7-4x_2^3/5";
$m[1]="-4x_3^2/3-7x_4/7";


/*Each element in m has two terms, and I want to isolate these by exploding 
on the minus sign, thus giving me four elements, which then need to have a 
minus inserted into them.


I take one of the four elements in $ss, and for each character I push it 
into a temporary storage array $test, then I reverse $test so the term is in 
the correct order, and then I insert the minus sign at the start. But 
funnily enough, there seems to be a flaw in my logic or code. What Ive 
written so far is*/

$ss=explode("-",$m);

for($cnt=1;$cnthttp://mobile.msn.com


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




Re: [PHP] What Do You Think?

2002-02-15 Thread Richard Crawford

Hmm, let's not forget Sam Adams Triple Bock, if you can find it.  I've
got a bottle that a friend of mine gave me for my birthday three years
ago...  I'm still waiting for the perfect reason to drink it (my wife
doesn't drink and I just don't like to drink alone).  Some of my best
work has been done with the help of Triple Bock.


On Fri, 2002-02-15 at 12:24, Miles Thompson wrote:
> Friday afternoon -- one can tell!
> 
> My votes are for Propellor Bitter or Garrison Red, both brewed here in Hfx, 
> NS. Availability of the former more or less determines where we have our 
> weekly Linux get-togethers.
> 
> It's now 4:30, so I'm raising one to you all - Miles
> 
> At 11:56 AM 2/15/2002 -0800, Richard Crawford wrote:
> >Tetley's is good stuff.
> >
> >Try Old Nick.  Only beer I've found that needs a chaser.
> >
> >
> >On Fri, 2002-02-15 at 11:52, Erik Price wrote:
> > >
> > > On Friday, February 15, 2002, at 02:40  PM, Richard Crawford wrote:
> > >
> > > > Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
> > > > zip code, and you get a list of all of the pubs and bars in your area
> > > > that serve draft Guinness.  I could support a site like that, or help
> > > > build one.
> > > >
> > >
> > > Guiness lovers have it easy.  My favorite beer, of all time, which I
> > > love with a passion far greater than the zeal of any Guinness drinker on
> > > this list, is Tetley's English Ale.  I live for that stuff.
> > >
> > > Not only can I hardly find a place with Tetley's on tap, I can hardly
> > > find it in stores!
> > >
> > >
> > > LOVE Tetley's.
> > >
> > >
> > > Erik
> > >
> > >
> > > 
> > >
> > > Erik Price
> > > Web Developer Temp
> > > Media Lab, H.H. Brown
> > > [EMAIL PROTECTED]
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >--
> >Sliante,
> >Richard S. Crawford
> >
> >mailto:[EMAIL PROTECTED]  http://www.mossroot.com
> >AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
> >MSN:  [EMAIL PROTECTED]
> >
> >"It is only with the heart that we see rightly; what is essential is
> >invisible to the eye."  --Antoine de Saint Exupery
> >
> >"Push the button, Max!"
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED]  http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is
invisible to the eye."  --Antoine de Saint Exupery

"Push the button, Max!"



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




Re: [PHP] What Do You Think?

2002-02-15 Thread Miles Thompson

Friday afternoon -- one can tell!

My votes are for Propellor Bitter or Garrison Red, both brewed here in Hfx, 
NS. Availability of the former more or less determines where we have our 
weekly Linux get-togethers.

It's now 4:30, so I'm raising one to you all - Miles

At 11:56 AM 2/15/2002 -0800, Richard Crawford wrote:
>Tetley's is good stuff.
>
>Try Old Nick.  Only beer I've found that needs a chaser.
>
>
>On Fri, 2002-02-15 at 11:52, Erik Price wrote:
> >
> > On Friday, February 15, 2002, at 02:40  PM, Richard Crawford wrote:
> >
> > > Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
> > > zip code, and you get a list of all of the pubs and bars in your area
> > > that serve draft Guinness.  I could support a site like that, or help
> > > build one.
> > >
> >
> > Guiness lovers have it easy.  My favorite beer, of all time, which I
> > love with a passion far greater than the zeal of any Guinness drinker on
> > this list, is Tetley's English Ale.  I live for that stuff.
> >
> > Not only can I hardly find a place with Tetley's on tap, I can hardly
> > find it in stores!
> >
> >
> > LOVE Tetley's.
> >
> >
> > Erik
> >
> >
> > 
> >
> > Erik Price
> > Web Developer Temp
> > Media Lab, H.H. Brown
> > [EMAIL PROTECTED]
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>--
>Sliante,
>Richard S. Crawford
>
>mailto:[EMAIL PROTECTED]  http://www.mossroot.com
>AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
>MSN:  [EMAIL PROTECTED]
>
>"It is only with the heart that we see rightly; what is essential is
>invisible to the eye."  --Antoine de Saint Exupery
>
>"Push the button, Max!"
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Re: scheduled tasks

2002-02-15 Thread Julio Nobrega Trabalhando

  If someone or something loads your page on this particular day, you can
have a:

if (date(...) == 'day') {
mail();
}

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Rodney Davis" <[EMAIL PROTECTED]> wrote in message
000701c1b65b$cdb19110$820fa8c0@BRAIN">news:000701c1b65b$cdb19110$820fa8c0@BRAIN...
> Is currently anyway of doing scheduled tasks with PHP (without using
> crontab)?  For example, using an email script to send out e-mail
> reminders every Monday or something like that?
>
> Thanks,
>
> Rodney
>



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




[PHP] scheduled tasks

2002-02-15 Thread Rodney Davis

Is currently anyway of doing scheduled tasks with PHP (without using
crontab)?  For example, using an email script to send out e-mail
reminders every Monday or something like that?
 
Thanks,
 
Rodney



Re: [PHP] What Do You Think?

2002-02-15 Thread Richard Crawford

Tetley's is good stuff.

Try Old Nick.  Only beer I've found that needs a chaser.


On Fri, 2002-02-15 at 11:52, Erik Price wrote:
> 
> On Friday, February 15, 2002, at 02:40  PM, Richard Crawford wrote:
> 
> > Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
> > zip code, and you get a list of all of the pubs and bars in your area
> > that serve draft Guinness.  I could support a site like that, or help
> > build one.
> >
> 
> Guiness lovers have it easy.  My favorite beer, of all time, which I 
> love with a passion far greater than the zeal of any Guinness drinker on 
> this list, is Tetley's English Ale.  I live for that stuff.
> 
> Not only can I hardly find a place with Tetley's on tap, I can hardly 
> find it in stores!
> 
> 
> LOVE Tetley's.
> 
> 
> Erik
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED]  http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is
invisible to the eye."  --Antoine de Saint Exupery

"Push the button, Max!"



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




Re: [PHP] What Do You Think?

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 02:40  PM, Richard Crawford wrote:

> Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
> zip code, and you get a list of all of the pubs and bars in your area
> that serve draft Guinness.  I could support a site like that, or help
> build one.
>

Guiness lovers have it easy.  My favorite beer, of all time, which I 
love with a passion far greater than the zeal of any Guinness drinker on 
this list, is Tetley's English Ale.  I live for that stuff.

Not only can I hardly find a place with Tetley's on tap, I can hardly 
find it in stores!


LOVE Tetley's.


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] What Do You Think?

2002-02-15 Thread Lars Torben Wilson

On Fri, 2002-02-15 at 11:40, Richard Crawford wrote:
> I'd be much more interested in microbreweries, though.  Most commercial
> breweries like Anheuser Busch and Coors don't brew beer.  Send some of
> their product to a lab, and the results will say something like, "Your
> horse has diabetes."
> 
> Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
> zip code, and you get a list of all of the pubs and bars in your area
> that serve draft Guinness.  I could support a site like that, or help
> build one.

I'd survive about a week after finding a site with that feature.

> On Fri, 2002-02-15 at 11:34, hugh danaher wrote:
> > I think you need to give us the link.  Also, I think a site showing where
> > all the commercial breweries are would be a nice project.
> > hugh
> > - Original Message -
> > From: "Arik Ashepa" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, February 15, 2002 10:07 AM
> > Subject: [PHP] What Do You Think?
> > 
> > 
> > > I hope you won't consider this as spam...
> > > A Php-Nuke powered web-site, I got a lot of themes, so you can view
> > > them, but first you need to sign up...
> > > anyway, give me your honest opinion.
> > >
> > > Sincerely
> > > Arik
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> -- 
> Sliante,
> Richard S. Crawford
> 
> mailto:[EMAIL PROTECTED]http://www.mossroot.com
> AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
> MSN:  [EMAIL PROTECTED]
> 
> "It is only with the heart that we see rightly; what is essential is
> invisible to the eye."  --Antoine de Saint Exupery
> 
> "Push the button, Max!"
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] What Do You Think?

2002-02-15 Thread Richard Crawford

I'd be much more interested in microbreweries, though.  Most commercial
breweries like Anheuser Busch and Coors don't brew beer.  Send some of
their product to a lab, and the results will say something like, "Your
horse has diabetes."

Hmm.  I'd also be interested in a "Guinness Finder" site.  Plug in your
zip code, and you get a list of all of the pubs and bars in your area
that serve draft Guinness.  I could support a site like that, or help
build one.


On Fri, 2002-02-15 at 11:34, hugh danaher wrote:
> I think you need to give us the link.  Also, I think a site showing where
> all the commercial breweries are would be a nice project.
> hugh
> - Original Message -
> From: "Arik Ashepa" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, February 15, 2002 10:07 AM
> Subject: [PHP] What Do You Think?
> 
> 
> > I hope you won't consider this as spam...
> > A Php-Nuke powered web-site, I got a lot of themes, so you can view
> > them, but first you need to sign up...
> > anyway, give me your honest opinion.
> >
> > Sincerely
> > Arik
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED]  http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is
invisible to the eye."  --Antoine de Saint Exupery

"Push the button, Max!"



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




Re: [PHP] The ASP "application" object in PHP?

2002-02-15 Thread Lars Torben Wilson

On Fri, 2002-02-15 at 05:43, Bendik Simonsen wrote:
> 
> I've recently started to learn ASP (*ducks the hurled flowerpots and
> vases*) because my school requires it, but of course I prefer PHP for
> my own scripting needs.
> 
> I have however, noticed one feature that ASP has that I have not found
> an equal for in PHP: the "application" object.
> 
> For those of you not familiar with ASP, the lowdown is this: The
> application object acts like a global session. You assign it variables
> and values like you would a session, but those variables are available
> to all instances and sessions. It is for example very useful to track
> different users at the same time, or to send messages from one session
> to another, or the likes.
> 
> Anything like this in PHP, or will I have to find a workaround for it,
> or *ick* do that little sniplet in ASP?
> 
> Thanks,
> Bendik Simonsen

There is a project called SRM to do just this sort of thing; you
can find out more at http://www.vl-srm.net. It's currently in beta,
but you might find it useful.


Torben

> ---
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] What Do You Think?

2002-02-15 Thread hugh danaher

I think you need to give us the link.  Also, I think a site showing where
all the commercial breweries are would be a nice project.
hugh
- Original Message -
From: "Arik Ashepa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 10:07 AM
Subject: [PHP] What Do You Think?


> I hope you won't consider this as spam...
> A Php-Nuke powered web-site, I got a lot of themes, so you can view
> them, but first you need to sign up...
> anyway, give me your honest opinion.
>
> Sincerely
> Arik
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Empty form

2002-02-15 Thread Steven Walker

Ben,

I've been dealing with this problem recently. The solution I found works 
great in my case... the data processing page is the same as the form 
page.

When the page is loaded it tests for post data. If no data is available 
(ie !isset($name)), then the form will be displayed. When the user 
submits the form, it actually submits it to the same page ($PHP_SELF). 
This way, no matter how many times the user makes mistakes, your page 
will faithfully redisplay the form until they get it right. You can even 
build in special formatting, such as highlighting missing or incorrect 
fields.

When the post data is verified, the page can display the next page by 
using an include() or header() redirect, and bypass the form.

I hope this helps.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

On Friday, February 15, 2002, at 12:24  AM, Ben Clumeck wrote:

> I am trying to have my form redirect back to my form, if the 'name' 
> field is
> not filled in or the submit button is not pushed.  Can someone tell me 
> what
> my problem is with the script below that I have in my header:
>
>  if(!isset($name)||($HTTP_POST_VARS[submit]))
> {
> header("Location: form.htm");
> }
> ?>
>
> Thanks,
>
> Ben
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] Re: Undefined class name

2002-02-15 Thread Julio Nobrega Trabalhando

ini_set('include_path', 'J:/Program Files/php/pear/');

require_once 'PEAR.php';
require_once 'DB.php';

ini_set(); should be the 'root' where all included files will be found. On
Windows you use / for paths or sometimes \\ (escaping a \).

  Anyway, the above method works on my machine.


--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Gary" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>   I am working at home today and have to use windows. I am trying to use
> PEAR  and keep getting an undefined class name for
> $db = DB::connect("mysql://$user:$pass@$host/$dname");
> my include for PEAR
> ini_set('include_path', 'J:\Program Files\php\pear\DB.php');
>
> where did I screw up.
>
> TIA
> Gary
>



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




Re: [PHP] Re: The ASP "application" object in PHP?

2002-02-15 Thread Michael Kimsal

Erik Price wrote:
> 
> On Friday, February 15, 2002, at 10:42  AM, Michael Kimsal wrote:
> 
>> Remember, ASP is not a language, and PHP is.  You're not programming 
>> "ASP" - you are most likely programming VBScript and your server 
>> environment gives that language access to server-specific functions
>> such as an application object.
> 
> 
> Where were you yesterday when I needed this kind of explanation!  :)
> 
> To explain the nature of my site and why I chose the route that I did, I 
> used a brief explanation of how the client-server-PHP system works.  
> But, with no experience with any other scripting language, I didn't have 
> much to justify why I chose PHP (the real reason is a matter of ethics ;).
> 
> I would love to have had your explanation of ASP's application object vs 
> PHP's lack of an "application object" when I wrote that.  I'm saving 
> this post.


I've been here all along!  :)

Seriously, we cover some of this in our class as well, and at our 
monthly PHP user group meetings.  I'm actually writing up a small paper
on this and other topics.  If you're interested in it, let me know.

I can also be reached at 734-480-9961 if you've questions that might
be faster talking about than emailing, and my AIM is 'mgkimsal' is 
you're on that and need some help.

That goes for anyone else on the list too...



Michael Kimsal
http://www.tapinternet.com/php
PHP Training Courses
734-480-9961




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




Re: [PHP] Re: The ASP "application" object in PHP?

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 10:42  AM, Michael Kimsal wrote:

> Remember, ASP is not a language, and PHP is.  You're not programming 
> "ASP" - you are most likely programming VBScript and your server 
> environment gives that language access to server-specific functions
> such as an application object.

Where were you yesterday when I needed this kind of explanation!  :)

To explain the nature of my site and why I chose the route that I did, I 
used a brief explanation of how the client-server-PHP system works.  
But, with no experience with any other scripting language, I didn't have 
much to justify why I chose PHP (the real reason is a matter of 
ethics ;).

I would love to have had your explanation of ASP's application object vs 
PHP's lack of an "application object" when I wrote that.  I'm saving 
this post.



Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] PHP Built-In Functionality (was: writing / reading from text files)

2002-02-15 Thread Rick Emery

Torben,

Just a side note:

I am continually amazed by the functionality that you and the rest of the
PHP development team put into PHP.  You have functions in PHP that would
take  a dozen lines for me to code in PERL and/or C.  Quite often, when I
think I've got to code some capability, I discover you have a function
already.

from those of us who have been pushing bits for a long time (30 years for
me), thanks...

rick

-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 12:53 PM
To: cyberskydive
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] writing / reading from text files


On Fri, 2002-02-15 at 10:36, cyberskydive wrote:
> thanks guys,
> 
> there is just one more question I dont see an answer for anywhere I've
> looked.
> 
> will fseek read past \n's and if so how do I move the filepointer to a
> newline, or should I just put all the data on one line? (not unreasonable
n
> this case)

fseek() neither knows nor cares what the contents of the byte it's 
pointing to are--it's not even an error to seek beyond the ends of a
file, so watch your bounds checking. :) 

fread() will read a line at a time, and update the file pointer as it 
goes, and is the usual way of reading a file line-by-line.

A lot of file work in PHP is done with the file() function, which reads 
a file all at once, placing each line into its own array element. This
makes line processing very, very easy--dunno if that will help you in
this situation, though.


Torben
 
> "Rick Emery" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > from the manual:
> >
> > int fseek (int fp, int offset [, int whence])
> > Sets the file position indicator for the file referenced by fp.The new
> > position, measured in bytes from the beginning of the file, is obtained
by
> > adding offset to the position specified by whence, whose values are
> defined
> > as follows:
> > SEEK_SET - Set position equal to offset bytes.
> > SEEK_CUR - Set position to current location plus offset.
> > SEEK_END - Set position to end-of-file plus offset.
> >
> > -Original Message-
> > From: cyberskydive [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 15, 2002 10:43 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] writing / reading from text files
> >
> >
> > lol- so I use fseek() to move the file pointer before where I need to
> > write/replace/update a value? Is there a parameter for fseek to tell it
to
> > move to a newline, or stop after a certain bytes?
> > "Rick Emery" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > fopen(), fwrite(),fseek(),fread(),fclose()
> > >
> > > -Original Message-
> > > From: cyberskydive [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 15, 2002 10:29 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] writing / reading from text files
> > >
> > >
> > > I need to write to a specific line in a text file, read from a line on
> > > demand, and update values at random, I want to do this all in the same
> > text
> > > file.
> > >
> > > what is the best way to go about this?
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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

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




Re: [PHP] writing / reading from text files

2002-02-15 Thread Lars Torben Wilson

On Fri, 2002-02-15 at 10:36, cyberskydive wrote:
> thanks guys,
> 
> there is just one more question I dont see an answer for anywhere I've
> looked.
> 
> will fseek read past \n's and if so how do I move the filepointer to a
> newline, or should I just put all the data on one line? (not unreasonable n
> this case)

fseek() neither knows nor cares what the contents of the byte it's 
pointing to are--it's not even an error to seek beyond the ends of a
file, so watch your bounds checking. :) 

fread() will read a line at a time, and update the file pointer as it 
goes, and is the usual way of reading a file line-by-line.

A lot of file work in PHP is done with the file() function, which reads 
a file all at once, placing each line into its own array element. This
makes line processing very, very easy--dunno if that will help you in
this situation, though.


Torben
 
> "Rick Emery" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > from the manual:
> >
> > int fseek (int fp, int offset [, int whence])
> > Sets the file position indicator for the file referenced by fp.The new
> > position, measured in bytes from the beginning of the file, is obtained by
> > adding offset to the position specified by whence, whose values are
> defined
> > as follows:
> > SEEK_SET - Set position equal to offset bytes.
> > SEEK_CUR - Set position to current location plus offset.
> > SEEK_END - Set position to end-of-file plus offset.
> >
> > -Original Message-
> > From: cyberskydive [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 15, 2002 10:43 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] writing / reading from text files
> >
> >
> > lol- so I use fseek() to move the file pointer before where I need to
> > write/replace/update a value? Is there a parameter for fseek to tell it to
> > move to a newline, or stop after a certain bytes?
> > "Rick Emery" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > fopen(), fwrite(),fseek(),fread(),fclose()
> > >
> > > -Original Message-
> > > From: cyberskydive [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, February 15, 2002 10:29 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] writing / reading from text files
> > >
> > >
> > > I need to write to a specific line in a text file, read from a line on
> > > demand, and update values at random, I want to do this all in the same
> > text
> > > file.
> > >
> > > what is the best way to go about this?
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 01:08  PM, Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

Actually, if you inspect the message I sent you (it's quoted below), 
you'll see that the specific part of your original post that I quoted is 
the part about how difficult it is to find information on them, and why 
no one seems to explain them.  I never intended to explain them to you, 
because I thought that someone else on the list had already taken care 
of that.

If you're still curious, the following document explains all about the 
filesystem used on Unix -- and is very readable (not some obscure 
technical document).  Please read it:

http://www.linuxdoc.org/HOWTO/Unix-and-Internet-Fundamentals-
HOWTO/disk-layout.html

This is part of Eric Raymond's "Unix and Internet Fundamentals" How-To 
document.  Even for people who really could care less about Unix, it 
explains pretty much how computers work in general.  I found it very 
informative when I first set about learning everything there is to know 
about computers.

http://www.linuxdoc.org/HOWTO/Unix-and-Internet-Fundamentals-HOWTO/


HTH,


Erik

>> -Original Message-
>> From: Erik Price [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, February 15, 2002 8:41 AM
>> To: Kevin Stone
>> Subject: Re: [PHP] Anyway to open a PHP file and view its code in the
>> browser?
>>
>>
>> On Thursday, February 14, 2002, at 05:44  PM, Kevin Stone wrote:
>>
>>> I did a net wide search on Symbolic links to learn what they are and
> how
>>> to use them.  Wouldn't you know everyone's talking about them but no
> one
>>> explains what they are or how to use them.
>>
>> It's because it's a very common thing in Unix, about as basic as copy
>> and paste is in Windows.  And Unix is the widest-used platform on the
>> web, so a lot of web people are familiar with it.  I'm not sure what
> the
>> Windows equivalent is.
>>
>> HTH,
>>
>>
>> - Erik
>>







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] writing / reading from text files

2002-02-15 Thread Rick Emery

from the manual:

fgets -- Gets line from file pointer
Description
string fgets (int fp, int length)

Returns a string of up to length - 1 bytes read from the file pointed to by
fp. Reading ends when length - 1 bytes have been read, on a newline (which
is included in the return value), or on EOF (whichever comes first). 
If an error occurs, returns FALSE. 
The file pointer must be valid, and must point to a file successfully opened
by fopen(), popen(), or fsockopen(). 

fputs -- Writes to a file pointer
Description
int fputs (int fp, string str [, int length])

fputs() is an alias to fwrite(), and is identical in every way. Note that
the length parameter is optional and if not specified the entire string will
be written

-Original Message-
From: cyberskydive [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 12:36 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] writing / reading from text files


thanks guys,

there is just one more question I dont see an answer for anywhere I've
looked.

will fseek read past \n's and if so how do I move the filepointer to a
newline, or should I just put all the data on one line? (not unreasonable n
this case)


"Rick Emery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> from the manual:
>
> int fseek (int fp, int offset [, int whence])
> Sets the file position indicator for the file referenced by fp.The new
> position, measured in bytes from the beginning of the file, is obtained by
> adding offset to the position specified by whence, whose values are
defined
> as follows:
> SEEK_SET - Set position equal to offset bytes.
> SEEK_CUR - Set position to current location plus offset.
> SEEK_END - Set position to end-of-file plus offset.
>
> -Original Message-
> From: cyberskydive [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 10:43 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] writing / reading from text files
>
>
> lol- so I use fseek() to move the file pointer before where I need to
> write/replace/update a value? Is there a parameter for fseek to tell it to
> move to a newline, or stop after a certain bytes?
> "Rick Emery" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > fopen(), fwrite(),fseek(),fread(),fclose()
> >
> > -Original Message-
> > From: cyberskydive [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 15, 2002 10:29 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] writing / reading from text files
> >
> >
> > I need to write to a specific line in a text file, read from a line on
> > demand, and update values at random, I want to do this all in the same
> text
> > file.
> >
> > what is the best way to go about this?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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

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




Re: [PHP] good practice

2002-02-15 Thread Peter J. Schoenster

On 15 Feb 2002, at 17:04, Philip J. Newman wrote:

> WHo really cares, if it works it don't matter what they call it.

In response to:

> > > On that same topic, *why* do people name files with both .inc and
> > > .php? 
> > >   Your .inc file has PHP code in it, right?  Why not just call it
> > >   .php and
> > > spare the server reconfiguration.  If knowing which files are

> > Heck, I've seen inc,cls,html,php3,php4

In the last 7 years I've worked for 4 companies in role of web 
developer.  I've also done some consulting here and there. I've had 
to work with a lot of "applications", using that term VERY loosely, 
written by other people. I've even been suprised by some of my 
older code :)

In Perl no self-respecting programmer writes anything that takes 
more than 5 minutes without using 'strict'.  You can write Perl in 
stream of consciousnsess and you can use OO.  If no one is every 
going to look at your code again, do it however you want.  But if 
there is that odd chance that your script might become an 
application or at least evolve then it behooves you to do more than 
just make sure it works.

Spolsky has an interesting, somewhat related, article here:

http://www.joelonsoftware.com/articles/fog000348.html

I'm certainly not without sin myself. It's all to easy to just banging 
away at the keyboard.  If you are going to do anything that lasts 
then consider thinking about it before doing it.

I had a case where a programmer wrote a script to be run by cron 
for one reason or another. He needed to use a lot of code written in 
a cgi script but he put the cron script in his root directory. Rather 
than include that script properly (should have been a module) he 
just copied that script to the root directory. It worked. But gosh ... 
when we evolved that cgi script we did not know that there was 
another copy out there. It was a real fun bug to track down.  The 
database was getting screwed up from that old script but no one 
recalled that this had been done and that old script was doing 
funky things (now that "it" had evolved).

Peter


http://www.readbrazil.com/
Answering Your Questions About Brazil

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




[PHP] Re: s.osborne, are you out there?

2002-02-15 Thread Gary

nope, I am getting it too.

Gary

Erik Price wrote:

> 
> 
> Am I the only one who gets the following message each time I post to 
> php-general?  Is there a moderator who could remove this subscriber?
> 
> Begin forwarded message:
> 
>> From: "Postmaster" 
>> To: [EMAIL PROTECTED]
>> Subject: Error delivering message to: [EMAIL PROTECTED]!
>> Received: from epimetheus.hosting4u.net ([209.15.2.70]) by 
>> exchange1.hhbrown.com with SMTP (Microsoft Exchange Internet Mail 
>> Service Version 5.5.2653.13) id DPC7L2V6; Fri, 15 Feb 2002 13:30:42 -0500
>> Received: (qmail 7276 invoked from network); 15 Feb 2002 18:31:28 -
>> Received: from norma.hosting4u.net (HELO rejection.noreply) 
>> (209.15.2.65) by mail-gate.hosting4u.net with SMTP; 15 Feb 2002 
>> 18:31:28 -
>> Return-Path: [EMAIL PROTECTED]
>>
>> Your message was not delivered for the following reason:
>>
>> E-mail Account: s.osborne is over the limit of 31457280 bytes.
>>
>> Automated Postmaster
>>
> 
> 
> 
> Erik
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 


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




Re: [PHP] writing / reading from text files

2002-02-15 Thread cyberskydive

thanks guys,

there is just one more question I dont see an answer for anywhere I've
looked.

will fseek read past \n's and if so how do I move the filepointer to a
newline, or should I just put all the data on one line? (not unreasonable n
this case)


"Rick Emery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> from the manual:
>
> int fseek (int fp, int offset [, int whence])
> Sets the file position indicator for the file referenced by fp.The new
> position, measured in bytes from the beginning of the file, is obtained by
> adding offset to the position specified by whence, whose values are
defined
> as follows:
> SEEK_SET - Set position equal to offset bytes.
> SEEK_CUR - Set position to current location plus offset.
> SEEK_END - Set position to end-of-file plus offset.
>
> -Original Message-
> From: cyberskydive [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 10:43 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] writing / reading from text files
>
>
> lol- so I use fseek() to move the file pointer before where I need to
> write/replace/update a value? Is there a parameter for fseek to tell it to
> move to a newline, or stop after a certain bytes?
> "Rick Emery" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > fopen(), fwrite(),fseek(),fread(),fclose()
> >
> > -Original Message-
> > From: cyberskydive [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 15, 2002 10:29 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] writing / reading from text files
> >
> >
> > I need to write to a specific line in a text file, read from a line on
> > demand, and update values at random, I want to do this all in the same
> text
> > file.
> >
> > what is the best way to go about this?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] s.osborne, are you out there?

2002-02-15 Thread Erik Price



Am I the only one who gets the following message each time I post to 
php-general?  Is there a moderator who could remove this subscriber?

Begin forwarded message:

> From: "Postmaster" 
> To: [EMAIL PROTECTED]
> Subject: Error delivering message to: [EMAIL PROTECTED]!
> Received: from epimetheus.hosting4u.net ([209.15.2.70]) by 
> exchange1.hhbrown.com with SMTP (Microsoft Exchange Internet Mail 
> Service Version 5.5.2653.13) id DPC7L2V6; Fri, 15 Feb 2002 13:30:42 
> -0500
> Received: (qmail 7276 invoked from network); 15 Feb 2002 18:31:28 -
> Received: from norma.hosting4u.net (HELO rejection.noreply) 
> (209.15.2.65) by mail-gate.hosting4u.net with SMTP; 15 Feb 2002 
> 18:31:28 -
> Return-Path: [EMAIL PROTECTED]
>
> Your message was not delivered for the following reason:
>
> E-mail Account: s.osborne is over the limit of 31457280 bytes.
>
> Automated Postmaster
>



Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] good practice

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 12:35  PM, J Smith wrote:

> The only real security problem is that if the file isn't parsed and 
> it's in
> the web server's document path, somebody can just go to
> http://www.example.com/include/config.inc and see the entire contents in
> plaintext -- passwords and config options galore. However, sticking 
> those
> .inc files outside of the web server's document path or otherwise 
> cutting
> off access to those files makes things a lot safer.
>
> When I met Rasmus at a seminar a few months ago, he mentioned that he 
> kind
> of started the whole ".inc" thing with included files, but he was
> astonished how so many people followed his convention without realizing
> that somebody could look into the .inc file so easily. When he was going
> it, he always explicitly denied access to those files through a 
> directive in Apache's httpd.conf file, which nobody else bothered to do.
>
> So if you want people to view those files and all of the code in them, 
> go
> nuts. Otherwise, you'd better somehow cut off access to them. 
> (Personally,
> I use an include directory and use a .htaccess file to limit access.)

Exactly.  So we have two problems:

1) we don't want people to be able to request 
'domain.com/includes/file.inc'
and see the text output
2) we don't want the parser to ever execute code out of context, ie 
serve a parsed version of 'domain.com/includes/file.inc' without 
including it into its parent.

So to tackle the first problem we set a directive in httpd.conf that 
denies any requests for any page that ends in '.inc' (I suppose a 
.htaccess file could work as well but I don't use them), and to tackle 
the second problem, we don't add '.inc' to our list of file types that 
should be parsed in the "AddType" line.

Here's the directive:


Order allow,deny
Deny from all


If you look under the archives, you will find the thread where I was the 
one who thought that parsing .inc was a good idea, and someone explained 
this very subject to -me-.  :)
(I think it was Mike Cullerton)


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Undefined class name

2002-02-15 Thread Gary

Hi all,
  I am working at home today and have to use windows. I am trying to use 
PEAR  and keep getting an undefined class name for
$db = DB::connect("mysql://$user:$pass@$host/$dname");
my include for PEAR
ini_set('include_path', 'J:\Program Files\php\pear\DB.php');

where did I screw up.

TIA
Gary


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




Re: [PHP] Symbolic links...

2002-02-15 Thread Ashley M. Kirchner

Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

This is probably a better explanation:

http://kb.indiana.edu/data/abbe.html


--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




Re: [PHP] problem with working with dates

2002-02-15 Thread DL Neil

Jacob,

> I'm sorry to bother the newsgroup with this, but I've been racking my
> brain on it for a few hours, and tried all the documentation, and
> realize it's a coding problem that will take someone about 3 seconds to
> figure out the error in.  I have this code:

=don't be sorry, these 'blind spots' are the strength of the group.

=check out the differences between =, the assignment operator; and == the logical 
comparision operator; and ===
the logical type and comparison operator. You've used the first in the IF, when you 
want the second!

=Regards,
=dn


> 
> $current_month = date (m);
> $current_year = date (Y);
>
>
> if("$current_month = 1")
>{
> $previous_month = 12;
>  $previous_year = $current_year - 1;
>}
>
> else
>  {
>  $previous_month = $current_month - 1;
>  $previous_year = $current_year;
>  }
>  print("");
>  print(" 
>href=\"inquiry_reports.php?search=search&new_year=$previous_year&new_month=$previous_month\">Previous
> Month");
>  print(" 
>href=\"inquiry_reports.php?search=search&new_year=$current_year&new_month=$current_month\">Current
> Month");
>  print("");
>  ?>
>
> but for some reason, no matter what the month, the first if statement
> (if current_month = 1) is seen as true and executes...  any suggestions?
>
> Cheers
>
> Jake Walker
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




RE: [PHP] problem with working with dates

2002-02-15 Thread SHEETS,JASON (Non-HP-Boise,ex1)

Change it to == 1

if("$current_month == 1")

Jason

-Original Message-
From: Jacob Walker [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] problem with working with dates


I'm sorry to bother the newsgroup with this, but I've been racking my
brain on it for a few hours, and tried all the documentation, and
realize it's a coding problem that will take someone about 3 seconds to
figure out the error in.  I have this code:

");
 print("Previous
Month");
 print("Current
Month");
 print("");
 ?>

but for some reason, no matter what the month, the first if statement
(if current_month = 1) is seen as true and executes...  any suggestions?

Cheers

Jake Walker
[EMAIL PROTECTED]


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

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




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Ashley M. Kirchner

Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

I just realized that URL talks about backing up symbolic links, as
opposed to doing an indepth explanation of what they are.  Never the less,
at the top it does say what a symlink is:

"A UNIX symbolic link is a file that contains a pointer to another file
or directory."

One could say, it's like creating a Shortcut on a Win9x (and up)
platform.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Ashley M. Kirchner

Kevin Stone wrote:

> Thanks for proving the point.  It's like I said.  No one is willing to
> explain what symbolic links are.  -Kevin

You just didn't search well enough:

http://pucc.princeton.edu/~clients/symlink.readme

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Kevin Stone

Thanks for proving the point.  It's like I said.  No one is willing to
explain what symbolic links are.  -Kevin

> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 8:41 AM
> To: Kevin Stone
> Subject: Re: [PHP] Anyway to open a PHP file and view its code in the
> browser?
> 
> 
> On Thursday, February 14, 2002, at 05:44  PM, Kevin Stone wrote:
> 
> > I did a net wide search on Symbolic links to learn what they are and
how
> > to use them.  Wouldn't you know everyone's talking about them but no
one
> > explains what they are or how to use them.
> 
> It's because it's a very common thing in Unix, about as basic as copy
> and paste is in Windows.  And Unix is the widest-used platform on the
> web, so a lot of web people are familiar with it.  I'm not sure what
the
> Windows equivalent is.
> 
> HTH,
> 
> 
> - Erik
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]




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




[PHP] What Do You Think?

2002-02-15 Thread Arik Ashepa

I hope you won't consider this as spam...
A Php-Nuke powered web-site, I got a lot of themes, so you can view
them, but first you need to sign up...
anyway, give me your honest opinion.

Sincerely
Arik


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




Re: [PHP] good practice

2002-02-15 Thread Keith V. (Vance Consulting LLC)

On 15 Feb 2002 at 10:50, Michael Kimsal wrote:

> Erik Price wrote:
> > 
> > On Thursday, February 14, 2002, at 04:40  PM, Michael Kimsal wrote:
> > 
> >> On that same topic, *why* do people name files with both .inc and 
> >> .php?  Your .inc file has PHP code in it, right?  Why not just call it 
> >> .php and
> >> spare the server reconfiguration.  If knowing which files are 
> >> "include" files (long time since I've made that distinction!) just 
> >> prepend
> >> them with inc_ or put them all in an includes/ directory.
> > 
> > 
> > If you are including a file into another file with PHP's 'include()' 
> > function, it doesn't matter what the extension is.  You don't even need 
> > an extension.  Apache doesn't even see this as a separate file, it 
> > thinks of it all as one big file with the name of whichever file is 
> > doing the including.
> > 
> > Giving the .inc suffix is a nice way to keep your code organized.  Also, 
> > I keep my .incs in a separate directory.
> > 
> > Not to mention I have a directive in my server's conf file that 
> > specifically prevents it from serving any file with the extension '.inc'.
> > 
> 
> 
> That's great for you that you have that luxury, as do I, but not 
> everyone has access to their server's conf file.
> 
Yeah, you may not be able to access the server's conf file but you can still put your 
include files outside the server's web space and name them whatever you want. 
Put something like this in your scripts if you can't modify the php.ini or access the 
server's conf directory.
ini_set("include_path", "/path_to_your_include_directory");

Regardless of the extension you use, putting them outside the server's web 
accessible area is the best way to protect them. I just use .php and put them in 
subdirectories to differentiate what site they are for or what their specific purpose 
is.

> 'Organizing' would be better served with the separate directory and/or
> a prepend, because most directory structures are sorted by name by default.
> 
> I replied privately to someone on this already, but I'll post it here as 
> well.
> 
> The majority of people learning PHP do so by examining other code, and a 
> great many do so in shared hosting environments where they can't control 
> the server config files.  Furthermore, because they are new they don't 
> understand the security implications of .inc or other extensions, and
> blindly copy code and run it without knowing they are exposed 
> security-wise.  That's my primary beef with .inc and other non- ".php"
> extensions.
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


K E I T H  V A N C E
Web Developer, IT Professional
http://www.vanceconsulting.net
[EMAIL PROTECTED]

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




[PHP] Re: problem with working with dates

2002-02-15 Thread Hugh Bothwell

> but for some reason, no matter what the month, the first if statement
> (if current_month = 1) is seen as true and executes...  any suggestions?

Try using 'equivalence-equals' (==) instead of 'assignment-equals' (=).



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




RE: [PHP] good practice

2002-02-15 Thread Chris Lott

Well, .inc seems to be so common as to be a standard practice. At the very
least, the real issue is education on the need to protect included files
anyway so that they can't be accessed directly.

c
--
Chris Lott
http://www.chrislott.org/

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




[PHP] problem with working with dates

2002-02-15 Thread Jacob Walker

I'm sorry to bother the newsgroup with this, but I've been racking my
brain on it for a few hours, and tried all the documentation, and
realize it's a coding problem that will take someone about 3 seconds to
figure out the error in.  I have this code:

");
 print("Previous
Month");
 print("Current
Month");
 print("");
 ?>

but for some reason, no matter what the month, the first if statement
(if current_month = 1) is seen as true and executes...  any suggestions?

Cheers

Jake Walker
[EMAIL PROTECTED]


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




Re: [PHP] fopen

2002-02-15 Thread Lars Torben Wilson

On Fri, 2002-02-15 at 08:14, Erik Price wrote:
> 
> On Friday, February 15, 2002, at 04:53  AM, Lars Torben Wilson wrote:
> 
> > The problem with that is that you have a time lag (perhaps only
> > in microseconds, but it still is a problem) while you're writing
> > the new data to the file. If some other process--say, another
> > invocation of the same script--tries to read from that file while
> > you're still overwriting it--you've got problems, since it'll find
> > only a partially-written file.
> >
> > That's called a 'race condition'. The other method avoids that,
> > since while you're writing data to the temp file, processes just
> > keep using the original. Once you're done, the rename happens
> > atomically, preventing the race condition.
> 
> What method do you use to get rid of the temporary file once you've used 
> it?  It appears, from reading the man page, that the file is still 
> present in the directory specified in tempname().
> 
> 
> Erik  <-- doesn't know much about working with files in PHP

unlink(), or you could use tmpfile() instead.


-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Re: [imp] CRAM-MD5 problem with Horde2/IMP3 and PHP4.1.1 ..

2002-02-15 Thread Mark Crispin

I know of no reason in c-client that would cause this.

The log messages indicate either some imapd other than UW, or a modified
version of UW imapd.  Either way, I can't speak for that imapd's performance.
I can only speak for the performance of unmodified UW imapd directly from UW.


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




Re: [PHP] good practice

2002-02-15 Thread J Smith


The only real security problem is that if the file isn't parsed and it's in 
the web server's document path, somebody can just go to 
http://www.example.com/include/config.inc and see the entire contents in 
plaintext -- passwords and config options galore. However, sticking those 
.inc files outside of the web server's document path or otherwise cutting 
off access to those files makes things a lot safer. 

When I met Rasmus at a seminar a few months ago, he mentioned that he kind 
of started the whole ".inc" thing with included files, but he was 
astonished how so many people followed his convention without realizing 
that somebody could look into the .inc file so easily. When he was going 
it, he always explicitly denied access to those files through a  
directive in Apache's httpd.conf file, which nobody else bothered to do.

So if you want people to view those files and all of the code in them, go 
nuts. Otherwise, you'd better somehow cut off access to them. (Personally, 
I use an include directory and use a .htaccess file to limit access.)

J



Erik Price wrote:

> 
> On Friday, February 15, 2002, at 10:50  AM, Michael Kimsal wrote:
> 
> Maybe I don't understand the security implications of .inc -- I thought
> that it was perfectly safe.  Since my php.ini is not configured to parse
> files with '.inc' extensions, I thought that I was better off using a
> separate extension than '.php': so that the code cannot be "executed out
> of context".  I got this idea from a post by Rasmus Lerdorf on this very
> list, only a month ago.
> 
> Erik
> 


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




[PHP] OOP: Polymorphism question

2002-02-15 Thread Richard Fox

I am new to PHP but 10 years in C++

One of the cool/powerful things you can do in C++ is the following:

class DrawDialog {
public:
...
   virtual Draw(); // implementation draws a plain dialog box
   };

class DrawStyleDialog : public DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws better dialog based on some parameters
   };

Somewhere in my code I have a function like:

void ShowGUI( DrawDialog& dd ) {
   dd.Draw();
   } 

ShowGUI can be called with any object that is derived from DrawDialog, obviously. Only 
code that calls ShowGUI must be changed when a new implementation of DrawDialog is 
used. This feature of C++ to have a base class pointer (or reference) be able to 
access derived class functionality is not something I've seen in any PHP 
documentation. Does it exist, and if not is there a workaround for this highly 
desirable feature?

TIA

Rich

PS Can anyone point me to the most comprehensive OOP documentation for PHP?



[PHP] Polymorphism question

2002-02-15 Thread Richard Fox



I am new to PHP but 10 years in C++

One of the cool/powerful things you can do in C++ is the following:

class DrawDialog {
public:
...
   virtual Draw(); // implementation draws a plain dialog box
   };

class DrawStyleDialog : public DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws better dialog based on some
parameters
   };

Somewhere in my code I have a function like:

void ShowGUI( DrawDialog& dd ) {
   dd.Draw();
   }

ShowGUI can be called with any object that is derived from DrawDialog,
obviously. Only code that calls ShowGUI must be changed when a new
implementation of DrawDialog is used. This feature of C++ to have a base
class pointer (or reference) be able to access derived class functionality
is not something I've seen in any PHP documentation. Does it exist, and if
not is there a workaround for this highly desirable feature?

TIA

Rich

PS Can anyone point me to the most comprehensive OOP documentation for PHP?

--


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




Re: [PHP] good practice

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 10:50  AM, Michael Kimsal wrote:

> That's great for you that you have that luxury, as do I, but not 
> everyone has access to their server's conf file.

Whether or not you want to call administrating a web server a luxury is 
debatable -- I'm learning new things about it all the time.

> 'Organizing' would be better served with the separate directory and/or
> a prepend, because most directory structures are sorted by name by 
> default.

On using a separate directory, that's agreed.  As a matter of personal 
aesthetics, I don't care to clutter a single directory with many many 
files (as prefixing filenames could lead to).

> The majority of people learning PHP do so by examining other code, and 
> a great many do so in shared hosting environments where they can't 
> control the server config files.

It is an extreme misconception that this is a luxury that few have, in 
fact I would go so far as to say that "shared hosting" is a luxury more 
than anything else.  If all you're doing is learning (and I assume 
that's what you're  referring to in your post), then there's absolutely 
no reason to pay someone else to host your content.

Linux and Apache are 100% free of charge.  MySQL is also 100% free of 
charge, for those who wish to use it.  I understand that a web hosting 
provider can provide more stability for public sites than a home 
connection, so for actually publising content it makes sense to go with 
a provider.  But for development, you don't even need a phone line -- 
nothing could be easier than accessing a directory through 127.0.0.1, 
you don't even need to ftp/scp your files to a remote server.

In fact, for development, you're better off if you -don't- put your 
server on the net, for security reasons.  It allows you to experiment 
without fear that someone's going to try to root your box.

A few months back I decided to learn how to administrate a web site, use 
a SQL database, and develop with a scripting language, to add to my 
limited knowledge of HTML.  I'm doing it with an old Pentium II with 
only 256 MB of RAM.  There's no reason a 386 or 68k (pre-PowerPC) 
couldn't do the same thing.  Linux, Apache, MySQL, PHP -- none of them 
cost me anything more than the time it takes to learn them, which pays 
itself back in dividends.  I still don't know everything, and I'm sure 
that a competent cracker -could- root my box.  But I'm learning all the 
time, and mentioning things like Apache directives (which are discussed 
all the time on this list) doesn't hurt anyone.

> Furthermore, because they are new they don't understand the security 
> implications of .inc or other extensions, and
> blindly copy code and run it without knowing they are exposed 
> security-wise.  That's my primary beef with .inc and other non- ".php"
> extensions.

Maybe I don't understand the security implications of .inc -- I thought 
that it was perfectly safe.  Since my php.ini is not configured to parse 
files with '.inc' extensions, I thought that I was better off using a 
separate extension than '.php': so that the code cannot be "executed out 
of context".  I got this idea from a post by Rasmus Lerdorf on this very 
list, only a month ago.

Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Dynamic Date Select and SQL

2002-02-15 Thread Simon H

Thanks Rick

But the SQL needs to work with MS Access AND MySQL through the PEAR DB
Abstraction layer... I'm not saying it wont work with Access because I don't
know yet...maybe it will, but there looks to be functions in there that may
be MySQL specific.

If I can do something like this it would be great...what I would like is to
get the earliest month & year from the DB table then fill in the gaps
between then and now, month by month to populate the SELECT BOX Options.

Thanks

Simon H

> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]]
> Sent: 15 February 2002 16:06
> To: 'Simon H'; PHP General
> Subject: RE: [PHP] Dynamic Date Select and SQL
> Sensitivity: Confidential
>
>
> If I understand your question, you are looking for the MYSQL sql
> statement.
> Based upon your info, I've found something like this example:
>
> mysql> describe a;
> ++--+--+-+-+---+
> | Field  | Type | Null | Key | Default | Extra |
> ++--+--+-+-+---+
> | mydate | datetime | YES  | | NULL|   |
> ++--+--+-+-+---+
> 1 row in set (0.04 sec)
>
> mysql> select * from a;
> +-+
> | mydate  |
> +-+
> | 2002-01-01 12:00:00 |
> | 2002-02-01 12:00:00 |
> | 2002-03-01 12:00:00 |
> | 2002-04-01 12:00:00 |
> | 2002-05-01 12:00:00 |
> | 2002-06-01 12:00:00 |
> | 2002-07-01 12:00:00 |
> +-+
> 7 rows in set (0.00 sec)
>
> mysql> select year(mydate)*100+month(mydate) as sel,mydate,
> concat(left(monthname(mydate),3),' ',year(mydate)) as monyr
> from a where mydate < now()+03;
> ++-+--+
> | sel| mydate  | monyr|
> ++-+--+
> | 200201 | 2002-01-01 12:00:00 | Jan 2002 |
> | 200202 | 2002-02-01 12:00:00 | Feb 2002 |
> | 200203 | 2002-03-01 12:00:00 | Mar 2002 |
> | 200204 | 2002-04-01 12:00:00 | Apr 2002 |
> | 200205 | 2002-05-01 12:00:00 | May 2002 |
> ++-+--+
> 5 rows in set (0.05 sec)
>
> -Original Message-
> From: Simon H [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 6:32 AM
> To: PHP General
> Subject: [PHP] Dynamic Date Select and SQL
> Sensitivity: Confidential
>
>
> I have a problem I hope someone can help me with...
>
> Firstly I have an SQL Query with a "WHERE dateMonthAndYear = $month1"
>
> Already this shows part of what I'm trying to do.  The date
> format in the DB
> is "-MM-DD HH:MM:SS".
>
> Now I need to dynamically generate a pulldown of months...
>
> The range of months in the pulldown are historical, so the last
> month would
> be the current month (which should also be the SELECTED option).
> The first
> month would be a fixed date, say Jan 2002.
>
> The value of the options would probably be like so:
>
> // <<---  Jump Menu
>   Feb
> 2002
> // <<---  Current Month (SELECTED)
>value="$PHP_SELF?month1=$first_month">$first_month_text
> // <<---  First Month in range
>value="$PHP_SELF?month1=$subsequent_month1">$subsequent_month1_tex
> t
> // <<---  Other months in range
>   .
> // <<---  Other months in range
>   Feb
> 2002
> // <<---  Current Month
>   ALL
> // <<---  Empty value
> will show all
> 
>
> I guess the question is, how do I dynamically create the select, based on
> the above spec (or make $first_month, the first month available in the SQL
> Query i.e. get the earliest month from the Query), then do the
> select using
> ONLY the month and year information.
>
> I can do most of the bits in between, just do know how to do the dynamic
> select for this particular application, or get the date into the SQL where
> ONLY the month and year are relevant.
>
> I am using Pear DB and need this to work on MySQL and Access
> through Pear so
> the SQL needs to be quite standard.  The above code is not syntaxed
> properlyjust meant for readability.
>
> Any ideas are much appreciated as I don't even know where to
> start with this
> one.
>
> Thanks
>
> Simon H
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




RE: [PHP] writing / reading from text files

2002-02-15 Thread Rick Emery

from the manual:

int fseek (int fp, int offset [, int whence])
Sets the file position indicator for the file referenced by fp.The new
position, measured in bytes from the beginning of the file, is obtained by
adding offset to the position specified by whence, whose values are defined
as follows: 
SEEK_SET - Set position equal to offset bytes. 
SEEK_CUR - Set position to current location plus offset. 
SEEK_END - Set position to end-of-file plus offset. 

-Original Message-
From: cyberskydive [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 10:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] writing / reading from text files


lol- so I use fseek() to move the file pointer before where I need to
write/replace/update a value? Is there a parameter for fseek to tell it to
move to a newline, or stop after a certain bytes?
"Rick Emery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> fopen(), fwrite(),fseek(),fread(),fclose()
>
> -Original Message-
> From: cyberskydive [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 10:29 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] writing / reading from text files
>
>
> I need to write to a specific line in a text file, read from a line on
> demand, and update values at random, I want to do this all in the same
text
> file.
>
> what is the best way to go about this?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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

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




Re: [PHP] writing / reading from text files

2002-02-15 Thread cyberskydive

lol- so I use fseek() to move the file pointer before where I need to
write/replace/update a value? Is there a parameter for fseek to tell it to
move to a newline, or stop after a certain bytes?
"Rick Emery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> fopen(), fwrite(),fseek(),fread(),fclose()
>
> -Original Message-
> From: cyberskydive [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 10:29 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] writing / reading from text files
>
>
> I need to write to a specific line in a text file, read from a line on
> demand, and update values at random, I want to do this all in the same
text
> file.
>
> what is the best way to go about this?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] writing / reading from text files

2002-02-15 Thread Rick Emery

fopen(), fwrite(),fseek(),fread(),fclose()

-Original Message-
From: cyberskydive [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 10:29 AM
To: [EMAIL PROTECTED]
Subject: [PHP] writing / reading from text files


I need to write to a specific line in a text file, read from a line on
demand, and update values at random, I want to do this all in the same text
file.

what is the best way to go about this?



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

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




RE: [PHP] Polymorphism question

2002-02-15 Thread Rick Emery

I've also done C and C++ since the 80's.

My experience with virtual, is that there is no base implementation for a
function.  Rather, the function is expected to be defined in the derived
class.

The inheritance you describe would have a base implementation (no virtual
declaration), which could be over-ridden in the derived class.

Yes, PHP does have the latter capability.

-Original Message-
From: Richard Fox [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 9:01 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Polymorphism question




I am new to PHP but 10 years in C++

One of the cool/powerful things you can do in C++ is the following:

class DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws a vanilla dialog box
   };

class DrawStyleDialog : public DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws better dialog
   };

Somewhere in my code I have a function like:

void ShowGUI( DrawPlainDialog& dd ) {
   dd.Draw();
   }

ShowGUI can be called with any object that is derived from DrawPlainDialog,
obviously. Only code that calls ShowGUI must be changed when a new
implementation of DrawPlainDialog is used. This feature of C++ to have a
base class pointer (or reference) be able to access derived class
functionality is not something I've seen in any PHP documentation. Does it
exist, and if not is there a workaround for this highly desirable feature?

TIA

Rich

PS Can anyone point me to the most comprehensive OOP documentation for PHP?

--




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

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




[PHP] Speed problems

2002-02-15 Thread Eric Katchan

Hi everyone, I am having a small speed problem and I think I may be on
track to solve it.  i need some input.

I have a search script which either returns results or not.

if No results I use a header location redirect to an insert form

if one result I redirect to part 2

else if many I display the list of results.

It appears as if the redirect takes alot of time before it can display
the redirected page

if results are found and I loop thropugh them and display results, it is
very fast.

php 4.02
With Postgresql db version 7.x

Anyone have any ideas?


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




[PHP] writing / reading from text files

2002-02-15 Thread cyberskydive

I need to write to a specific line in a text file, read from a line on
demand, and update values at random, I want to do this all in the same text
file.

what is the best way to go about this?



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




Re: [PHP] fopen

2002-02-15 Thread Erik Price


On Friday, February 15, 2002, at 04:53  AM, Lars Torben Wilson wrote:

> The problem with that is that you have a time lag (perhaps only
> in microseconds, but it still is a problem) while you're writing
> the new data to the file. If some other process--say, another
> invocation of the same script--tries to read from that file while
> you're still overwriting it--you've got problems, since it'll find
> only a partially-written file.
>
> That's called a 'race condition'. The other method avoids that,
> since while you're writing data to the temp file, processes just
> keep using the original. Once you're done, the rename happens
> atomically, preventing the race condition.

What method do you use to get rid of the temporary file once you've used 
it?  It appears, from reading the man page, that the file is still 
present in the directory specified in tempname().


Erik  <-- doesn't know much about working with files in PHP





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Dynamic Date Select and SQL

2002-02-15 Thread Rick Emery

If I understand your question, you are looking for the MYSQL sql statement.
Based upon your info, I've found something like this example:

mysql> describe a;
++--+--+-+-+---+
| Field  | Type | Null | Key | Default | Extra |
++--+--+-+-+---+
| mydate | datetime | YES  | | NULL|   |
++--+--+-+-+---+
1 row in set (0.04 sec)

mysql> select * from a;
+-+
| mydate  |
+-+
| 2002-01-01 12:00:00 |
| 2002-02-01 12:00:00 |
| 2002-03-01 12:00:00 |
| 2002-04-01 12:00:00 |
| 2002-05-01 12:00:00 |
| 2002-06-01 12:00:00 |
| 2002-07-01 12:00:00 |
+-+
7 rows in set (0.00 sec)

mysql> select year(mydate)*100+month(mydate) as sel,mydate, 
concat(left(monthname(mydate),3),' ',year(mydate)) as monyr 
from a where mydate < now()+03;
++-+--+
| sel| mydate  | monyr|
++-+--+
| 200201 | 2002-01-01 12:00:00 | Jan 2002 |
| 200202 | 2002-02-01 12:00:00 | Feb 2002 |
| 200203 | 2002-03-01 12:00:00 | Mar 2002 |
| 200204 | 2002-04-01 12:00:00 | Apr 2002 |
| 200205 | 2002-05-01 12:00:00 | May 2002 |
++-+--+
5 rows in set (0.05 sec)

-Original Message-
From: Simon H [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 6:32 AM
To: PHP General
Subject: [PHP] Dynamic Date Select and SQL
Sensitivity: Confidential


I have a problem I hope someone can help me with...

Firstly I have an SQL Query with a "WHERE dateMonthAndYear = $month1"

Already this shows part of what I'm trying to do.  The date format in the DB
is "-MM-DD HH:MM:SS".

Now I need to dynamically generate a pulldown of months...

The range of months in the pulldown are historical, so the last month would
be the current month (which should also be the SELECTED option).  The first
month would be a fixed date, say Jan 2002.

The value of the options would probably be like so:

  // <<---  Jump Menu
Feb
2002
// <<---  Current Month (SELECTED)
$first_month_text
// <<---  First Month in range
$subsequent_month1_text
// <<---  Other months in range
.
// <<---  Other months in range
Feb
2002
// <<---  Current Month
ALL
// <<---  Empty value
will show all


I guess the question is, how do I dynamically create the select, based on
the above spec (or make $first_month, the first month available in the SQL
Query i.e. get the earliest month from the Query), then do the select using
ONLY the month and year information.

I can do most of the bits in between, just do know how to do the dynamic
select for this particular application, or get the date into the SQL where
ONLY the month and year are relevant.

I am using Pear DB and need this to work on MySQL and Access through Pear so
the SQL needs to be quite standard.  The above code is not syntaxed
properlyjust meant for readability.

Any ideas are much appreciated as I don't even know where to start with this
one.

Thanks

Simon H


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

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




[PHP] Fw: Polymorphism question

2002-02-15 Thread Richard Fox



I am new to PHP but 10 years in C++

One of the cool/powerful things you can do in C++ is the following:

class DrawDialog {
public:
...
   virtual Draw(); // implementation draws a plain dialog box
   };

class DrawStyleDialog : public DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws better dialog based on some
parameters
   };

Somewhere in my code I have a function like:

void ShowGUI( DrawDialog& dd ) {
   dd.Draw();
   }

ShowGUI can be called with any object that is derived from DrawDialog,
obviously. Only code that calls ShowGUI must be changed when a new
implementation of DrawDialog is used. This feature of C++ to have a base
class pointer (or reference) be able to access derived class functionality
is not something I've seen in any PHP documentation. Does it exist, and if
not is there a workaround for this highly desirable feature?

TIA

Rich

PS Can anyone point me to the most comprehensive OOP documentation for PHP?

--


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




Re: [PHP] How get the name of the array variable?

2002-02-15 Thread DL Neil

Lone Star Rick,
I see that your day, and helpfulness to list members, is going a lot better than mine!

> Actually, if I had my druthers, my domain TLD would be ".texas".  Some day,
> when Texas
> becomes the independent country it should be, that will be my TLD.
>
> 

If it comes from TX... it would have to be BIG!

There have been some moves in the last few days to get the .US TLD sorted out and 
properly mobilised. That would
give you -.TX.US. Santa Anna mightn't like it, but at least you could get to be both 
patriotic and parochial,
er, provincial !

=dn
Citizen of the world, and hoarder of TX jokes



> So Rick,
>
> Guess you've squashed my little scheme for (fraudulently) convincing
> everyone that I can speak Polish fluently -
> given that I counldn't answer Tomek's question, I'm already scoring it up as
> a 'bad day'!
>
> On the subject of email addresses, does this observation mean that we are
> patriotic but you are not?
>
> =dn
> OT polishing of PHP (Programming his Puns)
>
>
> > your mailing address TLD (the ".pl" in "emarket.pl") says you're from
> Poland
> >
> > > Please feel free to translate it into Polish.
> >
> > How did You know it was Polish? :)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




[PHP] Polymorphism question

2002-02-15 Thread Richard Fox



I am new to PHP but 10 years in C++

One of the cool/powerful things you can do in C++ is the following:

class DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws a vanilla dialog box
   };

class DrawStyleDialog : public DrawPlainDialog {
public:
...
   virtual Draw(); // implementation draws better dialog
   };

Somewhere in my code I have a function like:

void ShowGUI( DrawPlainDialog& dd ) {
   dd.Draw();
   }

ShowGUI can be called with any object that is derived from DrawPlainDialog,
obviously. Only code that calls ShowGUI must be changed when a new
implementation of DrawPlainDialog is used. This feature of C++ to have a
base class pointer (or reference) be able to access derived class
functionality is not something I've seen in any PHP documentation. Does it
exist, and if not is there a workaround for this highly desirable feature?

TIA

Rich

PS Can anyone point me to the most comprehensive OOP documentation for PHP?

--




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




Re: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-15 Thread Anas Mughal

If you are on the same machine, why don't you just
open the file as follows:

file:/filename.php

Just don't go thru the webserver.




--- Kevin Stone <[EMAIL PROTECTED]> wrote:
> How can I open a local PHP script and view its code
> to the browser?  The
> Readfile() method appears to parse and execute the
> code.  The Fopen()
> method appears to parse and then not execute the
> code, leaving a blank
> screen, or at the very least displaying any non-PHP
> text existing in the
> script.  This is obviously rare question because I
> can't find any
> references on this list or on Usenet.  Is there a
> trick to this?  Or is
> it simply not possible.
>  
> Much Thanks,
> Kevin Stone <[EMAIL PROTECTED]>
> 


=
Anas Mughal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Tel: 973-249-6665

__
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

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




[PHP] Installing php_4.0.6 on Mandarke

2002-02-15 Thread George Pitcher

Hi all,

I have just installed Mandrake 8.1 with MySQL, Apache and PHP and Apache and
MySQL are working but when I do the phpinfo.php file I get a 404 error even
though the file is there.

It is as though it cannot see php files.

Any suggestions?

George



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




[PHP] creating PDF on the fly

2002-02-15 Thread fitiux

Hi,
I don't know if this question was here before.. but...   :-)

I would like to know if someone have some experience on creating PDF files
on the fly,
in my new job I need to do this .. well.. actually I must do this   :-)

files to be generated are documents with free information for any user of
our website,
but some documents must have portrait and landscape pages..
I found a couple of classes but with them I only can create informs in
portrait or landscape orientation

then how can I create a pdf file (on the fly) that containt portrait and
landscape orientation?

I hope that you can understand my tarzan-english  :-)

thanks.

Best Regards



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





Re: [PHP] good practice

2002-02-15 Thread Michael Kimsal

Erik Price wrote:
> 
> On Thursday, February 14, 2002, at 04:40  PM, Michael Kimsal wrote:
> 
>> On that same topic, *why* do people name files with both .inc and 
>> .php?  Your .inc file has PHP code in it, right?  Why not just call it 
>> .php and
>> spare the server reconfiguration.  If knowing which files are 
>> "include" files (long time since I've made that distinction!) just 
>> prepend
>> them with inc_ or put them all in an includes/ directory.
> 
> 
> If you are including a file into another file with PHP's 'include()' 
> function, it doesn't matter what the extension is.  You don't even need 
> an extension.  Apache doesn't even see this as a separate file, it 
> thinks of it all as one big file with the name of whichever file is 
> doing the including.
> 
> Giving the .inc suffix is a nice way to keep your code organized.  Also, 
> I keep my .incs in a separate directory.
> 
> Not to mention I have a directive in my server's conf file that 
> specifically prevents it from serving any file with the extension '.inc'.
> 


That's great for you that you have that luxury, as do I, but not 
everyone has access to their server's conf file.

'Organizing' would be better served with the separate directory and/or
a prepend, because most directory structures are sorted by name by default.

I replied privately to someone on this already, but I'll post it here as 
well.

The majority of people learning PHP do so by examining other code, and a 
great many do so in shared hosting environments where they can't control 
the server config files.  Furthermore, because they are new they don't 
understand the security implications of .inc or other extensions, and
blindly copy code and run it without knowing they are exposed 
security-wise.  That's my primary beef with .inc and other non- ".php"
extensions.






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




[PHP] Re: The ASP "application" object in PHP?

2002-02-15 Thread Michael Kimsal

Bendik Simonsen wrote:
> I've recently started to learn ASP (*ducks the hurled flowerpots and
> vases*) because my school requires it, but of course I prefer PHP for
> my own scripting needs.
> 
> I have however, noticed one feature that ASP has that I have not found
> an equal for in PHP: the "application" object.
> 
> For those of you not familiar with ASP, the lowdown is this: The
> application object acts like a global session. You assign it variables
> and values like you would a session, but those variables are available
> to all instances and sessions. It is for example very useful to track
> different users at the same time, or to send messages from one session
> to another, or the likes.
> 
> Anything like this in PHP, or will I have to find a workaround for it,
> or *ick* do that little sniplet in ASP?
> 
> Thanks,
> Bendik Simonsen
> 


It doesn't exist.  ASP is an application framework which exposes and 
manages those types of objects.  It could easily be approximated simply
by storing things in a database.

There are significant drawbacks to earlier versions of ASP's handling
of application variables - I can not vouch for these issues with Windows 
2000 and above.  However:

1.  Application variables didn't scale across machines.  Just like
session variables, application variables were/are tied to one machine. 
In load balanced environments, this is useless.

2.  Resource management.  Application variables were tied to a specific 
thread, so even in your multithreaded
IIS environment, accessing/updating app variables would require a 
specific thread to be open/available.  If 10 threads needed to update 
the application variable, they'd all have to wait sequenatially.

3.  Easy to abuse.  So many people abused the heck out of them it gave
ASP a bad name in speed with average users.  MS went so far as to say
in some of their white papers not to use application variables if
speed was a concern.  Also, many people would put database connection 
objects inside application variables, which was just hilarious, because
of the single-thread issue above.

There are a few other issues with application variables which rub me the 
wrong way - at least the early MS implementations - again, I can't speak 
to modern variations, but I suspect many of the same issues exist to
some degree or another.  They seem much like a 'crutch' if you will - if
you need global variables, build an 'appobject' table and put variables 
in there, and simply create some functions to manage it.  Maybe even 
create an 'application object' of your own, and instantiate it at the
start of every PHP request.  It would be a farily trivial thing, except 
for 'restarting' the application object when the application was 
'restarted' (stop/start IIS, among other things).

Remember, ASP is not a language, and PHP is.  You're not programming 
"ASP" - you are most likely programming VBScript and your server 
environment gives that language access to server-specific functions
such as an application object.

Remember the distinction, and it should be easy to see how to duplicate 
that type of functionality within the context of the PHP language.

Hope that helps.

P.S.  This is the kind of stuf we go over in depth in our PHP training 
courses for people migrating from ASP and/or operating in dual-language
mode.  :)


--
Michael Kimsal
http://www.tapinternet.com/php
PHP Training Courses
734-480-9961



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




RE: [PHP] uuencode

2002-02-15 Thread Michael Mehlmann

> Sorry...I missed it...I was thinking of urlencode().  Lack of sleep, I
> guess

and I thougth it was my lack of sleep ;-)
 
> I would suggest doing GOOGLE search for the uuencode algorithm and coding
> it
> in PHP

already done - found only a "non-binary-safe" coding!!

thanks
michi

> 
> -Original Message-
> From: Michael Mehlmann [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 8:38 AM
> To: Rick Emery
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] uuencode
> 
> 
> > uuencode() is a function, not a process.  You cannot read and write to
> it.
> > It takes a string and converts it.  Then use uudecode() to translate it
> > back.
> 
> it's the first time, I hear of this php-function (which version do you
> use).
> I use v4.0.6 and there isn't such a function!
> I only knew of the base64_encode and -_decode - function!
> 
> > Now, what do you REALLY want to do??
> 
> I want to save (binary) files as uuencoded-files!
> 
> 
> thanks
> michi
> > > to convert take a look at
> > http://www.php.net/manual/en/function.popen.php
> > 
> > thanks, but you can only write OR read to popen()
> > but I need to write AND read to/from "uuencode"!!!
> > 
> > thanks
> > michi
> >  
> > > IMHO
> > > M.N.
> > > ---
> > > 
> > > Michael Mehlmann wrote:
> > > 
> > > >Hi!
> > > >
> > > >All I want is, to call my php with a URL in my querystring!
> > > >myphp.php?URL=http
> > > >
> > > >my php should download the "URL", uuencode it, and then return the
> > > uuencoded
> > > >text!
> > > >as this should be binary-safe, it thought of using the linux-included
> > > >uuencode!
> > > >But how to get the (perhaps large binary) file and use uuencode like
> > > >"uuencode < input > output"?
> > > >
> > > 
> > > 
> > > 
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > 
> > 
> > -- 
> > GMX - Die Kommunikationsplattform im Internet.
> > http://www.gmx.net
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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




Re: [PHP] good practice

2002-02-15 Thread Erik Price


On Thursday, February 14, 2002, at 04:40  PM, Michael Kimsal wrote:

> On that same topic, *why* do people name files with both .inc and 
> .php?  Your .inc file has PHP code in it, right?  Why not just call it 
> .php and
> spare the server reconfiguration.  If knowing which files are "include" 
> files (long time since I've made that distinction!) just prepend
> them with inc_ or put them all in an includes/ directory.

If you are including a file into another file with PHP's 'include()' 
function, it doesn't matter what the extension is.  You don't even need 
an extension.  Apache doesn't even see this as a separate file, it 
thinks of it all as one big file with the name of whichever file is 
doing the including.

Giving the .inc suffix is a nice way to keep your code organized.  Also, 
I keep my .incs in a separate directory.

Not to mention I have a directive in my server's conf file that 
specifically prevents it from serving any file with the extension '.inc'.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] how to require php file in a.html file

2002-02-15 Thread Tyler Longren

If you're using apache, make sure .html is included as an extension that
gets parsed by PHP.

Tyler

- Original Message -
From: "mysqlphp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 8:08 AM
Subject: [PHP] how to require php file in a.html file


> Hi,
>
> How do you (or is it possible) to ask a html tagged file (snoopy.html)
> to include a php file that reads and embeds cookies and talks to a MySQL
> database?  The code below (written before the html tag) is not working
> for me and really want to avoid changing all my .html files to .php
> files.
>
> Thanks for any help,
>
> David
>
> 
> // includes
> include("track.php");
>
> ?>
> 
> etc...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




RE: [PHP] How get the name of the array variable?

2002-02-15 Thread Rick Emery

Actually, if I had my druthers, my domain TLD would be ".texas".  Some day,
when Texas
becomes the independent country it should be, that will be my TLD.



-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 8:57 AM
To: Rick Emery; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] How get the name of the array variable?


So Rick,

Guess you've squashed my little scheme for (fraudulently) convincing
everyone that I can speak Polish fluently -
given that I counldn't answer Tomek's question, I'm already scoring it up as
a 'bad day'!

On the subject of email addresses, does this observation mean that we are
patriotic but you are not?

=dn
OT polishing of PHP (Programming his Puns)


> your mailing address TLD (the ".pl" in "emarket.pl") says you're from
Poland
>
> > Please feel free to translate it into Polish.
>
> How did You know it was Polish? :)


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




[PHP] how to require php file in a.html file

2002-02-15 Thread mysqlphp

Hi,

How do you (or is it possible) to ask a html tagged file (snoopy.html)
to include a php file that reads and embeds cookies and talks to a MySQL
database?  The code below (written before the html tag) is not working
for me and really want to avoid changing all my .html files to .php
files.

Thanks for any help,

David



etc...


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




RE: [PHP] uuencode

2002-02-15 Thread Rick Emery

Sorry...I missed it...I was thinking of urlencode().  Lack of sleep, I guess

I would suggest doing GOOGLE search for the uuencode algorithm and coding it
in PHP

-Original Message-
From: Michael Mehlmann [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 8:38 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] uuencode


> uuencode() is a function, not a process.  You cannot read and write to it.
> It takes a string and converts it.  Then use uudecode() to translate it
> back.

it's the first time, I hear of this php-function (which version do you use).
I use v4.0.6 and there isn't such a function!
I only knew of the base64_encode and -_decode - function!

> Now, what do you REALLY want to do??

I want to save (binary) files as uuencoded-files!


thanks
michi
> > to convert take a look at
> http://www.php.net/manual/en/function.popen.php
> 
> thanks, but you can only write OR read to popen()
> but I need to write AND read to/from "uuencode"!!!
> 
> thanks
> michi
>  
> > IMHO
> > M.N.
> > ---
> > 
> > Michael Mehlmann wrote:
> > 
> > >Hi!
> > >
> > >All I want is, to call my php with a URL in my querystring!
> > >myphp.php?URL=http
> > >
> > >my php should download the "URL", uuencode it, and then return the
> > uuencoded
> > >text!
> > >as this should be binary-safe, it thought of using the linux-included
> > >uuencode!
> > >But how to get the (perhaps large binary) file and use uuencode like
> > >"uuencode < input > output"?
> > >
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

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




Re: [PHP] How get the name of the array variable?

2002-02-15 Thread DL Neil

So Rick,

Guess you've squashed my little scheme for (fraudulently) convincing everyone that I 
can speak Polish fluently -
given that I counldn't answer Tomek's question, I'm already scoring it up as a 'bad 
day'!

On the subject of email addresses, does this observation mean that we are patriotic 
but you are not?

=dn
OT polishing of PHP (Programming his Puns)


> your mailing address TLD (the ".pl" in "emarket.pl") says you're from Poland
>
> > Please feel free to translate it into Polish.
>
> How did You know it was Polish? :)



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




[PHP] Re: fsockopen timeout

2002-02-15 Thread Peter Clarke

OK I've found it...
The time out value is a FLOAT. So a timeout of 1 second is 1.0.
Strange since the examples in the manual are integers.

Anyway this works:
$socket = fsockopen($urlArray["host"], $urlArray["port"], &$errnum,
&$errstr, 1.0);

"Peter Clarke" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> According to the manual;
> http://www.php.net/manual/en/function.fsockopen.php
> Depending on the environment, optional connect timeout may not be
available.
>
> Does anyone know what environment is needed for it to be available?
> I have Redhat Linux 7.1 - and the timeout doen't seem to work.
>
> Any ideas?
>
> Peter
>


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




Re: [PHP] db design

2002-02-15 Thread Andrew Brampton

I would make 2 tables, a product table and a language table... It would look
like so:
Product ID | product name | manufacturer | etc

Then a language table that looks like:
Language ID | Product ID | product description | etc

Then you won't be replicated your 11 columns since they are not in the
product table anymore.. If there are 100 products, and 1 language then there
will be 100 records in the product table and 100 in the language table. If
there are 2 languages then there will be 200 in the language table.

This method means you will be able to expand your language endless... and I
don't think your DB Server will be slowed down too much by this, since u can
pull this all of with 1 query.. something like (from memory)
SELECT tblProducts.name, tblLanguage.Description  FROM tblProducts,
tblLanguage WHERE tblProducts.productID=tblLanguage.productID AND {some
other query}

Hope this helps
Andrew

- Original Message -
From: "Wilbert Enserink" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 15, 2002 12:33 PM
Subject: [PHP] db design


> hi all,
>
>
> I need some tips on database (mySQL) design.
> The problems lie in languages. I'm gonna make a e-commerce webiste. it's
> rather big (in my terms/experience). The website should be expandible
easily
> with regard to languages/translations.
>
> My biggest table with product descriptions has 43 columns. Other tables
> include a list of FAQ's, manufacturers and so on.
>
> What do you think I have to do? Make a new table for each language, or
> define more columns for each language within a table? What is normal in
> this, also with regard to doing queries?
>
> e.g. In the table with 43 columns, there are 11 columns which are the same
> for each language (product name, manufacturer and so on) The other columns
> will depend on language (like product description).
> --If I use a seperate table for each language than there is double info
(no
> normalization with regard to the 11 columns)
> --If I use more columns, than I have 32 columns extra per language. If I
> make 10 translations, then this table will reach over 10x32=320 columns.
>
> I need somebody who can give me overall info on this, or shine a broad
light
> on my Q. Does the db design has a large influence on flexibility with
regard
> to future expanding? And how about query times (response) on a server. I
> don't want it to get too slow
>
> Well I think, you know my point now,
>
> any info is much appreciated!!
>
>
> thx in advance,
>
> Wilbert Enserink
>
>
> -
> Pas de Deux
> Van Mierisstraat 25
> 2526 NM Den Haag
> tel 070 4450855
> fax 070 4450852
> http://www.pdd.nl
> [EMAIL PROTECTED]
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] good practice

2002-02-15 Thread J Smith


It does to a certain extent. If you're writing code that you're expecting 
others to see and use, you should try to be consistent and follow 
convention. If you write up a large project in C++ and suddenly start 
naming header files with a ".doc" extension, somebody's going to get 
confused.

Of course, if nobody's using your code but yourself, then whatever. But for 
the purposes of consistency, portability and common sense, following a 
common coding standard is a good thing.

J


Philip J. Newman wrote:

> WHo really cares, if it works it don't matter what they call it.
> 


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




RE: [PHP] Access Denied !! SOLVED!!

2002-02-15 Thread Thomas Edison Jr.

Hi,

well, after about a week or so, finally, the turmoil &
fire has extinguished. the whole problem of importing
.csv data and the access denied thingy has been
solved, all due to just 'one' single syntax!

As it turns out, the command to be applied is NOT THIS
:

LOAD DATA INFILE 'fanlist.csv' INTO TABLE try FIELDS
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES
TERMINATED BY '\n'

But in fact it is THIS :

LOAD DATA LOCAL INFILE 'fullpath/fanlist.csv' REPLACE
INTO TABLE try FIELDS TERMINATED BY ';' ENCLOSED BY
'"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' 

Wether you enter the command directly into the mySQL
command line, or through PHP, the error was coming the
same, and now with this, it works both ways too!

The syntax being missed was "LOCAL" in Load Data!

Thank!
T. Edison Jr.


--- Rick Emery <[EMAIL PROTECTED]> wrote:
> Thomas,
> What happens when you enter the LOAD DATA INFILE
> command directly into the
> MYSQL command line?
> 
> -Original Message-
> From: Thomas Edison Jr.
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 7:58 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Access Denied !!
> 
> 
> Hi,
> 
> I'm facing a rather tricky problem. 
> The thing is, while connecting to the mySQL database
> using my php page, i get the "acess denied" error on
> only One Particular command, and on any other query,
> the same page, with the same login details works
> fine!
> 
> For ex, this works fine :
> 
>  $db = mysql_connect("localhost","m","pwd");
> mysql_select_db("m",$db);
> 
> $sql = "CREATE table try (ID bigint(21) NOT NULL
> auto_increment, name varchar(50), email varchar(70),
> PRIMARY KEY (ID))";
> $result = mysql_query($sql);
> echo "Thank you! Your information has been
> entered.\n";
> ?>
> 
> But this gives an "Access Denied" error :
> 
>  $db = mysql_connect("localhost","m","pwd");
> mysql_select_db("m",$db);
> 
> $query = "LOAD DATA INFILE 'fanlist.csv' INTO TABLE
> try FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY
> '\"' LINES TERMINATED BY '\n'";
> mysql_query($query) or die("error:". mysql_error());
> ?>
> 
> Why is this happening? 
> 
> T. Edison jr.
> 
> 
> =
> Rahul S. Johari (Director)
> **
> Abraxas Technologies Inc.
> Homepage : http://www.abraxastech.com
> Email : [EMAIL PROTECTED]
> Tel : 91-4546512/4522124
> ***
> 
> __
> Do You Yahoo!?
> Got something to say? Say it better with Yahoo!
> Video Mail 
> http://mail.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

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




  1   2   >