Re: [PHP] gmdate()

2002-09-06 Thread lallous

I got an idea to solve my problem.

I'll make client side calculation.
I'll set the user pick a future time and then calculate from the client side
how many minutes exists between these two times, then pass the minutes
difference to the server.

"Naintara Jain" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> lets say,
>
> ServerOne has TimeZone GMT+2
> ServerTwo has TimeZone GMT+3
>
> the gmdate() will return diff values for the same timestamp.
> essentially there will be a diff of 1 hour in the return values from these
> two servers.
>
> -Naintara
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> t]On Behalf Of lallous
> Sent: Friday, September 06, 2002 8:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] gmdate()
>
>
> I don't own the server, and the server is probably set up correctly as it
is
> a web hosting server.
>
> anyway, how should that RedHat 6 server be set up ?
>
> Elias
> "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > The server needs to be set up correctly - it needs to know what time
> > zone it is in and if the BIOS time is GMT or local.
> >
> > lallous wrote:
> >
> > >Isn't the gmdate() supposed to return the same value when run from two
> > >different timezones?
> > >
> > >
> > >I run it on GMT+2 system and EDT system, and I get 1 hour difference,
> > >
> > >please advise.
> > >
> > >Elias
> > >
> > >
> > >
> > >
> > >
> >
>
>
>
> --
> 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 to print a mysql result

2002-09-06 Thread Adam Williams

echo "$sql";

Adam

On Sat, 7 Sep 2002, Chuck PUP Payne wrote:

> Hi,
>
> I am having a problem with menu options being pass on to my database. Is
> there a way that I can see what is sql statement that is passing on to the
> database? Say maybe print $sql or something like that?
>
> Chuck Payne
>
>
>


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




[PHP] How to print a mysql result

2002-09-06 Thread Chuck PUP Payne

Hi,

I am having a problem with menu options being pass on to my database. Is
there a way that I can see what is sql statement that is passing on to the
database? Say maybe print $sql or something like that?

Chuck Payne


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




[PHP] RE: File upload security and virus considerations

2002-09-06 Thread YC Nyon

I am doing an application where users can upload a *.zip file into the
server. Virus and hackers threats are my main concern.
Anyone mind sharing their experiences on how to deal with it. If u suggest
any antivirus, please specifiy the name. the server is on windows platform.
Also, if it's virus, how do i tell php to return a webpage to the user
saying it was unsuccessful.

TIA
Nyon








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




Re: [PHP] Web based FTP client

2002-09-06 Thread Justin French

on 07/09/02 12:48 AM, Jon Haworth ([EMAIL PROTECTED]) wrote:

> A couple of s side by side should let you do that.
> 
> The biggest problem I can see you hitting is reading the contents of the
> user's hard drive... usually this is impossible, for good reasons.

I *think* that's what he was asking about.

Justin


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




Re: [PHP] Low Cost PHP Hosting

2002-09-06 Thread Justin French

For testing out stuff, I'd recommend you set up apache/php/mysql on your
local machine (win, linux, unix, mac osx all work), it's a lot easier to
save a file locally and hit refresh in your browser than having to FTP the
updated file again and again and again.

AS far as hosts go, I'm sure if you searched the archives for "HOST", you'd
find 1000's of posts and suggestions.


Justin French


on 06/09/02 10:46 PM, Philip Radford ([EMAIL PROTECTED])
wrote:

> Hi All,
> 
> I have recently subscribed to the list and would like to thank everyone for
> their support and guidance in the use of the PHP scripting language. I am
> trying to find a low cost host for testing out PHP web applications on the
> Internet. I have a similar account set up with Brinkster for ASP and ASP.NET
> code but would like a similar environment for PHP. Any ideas? Thanks.
> 
> Regards
> Phil.
> 
> 
> 
> --
> 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] \n to Problem

2002-09-06 Thread Jacob Miller

At 23:51 09/06/2002, you wrote:
>I have a small problem in converting a plain text to html.



>$newstr = ereg_replace ("\n", "", $newstr);

try

$newstr = ereg_replace("\n\r|\n|\r", "", $newstr);

notice it looks for all types of line feeds

-jacob


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




Re: [PHP] \n to Problem

2002-09-06 Thread Jacob Miller

At 23:51 09/06/2002, you wrote:
>I have a small problem in converting a plain text to html.



>$newstr = ereg_replace ("\n", "", $newstr);

try

$newstr = ereg_replace("\n\r|\n|\r", "", $newstr);

notice it looks for all types of line feeds

-jacob


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




[PHP] Re: php4 w/ apache2 using module

2002-09-06 Thread Seairth Jacobs

My understanding is that PHP does not currently work well with Apache2,
though this may be a platform specific problem.  I couldn't even get Apache
2 to load it (under Win2K).  I have seen mentions that PHP 4.3 is supposed
to improve this situation, though I don't actually know if it's true or not.
In the meantime, I have seen the following advice:

1) Run Apache in pre-fork mode (which makes it act like Apache 1).
2) Use the CGI version of PHP (but as you note, there are some limitations
there).

I finally went back to Apache 1 for the meantime (since it's what my host
uses anyhow)

---
Seairth Jacobs
[EMAIL PROTECTED]



"Yoda2005" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Is there any way to do it? I cant seem to get it to install as a module
> nomatter what I do. Right now I have it running as a cgi parser but some
> stuff I want to do I cant really do when it is running like this... Any
> ideas?
>
>



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




Re: [PHP] defining vars within functions as global

2002-09-06 Thread Justin French

on 06/09/02 10:45 PM, Michael Sims ([EMAIL PROTECTED]) wrote:

> How about this:
> 
>  function foo()
> {
> return array (
> "foo" => "aaa",
> "bar" => "bbb"
> );
> }
> 
> extract(foo());
> 
> echo $foo;
> echo $bar;
> ?>

Very cool !!  -- thanks to everyone's replies.

Justin


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




Re: [PHP] Re: Source code

2002-09-06 Thread Justin French

I'd beg to differ:

http://www.php.net/manual/en/function.show-source.php

Justin French




on 06/09/02 9:10 PM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:

> You can't.
> 
> --
> 
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
> 
> "Roman Duriancik" <[EMAIL PROTECTED]> a écrit dans le message de
> news: [EMAIL PROTECTED]
>> How I show in IE source code of html page with php ?
>> 
>> 
>> roman
>> 
> 
> 


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




[PHP] Re: email with html and images

2002-09-06 Thread Manuel Lemos

Hello,

On 09/06/2002 08:32 PM, Josh wrote:
> Hey all
> 
> I have seen many tutorials on sending HTML email, and sending email with 
> attachments, but have found nothing on sending HTML email with the 
> images for the html attached.
> 
> Anyone familiar with doing this?

Try this class that does exactly what you need and more.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos


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




Re: [PHP] From ASP to PHP please help

2002-09-06 Thread Richard Baskett

Look up a program called asp2php.  That should definitely get you started!

Cheers!

Rick

"The intuitive mind is a sacred gift and the rational mind is a faithful
servant.  We have created a society that honors the servant and has
forgotten the gift." - Albert Einstein

> From: "Iguider" <[EMAIL PROTECTED]>
> Date: Fri, 6 Sep 2002 22:55:16 -
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] From ASP to PHP  please help
> 
> Hi
> I have a site web made in ASP ( using frontpage software), After I read
> about php I decided to re-do all my site with PHP, but still new in php
> script I need help to show me the best way to change borders in ASP to php .
> as you know frontpage software put  the borders in "_borders", I can still
> let left.htm, top.htm and bottom.htm and made necessary changes .
> After that I can check database connect.
> thanks in advance
> 
> 
> 
> __
> Pour mieux recevoir vos emails, utilisez un PC plus performant !
> Découvrez la nouvelle gamme DELL en exclusivité sur i (france)
> http://www.ifrance.com/_reloc/signedell
> 
> 
> -- 
> 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] php4 w/ apache2 using module

2002-09-06 Thread Adam Williams

what commands are you giving it to compile and what errors you getting?

Adam

On Fri, 6 Sep 2002, yoda2005 wrote:

> Is there any way to do it? I cant seem to get it to install as a module
> nomatter what I do. Right now I have it running as a cgi parser but some
> stuff I want to do I cant really do when it is running like this... Any
> ideas?
>
>
>
>


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




[PHP] email with html and images

2002-09-06 Thread josh

Hey all

I have seen many tutorials on sending HTML email, and sending email with 
attachments, but have found nothing on sending HTML email with the images 
for the html attached.

Anyone familiar with doing this?

Thanks,
Josh


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




Re: [PHP] Object composition and reference

2002-09-06 Thread Dan Ostrowski

Well this is just a suggestion since I am in the middle of some PostgreSQL
learning and I don't entirely know your situation.. BUT...

In times like this, I usually build one MASTER OBJECT to controll all the
other little happy citizen objects like mindless sheep.

For instance.  At one point I needed Form objects ( think of your bus ) to
not only have access to other objects called Style objects, which could
change ( think of your diesel object ), but also communicate to a database
and do all sorts of other fun stuff. Now.. I couldn't have random objects
floating around in orbit cause then they couldn't talk to each other so
well, and things would get frustrating and one of the objects was likely
to punch one of the other objects, knocking out his front properties.  I
couldn't afford the dental.

So what I did was create a "FormMaster" which held methods for accessing
individual objects, makeing all the objects do the same thing ( whether
they complained or not ), letting the objects access (indirectly) the
properties ( think 'global, but not' ) of the master object, and it all
stays very neat.

of course.. it's more coding... hehe.. but it made my forms behave quite
nicely.

regards,
dan



 Fri, 6 Sep 2002 17:45:33 -0500
Paul Smith <[EMAIL PROTECTED]> wrote:

> Other classes need to have access to these objects without going 
> through any mode objects. I suppose I can just pass by reference to 
> these other classes; I don't want to have any objects out of sync.
> 
> On Friday, September 6, 2002, at 06:12  PM, Dan Ostrowski wrote:
> 
> > The only point I don't understand is why you are averted to saying
> > $bus->setFuel($diesel); I don't understand the drawback...
> >
> > regards,
> > dan
> >
> >
> > On Fri, 6 Sep 2002 16:58:06 -0500
> > Paul Smith <[EMAIL PROTECTED]> wrote:
> >
> >> I'm compositing a class based on other classes. The component classes
> >> are (this is for a transportation application) fuel and vehicle. The
> >> container class is mode (as in mode of transit: rail, bus, etc.). 
> >> There
> >> can be several vehicles and fuels for each mode (many to one). I want
> >> to be able to accomplish something like this:
> >>
> >> $bus = new mode();
> >> $diesel = new fuel($bus);
> >> $ethanol = new fuel($bus);
> >> $class_a_bus = new vehicle($bus);
> >> $articulated_bus = new vehicle($bus);
> >>
> >> In other words, register the fuels and vehicles with the mode object 
> >> in
> >> such a way that I don't have to make them members of said object; in
> >> further other words, instead of doing it something like:
> >>
> >> $bus = new mode();
> >> $diesel = new fuel();
> >> $bus->addFuel($diesel);
> >>
> >> Is there a way I can then reference the components of the mode object
> >> without having to know the names I picked for the variables; without
> >> having to do something like:
> >>
> >> $diesel = new fuel();
> >> $bus->addFuel($diesel, 'diesel'); <-- a handle to reference the
> >> globally scoped variable
> >>
> >> One kludgy way would be to foreach() the $GLOBALS in a method of the
> >> mode class, checking for is_a('fuel'). One of my rules of thumb is to
> >> reduce use of the $GLOBALS. Would a more elegant solution be related 
> >> to
> >> PHP's reference counting? I apologize if this is a confusing-as-hell
> >> post. I would be more than happy to clarify a point...
> >>
> >> Paul
> >>
> >> --
> >> Paul Smith <[EMAIL PROTECTED]>
> >> Center for Neighborhood Technology
> >> Chicago, IL USA
> >>
> >>
> >> -- 
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> Paul Smith <[EMAIL PROTECTED]>
> Center for Neighborhood Technology
> Chicago, IL USA

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




[PHP] php4 w/ apache2 using module

2002-09-06 Thread yoda2005

Is there any way to do it? I cant seem to get it to install as a module
nomatter what I do. Right now I have it running as a cgi parser but some
stuff I want to do I cant really do when it is running like this... Any
ideas?



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




[PHP] From ASP to PHP please help

2002-09-06 Thread Iguider

Hi
I have a site web made in ASP ( using frontpage software), After I read
about php I decided to re-do all my site with PHP, but still new in php
script I need help to show me the best way to change borders in ASP to php .
as you know frontpage software put  the borders in "_borders", I can still
let left.htm, top.htm and bottom.htm and made necessary changes .
After that I can check database connect.
thanks in advance



__
Pour mieux recevoir vos emails, utilisez un PC plus performant !
Découvrez la nouvelle gamme DELL en exclusivité sur i (france)
http://www.ifrance.com/_reloc/signedell


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




[PHP] Object composition and reference

2002-09-06 Thread Paul Smith

I'm compositing a class based on other classes. The component classes 
are (this is for a transportation application) fuel and vehicle. The 
container class is mode (as in mode of transit: rail, bus, etc.). There 
can be several vehicles and fuels for each mode (many to one). I want 
to be able to accomplish something like this:

$bus = new mode();
$diesel = new fuel($bus);
$ethanol = new fuel($bus);
$class_a_bus = new vehicle($bus);
$articulated_bus = new vehicle($bus);

In other words, register the fuels and vehicles with the mode object in 
such a way that I don't have to make them members of said object; in 
further other words, instead of doing it something like:

$bus = new mode();
$diesel = new fuel();
$bus->addFuel($diesel);

Is there a way I can then reference the components of the mode object 
without having to know the names I picked for the variables; without 
having to do something like:

$diesel = new fuel();
$bus->addFuel($diesel, 'diesel'); <-- a handle to reference the 
globally scoped variable

One kludgy way would be to foreach() the $GLOBALS in a method of the 
mode class, checking for is_a('fuel'). One of my rules of thumb is to 
reduce use of the $GLOBALS. Would a more elegant solution be related to 
PHP's reference counting? I apologize if this is a confusing-as-hell 
post. I would be more than happy to clarify a point...

Paul

--
Paul Smith <[EMAIL PROTECTED]>
Center for Neighborhood Technology
Chicago, IL USA


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




Re: [PHP] Line Breaks in dynamic Download

2002-09-06 Thread Kevin Stone

Thank you all very much.  Turns out it was yet another browser cache issue
and a quick reboot solved the problem.  Minor modification of just two lines
and I'm back in business.  It's the details that'll kill you, eh?  :)

Final code...



Again  much thanks to everyone who helped me.

--
Kevin Stone
[EMAIL PROTECTED]


- Original Message -
From: "Steven" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 1:50 PM
Subject: [PHP] Line Breaks in dynamic Download


> 
> Again, the new problem is that the Text is not downloading as a file.  It
is
> just being printed to the screen.
> 
>
> I tested the following code:
>
>  header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=TEST.txt");
> echo "LINE ONE".chr(10)."LINE TWO".chr(10)."LINE THREE";
> ?>
>
> on a WinNT 4.0 with Apache 1.3.24 and PHP 4.2.3 and did not come across
the
> same issues as you.
>
> I was prompted to download or open the file.
>
> However, when I did open the file with Notepad it did not contain any line
> breaks, Wordpad did have the line breaks.
>
> HTH
> Steven
>
>
>
>
> --
> 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: fsockopen proxy?

2002-09-06 Thread :B nerdy

its failing before i can even authorize myself for use in the proxy at
if ($fs = fsockopen("wwp.icq.com",80)) {

what must i do?? :/ the proxy is on port 8080?
cheers

":B Nerdy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> im unable to access the web without first authenticating with the proxy.
how
> can i still use fsockopen and authenticate myself with php?
>
> cheers
>
>



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




Re: [PHP] MySQL and Array's REALLY simple question but I'm not GETTING it.. Ugh..

2002-09-06 Thread Chulkee Sung

> $sql2_results = mysql_fetch_array($top_level);

I guess this must be in a loop otherwise your $sq12_results keep getting
overwitten; thus,
the last record will be shown at the end.


> $query_sql2_rows = mysql_num_rows($top_level);
> 
> echo $query_sql2_rows;
> // echo's 2 rows
> 
> print " cellpadding=4 width=90%>";
> 
> print "Action ID width=100>OwnerTechnologySummary";
> 
> for ($counter=0; $counter < $query_sql2_rows; $counter++) {
> $tabledata = mysql_fetch_array($top_level);
> echo "$tabledata[0]";
> echo "$tabledata[6]";
> echo "$tabledata[2]";
> echo "$tabledata[3]";
> echo "";
> }
> print "";
> 
> Thanks.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
i18n Engineer
SCO, Inc.
www.sco.com (801) 765-4999 x5647
355 South 520 West, Suit 100, Lindon, Utah 84042 USA

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




Re: [PHP] MySQL and Array's REALLY simple question but I'm not GETTING it .. Ugh..

2002-09-06 Thread Brad Bonkoski

It doesn't matter what variables you assign to "fetch" the data, one of 
the effects of mysql_fetch_array() is to increment the database result 
variable.  It does this without you even knowing it.  check out the 
mysql_data_seek() function to see how you can make the adjustments 
yourself.  i.e. mysql_data_seek($result, 0) would set you back at the 
beginning, record one.

-Brad

Steve Gaas wrote:
> OK, this works.. This is wonderful.. But I don't get it.. I assigned two
> separate variables to that array function..  I don't understand why this
> works now, but thanks a lot for the help. 
> 
> I hope I don't inadvertently run into this again...
> 
> -steve
> 
> 
> $sql2 = mysql_connect("localhost", "eweb", "dbfun")
>   or die("Could not connect using default username and password LINE
> 14 ");
> 
> mysql_select_db("actionregs", $sql2);
> 
> $top_level = mysql_query("SELECT * FROM williams", $sql2)
>   or die("Could not do query sql1 to find username. Link might not
> have been made. What's up? LINE 19 ");
> 
> // $sql2_results = mysql_fetch_array($top_level);
> $query_sql2_rows = mysql_num_rows($top_level);
> $rows = 0;
> echo $query_sql2_rows;
> 
> 
> print " cellpadding=4 width=90%>";
> print "Action ID width=100>OwnerTechnologySummary";
> 
> for ($counter=0; $counter < $query_sql2_rows; $counter++) {
>   $tabledata = mysql_fetch_array($top_level);
>   echo "$tabledata[0]";
>   echo "$tabledata[6]";
>   echo "$tabledata[2]";
>   echo "$tabledata[3]";
>   echo "";
>   }
> print "";
> -Original Message-
> From: Brad Bonkoski [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, September 06, 2002 3:34 PM
> To: Steve Gaas
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] MySQL and Array's REALLY simple question but I'm not
> GETTING it .. Ugh..
> 
> Well, when you run the command:
> 
> $sql2_results = mysql_fetch_array($top_level);
> 
> The first time, it automatically increments the result...
> so you fetch the data bu do nothing with it...
> so when you get to your loop, you are already at the second entry in 
> your database..
> 
> So, remove the first instance of that and see how it works..
> HTH
> -Brad
> 
> Steve Gaas wrote:
> 
> 
>>Can anyone tell me what's wrong with my code?  All I get output from this
> 
> is
> 
>>the LAST row of data from my Database.  There are 2 rows, how do I make it
>>pull data from all of the rows?  It's not going through the loop like it
>>should  I need to be able to tell the mysql_fetch_array which row I
> 
> want
> 
>>in each it iteration of the for loop.  The For loop increments counter, but
>>there is no syntax to add $counter to the result_type.  The same goes with
>>fetch_row...  
>>
>>What am I forgetting!!??  I know it's something simple
>>
>>
>>***
>>
>>$sql2 = mysql_connect("localhost", "eweb", "dbfun")
>>  or die("Could not connect ");
>>
>>mysql_select_db("actionregs", $sql2);
>>
>>$top_level = mysql_query("SELECT * FROM williams", $sql2)
>>  or die("Could not do query ");
>>
>>$sql2_results = mysql_fetch_array($top_level);
>>$query_sql2_rows = mysql_num_rows($top_level);
>>
>>echo $query_sql2_rows;
>>// echo's 2 rows
>>
>>print ">cellpadding=4 width=90%>";
>>
>>print "Action ID>width=100>OwnerTechnologySummary";
>>
>>for ($counter=0; $counter < $query_sql2_rows; $counter++) {
>>  $tabledata = mysql_fetch_array($top_level);
>>  echo "$tabledata[0]";
>>  echo "$tabledata[6]";
>>  echo "$tabledata[2]";
>>  echo "$tabledata[3]";
>>  echo "";
>>  }
>>print "";
>>
>>Thanks.
>>
>>
>>
>> 
>>
> 
> 
> 



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




Re: [PHP] Re: How do I keep a page from caching in I.E

2002-09-06 Thread Casey Allen Shobe

I know this problem.  Konqueror, Netscape, Mozilla, and Opera are all broken.  
They use cache regardless of whether or not they should when you use the back 
button.  I know of no way around it.

What especially pisses me off is that Mozilla, shortly before 1.0, worked 
properly, even when you used the back button, as IE does.  But the 1.0 
release broke it, as though they did it intentionally.

Here's what I use, though it really only works in IE where the back button is 
concerned:

// Don't allow browsers to cache data
header ('Last-Modified: '.gmdate("D, d M Y H:i:s").' GMT');
header ('Expires: '.gmdate("D, d M Y H:i:s").' GMT');
header ('Cache-Control: no-cache, must-revalidate');
header ('Pragma: no-cache');

If anyone has any further information, I would appreciate it.  Are there 
workarounds in PHP?  Or do I need to complain to the web browser makers?

- Casey

On Friday 06 September 2002 05:44 am, Krzysztof Dziekiewicz wrote:
> 4.09.2002, 17:48, Victor V. Evtushenko wrote:
> > Donpro wrote:
> >> Hi,
> >>
> >> Using I.E. 5.5. I can't seem to keep a page from caching.  When I click
> >> on
> >
> > Have you read "HOWTO: Prevent Caching in Internet Explorer"?
> > http://support.microsoft.com/default.aspx?scid=kb;EN-US;q234067
>
> According to the description I inserted "header('Expires: -1');"
> It is fine if it is Internet Explorer.
> But e.g. Opera ignore the header. After BACK it displays old
> content. I even switched off all cache options in preferences but it
> does not help.
>
> >> the browser BACK button, I get the cached page so I have to click on
> >> Refresh to get the actual page content.  I've placed the following at
> >> the top of the HTML file but it doesn't seem to do anything. Any help
> >> would be appreciated.
>
> Krzysztof Dziekiewicz

-- 
Casey Allen Shobe / Network Security Analyst & PHP Developer
SecureWorks, Inc. / 404.327.6339 x169 / Fax: 404.728.0144
[EMAIL PROTECTED] / http://www.secureworks.net
Content is my own and does not necessarily represent my company.

Lost Terminal.

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




Re: [PHP] MySQL and Array's REALLY simple question but I'm notGETTING it .. Ugh..

2002-09-06 Thread Jed Verity

Hello, Steve,

When you call mysql_fetch_array the first time, you are accessing the data
from the first row of your results and then moving the pointer to the next
row. So, when you call mysql_fetch_array the second time, it is already
starting with the second row of your results. Try something like this
instead:

");

mysql_select_db("actionregs", $sql2);

$top_level = mysql_query("SELECT * FROM williams", $sql2)
or die("Could not do query ");

print "";

print "Action IDOwnerTechnologySummary";

while ($tabledata = mysql_fetch_array($top_level)) {
echo "";
echo "$tabledata[0]";
echo "$tabledata[6]";
echo "$tabledata[2]";
echo "$tabledata[3]";
echo "";
}
print "";
?>

You may need to pull the table data array items into variables before
echoing them. Does this work?

HTH!
Jed

On the threshold of genius, Steve Gaas wrote:

> Can anyone tell me what's wrong with my code?  All I get output from this is
> the LAST row of data from my Database.  There are 2 rows, how do I make it
> pull data from all of the rows?  It's not going through the loop like it
> should  I need to be able to tell the mysql_fetch_array which row I want
> in each it iteration of the for loop.  The For loop increments counter, but
> there is no syntax to add $counter to the result_type.  The same goes with
> fetch_row...  
> 
> What am I forgetting!!??  I know it's something simple
> 
> 
> ***
> 
> $sql2 = mysql_connect("localhost", "eweb", "dbfun")
> or die("Could not connect ");
> 
> mysql_select_db("actionregs", $sql2);
> 
> $top_level = mysql_query("SELECT * FROM williams", $sql2)
> or die("Could not do query ");
> 
> $sql2_results = mysql_fetch_array($top_level);
> $query_sql2_rows = mysql_num_rows($top_level);
> 
> echo $query_sql2_rows;
> // echo's 2 rows
> 
> print " cellpadding=4 width=90%>";
> 
> print "Action ID width=100>OwnerTechnologySummary";
> 
> for ($counter=0; $counter < $query_sql2_rows; $counter++) {
> $tabledata = mysql_fetch_array($top_level);
> echo "$tabledata[0]";
> echo "$tabledata[6]";
> echo "$tabledata[2]";
> echo "$tabledata[3]";
> echo "";
> }
> print "";
> 
> Thanks.
> 
> 


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




RE: [PHP] MySQL and Array's REALLY simple question but I'm not GETTING it .. Ugh..

2002-09-06 Thread Steve Gaas

OK, this works.. This is wonderful.. But I don't get it.. I assigned two
separate variables to that array function..  I don't understand why this
works now, but thanks a lot for the help. 

I hope I don't inadvertently run into this again...

-steve


$sql2 = mysql_connect("localhost", "eweb", "dbfun")
or die("Could not connect using default username and password LINE
14 ");

mysql_select_db("actionregs", $sql2);

$top_level = mysql_query("SELECT * FROM williams", $sql2)
or die("Could not do query sql1 to find username. Link might not
have been made. What's up? LINE 19 ");

// $sql2_results = mysql_fetch_array($top_level);
$query_sql2_rows = mysql_num_rows($top_level);
$rows = 0;
echo $query_sql2_rows;


print "";
print "Action IDOwnerTechnologySummary";

for ($counter=0; $counter < $query_sql2_rows; $counter++) {
$tabledata = mysql_fetch_array($top_level);
echo "$tabledata[0]";
echo "$tabledata[6]";
echo "$tabledata[2]";
echo "$tabledata[3]";
echo "";
}
print "";
-Original Message-
From: Brad Bonkoski [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 06, 2002 3:34 PM
To: Steve Gaas
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL and Array's REALLY simple question but I'm not
GETTING it .. Ugh..

Well, when you run the command:

$sql2_results = mysql_fetch_array($top_level);

The first time, it automatically increments the result...
so you fetch the data bu do nothing with it...
so when you get to your loop, you are already at the second entry in 
your database..

So, remove the first instance of that and see how it works..
HTH
-Brad

Steve Gaas wrote:

>Can anyone tell me what's wrong with my code?  All I get output from this
is
>the LAST row of data from my Database.  There are 2 rows, how do I make it
>pull data from all of the rows?  It's not going through the loop like it
>should  I need to be able to tell the mysql_fetch_array which row I
want
>in each it iteration of the for loop.  The For loop increments counter, but
>there is no syntax to add $counter to the result_type.  The same goes with
>fetch_row...  
>
>What am I forgetting!!??  I know it's something simple
>
>
>***
>
>$sql2 = mysql_connect("localhost", "eweb", "dbfun")
>   or die("Could not connect ");
>
>mysql_select_db("actionregs", $sql2);
>
>$top_level = mysql_query("SELECT * FROM williams", $sql2)
>   or die("Could not do query ");
>
>$sql2_results = mysql_fetch_array($top_level);
>$query_sql2_rows = mysql_num_rows($top_level);
>
>echo $query_sql2_rows;
>// echo's 2 rows
>
>print "cellpadding=4 width=90%>";
>
>print "Action IDwidth=100>OwnerTechnologySummary";
>
>for ($counter=0; $counter < $query_sql2_rows; $counter++) {
>   $tabledata = mysql_fetch_array($top_level);
>   echo "$tabledata[0]";
>   echo "$tabledata[6]";
>   echo "$tabledata[2]";
>   echo "$tabledata[3]";
>   echo "";
>   }
>print "";
>
>Thanks.
>
>
>
>  
>


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




Re: [PHP] MySQL and Array's REALLY simple question but I'm notGETTING it .. Ugh..

2002-09-06 Thread Brad Bonkoski

Well, when you run the command:

$sql2_results = mysql_fetch_array($top_level);

The first time, it automatically increments the result...
so you fetch the data bu do nothing with it...
so when you get to your loop, you are already at the second entry in 
your database..

So, remove the first instance of that and see how it works..
HTH
-Brad

Steve Gaas wrote:

>Can anyone tell me what's wrong with my code?  All I get output from this is
>the LAST row of data from my Database.  There are 2 rows, how do I make it
>pull data from all of the rows?  It's not going through the loop like it
>should  I need to be able to tell the mysql_fetch_array which row I want
>in each it iteration of the for loop.  The For loop increments counter, but
>there is no syntax to add $counter to the result_type.  The same goes with
>fetch_row...  
>
>What am I forgetting!!??  I know it's something simple
>
>
>***
>
>$sql2 = mysql_connect("localhost", "eweb", "dbfun")
>   or die("Could not connect ");
>
>mysql_select_db("actionregs", $sql2);
>
>$top_level = mysql_query("SELECT * FROM williams", $sql2)
>   or die("Could not do query ");
>
>$sql2_results = mysql_fetch_array($top_level);
>$query_sql2_rows = mysql_num_rows($top_level);
>
>echo $query_sql2_rows;
>// echo's 2 rows
>
>print "cellpadding=4 width=90%>";
>
>print "Action IDwidth=100>OwnerTechnologySummary";
>
>for ($counter=0; $counter < $query_sql2_rows; $counter++) {
>   $tabledata = mysql_fetch_array($top_level);
>   echo "$tabledata[0]";
>   echo "$tabledata[6]";
>   echo "$tabledata[2]";
>   echo "$tabledata[3]";
>   echo "";
>   }
>print "";
>
>Thanks.
>
>
>
>  
>



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




[PHP] MySQL and Array's REALLY simple question but I'm not GETTING it.. Ugh..

2002-09-06 Thread Steve Gaas

Can anyone tell me what's wrong with my code?  All I get output from this is
the LAST row of data from my Database.  There are 2 rows, how do I make it
pull data from all of the rows?  It's not going through the loop like it
should  I need to be able to tell the mysql_fetch_array which row I want
in each it iteration of the for loop.  The For loop increments counter, but
there is no syntax to add $counter to the result_type.  The same goes with
fetch_row...  

What am I forgetting!!??  I know it's something simple


***

$sql2 = mysql_connect("localhost", "eweb", "dbfun")
or die("Could not connect ");

mysql_select_db("actionregs", $sql2);

$top_level = mysql_query("SELECT * FROM williams", $sql2)
or die("Could not do query ");

$sql2_results = mysql_fetch_array($top_level);
$query_sql2_rows = mysql_num_rows($top_level);

echo $query_sql2_rows;
// echo's 2 rows

print "";

print "Action IDOwnerTechnologySummary";

for ($counter=0; $counter < $query_sql2_rows; $counter++) {
$tabledata = mysql_fetch_array($top_level);
echo "$tabledata[0]";
echo "$tabledata[6]";
echo "$tabledata[2]";
echo "$tabledata[3]";
echo "";
}
print "";

Thanks.



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




[PHP] Line Breaks in dynamic Download

2002-09-06 Thread Steven


Again, the new problem is that the Text is not downloading as a file.  It is
just being printed to the screen.


I tested the following code:



on a WinNT 4.0 with Apache 1.3.24 and PHP 4.2.3 and did not come across the
same issues as you.

I was prompted to download or open the file.

However, when I did open the file with Notepad it did not contain any line
breaks, Wordpad did have the line breaks.

HTH
Steven




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




[PHP] Re: stupid question

2002-09-06 Thread nicos

Correction:

/* Get the first character of a string  */
$str = 'This is a test.';
$first = $str{0};
$first will be 'T'

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Alex Shi" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> I have almost two years of experience in PHP. so don't think qualified for
> being a newbie...However still found something don't know when reading
> other's code :(
>
> Here is what I want to know: $Global{'hello'}. What this means? Is it a
> Variable-variable?
>
> Alex
>
> --
> ---
> TrafficBuilder Network:
> http://www.bestadv.net/index.cfm?ref=7029
>



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




Re: [PHP] Re: Question about character acces, [] vs {}

2002-09-06 Thread Robert Cummings

[EMAIL PROTECTED] wrote:
> 
> Where did you seen that it is depreciated?
> 

http://www.php.net/manual/en/language.types.string.php

[block quote begins]
String access by character

Characters within strings may be accessed by specifying the zero-based offset of the 
desired character after the string in curly braces. 

Note: For backwards compatibility, you can still use the array-braces. However, 
this syntax is deprecated as of PHP 4. 
[block quote ends]

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Fw: [PHP] Re: stupid question

2002-09-06 Thread Kevin Stone

Try it on your own..

$ary = array('key' => 'val');
$ary['key']; //prints val
$ary{'key'}; //prints val

Square brackets are more common but both are valid array syntax.  There may
be special cases where curly braces are used in place of square brackets..
this I don't know.

Kevin


- Original Message -
From: "Alex Shi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 1:28 PM
Subject: [PHP] Re: stupid question


> I checked the code again...it is $Globals{'lala'}...
>
>
> <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I never saw that is it really working? it is supposed to be
> $_GLOBAL['lala']
> > too.. but..
> >
> > --
> >
> > Nicos - CHAILLAN Nicolas
> > [EMAIL PROTECTED]
> > www.WorldAKT.com - Hébergement de sites Internet
> >
> > "Alex Shi" <[EMAIL PROTECTED]> a écrit dans le message de news:
> > [EMAIL PROTECTED]
> > > I have almost two years of experience in PHP. so don't think qualified
> for
> > > being a newbie...However still found something don't know when reading
> > > other's code :(
> > >
> > > Here is what I want to know: $Global{'hello'}. What this means? Is it
a
> > > Variable-variable?
> > >
> > > Alex
> > >
> > > --
> > > ---
> > > TrafficBuilder Network:
> > > http://www.bestadv.net/index.cfm?ref=7029
> > >
> >
> >
>
>
> --
> 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: Question about character acces, [] vs {}

2002-09-06 Thread nicos

Where did you seen that it is depreciated?

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Robert Cummings" <[EMAIL PROTECTED]> a écrit dans le message de
news: [EMAIL PROTECTED]
>
> Some time ago i wrote some code where I used the now deprecated
> form of accessing characters in a string $string[x]... Would there
> be much of a performance gain for me to go take the time to update
> the code to the newer $string{x} style?
>
> Cheers,
> Rob.
> --
> .-.
> | Robert Cummings |
> :-`.
> | Webdeployer - Chief PHP and Java Programmer  |
> :--:
> | Mail  : mailto:[EMAIL PROTECTED] |
> | Phone : (613) 731-4046 x.109 |
> :--:
> | Website : http://www.webmotion.com   |
> | Fax : (613) 260-9545 |
> `--'



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




[PHP] Re: stupid question

2002-09-06 Thread nicos

It looks like that some yrs ago, the variable $GLOBALS contains all the
variable of the page so thats like describing the variable of the page.
I'm not sure too, I've never tested/used it.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - H¨¦bergement de sites Internet

"Alex Shi" <[EMAIL PROTECTED]> a ¨¦crit dans le message de news:
[EMAIL PROTECTED]
> I checked the code again...it is $Globals{'lala'}...
>
>
> <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I never saw that is it really working? it is supposed to be
> $_GLOBAL['lala']
> > too.. but..
> >
> > --
> >
> > Nicos - CHAILLAN Nicolas
> > [EMAIL PROTECTED]
> > www.WorldAKT.com - Hébergement de sites Internet
> >
> > "Alex Shi" <[EMAIL PROTECTED]> a écrit dans le message de news:
> > [EMAIL PROTECTED]
> > > I have almost two years of experience in PHP. so don't think qualified
> for
> > > being a newbie...However still found something don't know when reading
> > > other's code :(
> > >
> > > Here is what I want to know: $Global{'hello'}. What this means? Is it
a
> > > Variable-variable?
> > >
> > > Alex
> > >
> > > --
> > > ---
> > > TrafficBuilder Network:
> > > http://www.bestadv.net/index.cfm?ref=7029
> > >
> >
> >
>



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




Re: [PHP] Line Breaks in dynamic Download

2002-09-06 Thread Kevin Stone

I used different chars for testing purposes only.  chr() function helped
with the original problem.  Again, the new problem is that the Text is not
downloading as a file.  It is just being printed to the screen.  Any ideas
why it wouldn't be prompting the downloading?

-Kevin

- Original Message -
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "'Kevin Stone'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 1:21 PM
Subject: RE: [PHP] Line Breaks in dynamic Download


> [snip]
>  header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=TEST.txt");
> echo "LINE ONE".chr(13)."LINE TWO".chr(10)."LINE THREE";
> ?>
> [/snip]
>
> Try this;
>
>  header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=TEST.txt");
> echo "LINE ONE".chr(13).chr(10)."LINE TWO"chr(13).chr(10)."LINE THREE";
> ?>
>
> HTH!
>
> Jay
>
>
> --
> 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] Question about character acces, [] vs {}

2002-09-06 Thread Robert Cummings


Some time ago i wrote some code where I used the now deprecated
form of accessing characters in a string $string[x]... Would there
be much of a performance gain for me to go take the time to update
the code to the newer $string{x} style?

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] Re: setting javascript variables on url

2002-09-06 Thread Mark McCulligh

Use the  JavaScript object "Location"

Example:
URL: http://www.www.com/index.htm?foo=bar
location.search;   returns ?foo=bar

Then use the JavaScript object "String" to search the string and exact the
value.
Use the method:  indexOf( ) to search the string for the character "="
Then use the method: substr( ) to get the "bar" out of the string.

Mark.
_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
[EMAIL PROTECTED]
- Original Message -
From: "Raphael Hamzagic" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 3:06 PM
Subject: setting javascript variables on url


> Anyone knows if there's a way to set a javascript variable in the calling
> url. Like:
>
> http://www.www.com/index.htm?foo=bar
>
> in index.htm:
> 
> 
> 
>
> Should print "bar"
>
> Thanks
>
> Raphael
>
>


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




[PHP] Re: stupid question

2002-09-06 Thread Alex Shi

I checked the code again...it is $Globals{'lala'}...


<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I never saw that is it really working? it is supposed to be
$_GLOBAL['lala']
> too.. but..
>
> --
>
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
>
> "Alex Shi" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > I have almost two years of experience in PHP. so don't think qualified
for
> > being a newbie...However still found something don't know when reading
> > other's code :(
> >
> > Here is what I want to know: $Global{'hello'}. What this means? Is it a
> > Variable-variable?
> >
> > Alex
> >
> > --
> > ---
> > TrafficBuilder Network:
> > http://www.bestadv.net/index.cfm?ref=7029
> >
>
>


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




[PHP] Re: rasmus@lerdorf.on.ca

2002-09-06 Thread nicos

Ewps wrong location.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

<[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Hello,
>
> After using the master.php.net's users website since few years, I
think
> that we should put more fonctions at it, like levels, more utils etc. If
you
> allow me to do something, tell me I should make a _better_ user
> administration page. If you have any idea, suggestions please tell me.
>
> Thanks you for your great work with PHP.
>
> --
>
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
>
>
>



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




[PHP] rasmus@lerdorf.on.ca

2002-09-06 Thread nicos

Hello,

After using the master.php.net's users website since few years, I think
that we should put more fonctions at it, like levels, more utils etc. If you
allow me to do something, tell me I should make a _better_ user
administration page. If you have any idea, suggestions please tell me.

Thanks you for your great work with PHP.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet




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




RE: [PHP] Line Breaks in dynamic Download

2002-09-06 Thread Jay Blanchard

[snip]

[/snip]

Try this;



HTH!

Jay


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




Re: [PHP] replacing \n with

2002-09-06 Thread Robert Cummings

David T-G wrote:
> 
> Brent --
> 
> The data file format is
> 
>   field@@data
>   field@@data
>   ...
> 
> and a real example is
> 
>   comment@@this is a comment
>   latdir@@N
>   londir@@W
>   latdec@@36
>   londec@@89
>   ...
> 
> and my code [now, after mods,] looks like
> 
>   ...
>   if ( file_exists($filelocation) ) # do we have an info file?
>   {
> $newfile = fopen($filelocation,"r");# grab it and start reading!
> while ( !feof ($newfile) )  # (go only until the end, of 
>course)
> {
>   $commentline = trim(fgets($newfile)); # get one line with 
>whitespace trimmed
>   if ( $commentline )   # a line with data?
>   {
> list ($field,$data) = preg_split("/@@/",$commentline);  # split it
> $content[$field] = preg_replace("//","\n",$data) ;  # replace our 
>swapped ''s with original '\n's and store it in the hash
>   }
> }
> fclose($newfile);   # always lock up
>   }
>   ...
> 
> so I'm just using fgets to read it.  The reason it looks that way is
> because, after the user has had the opportunity to edit the fields and
> hits the button, I process the data as
> 
>   ...
> $newfile = fopen($filelocation,"w");
> foreach ($keylist as $k)# loop thru keys
>   { 
>fwrite($newfile,"$k@@".ereg_replace("(\n|\r)+","",stripslashes(${base64_encode($k)}))."\n")
> ; } # write the clear text out
> fclose($newfile);
>   ...
> 
> Although I've solved the problem for now, the next version will probably
> end the data with a @@ and so I can just read another line if I don't
> have a closer.

Ignore me if this has already crossed your mind... but why not
use XML? You format would be extensible and there are utilities
that can process the input for you.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] Re: setting javascript variables on url

2002-09-06 Thread nicos

Take that to the correct newsgroup.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Raphael Hamzagic" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Anyone knows if there's a way to set a javascript variable in the calling
> url. Like:
>
> http://www.www.com/index.htm?foo=bar
>
> in index.htm:
> 
> 
> 
>
> Should print "bar"
>
> Thanks
>
> Raphael
>
>



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




[PHP] Re: stupid question

2002-09-06 Thread nicos

I never saw that is it really working? it is supposed to be $_GLOBAL['lala']
too.. but..

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Alex Shi" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> I have almost two years of experience in PHP. so don't think qualified for
> being a newbie...However still found something don't know when reading
> other's code :(
>
> Here is what I want to know: $Global{'hello'}. What this means? Is it a
> Variable-variable?
>
> Alex
>
> --
> ---
> TrafficBuilder Network:
> http://www.bestadv.net/index.cfm?ref=7029
>



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




Re: [PHP] Line Breaks in dynamic Download

2002-09-06 Thread Larry Irwin

Here's what your file contains:

ccadev:/# od -c TEST.txt
000L   I   N   E   O   N   E  \r   L   I   N   E   T   W
020O  \n   L   I   N   E   T   H   R   E   E
034

Wordpad handles it. Notepad does not.
But you have different line terminators for each line
Later,
Larry Irwin

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 2:48 PM
Subject: [PHP] Line Breaks in dynamic Download


> I have a script that allows clients to download their email lists from a
> database.  However I can not get the 'new line' characters (\n \r) to do
> their job in Notepad when the download is prompted and the file saved to
> disk.  I've simplified the problem with the code below.  Both \n and \r
> display as 'null' or undefined characters in Notepad.  What am I doing
> wrong?
>
>  $file = "LINE ONE\nLINE TWO\rLINE THREE\n\r";
>
> header("Cache-control: private");
> header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=TEST.txt");
> echo $file;
> ?>
>
> http://www.helpelf.com/texttest.php Click here to run this code.  You
should
> be prompted to save the file.  Open the resulting file in Notepad on your
> PC.  Tell me if the newlines show as 'null' characters or if each LINE
ONE,
> LINE TWO, etc. shows up on their own lines.  Mac users also welcome to try
> in Simpletext/BBedit.
>
> Much thanks,
> Kevin Stone
> [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] replacing \n with

2002-09-06 Thread David T-G

Brent --

...and then Brent Baisley said...
% 
% Sorry. Since you were looking to use , I thought you were creating 
% HTML content. But then, line feeds are ignored in HTML so then you 

Well, yes and no.


% wouldn't have a problem with them. I should have thought of that.

Well, yes and no :-)  It's my app, and it's understandable that you don't
already know everything about it from having not seen it yet!


% 
% How are you reading the file? The key being that you said you read it 
% "line by line". Once you read a line, could you just grab the first 
% length-1 characters and then do your parsing on that?

The data file format is

  field@@data
  field@@data
  ...

and a real example is

  comment@@this is a comment
  latdir@@N
  londir@@W
  latdec@@36
  londec@@89
  ...

and my code [now, after mods,] looks like

  ...
  if ( file_exists($filelocation) ) # do we have an info file?
  {
$newfile = fopen($filelocation,"r");# grab it and start reading!
while ( !feof ($newfile) )  # (go only until the end, of 
course)
{
  $commentline = trim(fgets($newfile)); # get one line with whitespace 
trimmed
  if ( $commentline )   # a line with data?
  {
list ($field,$data) = preg_split("/@@/",$commentline);  # split it
$content[$field] = preg_replace("//","\n",$data) ;  # replace our swapped 
''s with original '\n's and store it in the hash
  }
}
fclose($newfile);   # always lock up
  }
  ...

so I'm just using fgets to read it.  The reason it looks that way is
because, after the user has had the opportunity to edit the fields and
hits the button, I process the data as

  ...
$newfile = fopen($filelocation,"w");
foreach ($keylist as $k)# loop thru keys
  { 
fwrite($newfile,"$k@@".ereg_replace("(\n|\r)+","",stripslashes(${base64_encode($k)}))."\n")
 ; } # write the clear text out
fclose($newfile);
  ...

Although I've solved the problem for now, the next version will probably
end the data with a @@ and so I can just read another line if I don't
have a closer.


Thanks again & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78115/pgp0.pgp
Description: PGP signature


[PHP] Script for drawing

2002-09-06 Thread Verdon Vaillancourt

Hi List,

Is anyone aware of a script that would allow an image file to be read (like
a map) and then allow a user to add a dot (or any other shape) and/or text
to the image and then save the resulting image.

TIA, verdon


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




Re: [PHP] Re: Hardware Address

2002-09-06 Thread bbonkosk

Someone already posted a solution, which was a great idea actually :-)

exec("arp $_SERVER[REMOTE_ADDR]", $output);
echo "H/W Addr should be: $output[1]";

Because you are on a LAN, you should be easily able to acertain the MAC address 
through ARP.  This would not qork for non-LAN situations, but it should for 
you.

-Brad

> Hello all,
> 
> The application I am trying to should only be accessible from work as it
> is 
> a timeclock. Consequently, a login will, unfortunately, not work. An IP 
> address may work, but the whole university is on DHCP and I do not want
t> hem 
> to clock in from other parts of the university (student labs, etc.). I
am>  
> not set on using hardware addresses, but it seems like a way to do it if
> PHP 
> allows, which it appears to not. I am open to any suggestions any of you 
> might have. I believe all the computers are on the same collision
domain.>  I 
> dont know if that helps though...
> 
> Thanks for all your help,
> Chris
> 
> >From: Brent Baisley <[EMAIL PROTECTED]>
> >To: Tyler Longren <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [PHP] Re: Hardware  Address
> >Date: Fri, 6 Sep 2002 08:49:35 -0400
> >
> >To get the hardware address you need to dig down through the network 
> >layers. If you look at the OSI 7 network model (used on all systems),
yo> u 
> >will see that PHP really operates on layers 6 & 7. The hardware address 
> >(MAC Address) is down on layer 2, the data link layer. The layered
model>  is 
> >designed to assure compatibility and ease of implementation. Meaning,
ea> ch 
> >layer does what it is supposed to and doesn't care how the other layers 
> >accomplish their job.
> >I highly doubt that PHP would be permitted to dig down into the network 
> >stack when it's not running as root. I'm not sure what you mean by 
> >"universities and broadband isp do 'this'". If you are referring to 
> >limiting bandwidth, this should be, and usually is, done on the router 
> >level. ISP's want to limit use of their network bandwidth, not their
ser> ver 
> >bandwidth.
> >
> >Limiting use of an application is normally done through a user login. 
> >Wouldn't you want to limit the user not a specific computer? Besides,
it> 's 
> >easy enough to override the hardware address of a network card or even
u> se 
> >a different one. Easier than IP spoofing.
> >
> >
> >On Thursday, September 5, 2002, at 09:45 PM, Tyler Longren wrote:
> >
> >>using exec() or system() will only be able to execute commands on the
> >>machine php is installed on.  I sometimes wonder how universities and
> >>broadband isp's do this.  I'd be interested in seeing how it works.
> >>
> >>Sorry, I'm not much help anymore.
> >>
> >>tyler
> >>
> >>On Fri, 6 Sep 2002 01:24:07 +0200
> >><[EMAIL PROTECTED]> wrote:
> >>
> >>>Hi,
> >>>
> >>>The best way I think is to use exec() or system() to ask that to the
> >>>system. May be someone knows something better too.
> >>>
> >>>--
> >>>
> >>>Nicos - CHAILLAN Nicolas
> >>>[EMAIL PROTECTED]
> >>>www.WorldAKT.com - Hébergement de sites Internet
> >>>
> >>>"Chris Cook" <[EMAIL PROTECTED]> a écrit dans le message de news:
> >>>[EMAIL PROTECTED]
> Hello all,
> 
> I am working on a LAN application and am interested in obtaining the
> >>>user's
> network card address to limit usage of the program. Is there a way
> to do this in PHP?
> 
> I am on a network that uses DHCP so using the IP address probably
> wont
> >>>work
> and I am also worried about IP spoofing.
> 
> Thanks for any help you can provide,
> Chris
> 
> 
> _
> Send and receive Hotmail on your mobile device:
> http://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
> >>
> >>
> >--
> >Brent Baisley
> >Systems Architect
> >Landover Associates, Inc.
> >Search & Advisory Services for Advanced Technology Environments
> >p: 212.759.6400/800.759.0577
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> _
> Chat with friends online, try MSN Messenger: http://messenger.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




Re: [PHP] Sessions with register_globals = off

2002-09-06 Thread Daniel Guerrier

Here you go

http://www.zend.com/manual/function.session-is-registered.php
--- Mauricio Cuenca <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I'm working with register_globals turned off. I'm
> setting this session
> cookie:
> 
>if ($nresult) {
>   if (mysql_numrows($nresult)) {
>   session_start();
>  $_SESSION['auth'] = 'TRUE'; } }
> 
> And then I'm checking if the cookie is set, but it
> doesn't work:
>if ($_SESSION['auth'] == 'TRUE') {
>   show_menu(); }
> 
> Is there any error on my code ? What am I doing
> wrong ?
> I read this on http://www.php.net/release_4_1_0.php:
> "Another neat trick is that creating new entries in
> the $_SESSION array will
> automatically register them as session variables, as
> if you called
> session_register(). This trick is limited to the
> session module only - for
> example, setting new entries in $_ENV will *not*
> perform an implicit
> putenv()."
> 
> That's what I am not using
> sessione_register($variable).
> 
> TIA,
> 
> _
> Mauricio Cuenca
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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




Re: [PHP] Line Breaks in dynamic Download

2002-09-06 Thread Kevin Stone

Much thanks.  This works but now it won't propmpt the download.  Once the
headers are sent anything going to std out is part of the download correct?
But this is just printing to the screen.  Any thoughts there?



-Kevin

- Original Message -
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "'Kevin Stone'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 12:55 PM
Subject: RE: [PHP] Line Breaks in dynamic Download


> [snip]
> I have a script that allows clients to download their email lists from a
> database.  However I can not get the 'new line' characters (\n \r) to do
> their job in Notepad when the download is prompted and the file saved to
> disk.  I've simplified the problem with the code below.  Both \n and \r
> display as 'null' or undefined characters in Notepad.  What am I doing
> wrong?
>
>  $file = "LINE ONE\nLINE TWO\rLINE THREE\n\r";
>
> header("Cache-control: private");
> header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=TEST.txt");
> echo $file;
> ?>
> [/snip]
>
> They're undefined characters. Notepad has this whole silly Windoze thing
> going on requiring a carriage return-linefeed at the end of each line you
> wish break. So you will either need to do \r\n or chr(13) chr(10) at each
> place you want a break (or a ^m). This happens to be an anomaly with
> Notepad, which unlike popular belief is not really a text editor, it just
> plays one on TV. Open your file in WordPAd, and prepare to be amazed.
>
> HTH!
>
> Jay
>
> *
> * Texas PHP Developers Conf  Spring 2003*
> * T Bar M Resort & Conference Center*
> * New Braunfels, Texas  *
> * Contact [EMAIL PROTECTED]   *
> *   *
> * Want to present a paper or workshop? Contact now! *
> *
>
>
>
> --
> 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] setting javascript variables on url

2002-09-06 Thread Raphael Hamzagic

Anyone knows if there's a way to set a javascript variable in the calling
url. Like:

http://www.www.com/index.htm?foo=bar

in index.htm:




Should print "bar"

Thanks

Raphael



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




Re: [PHP] PHP and Apache

2002-09-06 Thread Steve Edberg

It's certainly _possible_ -

Your httpd.conf (I'm assuming you use Apache, of course) file is just 
a text file that can be read/written like anything else. Then you 
could do a

system('/path/to/apache/bin/apachectl restart');

to activate. Doing it this simply, thoughm means that your 
webserver's user (usually nobody) would have write access to the conf 
file and execute perms to apachectl, which could open up some 
bulldozer-security holes. At the very least, you want to access 
things through SSL.

But you might want to try Webmin:

http://www.webmin.com/

Looks very comprehensive, and I've seem a number of good 
recommendations for it. I've been planning on doing a little testing 
of it on my test server, but haven't had the time.

-steve



At 4:48 PM +0100 9/6/02, Tim Haynes wrote:
>Is there any easy way of creating,editing and deleting virtual hosts using
>PHP via a website??  I have already thought of a way but seems a little long
>winded.
>
>Thanks in advance.


-- 
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| The end to politics as usual:  |
| The Monster Raving Loony Party (http://www.omrlp.com/) |
++

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




Re: [PHP] Re: Hardware Address

2002-09-06 Thread Chris Cook

Hello all,

The application I am trying to should only be accessible from work as it is 
a timeclock. Consequently, a login will, unfortunately, not work. An IP 
address may work, but the whole university is on DHCP and I do not want them 
to clock in from other parts of the university (student labs, etc.). I am 
not set on using hardware addresses, but it seems like a way to do it if PHP 
allows, which it appears to not. I am open to any suggestions any of you 
might have. I believe all the computers are on the same collision domain. I 
dont know if that helps though...

Thanks for all your help,
Chris

>From: Brent Baisley <[EMAIL PROTECTED]>
>To: Tyler Longren <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] Re: Hardware  Address
>Date: Fri, 6 Sep 2002 08:49:35 -0400
>
>To get the hardware address you need to dig down through the network 
>layers. If you look at the OSI 7 network model (used on all systems), you 
>will see that PHP really operates on layers 6 & 7. The hardware address 
>(MAC Address) is down on layer 2, the data link layer. The layered model is 
>designed to assure compatibility and ease of implementation. Meaning, each 
>layer does what it is supposed to and doesn't care how the other layers 
>accomplish their job.
>I highly doubt that PHP would be permitted to dig down into the network 
>stack when it's not running as root. I'm not sure what you mean by 
>"universities and broadband isp do 'this'". If you are referring to 
>limiting bandwidth, this should be, and usually is, done on the router 
>level. ISP's want to limit use of their network bandwidth, not their server 
>bandwidth.
>
>Limiting use of an application is normally done through a user login. 
>Wouldn't you want to limit the user not a specific computer? Besides, it's 
>easy enough to override the hardware address of a network card or even use 
>a different one. Easier than IP spoofing.
>
>
>On Thursday, September 5, 2002, at 09:45 PM, Tyler Longren wrote:
>
>>using exec() or system() will only be able to execute commands on the
>>machine php is installed on.  I sometimes wonder how universities and
>>broadband isp's do this.  I'd be interested in seeing how it works.
>>
>>Sorry, I'm not much help anymore.
>>
>>tyler
>>
>>On Fri, 6 Sep 2002 01:24:07 +0200
>><[EMAIL PROTECTED]> wrote:
>>
>>>Hi,
>>>
>>>The best way I think is to use exec() or system() to ask that to the
>>>system. May be someone knows something better too.
>>>
>>>--
>>>
>>>Nicos - CHAILLAN Nicolas
>>>[EMAIL PROTECTED]
>>>www.WorldAKT.com - Hébergement de sites Internet
>>>
>>>"Chris Cook" <[EMAIL PROTECTED]> a écrit dans le message de news:
>>>[EMAIL PROTECTED]
Hello all,

I am working on a LAN application and am interested in obtaining the
>>>user's
network card address to limit usage of the program. Is there a way
to do this in PHP?

I am on a network that uses DHCP so using the IP address probably
wont
>>>work
and I am also worried about IP spoofing.

Thanks for any help you can provide,
Chris


_
Send and receive Hotmail on your mobile device:
http://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
>>
>>
>--
>Brent Baisley
>Systems Architect
>Landover Associates, Inc.
>Search & Advisory Services for Advanced Technology Environments
>p: 212.759.6400/800.759.0577
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




RE: [PHP] generating variable names

2002-09-06 Thread Daniel Masson

Hi ... You can make it like this:

If you have 
$variable4[0]="four";

Then you can have a new variable

$$variable[0] , and the new variable´s name is four


Cordialmente

Daniel Massón => Ingeniero de desarollo

[EMAIL PROTECTED]

www.imagine.com.co

Tels: (57)(1) 2182064 - 6163218

Bogotá - Colombia



- Soluciones web para internet e intranet

- Asesoría y Soporte Técnico

- Licenciamiento de Software 



-Mensaje original-
De: Kevin Heflin [mailto:[EMAIL PROTECTED]] 
Enviado el: viernes, 06 de septiembre de 2002 13:38
Para: php-general
Asunto: [PHP] generating variable names


Hoping someone can help me with this. Below I have an example of what 
I'm trying to accomplish.
Bottom line.. I need to print out $variable3[0] and $variable4[0] and my
problem is that I'm trying to generate the variable name. I can 
get this to work with $variable1 and $variable2 which are not arrays, 
however that doesn't help me much.

Any suggestions would be appreciated.

Kevin



");
$j++;
}


$j=1;
while($j<5){
$k="\$variable".$j."[0]";
print("$k ");
print("${variable.$k} ");
$j++;
}
?>


-- 
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] Line Breaks in dynamic Download

2002-09-06 Thread Jay Blanchard

[snip]
I have a script that allows clients to download their email lists from a
database.  However I can not get the 'new line' characters (\n \r) to do
their job in Notepad when the download is prompted and the file saved to
disk.  I've simplified the problem with the code below.  Both \n and \r
display as 'null' or undefined characters in Notepad.  What am I doing
wrong?


[/snip]

They're undefined characters. Notepad has this whole silly Windoze thing
going on requiring a carriage return-linefeed at the end of each line you
wish break. So you will either need to do \r\n or chr(13) chr(10) at each
place you want a break (or a ^m). This happens to be an anomaly with
Notepad, which unlike popular belief is not really a text editor, it just
plays one on TV. Open your file in WordPAd, and prepare to be amazed.

HTH!

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



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




Re: [PHP] Line Breaks in dynamic Download

2002-09-06 Thread Chris Boget

>  $file = "LINE ONE\nLINE TWO\rLINE THREE\n\r";

Try this instead and see if it works...

$windowsNewLine = chr(13) . chr(10);

$file = "LINE ONE{$windowsNewLine}LINE TWO{$windowsNewLine}LINE 
THREE{$windowsNewLine}";

Not sure if Notepad will interpret \r\n correctly...

Chris



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




[PHP] stupid question

2002-09-06 Thread Alex Shi

I have almost two years of experience in PHP. so don't think qualified for 
being a newbie...However still found something don't know when reading 
other's code :( 

Here is what I want to know: $Global{'hello'}. What this means? Is it a 
Variable-variable?

Alex

-- 
---
TrafficBuilder Network: 
http://www.bestadv.net/index.cfm?ref=7029


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




[PHP] Line Breaks in dynamic Download

2002-09-06 Thread Kevin Stone

I have a script that allows clients to download their email lists from a
database.  However I can not get the 'new line' characters (\n \r) to do
their job in Notepad when the download is prompted and the file saved to
disk.  I've simplified the problem with the code below.  Both \n and \r
display as 'null' or undefined characters in Notepad.  What am I doing
wrong?



http://www.helpelf.com/texttest.php Click here to run this code.  You should
be prompted to save the file.  Open the resulting file in Notepad on your
PC.  Tell me if the newlines show as 'null' characters or if each LINE ONE,
LINE TWO, etc. shows up on their own lines.  Mac users also welcome to try
in Simpletext/BBedit.

Much thanks,
Kevin Stone
[EMAIL PROTECTED]


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




[PHP] generating variable names

2002-09-06 Thread Kevin Heflin

Hoping someone can help me with this. Below I have an example of what 
I'm trying to accomplish.
Bottom line.. I need to print out $variable3[0] and $variable4[0]
and my problem is that I'm trying to generate the variable name. I can 
get this to work with $variable1 and $variable2 which are not arrays, 
however that doesn't help me much.

Any suggestions would be appreciated.

Kevin



");
$j++;
}


$j=1;
while($j<5){
$k="\$variable".$j."[0]";
print("$k ");
print("${variable.$k} ");
$j++;
}
?>


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




RE: [PHP] Newbie alert - Ok don't yell at me...

2002-09-06 Thread Jay Blanchard

[snip]
I am such a newbie it's not funny.  I have a php bible and I am checking the
code on three different websites.

I was wondering if someone had some sample code on this:

I want to list field1 from a mysql db - (I can do that)  - but I want to put
a hyperlink so the user can click it and go into the entire record to
update.
[/snip]

while($row = mysql_fetch_object($result)){
   print("" . field1 . "");
}

You just print the desired field into an a tag, if I am understanding you
correctly. I would have to see your code to let you know more.

HTH!

Jay



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




[PHP] Newbie alert - Ok don't yell at me...

2002-09-06 Thread Fountain, Jennifer (Thomastech)

I am such a newbie it's not funny.  I have a php bible and I am checking the
code on three different websites. 

I was wondering if someone had some sample code on this:

I want to list field1 from a mysql db - (I can do that)  - but I want to put
a hyperlink so the user can click it and go into the entire record to
update.  

I can't make this happen successfully.

Thanks for any help!



-Jenn





Re: [PHP] replacing \n with

2002-09-06 Thread Brent Baisley

Sorry. Since you were looking to use , I thought you were creating 
HTML content. But then, line feeds are ignored in HTML so then you 
wouldn't have a problem with them. I should have thought of that.

How are you reading the file? The key being that you said you read it 
"line by line". Once you read a line, could you just grab the first 
length-1 characters and then do your parsing on that?


On Friday, September 6, 2002, at 12:46 PM, David T-G wrote:

> I don't want to simply add a ; I want to *replace* the newline (and
> return, as we found out in a subthread).
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




RE: [PHP] Image Resizing ... lets try this again.

2002-09-06 Thread Dave at Sinewaves.net

search the archive - i posted a gd1 solution about 2 or 3 weeks ago...

dave



-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 7:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Image Resizing ... lets try this again.


I sent this email out earlier this morning and got no response. It was quite
early so I thought I would send it again now that more people are hopefully
at work :-)





I have been trying to figure out the best way to resize photo quality images
to thumbnail size and have them come out looking good. I have read about the
function "  >

imagecreatetruecolor()" and it looks like it may do this. However I do not
have GD 2 installed which is required for this function to work. In the
process of trying to figure out how to install GD v2 I came across the
following page.



http://www.php.net/manual/en/ref.image.php


 >



On this page is says;







 "Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled
version has some additional features like alpha blending and should be used
in preference to the external library since it's codebase is better
maintained and more stable."







I thought the most recent version of php was 4.2.2?







Anyway if there is a better way to resize images to create "high quality"
thumbnails I would love to hear about it. I am on a redhat 7.3 server and
not very familiar with linux. I would prefer not to have to take the time
involved in learning how to install new packages right now, but realize this
may be unavoidable.







Thanks in advance for any help.





























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




RE: [PHP] Web based FTP client

2002-09-06 Thread David Buerer

no more of a security breach than any other ftp client a user would make the
CHOICE to use.  Hey, it's our responsibility as developers to make things as
secure as possible...but only to the point that we continue to help meet the
needs of our clients.  When we stop meeting the needs because of our
obsession with security we've failed.

-Original Message-
From: Chris Hewitt [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 11:11 AM
To: Mark McCulligh
Cc: David Buerer; [EMAIL PROTECTED]
Subject: Re: [PHP] Web based FTP client


Mark McCulligh wrote:

>
>I know how to browse the user's file system using JavaScript or VBScript if
>I use the ActiveX object "FileSystemObject" but then the site will only
work
>
Sounds like a massive security breach.

Chris




Re: [PHP] Web based FTP client

2002-09-06 Thread Chris Hewitt

Mark McCulligh wrote:

>
>I know how to browse the user's file system using JavaScript or VBScript if
>I use the ActiveX object "FileSystemObject" but then the site will only work
>
Sounds like a massive security breach.

Chris


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




[PHP] Re: PHP 4.2.3 released

2002-09-06 Thread Remus Agundar

No announcement in php.announce?

"Zeev Suraski" <[EMAIL PROTECTED]> wrote in message
5.1.0.14.2.20020906171453.01c4d668@localhost">news:5.1.0.14.2.20020906171453.01c4d668@localhost...
> PHP 4.2.3 has been released.  It is a maintenance release
and includes a
> large number of fixes for the previous 4.2.2 version.
4.2.3 is a
> recommended upgrade for all users of PHP, and particularly
Windows users.
>
> Full list of changes:
> - Enabled strcoll() on win32. (Markus)
> - Fixed possible ASCII control char injection in mail().
(Stefan Esser)
> - Fixed a potential crash bug in
import_request_variables() (Zeev)
> - Fixed several problems with directory functions on
Windows. (Steph)
> - Fixed xbithack bug in Apache module. (Rasmus)
> - Fixed a bug that prevented touch() from working on
various platforms. (Steph)
> - Fixed ob_gzhandler()'s handling of requests that do have
the Accept-Encoding
>header, but do not allow compression. (Zeev)
> - Fixed several bugs in the multithreaded version that
could cause random parse
>errors, especially on machines with multiple CPUs.
(Zeev, Zend Engine)
> - Fixed a build problem in bcmath. (Alan)
> - Fixed several bzip2 issues. (Andrei, kalowsky)
> - Fixed several COM issues. (Harald)
> - Various exif fixes. (Marcus)
> - Fixed domxml_xslt_process() and
domxml_get_element_by_id() and several
>other issues in DOMXML. (Christian)
> - Fixed DOMXML crash on removing previously created
attributes. (Christian)
> - Fixed crash when converting $GLOBALS to an object.
(Zeev, Zend Engine)
> - Fixed ImageCreateFromGD2Part() (Jani)
> - Fixed a build issue in the IMAP extension under IRIX.
(kalowsky)
> - Fixed a bug in imap_last_error() (Jani)
> - Various mbstring fixes. (Yasuo, Rui)
> - Fixed a build problem in the mcal extension. (Jani)
> - Made MySQL rollback open transactions when the request
ends. (Georg)
> - Fixed a crash in the shutdown order of the ODBC module.
(kalowsky)
> - Fixed PCRE build problems. ([EMAIL PROTECTED])
> - Fixed a crash in pg_lo_write() (Yasuo)
> - Fixed posix_isatty() and posix_ttyname(). (Markus)
> - Fixed accidental pg_lo_import() API change. (Yasuo)
> - Fixed ereg_replace() crash when the backreference number
was greater than the
>number of captured subpatterns.
([EMAIL PROTECTED])
> - Fixed array_rand() on thread-safe platforms such as
Windows. (Edin)
> - Report the right exit code after a call to exit().
(Edin)
>
> Shana tova,
>
> Zeev
>



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




[PHP] Sessions with register_globals = off

2002-09-06 Thread Mauricio Cuenca

Hello,

I'm working with register_globals turned off. I'm setting this session
cookie:

   if ($nresult) {
  if (mysql_numrows($nresult)) {
  session_start();
 $_SESSION['auth'] = 'TRUE'; } }

And then I'm checking if the cookie is set, but it doesn't work:
   if ($_SESSION['auth'] == 'TRUE') {
  show_menu(); }

Is there any error on my code ? What am I doing wrong ?
I read this on http://www.php.net/release_4_1_0.php:
"Another neat trick is that creating new entries in the $_SESSION array will
automatically register them as session variables, as if you called
session_register(). This trick is limited to the session module only - for
example, setting new entries in $_ENV will *not* perform an implicit
putenv()."

That's what I am not using sessione_register($variable).

TIA,

_
Mauricio Cuenca



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




[PHP] Re: PHP 4.2.3 released

2002-09-06 Thread nicos

Nice work.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

"Zeev Suraski" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> PHP 4.2.3 has been released.  It is a maintenance release and includes a
> large number of fixes for the previous 4.2.2 version.  4.2.3 is a
> recommended upgrade for all users of PHP, and particularly Windows users.
>
> Full list of changes:
> - Enabled strcoll() on win32. (Markus)
> - Fixed possible ASCII control char injection in mail(). (Stefan Esser)
> - Fixed a potential crash bug in import_request_variables() (Zeev)
> - Fixed several problems with directory functions on Windows. (Steph)
> - Fixed xbithack bug in Apache module. (Rasmus)
> - Fixed a bug that prevented touch() from working on various platforms.
(Steph)
> - Fixed ob_gzhandler()'s handling of requests that do have the
Accept-Encoding
>header, but do not allow compression. (Zeev)
> - Fixed several bugs in the multithreaded version that could cause random
parse
>errors, especially on machines with multiple CPUs. (Zeev, Zend Engine)
> - Fixed a build problem in bcmath. (Alan)
> - Fixed several bzip2 issues. (Andrei, kalowsky)
> - Fixed several COM issues. (Harald)
> - Various exif fixes. (Marcus)
> - Fixed domxml_xslt_process() and domxml_get_element_by_id() and several
>other issues in DOMXML. (Christian)
> - Fixed DOMXML crash on removing previously created attributes.
(Christian)
> - Fixed crash when converting $GLOBALS to an object. (Zeev, Zend Engine)
> - Fixed ImageCreateFromGD2Part() (Jani)
> - Fixed a build issue in the IMAP extension under IRIX. (kalowsky)
> - Fixed a bug in imap_last_error() (Jani)
> - Various mbstring fixes. (Yasuo, Rui)
> - Fixed a build problem in the mcal extension. (Jani)
> - Made MySQL rollback open transactions when the request ends. (Georg)
> - Fixed a crash in the shutdown order of the ODBC module. (kalowsky)
> - Fixed PCRE build problems. ([EMAIL PROTECTED])
> - Fixed a crash in pg_lo_write() (Yasuo)
> - Fixed posix_isatty() and posix_ttyname(). (Markus)
> - Fixed accidental pg_lo_import() API change. (Yasuo)
> - Fixed ereg_replace() crash when the backreference number was greater
than the
>number of captured subpatterns. ([EMAIL PROTECTED])
> - Fixed array_rand() on thread-safe platforms such as Windows. (Edin)
> - Report the right exit code after a call to exit(). (Edin)
>
> Shana tova,
>
> Zeev
>



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




[PHP] Splitting a single class code in multiple php files

2002-09-06 Thread Dario Fumagalli

Hi,

I have a really huge form handler implemented as a single php class.

The handler takes some POST values and depending on their contents calls
some very big member functions.
Now I have to add new functionality and I fear that a 500K php script will
kill server response time.

Since I don't have the time needed for a reenginering my first thought was
to split this big class into about 10 files to be loaded "on demand".

This would be made possible since the members functions are easily grouped
in fairly independent groups each consisting of 3 - 10 functions.

There would be also a "nucleus": the core of the current class (some 10s
functions) that is used widely by others functions (i.e. for authentication
and form variables decryption) and works as a sort of underlying "API".

Unfortunately it is not possible to make those groups completely detached as
normal functions due to the sheer amount of code referencing to the base
nucleus.

If it was C / C++ code (my normal working languages) I'd have no problems,
but in PHP I don't know how to do it (and in a "clean way").

In my intention the implementation had to be something like this:

1) Start of the code (global scope) -> Done.
2) Retrieve the operation to be performed (actually available operations are
identified by constants) -> Done.
3) Call some sort of OperationToInclueFileNames($CurrentOperation) function.
It returns an array of php file names.
Each of these contains the definitions and code of the functions needed
to process $CurrentOperation (and only them). -> Easily Done.
4) Some how require_once() or include_once() (*_once because there is code
that includes others modules in deep levels) at strategic points in order to
effectively load the needed code.
And there is the problem: I can't figure out a working way of putting member
functions outside the main class declaration (I'm using PHP 4.1.1 and it
will NOT be upgraded).
In C++ish style, given the :: scope resolution operator it would be simply a
matter of defining them in another file, i.e.

From

Declaration_and_definition.php
Class Foo {
Member1() {
Body1
};

Member2() {
Body2
}
};


To

Declaration.php
Start();
$CurrentOperation = GetCurrentOperation();
$FileList = OperationToInclueFileNames($CurrentOperation);
For each $FileList element as $FileName require_once($FileName);
End;


File1.php:

Foo::Member1() {
Body1
}

Foo::Member1A() {
Body1A
}

Foo::Member1B() {
Body1B
}
---

File 2.php:

Foo::Member2() {
Body2
}

Foo::Member2A() {
Body2A
}
---

... and so on with other PHP files containing the needed code.


In "real" PHP I don't know how to do it, instead.
Perhaps it might be made to work for functions outside classes, but for me
this way is not an option.
Has anyone ever been in a similar situation and has he / she found a working
(i.e. tested) solution?

Thanks in advance,
Dario Fumagalli



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




[PHP] PHP 4.2.3 released

2002-09-06 Thread Zeev Suraski

PHP 4.2.3 has been released.  It is a maintenance release and includes a 
large number of fixes for the previous 4.2.2 version.  4.2.3 is a 
recommended upgrade for all users of PHP, and particularly Windows users.

Full list of changes:
- Enabled strcoll() on win32. (Markus)
- Fixed possible ASCII control char injection in mail(). (Stefan Esser)
- Fixed a potential crash bug in import_request_variables() (Zeev)
- Fixed several problems with directory functions on Windows. (Steph)
- Fixed xbithack bug in Apache module. (Rasmus)
- Fixed a bug that prevented touch() from working on various platforms. (Steph)
- Fixed ob_gzhandler()'s handling of requests that do have the Accept-Encoding
   header, but do not allow compression. (Zeev)
- Fixed several bugs in the multithreaded version that could cause random parse
   errors, especially on machines with multiple CPUs. (Zeev, Zend Engine)
- Fixed a build problem in bcmath. (Alan)
- Fixed several bzip2 issues. (Andrei, kalowsky)
- Fixed several COM issues. (Harald)
- Various exif fixes. (Marcus)
- Fixed domxml_xslt_process() and domxml_get_element_by_id() and several
   other issues in DOMXML. (Christian)
- Fixed DOMXML crash on removing previously created attributes. (Christian)
- Fixed crash when converting $GLOBALS to an object. (Zeev, Zend Engine)
- Fixed ImageCreateFromGD2Part() (Jani)
- Fixed a build issue in the IMAP extension under IRIX. (kalowsky)
- Fixed a bug in imap_last_error() (Jani)
- Various mbstring fixes. (Yasuo, Rui)
- Fixed a build problem in the mcal extension. (Jani)
- Made MySQL rollback open transactions when the request ends. (Georg)
- Fixed a crash in the shutdown order of the ODBC module. (kalowsky)
- Fixed PCRE build problems. ([EMAIL PROTECTED])
- Fixed a crash in pg_lo_write() (Yasuo)
- Fixed posix_isatty() and posix_ttyname(). (Markus)
- Fixed accidental pg_lo_import() API change. (Yasuo)
- Fixed ereg_replace() crash when the backreference number was greater than the
   number of captured subpatterns. ([EMAIL PROTECTED])
- Fixed array_rand() on thread-safe platforms such as Windows. (Edin)
- Report the right exit code after a call to exit(). (Edin)

Shana tova,

Zeev


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




[PHP] Terminal environment + NCURSES + PHP

2002-09-06 Thread Nikolai Vladychevski


Hello, 

We are developing an aplication to use it over terminal. It has to be a 
text-based application, not web-based. Sine we all know PHP very well and 
only few of us know C, we want to use PHP to develop it. The application 
complexity is like "mc" (Midnight Commander) program and requieres many 
objects like menus, entry fields, selects, radio buttons, and all of this 
widgets need to be for text environment. I have found many widgets (free 
source code) developed in C, but noning for PHP. I wonder, did someone 
developed widget/libraries/otherusefullcode for PHP to use it in a text 
environment? What code related to text environment for php exists at this 
time? I have already compiled my php binary --with-ncurses and I know it is 
possible to develop my own menus, buttons and etc... but I would first ask 
for what is actualy available on the net. 

Thank you very much for any input
Nikolai 


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




Re: [PHP] replacing \n with

2002-09-06 Thread David T-G

Brian --

...and then Brian V Bonini said...
% 
% I'm sorry, I missed the first part of this thread so am only going by its
% subject line mostly... But, I assume you are all aware of the nl2br function

Well, only sorta; I said "replace" in there, you may notice.


% and there's a special reason it does not apply here but I thought I'd
% mention it any way... Just in case... :)

Thanks anyway, but it doesn't work.  See the reply I just sent in this
thread for details.


% 
% -B


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78089/pgp0.pgp
Description: PGP signature


Re: [PHP] replacing \n with

2002-09-06 Thread David T-G

Brent, et al --

...and then Brent Baisley said...
% 
% Why not just use the nl2br() function? It's a lot easier that using any 

Because it doesn't do what I need.  From the Fine Manual:

  nl2br --  Inserts HTML line breaks before all newlines in a string
  string nl2br ( string string)
  Returns string with '' inserted before all newlines.

I don't want to simply add a ; I want to *replace* the newline (and
return, as we found out in a subthread).


% replace function you build yourself.

Except that it doesn't work :-)


Thanks & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78088/pgp0.pgp
Description: PGP signature


[PHP] (SOLVED) Re: [PHP] replacing \n with

2002-09-06 Thread David T-G

Rob, et al --

...and then Robert Cummings said...
% 
% David T-G wrote:
% > 
% > ...and then Robert Cummings said...
% > %
...
% > % $foo = str_replace( "\n", '', $foo );
% > %
% > % That one work for you? It's more efficient too.
% > 
% > Actually, no.  I thought about listing all of the things I had tried (and
...
% > well as the $fin and $fout separation.  I always have the newline left
% > behind.
...
% 
% *ACK* Stoopid microsoft... it's the "\r" character I bet.

That was it, or at least sort of.  Thank heavens I always test before I
post, because I was going to smugly comment that I'm using freebsd *but*
I tried switching to \r and noticed that the added  moved from one
line to the other.  So I whipped up

  $fout = ereg_replace("(\n|\r)+","",$fin) ;

and it works -- there must actually be \r\n there -- and I'll work
backwards from there (I'll use an expression like the above to robustly
handle by-god-anything that comes in!) to get rid of these temp variables.


% 
% Cheers,
% Rob.


Thanks a *bunch*!

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78087/pgp0.pgp
Description: PGP signature


RE: [PHP] unix timestamp

2002-09-06 Thread Adam Voigt

$date = date("U",strtotime("-7 day"));

Have a nice day.

Adam Voigt
[EMAIL PROTECTED]

On Fri, 2002-09-06 at 12:37, Mike richardson wrote:
> The attached class is a date utility that I created a long time ago.  
> 
> It parses out SQL dates, does differences, and specific to your needs,
> you can use dateAdjust() to move a unix timestamp by a number of
> seconds, minutes, hours, days, months, quarters, years or centuries.
> 
> You should be able to either employ this class, or simply look through
> the code to find the answers to most of your date woes.  The only thing
> this class doesn't do, is account for leap years, when working with
> quantities that span multiple months. (never got around to this yet,
> suppose I will need to before 2004!)
> 
> Attached is also a short readme to explain what the functions are and
> what they do (the code itself is also well commented).
> 
> Best wishes!
> 
> Michael "phpzen"
> 
> -Original Message-
> From: andy [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, September 06, 2002 4:50 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] unix timestamp
> 
> 
> Hi everybody,
> 
> I am trying to create a unix timestamp which dates back a certain amount
> of days. Lets say I would like to have a unix timestamp from 7 days ago.
> 
> what I tryed is just to subtract values since this are counted s since
> the start of the unix epoche, but this does not work in cases like the
> switch of months. Has anybody an idea how to do that?
> 
> Thanx, Andy
> 
> 
> 
> -- 
> 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] unix timestamp

2002-09-06 Thread Mike richardson

The attached class is a date utility that I created a long time ago.  

It parses out SQL dates, does differences, and specific to your needs,
you can use dateAdjust() to move a unix timestamp by a number of
seconds, minutes, hours, days, months, quarters, years or centuries.

You should be able to either employ this class, or simply look through
the code to find the answers to most of your date woes.  The only thing
this class doesn't do, is account for leap years, when working with
quantities that span multiple months. (never got around to this yet,
suppose I will need to before 2004!)

Attached is also a short readme to explain what the functions are and
what they do (the code itself is also well commented).

Best wishes!

Michael "phpzen"

-Original Message-
From: andy [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 06, 2002 4:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] unix timestamp


Hi everybody,

I am trying to create a unix timestamp which dates back a certain amount
of days. Lets say I would like to have a unix timestamp from 7 days ago.

what I tryed is just to subtract values since this are counted s since
the start of the unix epoche, but this does not work in cases like the
switch of months. Has anybody an idea how to do that?

Thanx, Andy



-- 
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] replacing \n with

2002-09-06 Thread Brian V Bonini

I'm sorry, I missed the first part of this thread so am only going by its
subject line mostly... But, I assume you are all aware of the nl2br function
and there's a special reason it does not apply here but I thought I'd
mention it any way... Just in case... :)

-B


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




Re: [PHP] replacing \n with

2002-09-06 Thread Brent Baisley

Why not just use the nl2br() function? It's a lot easier that using any 
replace function you build yourself.


On Friday, September 6, 2002, at 11:58 AM, David T-G wrote:

> Hi, all --
>
> I have a php script which writes comments out to a file in the format
>
>   field@@comment
>   field@@comment
>   ...
>
> and everything has worked delightfully -- until someone put in a newline
> in one of the items and now we have
>
>   field@@com
>   ment
>   field@@comment
>   ...
>
> and things break.  I read the file, line by line, and parse on @@ as my
> separator, so anything after a newline is lost.
>
> I thought I'd just replace that newline with a  since that's what 
> the
> user really wants, but I can't get rid of the \n while I'm at it; 
> through
> various attempts at directly replacing or using variables or such like
>
>   preg_replace("/\n/","",$mydatastring) ;
>   preg_replace("/$newline/","$linebreak",$mydatastring) ;
>
> I get mixed results of
>
>   field@@com
>   ment
>
> or
>
>   field@@com
>   ment
>
> but in no case have I managed to get
>
>   field@@comment
>
> which is what I want.
>
> Is there a way to turn off the recognition of \n as an end of line and
> instead operate on the entire $mydatastring?
>
> TIA & HAND
>
> :-D
> --
> David T-G  * It's easier to fight for one's 
> principles
> (play) [EMAIL PROTECTED] * than to live up to them. -- fortune 
> cookie
> (work) [EMAIL PROTECTED]
> http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl 
> Npg!
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




Re: [PHP] replacing \n with

2002-09-06 Thread Robert Cummings

David T-G wrote:
> 
> Rob, et al --
> 
> ...and then Robert Cummings said...
> %
> % Actually on second thought... and I don't know why I went with the
> 
> *grin*
> 
> % crowd in the first place... I do the following:
> %
> % $foo = "I don't like\nnewlines";
> %
> % $foo = str_replace( "\n", '', $foo );
> %
> % That one work for you? It's more efficient too.
> 
> Actually, no.  I thought about listing all of the things I had tried (and
> ereg_replace wasn't one of 'em) in my post but didn't want to clutter
> things up.  I've tried str_replace, preg_replace, and now ereg_replace,
> and have tried working on the function extraction of the data directly as
> well as the $fin and $fout separation.  I always have the newline left
> behind.
> 
> I'm a [rusty] perl guy, and so I keep wanting to know what's the magic
> variable in PHP to set to make it eat entire paragraphs, like $/ or such
> in perl (there's where the rusty part comes in!).  If these functions are
> just operating on a single line then the newline(s) won't get eaten.

*ACK* Stoopid microsoft... it's the "\r" character I bet.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] replacing \n with

2002-09-06 Thread David T-G

Rob, et al --

...and then Robert Cummings said...
% 
% Actually on second thought... and I don't know why I went with the

*grin*


% crowd in the first place... I do the following:
% 
% $foo = "I don't like\nnewlines";
% 
% $foo = str_replace( "\n", '', $foo );
% 
% That one work for you? It's more efficient too.

Actually, no.  I thought about listing all of the things I had tried (and
ereg_replace wasn't one of 'em) in my post but didn't want to clutter
things up.  I've tried str_replace, preg_replace, and now ereg_replace,
and have tried working on the function extraction of the data directly as
well as the $fin and $fout separation.  I always have the newline left
behind.

I'm a [rusty] perl guy, and so I keep wanting to know what's the magic
variable in PHP to set to make it eat entire paragraphs, like $/ or such
in perl (there's where the rusty part comes in!).  If these functions are
just operating on a single line then the newline(s) won't get eaten.


% 
% Cheers,
% Rob.


Thanks & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78081/pgp0.pgp
Description: PGP signature


Re: [PHP] Re: sending email with linefeeds

2002-09-06 Thread Peter Janett

I spent a LOT of time several moths back trying to figure this one out.  It
worked fine in Outlook Express, but in Outlook, the whole message appeared
on a single line.  It only happened when my client filled out the form from
a Mac, which turned out to be the important clue.

The trick ended up being to remove all the carriage returns from the body of
the email.  Just like you, I played with lots of different mime type
headers, and tried to copy message source headers line by line, tab by tab,
etc.  If was very frustrating.  Don't know why exactly, but my theory was
that if Outlook saw any carriage returns, it displayed it as html formatted,
which made it all show up on one line.

Here's my code (it's in Perl, but you can adjust it to PHP simply), which
simply removes all carriage returns and replaces them with nothing in the
body of the message to be sent.
$FORM{'Message'} =~ s/\r//g;

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.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882

- Original Message -
From: "Erwin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 9:20 AM
Subject: [PHP] Re: sending email with linefeeds


> Kai Hinkelmann wrote:
> > Hi,
> >
> > we are sending plain-text-emails from php not using the mail-command
> > but with port-operations. Everything works fine BUT outlook 2000 eats
> > the linefeeds. We tried several things: copying the header from an
> > original (functional) email from outlook, sending with \n or \r\n to
> > seperate header-info and so on... nothing works.
> >
> > All email-clients show the mails correct - outlook 2000 doesn't.
> > Since other mails are shown correct, there MUST be a way, but we
> > don't know, which.
> >
> > Who can help?
>
> Please paste a generated mail message (including header information), so
we
> can have a look at it...
>
> Grtz Erwin
>
>
>
> --
> 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




IRE: [PHP] Web based FTP client

2002-09-06 Thread David Buerer

That's been one of the major problems i've encoutered as well because PHP is
a server based language (what you've got,) not a client based language (what
you need.)  If i had to write a web based ftp client.  I would do some
exploring with Java, or flash, activeX, or ? all languages which can
open up direct socket connections and maybe you can even find some libraries
with pre-built in ftp functions.  Do some searching on the web and see what
shows up.

David

-Original Message-
From: Mark McCulligh [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 9:17 AM
To: David Buerer
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Web based FTP client


Do you mean use a Java Applet or JavaScript.

I know how to browse the user's file system using JavaScript or VBScript if
I use the ActiveX object "FileSystemObject" but then the site will only work
on IE. I don't like build sites that only work for one browser.

But even if I create a page that lets the user browse their own computer and
the FTP Server using a combo of JavaScript, PHP and HTML frames.  I still
don't know how to ftp right from the client side browser without using the
 tag "file" and upload, not ftp.

Mark.
_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
[EMAIL PROTECTED]
- Original Message -
From: "David Buerer" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 11:24 AM
Subject: RE: [PHP] Web based FTP client


> Reading the users hard drive is impossible from php, but it's really easy
> with Java.
>
> -Original Message-
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 06, 2002 7:49 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Web based FTP client
>
>
> Hi Mark,
>
> > I am trying to build or find a web FTP client.
> > I want it to look like a windows based FTP client a list box on one
> > site for the user's file system and a list box on the other for the
> > ftp server.
>
> A couple of s side by side should let you do that.
>
> The biggest problem I can see you hitting is reading the contents of the
> user's hard drive... usually this is impossible, for good reasons.
>
>
> Cheers
> Jon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>




Re: [PHP] replacing \n with

2002-09-06 Thread Robert Cummings

Actually on second thought... and I don't know why I went with the
crowd in the first place... I do the following:

$foo = "I don't like\nnewlines";

$foo = str_replace( "\n", '', $foo );

That one work for you? It's more efficient too.

Cheers,
Rob.


David T-G wrote:
> 
> Rob, et al --
> 
> ...and then Robert Cummings said...
> %
> % David T-G wrote:
> % >
> % I've never had problems with doing:
> %
> % $foo = "I don't like\nnewlines";
> %
> % $foo = ereg_replace( "\n", '', $foo );
> 
> I'm afraid I do.  Given my code
> 
>   $fin = stripslashes(${base64_encode($k)}) ;   ###
>   print "\$fin is .$fin.\n";###
>   $fout = ereg_replace("\n","",$fin) ;
>   print "and \$fout is .$fout.\n";  ###
> 
> (ignore the scary base64 stuff :-) I get
> 
>   $fin is .This is the first line. Here is the second line..
>   and $fout is .This is the first line.
>   Here is the second line..
> 
> in my browser and
> 
>   $fin is .This is the first line.
>   Here is the second line..
>   and $fout is .This is the first line.
>   Here is the second line..
>   
> 
> in my browser's source window.  The newlines are still there.
> 
> Any thoughts?
> 
> %
> % Cheers,
> % Rob.
> 
> Thanks & HAND
> 
> :-D
> --
> David T-G  * It's easier to fight for one's principles
> (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
> (work) [EMAIL PROTECTED]
> http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
> 
>   
>
>Part 1.2Type: application/pgp-signature

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Web based FTP client

2002-09-06 Thread Mark McCulligh

Do you mean use a Java Applet or JavaScript.

I know how to browse the user's file system using JavaScript or VBScript if
I use the ActiveX object "FileSystemObject" but then the site will only work
on IE. I don't like build sites that only work for one browser.

But even if I create a page that lets the user browse their own computer and
the FTP Server using a combo of JavaScript, PHP and HTML frames.  I still
don't know how to ftp right from the client side browser without using the
 tag "file" and upload, not ftp.

Mark.
_
Mark McCulligh, Application Developer / Analyst
Sykes Canada Corporation www.SykesCanada.com
(888)225-6824 ex. 3262
[EMAIL PROTECTED]
- Original Message -
From: "David Buerer" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 11:24 AM
Subject: RE: [PHP] Web based FTP client


> Reading the users hard drive is impossible from php, but it's really easy
> with Java.
>
> -Original Message-
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 06, 2002 7:49 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Web based FTP client
>
>
> Hi Mark,
>
> > I am trying to build or find a web FTP client.
> > I want it to look like a windows based FTP client a list box on one
> > site for the user's file system and a list box on the other for the
> > ftp server.
>
> A couple of s side by side should let you do that.
>
> The biggest problem I can see you hitting is reading the contents of the
> user's hard drive... usually this is impossible, for good reasons.
>
>
> Cheers
> Jon
>
> --
> 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] replacing \n with

2002-09-06 Thread David T-G

Rob, et al --

...and then Robert Cummings said...
% 
% David T-G wrote:
% > 
% I've never had problems with doing:
% 
% $foo = "I don't like\nnewlines";
% 
% $foo = ereg_replace( "\n", '', $foo );

I'm afraid I do.  Given my code

  $fin = stripslashes(${base64_encode($k)}) ;   ###
  print "\$fin is .$fin.\n";###
  $fout = ereg_replace("\n","",$fin) ;
  print "and \$fout is .$fout.\n";  ###

(ignore the scary base64 stuff :-) I get

  $fin is .This is the first line. Here is the second line..
  and $fout is .This is the first line. 
  Here is the second line..

in my browser and

  $fin is .This is the first line.
  Here is the second line..
  and $fout is .This is the first line.
  Here is the second line..
  

in my browser's source window.  The newlines are still there.

Any thoughts?


% 
% Cheers,
% Rob.


Thanks & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78076/pgp0.pgp
Description: PGP signature


[PHP] Re: Here is a email

2002-09-06 Thread Kai Hinkelmann

This one is in the wrong place... please ignore...



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




Re: [PHP] replacing \n with

2002-09-06 Thread N. Pari Purna Chand

Bothe of us got the same problem at same time :-)

- Original Message - 
From: "David T-G" <[EMAIL PROTECTED]>
To: "PHP General list" <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 9:28 PM
Subject: [PHP] replacing \n with 




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




Re: [PHP] \n to Problem

2002-09-06 Thread David T-G

Chandu, et al --

...and then N. Pari Purna Chand said...
% 
% I have a small problem in converting a plain text to html.

Son of a gun...  Maybe it's world consciousness working on this :-)

I've just posted a similar question.  Be sure to watch both threads just
in case.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78073/pgp0.pgp
Description: PGP signature


RE: [PHP] Calculating Totals from table columns without a second query to the DB

2002-09-06 Thread Jay Blanchard

[snip]
> Challenge; Can this be made as simple for rows too?



  $val)
$rowTotal += $val;
  // display whatever is needed from $row
  $rowTotals[] = $rowTotal; // or echo it out to the last column of the
table
}

  ?>


[/snip]

:^]

Or based on the original query;

while($row = mysql_fetch_object($result)){
   print("" . $row->value . "\n");
   print("" . $row->another_value . "\n");
   $value1 = $value1 + $row->value;
   $value2 = $value2 + $row->another_value;
   }

you could add the following to the WHILE loop ...
   print("" . ($row->value + $row->another_value) . "\n");

... giving you another column with the row total. That way you could avoid
adding columns that do not contain numerical values if that is the case in
your result set. And I think that you would want to use mysql_fetch_array
for your example.

Jay



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




Re: [PHP] replacing \n with

2002-09-06 Thread Robert Cummings

David T-G wrote:
> 
I've never had problems with doing:

$foo = "I don't like\nnewlines";

$foo = ereg_replace( "\n", '', $foo );

Cheers,
Rob.


> Hi, all --
> 
> I have a php script which writes comments out to a file in the format
> 
>   field@@comment
>   field@@comment
>   ...
> 
> and everything has worked delightfully -- until someone put in a newline
> in one of the items and now we have
> 
>   field@@com
>   ment
>   field@@comment
>   ...
> 
> and things break.  I read the file, line by line, and parse on @@ as my
> separator, so anything after a newline is lost.
> 
> I thought I'd just replace that newline with a  since that's what the
> user really wants, but I can't get rid of the \n while I'm at it; through
> various attempts at directly replacing or using variables or such like
> 
>   preg_replace("/\n/","",$mydatastring) ;
>   preg_replace("/$newline/","$linebreak",$mydatastring) ;
> 
> I get mixed results of
> 
>   field@@com
>   ment
> 
> or
> 
>   field@@com
>   ment
> 
> but in no case have I managed to get
> 
>   field@@comment
> 
> which is what I want.
> 
> Is there a way to turn off the recognition of \n as an end of line and
> instead operate on the entire $mydatastring?
> 
> TIA & HAND
> 
> :-D
> --
> David T-G  * It's easier to fight for one's principles
> (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
> (work) [EMAIL PROTECTED]
> http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
> 
>   
>
>Part 1.2Type: application/pgp-signature

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] Link for downloading?

2002-09-06 Thread Alex Shi

Thanks for your reply! Still have another question: How to use 
header() to generate download link?

Alex

- Original Message - 
From: <[EMAIL PROTECTED]>
To: "Alex Shi" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 7:27 AM
Subject: Re: [PHP] Link for downloading?


> Question 1:
> I think this has to do with how you attribute your file extensions in 
> httpd.conf (Apache thing, not PHP), so check out the docs on apache.org
> 
> Question 2:
> I woudl tend to believe it depends what kind of link it is...
> is it and HTTP downlaod site (which would use the windows "save file as" 
> dialog, or is it a link to an FTP site, which may use your local FTP 
> software...
> 
> HTH
> -Brad
> 
> > Hello,
> > 
> > How to create a link that when click it will lauch file downloading at
> > client's end.
> > 
> > And another question which might be biased from this topic, but 
> > still related with the subject of this message: why some downloading 
> > link will lauch a ftp client such as NetAnts or Download Accelerator 
> > while other link will start a Window's builtin download window?
> > 
> > Alex
> > 
> > -- 
> > 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] replacing \n with

2002-09-06 Thread David T-G

Hi, all --

I have a php script which writes comments out to a file in the format

  field@@comment
  field@@comment
  ...

and everything has worked delightfully -- until someone put in a newline
in one of the items and now we have

  field@@com
  ment
  field@@comment
  ...

and things break.  I read the file, line by line, and parse on @@ as my
separator, so anything after a newline is lost.

I thought I'd just replace that newline with a  since that's what the
user really wants, but I can't get rid of the \n while I'm at it; through
various attempts at directly replacing or using variables or such like

  preg_replace("/\n/","",$mydatastring) ;
  preg_replace("/$newline/","$linebreak",$mydatastring) ;

I get mixed results of

  field@@com
  ment

or

  field@@com
  ment

but in no case have I managed to get

  field@@comment

which is what I want.

Is there a way to turn off the recognition of \n as an end of line and
instead operate on the entire $mydatastring?


TIA & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg78069/pgp0.pgp
Description: PGP signature


[PHP] \n to Problem

2002-09-06 Thread N. Pari Purna Chand

I have a small problem in converting a plain text to html.

say 

$text = "PHP
Rocks";

Observe the '\n',

When I call the converttohtml function which I wrote ( see bottom )
$html = converttohtml($plaintext);
The $html I'm getting is
"PHP
Rocks";
Observe the '\n' still exists,

What is the way to make the 'converttohtml' function return
a plain string with out any '\n'.
The out put I'm looking for is "PHPRocks";

function converttohtml($plaintext) {
$newstr = htmlentities($plaintext);
$newstr = ereg_replace ("\n", "", $newstr);
$newstr = ereg_replace (" ", " ", $newstr);
return $newstr;
}

/Chandu


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




[PHP] Re: Link for downloading?

2002-09-06 Thread Alex Shi

Thanks...but how to use header() to generate such a download link?

Alex


<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> First, to create a link thats just a  that point to the file.
> ie file
>
> Second, that depend of your windows's default configuration.
>
> --
>
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> www.WorldAKT.com - Hébergement de sites Internet
>
> "Alex Shi" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > Hello,
> >
> > How to create a link that when click it will lauch file downloading at
> > client's end.
> >
> > And another question which might be biased from this topic, but
> > still related with the subject of this message: why some downloading
> > link will lauch a ftp client such as NetAnts or Download Accelerator
> > while other link will start a Window's builtin download window?
> >
> > Alex
>
>


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




[PHP] Re: sending email with linefeeds

2002-09-06 Thread Kai Hinkelmann

I can't believe that I hit wrong buttons two times... so my answer for the
third time...

Thanks for your answer. Here is a genereted email:

Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 21481 invoked from network); 6 Sep 2002 15:47:03 -
Received: from notused.i-dea.de (HELO mail.e-h.de) (62.26.122.219)
  by ns.i-dea.de with SMTP; 6 Sep 2002 15:47:03 -
From:<[EMAIL PROTECTED]>
Subject:Testmail
Date:Fri, 6 Sep 2002 17:51:28
To:<>
Reply-To:<[EMAIL PROTECTED]>
MIME-Version:1.0
Content-Type:text/plain;
charset="iso-8859-1"
X-UIDL: _7F!!bMh!!~Ea"!9Bn"!

first line
second line
third line

the three lines are seperated with 0d0a, just as outlook would seperate them
but the lines are not shown as a stack but as ONE line.

Kai

"Erwin" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Kai Hinkelmann wrote:
> > Hi,
> >
> > we are sending plain-text-emails from php not using the mail-command
> > but with port-operations. Everything works fine BUT outlook 2000 eats
> > the linefeeds. We tried several things: copying the header from an
> > original (functional) email from outlook, sending with \n or \r\n to
> > seperate header-info and so on... nothing works.
> >
> > All email-clients show the mails correct - outlook 2000 doesn't.
> > Since other mails are shown correct, there MUST be a way, but we
> > don't know, which.
> >
> > Who can help?
>
> Please paste a generated mail message (including header information), so
we
> can have a look at it...
>
> Grtz Erwin
>
>



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




[PHP] Here is a email

2002-09-06 Thread Kai Hinkelmann

Thanks for your answer. Here is a genereted email:

Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 21481 invoked from network); 6 Sep 2002 15:47:03 -
Received: from notused.i-dea.de (HELO mail.e-h.de) (62.26.122.219)
  by ns.i-dea.de with SMTP; 6 Sep 2002 15:47:03 -
From:<[EMAIL PROTECTED]>
Subject:Testmail
Date:Fri, 6 Sep 2002 17:51:28
To:<>
Reply-To:<[EMAIL PROTECTED]>
MIME-Version:1.0
Content-Type:text/plain;
charset="iso-8859-1"
X-UIDL: _7F!!bMh!!~Ea"!9Bn"!

first line
second line
third line

the three lines are seperated with 0d0a, just as outlook would seperate them
but the lines are not shown as a stack but as ONE line.

Kai



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




[PHP] PHP and Apache

2002-09-06 Thread Tim Haynes

Is there any easy way of creating,editing and deleting virtual hosts using
PHP via a website??  I have already thought of a way but seems a little long
winded.

Thanks in advance.

Tim



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




RE: [PHP] Web based FTP client

2002-09-06 Thread David Buerer

Reading the users hard drive is impossible from php, but it's really easy
with Java.

-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 7:49 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Web based FTP client


Hi Mark,

> I am trying to build or find a web FTP client.
> I want it to look like a windows based FTP client a list box on one
> site for the user's file system and a list box on the other for the 
> ftp server.

A couple of s side by side should let you do that.

The biggest problem I can see you hitting is reading the contents of the
user's hard drive... usually this is impossible, for good reasons.


Cheers
Jon

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




RE: [PHP] Calculating Totals from table columns without a second query to the DB

2002-09-06 Thread Jon Haworth

Hi Jay,

> while($row = mysql_fetch_object($result)){
>print("" . $row->value . "\n");
>print("" . $row->another_value . "\n");
>$value1 = $value1 + $row->value;
>$value2 = $value2 + $row->another_value;
> }
> 
> Challenge; Can this be made as simple for rows too?



  $val) 
$rowTotal += $val;
  // display whatever is needed from $row
  $rowTotals[] = $rowTotal; // or echo it out to the last column of the
table
}
  
  ?>



I don't usually use mysql_fetch_object so I'm not sure if you can walk
through it with foreach() though...


Cheers
Jon



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




RE: [PHP] Calculating Totals from table columns without a second query to the DB

2002-09-06 Thread Richard Black

One thing I would add to Jay's out loud thoughts...

Always consider alternative approaches. Using a single query and
calculating the totals at the same time is fine if you have a small
dataset, or (as in this case) are producing page totals (I'm assuming
the dataset is paged to fit all on one page, so restricting the number
of rows to 20, say).

I had a situation where I had to report a bunch of stuff all at once,
like 600 or 700 rows, and had to total 7 or 8 columns. In that case, I
found it was far quicker to have separate queries for the row data and
the totals, because the database was far quicker at totalling the stuff
than the PHP code was.

Now, where the cut off is I'm not sure. There are a huge number of
factors which would be involved (size of dataset, choice of database,
number of totals - and calculations required for these totals etc). 

I guess knowing plenty of alternatives - or at least understanding what
you're doing enough to be able to think of alternatives - and thinking
about stuff rather than just doing it the way you always did are the key
points here.

Just my tuppence...

Richy
==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED] 

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]] 
Sent: 06 September 2002 16:33
To: [EMAIL PROTECTED]
Subject: [PHP] Calculating Totals from table columns without a second
query to the DB


[thinking out loud]
For small result sets where I am looking for column totals I generally
issue 2 queries to the database, one for the data and one for the
totals. This works fine, but for some things the database returns 100's
or 1000's of records. To make this easier to use I "page" the records,
showing an appropriate number of records for each page. The records for
each page returned like so (normal);

while($row = mysql_fetch_object($result)){
   print("" . $row->value . "\n");
   print("" . $row->another_value . "\n");
   }

The PHB would now like a "totals per page" and a "grand totals". Easy
enough with 3 queries each time the page is called, one for the records,
one for the page totals, (using proper LIMIT queries) and one for the
grand totals, but awfully inefficient and intensive.

I suppose I could do something like this;

while($row = mysql_fetch_object($result)){
   print("" . $row->value . "\n");
   print("" . $row->another_value . "\n");
   $value1 = $value1 + $row->value;
   $value2 = $value2 + $row->another_value;
   }
[/thinking out loud]

In the process of typing this out I of course realized that this would
work very well. Even if the database contains NULL values they are
treated as zero. This gets me back to 2 queries, one of which only has
to be issued once (the one for the grand totals, the results can be held
in variables and echo'd or printed as needed). It also seems to be very
efficient as the $value variables will only be doing a one time math
operation each time through the while loop. For smaller results sets all
on one page the same type of operation could be used for the grand
totals as well, working the whole report down to a single query. I use a
lot of crosstab queries where totals are needed along the bottom or
right side, you can only do one within the original query. The other
totals are left to another query ... usually.

This should be a lesson to us all, we all try to over-compicate the
issue sometimes. Usually a look at the
docs/manual/FAQ/other-text-intensive-method-of-delivering-information
will deliver the solution to a problem while some thought slowed to a
reasonable speed (such as me typing out the problem above) will also
allow natural logic to occur, producing a solution. Break down the
process into managable portions, solving each portion before moving on
to the next.

Challenge; Can this be made as simple for rows too?

Peace and I HTH someone else!

Jay

Hard work has a future payoff. Laziness pays off NOW.

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort & Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*




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




  1   2   >