Re: [PHP] Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Burhan Khalid
Tian, Simon (Contractor) (DSCP) wrote:
Hi all,

I have a website written in php3 , but the isp just did a upgrade of PHP
4.3.3. it was
a php 4 and it worked fine with my php3 progarm
Read this > http://www.php.net/reserved.variables

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Exporting Data to Excel

2003-10-22 Thread Ben C.
I am using the code below to export my data into an excel file.  The code is
located in a password protected area which is checked against saved session
variables.  However when I put session_start(); the download errors out.
Does any one have any suggestions?  Please help.



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



RE: [PHP] problem in 2 dimensional Array

2003-10-22 Thread Martin Towell
> Dear Members
> 
> i have 2 problems in 2 dimensional array
> 
> 1. how to declare global 2 dimensional array in php
> 2. how to pass 2 dimensional array in function as an
> arrgument
> 
> waiting for ur soon reply
> Khuram Noman

1. $myvar = array();
   $myvar[0] = array();
   $myvar[0][0] = "myval";
   etc...

   or directly
   $myvar[0][0] = "myval";   

2. The same way you pass any other variable to a function
   myfunc($myvar);

HTH
Martin

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



[PHP] problem in 2 dimensional Array

2003-10-22 Thread khuram noman
Dear Members

i have 2 problems in 2 dimensional array

1. how to declare global 2 dimensional array in php
2. how to pass 2 dimensional array in function as an
arrgument

waiting for ur soon reply
Khuram Noman

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] there has to be a better way...

2003-10-22 Thread Walter Torres
> -Original Message-
> From: Colin Kettenacker [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 23, 2003 12:53 AM
> To: jsWalter; [EMAIL PROTECTED]
> Subject: Re: [PHP] there has to be a better way...
>
>
> Hi Walter,
>
> You may want to look into PEAR's config package. It does pretty
> much all you
> have listed here and a lot more. I just started looking into it today.

Thanks Colin.

I saw that it, read it, played with it.

It was just way to big a clunky for what I was looking to do.

I have what "need" to make this work.

I was just hoping to have a better method of reading the file and ignoring
the blank lines and the commented lines.

I just have this thing about double level IF statements.

Thanks.

Walter

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread Colin Kettenacker
Hi Walter,

You may want to look into PEAR's config package. It does pretty much all you
have listed here and a lot more. I just started looking into it today. I
haven't looked closely at the code so I don't know how efficiently it
handles everything it does but it may give you some ideas. As far as I tell
it can handle Generic Config files, .ini files, XML config files and more.

http://pear.php.net/package/Config
http://pear.php.net/manual/en/package.configuration.php

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net


jsWalter [EMAIL PROTECTED] on 10/22/03 1:10 AM wrote:

> I need to read (write comes later) from a config file that we used to handle
> manually.
> 
> I'm getting lazy, so I'm writing a web interface for this.
> 
> What I have does this...
> - open a given file
> - dump entire file into a string
> - explode string into an array at the EOL marker
> - walk down this new array
> - decide if there is anything in current element
> - decide if current line is a comment
> - split line at '=' into 2 variables
> - add new key and value from these variables back into array
> - kill original array element
> 
> There must be a better way to do this.
> 
> All this seems a bit over kill to me.
> 
> Does anyone have any ideas on this?
> 
> Thanks
> 
> Walter
> 
> This is what I have...
> 
>  
> $config = $list . '/home/walter/vmd/config';
> 
> // Open the file
> $handle = fopen ($config, "r");
> 
> // Read entire file into var
> $content = fread($handle, filesize($config));
> 
> // convert var into array and explode file via line break
> $content = split("\r\n", $content);
> 
> // close file
> fclose($handle);
> 
> // Loop through file contents array
> foreach ($content as $i => $value)
> {
> // If we have any data in this line
> if (! empty ($value))
> {
> // If this line is not a comment
> if ( $value{0} != '#')
> {
> list($a, $b) = split("=", $value);
> $content[$a] = $b;
> }
> 
> // kill original array element
> unset($content[$i]);
> }
> }
> 
> // show me what I have
> echo '';
> echo print_r($content);
> echo '';
> 
> ?>
> 
> # Sample config file data, just 2 lines from the file...
> #
> # The "Personal Name" of the list, used in outgoing headers.
> # If empty, default is the same as the list's username.
> # if explicitly `false', then it is redefined empty.
> LIST_NAME="RMT Working Group"
> 
> # The address of the list's admin or owner.
> # if explicitly `false', then it is redefined empty.
> [EMAIL PROTECTED]
> 
> ...

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



[PHP] [Newbie Guide] For the benefit of new members

2003-10-22 Thread Ma Siva Kumar
=
This message is for the benefit of new subscribers and those new to PHP.  
Those who  do not want to be bothered just filter out the [Newbie Guide] 
mails. Please feel free to add more points and send to the list.
==
1. If you have any queries/problems about PHP try http://www.php.net/manual/en 
first. You can download a copy and use it offline also. 

You can also try http://www.php.net/manual/faq.php to get answers to 
frequently answered questions about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Try searching for "php YOUR QUERY" and you 
may be lucky to get an answer within the first 10 results.

3. Glancing through the list archive  you can find many of the common topics 
discussed repeatedly and can get your answer from those discussions. 

There is a new searchable archive (launched on October 21, 2003) at
 http://phparch.com/mailinglists, which provides a comprehensive and
 convenient search tool.

4. If you are stuck with a script and do not understand what is wrong, instead 
of posting the whole script, try doing some research yourself. One useful 
trick is to print the variable/sql query using print or echo command and 
check whether you get what you expected. 

After diagnosing the problem, send the details of your efforts (following 
steps 1, 2 & 3) and ask for help.

5. Provide a clear descriptive subject line. Avoid general subjects like 
"Help!!", "A Question" etc.  Especially avoid blank subjects. 

6. When you want to start a new topic, open a new mail and enter the mailing 
list address [EMAIL PROTECTED] instead of replying to an existing 
thread and replacing the subject and body with your message.

7. PHP is a server side scripting language. Whatever processing PHP does takes 
place BEFORE the output reaches the client. Therefore, it is not possible to 
access the users'  computer related information (OS, screen size etc) using 
PHP. You need to go for JavaScript and ask the question in a JavaScript 
list.

8. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. [contribued by Chris W Parker]

9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

10. One of the repeatedly discussed question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. You can get all the opinions by going 
through the list archives. If you want a list try this link : 
http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne).

Hope you have a good time programming with PHP.

Best regards,
-- 
Integrated Management Tools for leather industry
--
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

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



[PHP] setlocale Q

2003-10-22 Thread jsWalter
Why does...

   // assume October...
   setlocale(LC_TIME, "de_GR");
   echo strftime("%d. %B %Y");

gives me 'October'?

and this...

   // assume October...
   setlocale(LC_TIME, "de");
   echo strftime("%d. %B %Y");

gives me 'October'?

and this...

   // assume October...
   setlocale(LC_TIME, "d");
   echo strftime("%d. %B %Y");

gives me 'oktober'?


I'm on a Win 2k box.

Walter

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



[PHP] Re: using mail() - what is max number of email addresses I can specify in To field?

2003-10-22 Thread Manuel Lemos
Hello,

On 10/23/2003 01:35 AM, John Christopher wrote:
I am writing a script that will query a database
table for some statistical information, and then
email it (daily, weekly, and monthly) to a list of
subscribers.  I don't know ahead of time how many
persons will be subscribed to receive the info
(it could be 20 persons or 2000 or more).  Email
addresses can be added to or deleted from the
subscriber list at any time.
If I am not mistaken, MTAs have a limit on how
many recipients can be specified on the To: line
of an email message.  What is the limit, or does
it depend on the MTA you're using (sendmail, qmail,
etc), or other factors?  If there is such a limit,
then what is the best way to send the message to
each recipient?
That is something that is configured intentionally by hosting that don't 
want their clients to do bulk mailings like you want to do.

So, I think you should ask your hosting company if you can do what you 
want in your current hosting plan. Some times they provide you better 
alternatives if you pay more. After all you will be consuming more 
bandwidth and CPU resources of the server.

Anyway, to send that many messages, I do not recomend personalization of 
the message body because it will make PHP spend a lot more time 
composing the message to be sent.

In the past it used to be good idea to send just a single message with 
all recipients in Bcc: . However that started to be a problem since 
services like Hotmail started considering to be spam messages that did 
not have the recipients address in To: or Cc: headers.

The alternative is to send separate messages to different users, 
personalizing just the To: header. In that case, you may want to try 
this class that is optimized to send bulk mailing by caching message 
bodies. It also lets you compose HTML mail with images and alternative 
text parts for non-HTML capable mail programs still read the messages.

http://www.phpclasses.org/mimemessage

There are other optimization tips, but I would need to know what is the 
mailer system (sendmail, qmail, postfix, remote SMTP, etc...) that your 
hosting uses, so I can make an adequate recomendation.

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP & JavaScript

2003-10-22 Thread jsWalter
"Martin Towell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Hi everybody!
> >
> > Have somebody any idea how I could do something like that?
> >
> >  > settype($phpScreenWidth,  "string");
> > settype($phpScreenHeight, "string");
> > ?>

This is a serverside process

This says the var $phpScreenWidth and the var $phpScreenHeight are to be
strings.

At this point they have no value associated with them.

This is done on your server, *before* the page is given to the user...


> > 
> > var phpScreenWidth, phpScreenHight;
> >
> > phpScreenWidth  = screen.width;
> > phpScreenHeight = screen.height;
> >
> > 

This is a clientside process

This retrieves the width and height of the users browser window and drops
that value into 2 JavaScript variables.

This is done on the clinets browser, *after* the page is given to the
user...


> >  > echo "Width:|".$phpScreenWidth."|";
> > echo "Height:|".$phpScreenHeight."|";
> > ?>

This is a serverside process

this displays the values of the vars $phpScreenWidth and $phpScreenHeight.

This varaibles do *not* have any values.

This is done on your server, *before* the page is given to the user...



> > I know that this code is not working, it is just to see what I want to
> > do.

ASSUPTION: all 3 sections are on the same PHP page to be servered.

Section #1 and #3 will be processed on the server *before* the page is given
to the user.

Section #2 will be processed on the clients browser *after* the page is
given to the user.


Your trying to clean the dinner dishes *before* you've set the table for
dinner.

It looks like you want to know the width and height of the clients browser
window.

And you want your PHP process to know this so it can do some magic.

Well, first your going to have to serve up a page that retrieves that info,
via JavaScript, places that info in 2 HIDDEN form objects, SUBMIT that info
back to your PHP process and pull that data from the POST variables.

*Then* you can do your magic in PHP with these values.

Or, you can translate your magic into JavaScript and let JS do your magic on
the clients browser.

Does this help you?

Walter

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



Re: [PHP] using mail() - what is max number of email addresses I can specify in To field?

2003-10-22 Thread Rolf Brusletto
It really depends on the mta you use... if your going to use mail(); the 
I would put the list of addresses in an array and the do

foreach($addressArray as $address) {
mail($address,'Here is your subject','Here is your content');
}
Rolf Brusletto
http://www.phpexamples.net
John Christopher wrote:

I am writing a script that will query a database
table for some statistical information, and then
email it (daily, weekly, and monthly) to a list of
subscribers.  I don't know ahead of time how many
persons will be subscribed to receive the info
(it could be 20 persons or 2000 or more).  Email
addresses can be added to or deleted from the
subscriber list at any time.
If I am not mistaken, MTAs have a limit on how
many recipients can be specified on the To: line
of an email message.  What is the limit, or does
it depend on the MTA you're using (sendmail, qmail,
etc), or other factors?  If there is such a limit,
then what is the best way to send the message to
each recipient?
Thank you.

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 

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


Re: [PHP] using mail() - what is max number of email addresses I can specify in To field?

2003-10-22 Thread Marco Tabini
I'm not sure if you've considered this possibility--but can't you send 
the messages to one recipient at a time? This way, the problem wouldn't 
present itself, and the end result would be quite the same (with the 
added bonus of not having to disclose your entire mailing list to each 
recipient).

To speed things up, you may want to look at the PHPMailer project 
(http://phpmailer.sourceforge.net/), which provides a class that 
facilitates sending the same message to multiple recipients, as well as 
other aspects of e-mailing, like HTML bodies and attachments.

Finally--if you're sending lots of e-mail I recommend you monitor your 
MTA carefully--Sendmail has a habit of choking on large mailings, 
whereas learner MTAs like Exim or Qmail seem to do better.

Cheers,

Marco

John Christopher wrote:
I am writing a script that will query a database
table for some statistical information, and then
email it (daily, weekly, and monthly) to a list of
subscribers.  I don't know ahead of time how many
persons will be subscribed to receive the info
(it could be 20 persons or 2000 or more).  Email
addresses can be added to or deleted from the
subscriber list at any time.
If I am not mistaken, MTAs have a limit on how
many recipients can be specified on the To: line
of an email message.  What is the limit, or does
it depend on the MTA you're using (sendmail, qmail,
etc), or other factors?  If there is such a limit,
then what is the best way to send the message to
each recipient?
Thank you.

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] using mail() - what is max number of email addresses I can specify in To field?

2003-10-22 Thread John Christopher

I am writing a script that will query a database
table for some statistical information, and then
email it (daily, weekly, and monthly) to a list of
subscribers.  I don't know ahead of time how many
persons will be subscribed to receive the info
(it could be 20 persons or 2000 or more).  Email
addresses can be added to or deleted from the
subscriber list at any time.

If I am not mistaken, MTAs have a limit on how
many recipients can be specified on the To: line
of an email message.  What is the limit, or does
it depend on the MTA you're using (sendmail, qmail,
etc), or other factors?  If there is such a limit,
then what is the best way to send the message to
each recipient?

Thank you.


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread Curt Zirzow
* Thus wrote jsWalter ([EMAIL PROTECTED]):
> I need to read (write comes later) from a config file that we used to handle
> manually.
> 
> I'm getting lazy, so I'm writing a web interface for this.
> 
> What I have does this...
>   - open a given file
>   - dump entire file into a string
>   - explode string into an array at the EOL marker
>   - walk down this new array

Instead of doing these last three, just walk through each line of
the file.  These tasks are just adding extra overhead.

>   - decide if there is anything in current element
>   - decide if current line is a comment
>   - split line at '=' into 2 variables
>   - add new key and value from these variables back into array

We can kill these four conditions in two lines of code. (see below)

>   - kill original array element

Dont need this if we are reading directly from the file.

> 
> There must be a better way to do this.

Pehraps something like this:

No # in the beginning, not
   needed but makes pcre skip it,
   much faster if line is a comment)
 (\w+) (?# The key must be a word )
 \s*=\s*   (?# Allow space on both sides of =)
 (?(?=")   (?# If quoted )
"([^"]*)"  (?# Grab all but quoted)
 | (?# else )
(\w+)  (?# grab the word )
 )
 /x', $line, $matches) ) {
//print_r($matches);
$content[$matches[1]] = ($matches[2]? $matches[2]: $matches[3]);

}
}
print_r($content);
?>

Ok, i lied it was more than two lines, but I made the regular
expression readable (if you can call it that :) A demo of this can
be seen here:

  http://zirzow.dyndns.org/html/php/tests/array/parseini.php

HTH,

Cheers

Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Thanks Everyone. This is so cool!!! :)

On 10/22/03 11:15 PM, "Mykroft Holmes IV" <[EMAIL PROTECTED]> wrote:

> 
> 
> Mykroft Holmes IV wrote:
> 
>> 
>> 
>> Chuck PUP Payne wrote:
>> 
>>> Hi,
>>> 
>>> Is there a way I can get php to call the program fortune then print
>>> that a
>>> web page.
>>> 
>>> Thanks.
>>> 
>>> Payne
>>> 
>> 
>> echo '';
>> passthru(fortune);
>> echo '';
>> 
>> Should do it. I use this for a nice little Server Status page that
>> iterates through an array of unix commands, works like a charm.
>> 
>> Adam
>> 
> 
> Oops, should be:
> 
> echo '';
> passthru('fortune');
> echo '';
> 
> Adam

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



Re: [PHP] Php and Fortune

2003-10-22 Thread David Otton
On Wed, 22 Oct 2003 22:54:55 -0400, you wrote:

>Is there a way I can get php to call the program fortune then print that a
>web page.

http://uk2.php.net/system

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



RE: [PHP] Php and Fortune

2003-10-22 Thread Martin Towell
> Chuck PUP Payne wrote:
> > Hi,
> > 
> > Is there a way I can get php to call the program fortune 
> then print that a
> > web page.
> > 
> > Thanks.
> > 
> > Payne
> > 
> 
> echo '';
> passthru(fortune);
> echo '';
> 
> Should do it. I use this for a nice little Server Status page that 
> iterates through an array of unix commands, works like a charm.
> 
> Adam

shouldn't fortune be in backticks?
passthru(`fortune`);

Martins

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



Re: [PHP] Php and Fortune

2003-10-22 Thread Mykroft Holmes IV


Mykroft Holmes IV wrote:



Chuck PUP Payne wrote:

Hi,

Is there a way I can get php to call the program fortune then print 
that a
web page.

Thanks.

Payne

echo '';
passthru(fortune);
echo '';
Should do it. I use this for a nice little Server Status page that 
iterates through an array of unix commands, works like a charm.

Adam

Oops, should be:

echo '';
passthru('fortune');
echo '';
Adam

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


Re: [PHP] Php and Fortune

2003-10-22 Thread Marco Tabini
Hello Chuck--

You can use a number of PHP functions, such as shell_exec and passthru, 
which will run an external app and return its result either in a 
variable or directly to the output. Some more info regarding this 
specific problem (and a script) here:

http://www.phparch.com/mailinglists/msg.php?a=572205&s=fortune&p=&g=

Cheers,

Marco

Chuck PUP Payne wrote:
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.
Thanks.

Payne

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


Re: [PHP] Php and Fortune

2003-10-22 Thread Mykroft Holmes IV


Chuck PUP Payne wrote:
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.
Thanks.

Payne

echo '';
passthru(fortune);
echo '';
Should do it. I use this for a nice little Server Status page that 
iterates through an array of unix commands, works like a charm.

Adam

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


[PHP] Php and Fortune

2003-10-22 Thread Chuck PUP Payne
Hi,

Is there a way I can get php to call the program fortune then print that a
web page.

Thanks.

Payne

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



Re: [PHP] fsock sending bad request

2003-10-22 Thread Tom Rogers
Hi,

Thursday, October 23, 2003, 7:58:19 AM, you wrote:
deo> Hi there the following code doesnt seem to work, i am getting a bad request
deo> sent back from the server, what could be the problem of something so
deo> simple ?

deo> $header .= "POST test.php HTTP/1.0\r\n";
deo> $header.= "Host: host\r\n";
deo> $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
deo> $header .= 'Content-Length: ' . strlen($req) . "\n\n";
deo> $header .= "Connection: close\n\n";
deo> $header.= "$req\n";
deo> $header.= "\r\n";




deo> $fp = fsockopen("host", "80", $errno, $errstr, $timeout = 30);
deo> if (!$fp) {
deo>   // ERROR
deo>   echo "$errstr ($errno)";
deo> } else {

deo> //put the data..
deo>   fputs ($fp, $header . $req);
deo>   while (!feof($fp)) {
deo> //read the data returned...
deo> $res = fgets ($fp, 1024);
deo>echo $res;
deo>  }
deo>   fclose ($fp);
deo> }


you probably don't need this in the header

$header.= "$req\n";

but I have no idea what $req contains

-- 
regards,
Tom

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



Re: [PHP] Images being uploaded in ASCII format

2003-10-22 Thread Tom Rogers
Hi,

Thursday, October 23, 2003, 4:05:13 AM, you wrote:
PG> Hi all.  I'd like to take a brief sentence to introduce myself first.
PG> My name is Pablo Gosse, and I've just recently joined the php-general
PG> list.  I've been using PHP since early 2000, and work as webmaster
PG> at the University of Northern British Columbia.

PG> I'm running into a problem with file uploads being handled in ascii
PG> rather than binary format.

PG> I've been writing a CMS for the past few months and the wysiwyg editor
PG> we're integrating has a very nice image manager built in
PG> (www.devedit.com).  However, the uploads are being transferred in ascii
PG> format instead of binary (or auto-detect) which is mangling all the
PG> images.

PG> I've done a lot of research into this but can't seem to pin down the
PG> problem.  I've looked through both my php.ini and httpd.conf and can't
PG> seem to find anything there that would remedy this problem.

PG> Does anyone have any advice as to where I should be looking to fix this
PG> problem?

PG> Thanks much in advance.

PG> Cheers,
PG> Pablo

make sure you have ENCTYPE="multipart/form-data" in the form tag

-- 
regards,
Tom

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



[PHP] RE: [PHP-WIN] Re: [PHP] PHP & JavaScript

2003-10-22 Thread BQ777
Oh I see. Well I thought that, but I wasn't sure.

Ok I will do this way. No I have an direction :)

Thanks a lot.


-Original Message-
From: Mike Migurski [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 23. Oktober 2003 03:11
To: BQ777
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: [PHP] PHP & JavaScript

>Have somebody any idea how I could do something like that?



You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...

>[time]->
client request received from browser
 |
 +-> PHP code executed on server
  |
  +-> text output to webserver (including javascript source)
   |
   +-> [drawing of cloud representing internet]
|
+-> text input to web browser on client side
 |
 +-> javascript executed by client
>[time]->

...The only way to have the javascript affect the PHP, is to make a
subsequent request /back/ to the server after the javascript has started
executing. You can, for example, package the screen size into a GET
variable appended to an image request.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP Windows 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] Age from birthdate?

2003-10-22 Thread Mike Migurski
>> >I do wonder what the rule for those born on Feb 29'th.  Do they
>> >celebrate they're birthday before or after it on non leap years?
>> >
>> >
>>Neither.  They celebrate it on Feb 29th.  So while we age every
>> year, they only age once every four.  Make sense?
>
>So their life expectancy is only ~19 years? I'd hate to be born on that
>day :)

I dunno, a housemate of mine is thrilled to be turning just 9 years old
this year. :D

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] PHP & JavaScript

2003-10-22 Thread Mike Migurski
>Have somebody any idea how I could do something like that?



You're somewhat out of luck, as the chain of events in your typical HTTP
transaction looks something like this...

>[time]->
client request received from browser
 |
 +-> PHP code executed on server
  |
  +-> text output to webserver (including javascript source)
   |
   +-> [drawing of cloud representing internet]
|
+-> text input to web browser on client side
 |
 +-> javascript executed by client
>[time]->

...The only way to have the javascript affect the PHP, is to make a
subsequent request /back/ to the server after the javascript has started
executing. You can, for example, package the screen size into a GET
variable appended to an image request.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



RE: [PHP] PHP & JavaScript

2003-10-22 Thread BQ777
Exactly.

but it should be only with one step.
That means, just running the file once and get the vars.

cbq

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 23. Oktober 2003 03:00
To: 'BQ777'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP & JavaScript

> Hi everybody!
>  
> Have somebody any idea how I could do something like that?
>  
>  settype($phpScreenWidth,  "string");
> settype($phpScreenHeight, "string");   
> ?>
>  
> 
> var phpScreenWidth, phpScreenHight;
> 
> phpScreenWidth  = screen.width;
> phpScreenHeight = screen.height;
> 
> 
>  
>  echo "Width:|".$phpScreenWidth."|";
> echo "Height:|".$phpScreenHeight."|";
> ?>
>  
> I know that this code is not working, it is just to see what I want to
> do.
> If somebody know a solution, like this, then please let me know.

What are you trying do? Are you trying to pass to PHP the user's screen
width and height ?

Martin

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



RE: [PHP] Age from birthdate?

2003-10-22 Thread Martin Towell
> * Thus wrote Ashley M. Kirchner ([EMAIL PROTECTED]):
> > Curt Zirzow wrote:
> > 
> > >I do wonder what the rule for those born on Feb 29'th.  Do they
> > >celebrate they're birthday before or after it on non leap years?
> > > 
> > >
> >Neither.  They celebrate it on Feb 29th.  So while we age every 
> > year, they only age once every four.  Make sense?
> 
> So their life expectancy is only ~19 years? I'd hate to be born on
> that day :)

And they'd look old for their age too. A 5 year old would look 20 ;-/

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



Re: [PHP] Age from birthdate?

2003-10-22 Thread Curt Zirzow
* Thus wrote Ashley M. Kirchner ([EMAIL PROTECTED]):
> Curt Zirzow wrote:
> 
> >I do wonder what the rule for those born on Feb 29'th.  Do they
> >celebrate they're birthday before or after it on non leap years?
> > 
> >
>Neither.  They celebrate it on Feb 29th.  So while we age every 
> year, they only age once every four.  Make sense?

So their life expectancy is only ~19 years? I'd hate to be born on
that day :)


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



RE: [PHP] PHP & JavaScript

2003-10-22 Thread Martin Towell
> Hi everybody!
>  
> Have somebody any idea how I could do something like that?
>  
>  settype($phpScreenWidth,  "string");
> settype($phpScreenHeight, "string");   
> ?>
>  
> 
> var phpScreenWidth, phpScreenHight;
> 
> phpScreenWidth  = screen.width;
> phpScreenHeight = screen.height;
> 
> 
>  
>  echo "Width:|".$phpScreenWidth."|";
> echo "Height:|".$phpScreenHeight."|";
> ?>
>  
> I know that this code is not working, it is just to see what I want to
> do.
> If somebody know a solution, like this, then please let me know.

What are you trying do? Are you trying to pass to PHP the user's screen
width and height ?

Martin

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



[PHP] PHP & JavaScript

2003-10-22 Thread BQ777
Hi everybody!
 
Have somebody any idea how I could do something like that?
 

 

var phpScreenWidth, phpScreenHight;

phpScreenWidth  = screen.width;
phpScreenHeight = screen.height;


 
";
echo "Height:|".$phpScreenHeight."|";
?>
 
I know that this code is not working, it is just to see what I want to
do.
If somebody know a solution, like this, then please let me know.
 
greetZ
 
CBQ


[PHP] Q on preg_split

2003-10-22 Thread jsWalter
I have an array... [ sample of contents below]

[0] =>
[1] => # words are recognized ceaselessly: true, yes, on, false, no,
off.
[2] => # ---
[3] =>
[4] =>
[5] => # The mailing address of the list.
[6] => # If empty, default is derived from address given in VMD.rc.
[7] => LIST_ADDRESS=
[8] =>

I have this script segment that processes the array into an associated array
of name/value pairs...


// Loop through file contents array
foreach ($content as $i => $value)
{
  // If we have any data in this line
  if (! empty ($value))
  {
// If this line is not a comment
if ( $value{0} != '#')
{
   list($a, $b) = split("=", $value);
   $content[$a] = $b;
}

// kill orginal array element
unset($content[$i]);

   }
}


this work fine, but I saw a piece of script where someone used...

   list($a, $b) = preg_split("/=/",$content[$i], -1, PREG_SPLIT_NO_EMPTY);

I inserted this in my script, and removed both IF statements.

This works fine on the blank elements, but spits out warnings on the
elements that do not have an '=' in it.

I guess my problem stems from the fact I can't (don't know how to) read a
file one line at a time.

If I could to that, then I could just ignore blank lines, and or comment
lines right off the bat.

Anyone have any ideas on how best to solve this? Or at least a better
solution?

And parse_ini_file() does not help with this, unless someone can tell me how
to change the delimiter this method assumes.

Thanks

Walter

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



Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi again Marek,

I want the results like this:

  company1
  1plan1 // this is the important one as its the least/most (depending on
DESC or ASC)
  1plan2 // this is all the other plans company1 offers (which meet the sql
parameters)

  company2
  2plan1 // this again is important as its the second least/most (depending
on DESC or ASC)
  2plan2 //this is all the other plans company2 offers (which meet the sql
parameters)


  company3
  3plan1 // this again is important as its the third least/most (depending
on DESC or ASC)
  3plan2 //this is all the other plans company3 offers (which meet the sql
parameters)

  etc

I've pretty much given up on this coz I have been experimenting with
differient code and my brains gone to mush right now...

Thanks for trying.

-Ryan




> Still you have shown only how you didn't want the results ordered but
> how you want them.
>
> Ryan A wrote:
> > Hi Marek,
> > Sorry about the confusion, let me explain.
> >
> > With default sorting (without $TheOrder) I am getting this:
> >
> > (using $sqlle = "select * from $table_namee where price <=$max and
spacee
> >
> >>=$min order by custno,price LIMIT $limitvalue1, $limit"; )
> >
> >
> >  company1
> >  1plan1
> >  1plan2
> >
> >  company2
> >  2plan1
> >  2plan2
> >
> >
> >  company3
> >  3plan1
> >  3plan2
> >
> >  etc
> >
> > Which is the perfect results that I am looking for. This is the code i
am
> > using to get that output:
> >
> > if(empty($Tcompany))
> >  { $Tcompany = $row[4];  }
> >  elseif($Tcompany != $row[4])
> >  {
> > //echo plan and html here
> > $Tcompany = $row[4];
> >  }
> >
> > So far so good, I am getting everything exactly the way I want it.
> >
> >
> > Now  I want to give the user an ability to sort the data according to
the
> > way he wants itso I am using:
> > ($sqlle = "select * from $table_namee where price <=$max and spacee=$min
> > order by $TheOrder, custno LIMIT $limitvalue1, $limit)
> >
> >
> > and the results are coming out jumbled like this:
> >
> > company1
> >  1plan1
> >
> > company3
> >  3plan1
> >
> > company1
> >  1plan2
> >
> >
> > company2
> >  2plan1
> >  2plan2
> >
> >
> > I do basically want to order by both (as you said)...first order by
> > $TheOrder and make sure it displays by "company"
> > Rob from the list said something about caching the result...but I really
> > couldnt understand...am looking into it though.
> >
> >
> > Any ideas or questions?
> >
> > Thanks,
> > -Ryan
> >
> >
> >
> >
> >
> >
> >>Hi again,
> >>
> >>I cannot spot any difference from the original that you already have.
> >>
> >>Marek
> >>
> >>Ryan A wrote:
> >>
> >>>Hi,
> >>>Thanks for replying.
> >>>
> >>>Yes, i know ordering by both at once  as if they were on the first
place
> >
> > is
> >
> >>>illogical, thats why I need a php answer to "wangle"  thisI want
the
> >>>desired output to be the same when the sort by was by default
> >
> > "price"..eg:
> >
> >>>company1
> >>>1plan1
> >>>1plan2
> >>>
> >>>company2
> >>>2plan1
> >>>2plan2
> >>>
> >>>
> >>>company3
> >>>3plan1
> >>>3plan2
> >>>
> >>>etc
> >>>
> >>>What do you think?
> >>>
> >>>Cheers,
> >>>-Ryan
> >>>
> >>>
> >>>
> >>>
> How do you mean it? Order by both at once as if they were on the first
> place? Is this logicaly possible?
> 
> You should post your desired output.
> 
> Marek
> 
> Ryan A wrote:
> 
> 
> >Hi Marek,
> >Thanks for replying.
> >
> >If I do that I get the companies neatly but the not sorted according
to
> >>>
> >>>the
> >>>
> >>>
> >$TheOrder...:-(
> >
> >Yep, am checkign user inputs.
> >
> >Cheers,
> >-Ryan
> 
> 
> 
> >>
> >>
> >
>
>
>

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



Re: [PHP] Age from birthdate?

2003-10-22 Thread Ashley M. Kirchner
Curt Zirzow wrote:

I do wonder what the rule for those born on Feb 29'th.  Do they
celebrate they're birthday before or after it on non leap years?
 

   Neither.  They celebrate it on Feb 29th.  So while we age every 
year, they only age once every four.  Make sense?

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

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


Re: [PHP] Simple array question

2003-10-22 Thread David Otton
On Thu, 23 Oct 2003 14:01:59 -0500, you wrote:

>Is there a simple way to return the key (name) of one element in an 
>array? I looked up key() in the docs, but there are no examples or 
>notes...

Ok, to make sure I understand you:

given an array

('apple' => 'red', 'banana' => 'yellow')

you want a function where you submit 'red' and the function returns 'apple'?

The problem is that keys have to be unique, but values don't. What should
the function return for this array?

('apple' => 'red', 'banana' => 'yellow', 'tomato' => 'red')

I can see two choices - if values are guaranteed unique, or if you only care
about the last hit, use array_flip() to transform the array, then do a
normal lookup:

$a = array_flip ($a);
$key = $a['red'];

If you want /all/ the keys, just iterate over the array:

$result = array();
$target = 'apple';
foreach ($a as $key => $val)
{
if ($target == $val)
{
$result[] = $key;
}
}

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



Re: [PHP] Age from birthdate?

2003-10-22 Thread Curt Zirzow
* Thus wrote John W. Holmes ([EMAIL PROTECTED]):
> DvDmanDT wrote:
> 
> >How would I get the age of someone if I store the birthdate in a date 
> >field?
> >I just realized FLOOR((UNIX_TIMESTAMP(NOW()) -
> >UNIX_TIMESTAMP(birthdate))/60/60/24/365.25)  wont work for persons born
> >before 1970... :p I must get the current age in years, and I must be able 
> >to
> >select by age... :p Any ideas?
> 
> YEAR(CURRENT_DATE) - YEAR(dob) - 
> (IF(DAYOFYEAR(dob)>DAYOFYEAR(CURRENT_DATE),1,0)) AS age

I do wonder what the rule for those born on Feb 29'th.  Do they
celebrate they're birthday before or after it on non leap years?


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread John W. Holmes
jsWalter wrote:

I need to read (write comes later) from a config file that we used to handle
manually.
I'm getting lazy, so I'm writing a web interface for this.
Don't know if someone said this or not, but why not just use 
parse_ini_file() ?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Age from birthdate?

2003-10-22 Thread John W. Holmes
DvDmanDT wrote:

How would I get the age of someone if I store the birthdate in a date field?
I just realized FLOOR((UNIX_TIMESTAMP(NOW()) -
UNIX_TIMESTAMP(birthdate))/60/60/24/365.25)  wont work for persons born
before 1970... :p I must get the current age in years, and I must be able to
select by age... :p Any ideas?
YEAR(CURRENT_DATE) - YEAR(dob) - 
(IF(DAYOFYEAR(dob)>DAYOFYEAR(CURRENT_DATE),1,0)) AS age

will work for MySQL, where "dob" is your DATE date of birth column.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Email Body

2003-10-22 Thread John W. Holmes
micro brew wrote:
I am sending an email using mail() and it works fine. 
But the formatting of the body of the email is wrong. 
I want to format part of it in columns sort of like
this:
Name   Quantity  Price

Can this be done neatly without using an html email?
\t is a tab. You can use that to line things up.

Like the other guy said, make sure your strings are within double 
quotes, otherwise things like \t and \n do not get evaluated.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
Still you have shown only how you didn't want the results ordered but 
how you want them.

Ryan A wrote:
Hi Marek,
Sorry about the confusion, let me explain.
With default sorting (without $TheOrder) I am getting this:

(using $sqlle = "select * from $table_namee where price <=$max and spacee

=$min order by custno,price LIMIT $limitvalue1, $limit"; )


 company1
 1plan1
 1plan2
 company2
 2plan1
 2plan2
 company3
 3plan1
 3plan2
 etc

Which is the perfect results that I am looking for. This is the code i am
using to get that output:
if(empty($Tcompany))
 { $Tcompany = $row[4];  }
 elseif($Tcompany != $row[4])
 {
//echo plan and html here
$Tcompany = $row[4];
 }
So far so good, I am getting everything exactly the way I want it.

Now  I want to give the user an ability to sort the data according to the
way he wants itso I am using:
($sqlle = "select * from $table_namee where price <=$max and spacee=$min
order by $TheOrder, custno LIMIT $limitvalue1, $limit)
and the results are coming out jumbled like this:

company1
 1plan1
company3
 3plan1
company1
 1plan2
company2
 2plan1
 2plan2
I do basically want to order by both (as you said)...first order by
$TheOrder and make sure it displays by "company"
Rob from the list said something about caching the result...but I really
couldnt understand...am looking into it though.
Any ideas or questions?

Thanks,
-Ryan





Hi again,

I cannot spot any difference from the original that you already have.

Marek

Ryan A wrote:

Hi,
Thanks for replying.
Yes, i know ordering by both at once  as if they were on the first place
is

illogical, thats why I need a php answer to "wangle"  thisI want the
desired output to be the same when the sort by was by default
"price"..eg:

company1
1plan1
1plan2
company2
2plan1
2plan2
company3
3plan1
3plan2
etc

What do you think?

Cheers,
-Ryan



How do you mean it? Order by both at once as if they were on the first
place? Is this logicaly possible?
You should post your desired output.

Marek

Ryan A wrote:


Hi Marek,
Thanks for replying.
If I do that I get the companies neatly but the not sorted according to
the


$TheOrder...:-(

Yep, am checkign user inputs.

Cheers,
-Ryan






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


[PHP] Re: Check mysq_field_type, display appropriate FORM element

2003-10-22 Thread Justin Patrin
I'm working on a general purpose database data editor in PHP which can 
allow users to edit what you want and also knows about linked record 
with no extra coding. I was planning on putting this kind of field 
typing and type checking in my code, but haven't gotten around to it 
yet. If you're interested, check out:

http://rdbedit.sourceforge.net

If you're interested in developing on it, contact me.

René fournier wrote:

Hello everyone,

I'm upgrading my simple CMS app, and would like to add a [simple] 
function to it—which I'm finding is no so simple (at least for me). To 
illustrate:

The user clicks "Edit" on a particular table row. The CMS then fetches 
that row from the table and begins displaying the value of each field in 
a form (which the user can then edit and at then click "Update") . So 
far, so good.

What I want to add is a function that will, depending on the field type 
(text, set, enum), display the field value as either a  or 
. For example, for a field called "status", which is of 
type ENUM, and can contain the values "Online" or "Offline", I want this 
CMS function to return something like "..." along with 
the allowed values, with the active one selected.

Beyond this, I'd like to extend this check_field_type function to handle 
fields that contain links to images, etc. But this is where I need to 
start.

Thanks.

...Rene

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


[PHP] Check mysq_field_type, display appropriate FORM element

2003-10-22 Thread René Fournier
Hello everyone,

I'm upgrading my simple CMS app, and would like to add a [simple] 
function to it—which I'm finding is no so simple (at least for me). To 
illustrate:

The user clicks "Edit" on a particular table row. The CMS then fetches 
that row from the table and begins displaying the value of each field 
in a form (which the user can then edit and at then click "Update") . 
So far, so good.

What I want to add is a function that will, depending on the field type 
(text, set, enum), display the field value as either a  or 
. For example, for a field called "status", which is of 
type ENUM, and can contain the values "Online" or "Offline", I want 
this CMS function to return something like "..." along 
with the allowed values, with the active one selected.

Beyond this, I'd like to extend this check_field_type function to 
handle fields that contain links to images, etc. But this is where I 
need to start.

Thanks.

...Rene

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


Re: [PHP] Email Body

2003-10-22 Thread Rolf Brusletto
didn't mention this before, but the difference between the two examples 
if you hadn't noticed already is that the first is single quoted, and 
the second, double quoted.

Rolf

micro brew wrote:

I am sending an email using mail() and it works fine. 
But the formatting of the body of the email is wrong. 
I want to format part of it in columns sort of like
this:
Name   Quantity  Price

Can this be done neatly without using an html email?

Also what is the trick to making line returns display
properly in the email client?  I've tried using \r\n
with no luck.  I also tried \n.  The characters show
in the email but no line breaks.  Any suggestions?
TIA,

Mike

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 

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


Re: [PHP] Email Body

2003-10-22 Thread Rolf Brusletto
yo -

\n should work, but it depends on which type of quotes you use... see 
the following..

$content = 'this is the first line\n this is the second line\n this is 
the third line';

would return

this is the first line\n this is the second line\n this is the third line

as opposed to

$content = "this is the first line\n this is the second line\n this is 
the third line";

which would return

this is the first line
this is the second line
this is the third line
As for the formatting... I haven't been able to format a text email 
perfectly myself..

Rolf Brusletto
http://www.phpExamples.net
micro brew wrote:

I am sending an email using mail() and it works fine. 
But the formatting of the body of the email is wrong. 
I want to format part of it in columns sort of like
this:
Name   Quantity  Price

Can this be done neatly without using an html email?

Also what is the trick to making line returns display
properly in the email client?  I've tried using \r\n
with no luck.  I also tried \n.  The characters show
in the email but no line breaks.  Any suggestions?
TIA,

Mike

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 

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


[PHP] Email Body

2003-10-22 Thread micro brew
I am sending an email using mail() and it works fine. 
But the formatting of the body of the email is wrong. 
I want to format part of it in columns sort of like
this:
Name   Quantity  Price

Can this be done neatly without using an html email?

Also what is the trick to making line returns display
properly in the email client?  I've tried using \r\n
with no luck.  I also tried \n.  The characters show
in the email but no line breaks.  Any suggestions?

TIA,

Mike

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] there has to be a better way...

2003-10-22 Thread Daevid Vincent
> -Original Message-
> From: Walter Torres [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 22, 2003 3:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] there has to be a better way...
> 
> 
> "Daevid Vincent" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Here is a snippet from my dhcp web page found on my site 
> below... Not
> > exactly what you want, but could help you start...
> 
> thanks!
> 
> 
> > // read in the dhcp_map.ini file to map MAC addresses to images
> > $mapFile = "./dhcp_map.ini";
> > if( $fp = @fopen($mapFile, "r") )
> > {
> > while( $line = fgets($fp, 1024) )
> 
> this pulls out 1024 bytes of data form the file. right?
> or does this pull UPTO 1024 bytes of data or the EOL, which 
> ever is first?
> if fgets() onlt pulls out so much data, not to EOL, why use it?

Yes. Keeps getting 1024 byte chunks until EOL as per the documentation.

> 
> > if ($line{0} != "#") $tempMap .= $line;  // strip
> > out # comments
> > } else echo "ERROR: Can't read ".$mapFile."";
> > fclose ($fp);
> > $map = explode("\n", $tempMap);
> 
> Now make an array of these line. Right?

Ignore comment lines (#) 
Yes, explode the entire file in to one line per array key.

> > for($i = 0; $i < count($map); $i++)
> > {
> > list($mac, $image, $name) = preg_split("/\s/",$map[$i], -1,
> > PREG_SPLIT_NO_EMPTY);
> 
> walk down the map array.
> split each element on the SPACE, but don't deal with blank lines

Take each line/key of the array and split it into another array of 'stuff'
Ignore any spaces between chunks of data. If you look at the data file,
you'll understand.

> seems almost the same.
> nice use of PREG_SPLIT. I guess that helps with the BLANK lines.

It helps with blank space between MAC, image and name columns on a single
line.

> If I understand right, if I pull out 1028 of data, the '#' on 
> each line
> could be anywhere in that buffer, not just at the first character.

Yeah, in my case, I only count a # at the beginning of a line AKA $line{0}

> That's why I pulled in the entire file into a string var and 
> then exploded it into an array split on EOL characters.
> 
> Am I missing something?
> 
> Thanks for your sample.

Np.

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



Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi Marek,
Sorry about the confusion, let me explain.

With default sorting (without $TheOrder) I am getting this:

(using $sqlle = "select * from $table_namee where price <=$max and spacee
>=$min order by custno,price LIMIT $limitvalue1, $limit"; )

 company1
 1plan1
 1plan2

 company2
 2plan1
 2plan2


 company3
 3plan1
 3plan2

 etc

Which is the perfect results that I am looking for. This is the code i am
using to get that output:

if(empty($Tcompany))
 { $Tcompany = $row[4];  }
 elseif($Tcompany != $row[4])
 {
//echo plan and html here
$Tcompany = $row[4];
 }

So far so good, I am getting everything exactly the way I want it.


Now  I want to give the user an ability to sort the data according to the
way he wants itso I am using:
($sqlle = "select * from $table_namee where price <=$max and spacee=$min
order by $TheOrder, custno LIMIT $limitvalue1, $limit)


and the results are coming out jumbled like this:

company1
 1plan1

company3
 3plan1

company1
 1plan2


company2
 2plan1
 2plan2


I do basically want to order by both (as you said)...first order by
$TheOrder and make sure it displays by "company"
Rob from the list said something about caching the result...but I really
couldnt understand...am looking into it though.


Any ideas or questions?

Thanks,
-Ryan





> Hi again,
>
> I cannot spot any difference from the original that you already have.
>
> Marek
>
> Ryan A wrote:
> > Hi,
> > Thanks for replying.
> >
> > Yes, i know ordering by both at once  as if they were on the first place
is
> > illogical, thats why I need a php answer to "wangle"  thisI want the
> > desired output to be the same when the sort by was by default
"price"..eg:
> >
> > company1
> > 1plan1
> > 1plan2
> >
> > company2
> > 2plan1
> > 2plan2
> >
> >
> > company3
> > 3plan1
> > 3plan2
> >
> > etc
> >
> > What do you think?
> >
> > Cheers,
> > -Ryan
> >
> >
> >
> >>How do you mean it? Order by both at once as if they were on the first
> >>place? Is this logicaly possible?
> >>
> >>You should post your desired output.
> >>
> >>Marek
> >>
> >>Ryan A wrote:
> >>
> >>>Hi Marek,
> >>>Thanks for replying.
> >>>
> >>>If I do that I get the companies neatly but the not sorted according to
> >
> > the
> >
> >>>$TheOrder...:-(
> >>>
> >>>Yep, am checkign user inputs.
> >>>
> >>>Cheers,
> >>>-Ryan
> >>
> >>
> >>
> >
>
>
>

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread jsWalter

"Daevid Vincent" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Here is a snippet from my dhcp web page found on my site below... Not
> exactly what you want, but could help you start...

thanks!


> // read in the dhcp_map.ini file to map MAC addresses to images
> $mapFile = "./dhcp_map.ini";
> if( $fp = @fopen($mapFile, "r") )
> {
> while( $line = fgets($fp, 1024) )

this pulls out 1024 bytes of data form the file. right?

or does this pull UPTO 1024 bytes of data or the EOL, which ever is first?


> if ($line{0} != "#") $tempMap .= $line;  // strip
> out # comments
> } else echo "ERROR: Can't read ".$mapFile."";
> fclose ($fp);
> $map = explode("\n", $tempMap);

OK. $tempMap is a string var. Each line of the file has a /n delimiting it.

Now make an array of these line.

Right?

> for($i = 0; $i < count($map); $i++)
> {
> list($mac, $image, $name) = preg_split("/\s/",$map[$i], -1,
> PREG_SPLIT_NO_EMPTY);

walk down the map array.

split each element on the SPACE, but don't deal with blank lines

...

seems almost the same.

nice use of PREG_SPLIT. I guess that helps with the BLANK lines.

if fgets() onlt pulls out so much data, not to EOL, why use it?

If I understand right, if I pull out 1028 of data, the '#' on each line
could be anywhere in that buffer, not just at the first character.

That's why I pulled in the entire file into a string var and then exploded
it into an array split on EOL characters.

Am I missing something?

Thanks for your sample.

Walter

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread jsWalter
"- Edwin -" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wed, 22 Oct 2003 03:10:44 -0500
> "jsWalter" <[EMAIL PROTECTED]> wrote:
>
> [snip]
> > There must be a better way to do this.
> [/snip]
>
>   http://www.php.net/manual/en/function.parse-ini-file.php ?

thanks.

But, my concern with that is my config files use '#' for comment lines, not
';'

Is there a way around this?

Walter




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



Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
Hi again,

I cannot spot any difference from the original that you already have.

Marek

Ryan A wrote:
Hi,
Thanks for replying.
Yes, i know ordering by both at once  as if they were on the first place is
illogical, thats why I need a php answer to "wangle"  thisI want the
desired output to be the same when the sort by was by default "price"..eg:
company1
1plan1
1plan2
company2
2plan1
2plan2
company3
3plan1
3plan2
etc

What do you think?

Cheers,
-Ryan


How do you mean it? Order by both at once as if they were on the first
place? Is this logicaly possible?
You should post your desired output.

Marek

Ryan A wrote:

Hi Marek,
Thanks for replying.
If I do that I get the companies neatly but the not sorted according to
the

$TheOrder...:-(

Yep, am checkign user inputs.

Cheers,
-Ryan




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


[PHP] fsock sending bad request

2003-10-22 Thread daniel
Hi there the following code doesnt seem to work, i am getting a bad request
sent back from the server, what could be the problem of something so
simple ?

$header .= "POST test.php HTTP/1.0\r\n";
$header.= "Host: host\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= 'Content-Length: ' . strlen($req) . "\n\n";
$header .= "Connection: close\n\n";
$header.= "$req\n";
$header.= "\r\n";




$fp = fsockopen("host", "80", $errno, $errstr, $timeout = 30);
if (!$fp) {
  // ERROR
  echo "$errstr ($errno)";
} else {

//put the data..
  fputs ($fp, $header . $req);
  while (!feof($fp)) {
//read the data returned...
$res = fgets ($fp, 1024);
echo $res;
 }
  fclose ($fp);
}

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



Re: [PHP] Age from birthdate?

2003-10-22 Thread Jason Wong
On Thursday 23 October 2003 00:31, DvDmanDT wrote:
> How would I get the age of someone if I store the birthdate in a date
> field? I just realized FLOOR((UNIX_TIMESTAMP(NOW()) -
> UNIX_TIMESTAMP(birthdate))/60/60/24/365.25)  wont work for persons born
> before 1970... :p I must get the current age in years, and I must be able
> to select by age... :p Any ideas?

If using MySQL:

  SELECT FROM_DAYS((TO_DAYS(NOW()) - TO_DAYS(dob))) as age

or something.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Oh, yeah, life goes on, long after the thrill of livin' is gone.
-- John Cougar, "Jack and Diane"
*/

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



Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi,
Thanks for replying.

Yes, i know ordering by both at once  as if they were on the first place is
illogical, thats why I need a php answer to "wangle"  thisI want the
desired output to be the same when the sort by was by default "price"..eg:

company1
1plan1
1plan2

company2
2plan1
2plan2


company3
3plan1
3plan2

etc

What do you think?

Cheers,
-Ryan


> How do you mean it? Order by both at once as if they were on the first
> place? Is this logicaly possible?
>
> You should post your desired output.
>
> Marek
>
> Ryan A wrote:
> > Hi Marek,
> > Thanks for replying.
> >
> > If I do that I get the companies neatly but the not sorted according to
the
> > $TheOrder...:-(
> >
> > Yep, am checkign user inputs.
> >
> > Cheers,
> > -Ryan
>
>
>

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



Re: [PHP] Re: (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code

2003-10-22 Thread John Black
Hey,


> I think he just answered the other guy's question with your answer to
another one ;-).
Oh, ok.

> btw. http://www.securecents.com/secureCode_features.php only returns a
404.
DAMN! we changed the name from SecureCode to CodeSecure and I guess forgot
to make the change on the site :-(
anyway, now we have a duplicate page so it shouldnt cause a bother no
more...

Thanks for pointing that out.

-JB

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




Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
How do you mean it? Order by both at once as if they were on the first 
place? Is this logicaly possible?

You should post your desired output.

Marek

Ryan A wrote:
Hi Marek,
Thanks for replying.
If I do that I get the companies neatly but the not sorted according to the
$TheOrder...:-(
Yep, am checkign user inputs.

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


Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi Ray,
Thanks for replying.

Can you give me a small code example please?

This is what I am using to get the companies in order:

if(empty($Tcompany))
 { $Tcompany = $row[4];  }
 elseif($Tcompany != $row[4])
 {
//echo plan and html here
$Tcompany = $row[4];
 }

(I think the above was contributed to me by the dude...John Holmes...but am
not sure...works like a charm though so I guess so)

Cheers,
-Ryan


> You can always query the database and store the results as arrays in the
> session and sort the arrays...this would limit how many times that you
> are querying the database (if you are just sorting the results).
>
> --
> ray
>
> On Wed, 2003-10-22 at 15:02, Ryan A wrote:
> > Hi,
> > I have a search form that queries the database and returns results in
this
> > order:
> >
> > company name1
> > 1plan 1
> > 1plan 2
> > etc
> >
> > company name2
> > 2plan 1
> > 2plan 2
> > etc
> >
> > company name3
> > 3plan 1
> > 3plan 2
> > etc
> >
> > etc etc
> >
> > This is my sql:
> >
> > $sqlle = "select * from $table_namee where price <=$max and spacee
>=$min
> > order by custno,price LIMIT $limitvalue1, $limit";
> >
> >
> >
> > So far no problems at all, now I want to add an option so that the
visitor
> > has more control of the results...right now its sorting by $price, I
have
> > made a drop down menu where the visitor can sort on 7 differient fields,
> > this is my sql:
> >
> > (I have added $TheOrder so it can change according to what was selected.
> > (Eg. Price, name, company, website etc)
> >
> > $sqlle = "select * from $table_namee where price <=$max and spacee
>=$min
> > order by $TheOrder, custno LIMIT $limitvalue1, $limit";
> >
> > This is screwing up my results totally, its giving me something like:
> >
> > company name1
> > 1plan 1
> >
> > company name2
> > 2plan 1
> >
> > company name1
> > 1plan 2
> >
> > company name3
> > 3plan 2
> >
> > company name2
> > 2plan 2
> >
> > etc
> >
> > How can i offer the above and still get my results neatly done (like
before)
> > by company/custno?
> >
> > Any ideas? Any help appreciated.
> >
> > Cheers,
> > -Ryan
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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



Re: [PHP] Re: (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code

2003-10-22 Thread Thomas Seifert

I think he just answered the other guy's question with your answer to another one ;-).

btw. http://www.securecents.com/secureCode_features.php only returns a 404.



thomas

On Wed, 22 Oct 2003 23:20:13 +0200 [EMAIL PROTECTED] (John Black) wrote:

> Hi Jason,
> 
> Did I say something wrong?
> A bit puzzled as you just copied what I wrote to the other guy and
> reposted
> 
> Cheers,
> -JB
> 
> 
> 
> > On Wednesday 22 October 2003 21:38, Bas wrote:
> > > Is it free?
> >
> > > > For details, check us out at http://www.secureCents.com
> >
> > -- 
> > Jason Wong -> Gremlins Associates -> www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet Applications Development *
> > --
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-general
> > --
> > /*
> > "The fundamental principle of science, the definition almost, is this: the
> > sole test of the validity of any idea is experiment."
> > -- Richard P. Feynman
> > */
> >
> > -- 
> > 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] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi Marek,
Thanks for replying.

If I do that I get the companies neatly but the not sorted according to the
$TheOrder...:-(

Yep, am checkign user inputs.

Cheers,
-Ryan


> I hope you check all user inputs for validity. Your order clause should
> be "order by custno, $TheOrder".
>
> Ryan A wrote:
> > Hi,
> > I have a search form that queries the database and returns results in
this
> > order:
> >
> > company name1
> > 1plan 1
> > 1plan 2
> > etc
> >
> > company name2
> > 2plan 1
> > 2plan 2
> > etc
> >
> > company name3
> > 3plan 1
> > 3plan 2
> > etc
> >
> > etc etc
> >
> > This is my sql:
> >
> > $sqlle = "select * from $table_namee where price <=$max and spacee
>=$min
> > order by custno,price LIMIT $limitvalue1, $limit";
> >
> >
> >
> > So far no problems at all, now I want to add an option so that the
visitor
> > has more control of the results...right now its sorting by $price, I
have
> > made a drop down menu where the visitor can sort on 7 differient fields,
> > this is my sql:
> >
> > (I have added $TheOrder so it can change according to what was selected.
> > (Eg. Price, name, company, website etc)
> >
> > $sqlle = "select * from $table_namee where price <=$max and spacee
>=$min
> > order by $TheOrder, custno LIMIT $limitvalue1, $limit";
> >
> > This is screwing up my results totally, its giving me something like:
> >
> > company name1
> > 1plan 1
> >
> > company name2
> > 2plan 1
> >
> > company name1
> > 1plan 2
> >
> > company name3
> > 3plan 2
> >
> > company name2
> > 2plan 2
> >
> > etc
> >
> > How can i offer the above and still get my results neatly done (like
before)
> > by company/custno?
> >
> > Any ideas? Any help appreciated.
> >
> > Cheers,
> > -Ryan
> >
>
>
>

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



Re: [PHP] (ANNOUNCE) New PHP mailing list *searchable* archives

2003-10-22 Thread Marco Tabini
Hello All--

I'd have to agree with Richard in that there doesn't seem to be a good 
way to make this idea fly--at the very least, it would be annoying (also 
because there really is no way to guarantee that the results would be 
entirely relevant to the contents of the message).

I've sent an e-mail to the php.net webmaster asking their opinion on 
adding a link to the archives (maybe to all of them, although personally 
I think that would be confusing) to the signature that gets added to 
each message that goes through the list. We'll see what they think... 
any support we can muster from the list itself will certainly help ;-)

Cheers

Marco

Richard Baskett wrote:
on 10/22/03 13:32, David T-G at [EMAIL PROTECTED] wrote:


Richard, et al --

...and then Richard Baskett said...
% 
% on 10/21/03 16:40, David T-G at [EMAIL PROTECTED] wrote:
% 
% > ...and then Marco Tabini said...
% > % 
% > % php.general for new messages and send back an e-mail to the list with
...
% > 
% > A nice idea, but terribly difficult to implement practically.  It was
% > tried on the mutt-users list and the manitainer was roundly flamed :-)
% 
% It seems like it would be ok to have it sent to the person that asked the
% question...  And then if they did not want to receive those notices, then
% they could opt out of that..

That sounds a lot like opt-out spam.  Is it OK for me to send you lots of
unsolicted, form-letter, machine-generated emails? :-)
It wasn't pretty.


I understand what you are saying, but if it's part of the agreement when you
sign up for the php-general mailing list.. then...  And at any time you can
opt in again if you wanted.  Or if that is still too intrusive then have a
little notice at the bottom of each php-general mailing along with the other
footer stuff and let people opt in that way from the beginning...
Rick

Beauty of whatever kind, in its supreme development, invariably excites the
sensitive soul to tears. - Edgar Allan Poe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code

2003-10-22 Thread John Black
Hi Jason,

Did I say something wrong?
A bit puzzled as you just copied what I wrote to the other guy and
reposted

Cheers,
-JB



> On Wednesday 22 October 2003 21:38, Bas wrote:
> > Is it free?
>
> > > For details, check us out at http://www.secureCents.com
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> "The fundamental principle of science, the definition almost, is this: the
> sole test of the validity of any idea is experiment."
> -- Richard P. Feynman
> */
>
> -- 
> 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] Screwing up my results...please help

2003-10-22 Thread Marek Kilimajer
I hope you check all user inputs for validity. Your order clause should 
be "order by custno, $TheOrder".

Ryan A wrote:
Hi,
I have a search form that queries the database and returns results in this
order:
company name1
1plan 1
1plan 2
etc
company name2
2plan 1
2plan 2
etc
company name3
3plan 1
3plan 2
etc
etc etc

This is my sql:

$sqlle = "select * from $table_namee where price <=$max and spacee >=$min
order by custno,price LIMIT $limitvalue1, $limit";


So far no problems at all, now I want to add an option so that the visitor
has more control of the results...right now its sorting by $price, I have
made a drop down menu where the visitor can sort on 7 differient fields,
this is my sql:
(I have added $TheOrder so it can change according to what was selected.
(Eg. Price, name, company, website etc)
$sqlle = "select * from $table_namee where price <=$max and spacee >=$min
order by $TheOrder, custno LIMIT $limitvalue1, $limit";
This is screwing up my results totally, its giving me something like:

company name1
1plan 1
company name2
2plan 1
company name1
1plan 2
company name3
3plan 2
company name2
2plan 2
etc

How can i offer the above and still get my results neatly done (like before)
by company/custno?
Any ideas? Any help appreciated.

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


Re: note: [PHP] ob_get_length() returns uncompressed buffer length (after ob_start('ob_gzhandler'))

2003-10-22 Thread daniel hahler
Hallo PHP-general list,

on Wed, 22 Oct 2003 23:07:06 +0200 I already wrote:

dh> Hallo daniel,

don't want to talk only to myself.. this is for everyone.. :)


-- 
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc

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



Re: [PHP] Screwing up my results...please help

2003-10-22 Thread Ray Hunter
You can always query the database and store the results as arrays in the
session and sort the arrays...this would limit how many times that you
are querying the database (if you are just sorting the results).

--
ray

On Wed, 2003-10-22 at 15:02, Ryan A wrote:
> Hi,
> I have a search form that queries the database and returns results in this
> order:
> 
> company name1
> 1plan 1
> 1plan 2
> etc
> 
> company name2
> 2plan 1
> 2plan 2
> etc
> 
> company name3
> 3plan 1
> 3plan 2
> etc
> 
> etc etc
> 
> This is my sql:
> 
> $sqlle = "select * from $table_namee where price <=$max and spacee >=$min
> order by custno,price LIMIT $limitvalue1, $limit";
> 
> 
> 
> So far no problems at all, now I want to add an option so that the visitor
> has more control of the results...right now its sorting by $price, I have
> made a drop down menu where the visitor can sort on 7 differient fields,
> this is my sql:
> 
> (I have added $TheOrder so it can change according to what was selected.
> (Eg. Price, name, company, website etc)
> 
> $sqlle = "select * from $table_namee where price <=$max and spacee >=$min
> order by $TheOrder, custno LIMIT $limitvalue1, $limit";
> 
> This is screwing up my results totally, its giving me something like:
> 
> company name1
> 1plan 1
> 
> company name2
> 2plan 1
> 
> company name1
> 1plan 2
> 
> company name3
> 3plan 2
> 
> company name2
> 2plan 2
> 
> etc
> 
> How can i offer the above and still get my results neatly done (like before)
> by company/custno?
> 
> Any ideas? Any help appreciated.
> 
> Cheers,
> -Ryan

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



note: [PHP] ob_get_length() returns uncompressed buffer length (after ob_start('ob_gzhandler'))

2003-10-22 Thread daniel hahler
Hallo daniel,

am Mon, 20 Oct 2003 13:45:18 +0200 schrieb ich bereits:

dh> But I did not find an answer, how to correct this.. - using
dh> ob_implicit_flush(); did also not help.

is there no way to put header('Content-Length: '.$sth) in when you use
ob_gzhandler in output buffering?

that would be bad.. because you then would have to decide between
bandwidth saving (ob_gzhandler) or
fast transmitting (Content-Length), as there could be more threats
cathcing up a particular file altogether.


-- 
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc

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



Re: [PHP] php with Interbase ?

2003-10-22 Thread Jordan S. Jones
It really depends on what you want compiled in.  If you are not sure 
what options are available, you could try
./configure --help

Jordan S. Jones

Luiz Gustavo Sarubi Macchi wrote:

Hi all, 

Please, I´d like to compile my php with interbase. I know that i should
put --with-interbase[=DIR], but what else should i put in configure ?
Is anyone has a script to do this ?

Should I compile apache too ?

thanks a any help

I´m using:

Mandrake 9.1 kernel 2.4.21-0.13mdk
php-ini-4.3.0-1mdk
mod_php-4.3.1-1mdk
php-readline-4.3.0-1mdk
php-domxml-4.3.0-2mdk
php-xslt-4.3.0-3mdk
php-manual-en-4.3.0-2mdk
libphp_common430-430-11mdk
php-gd-4.3.0-2mdk
php-tclink-4.3.0_3.3.1-12mdk
php-cli-4.3.1-11mdk
php-cgi-4.3.1-11mdk
php-mysql-4.3.0-2mdk
phpgroupware-0.9.14-2mdk
php-xmlrpc-4.3.0-2mdk
php430-devel-430-11mdk
apache2-mod_php-2.0.44_4.3.1-2mdk
php-rrdtool-1.0.40-2mdk
php-xml-4.3.0-2mdk




gugao

 

--
I am nothing but a poor boy. Please Donate..
https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones&no_note=1&tax=0¤cy_code=USD
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Screwing up my results...please help

2003-10-22 Thread Ryan A
Hi,
I have a search form that queries the database and returns results in this
order:

company name1
1plan 1
1plan 2
etc

company name2
2plan 1
2plan 2
etc

company name3
3plan 1
3plan 2
etc

etc etc

This is my sql:

$sqlle = "select * from $table_namee where price <=$max and spacee >=$min
order by custno,price LIMIT $limitvalue1, $limit";



So far no problems at all, now I want to add an option so that the visitor
has more control of the results...right now its sorting by $price, I have
made a drop down menu where the visitor can sort on 7 differient fields,
this is my sql:

(I have added $TheOrder so it can change according to what was selected.
(Eg. Price, name, company, website etc)

$sqlle = "select * from $table_namee where price <=$max and spacee >=$min
order by $TheOrder, custno LIMIT $limitvalue1, $limit";

This is screwing up my results totally, its giving me something like:

company name1
1plan 1

company name2
2plan 1

company name1
1plan 2

company name3
3plan 2

company name2
2plan 2

etc

How can i offer the above and still get my results neatly done (like before)
by company/custno?

Any ideas? Any help appreciated.

Cheers,
-Ryan

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



Re: [PHP] (ANNOUNCE) New PHP mailing list *searchable* archives

2003-10-22 Thread Richard Baskett
on 10/22/03 13:32, David T-G at [EMAIL PROTECTED] wrote:

> Richard, et al --
> 
> ...and then Richard Baskett said...
> % 
> % on 10/21/03 16:40, David T-G at [EMAIL PROTECTED] wrote:
> % 
> % > ...and then Marco Tabini said...
> % > % 
> % > % php.general for new messages and send back an e-mail to the list with
> ...
> % > 
> % > A nice idea, but terribly difficult to implement practically.  It was
> % > tried on the mutt-users list and the manitainer was roundly flamed :-)
> % 
> % It seems like it would be ok to have it sent to the person that asked the
> % question...  And then if they did not want to receive those notices, then
> % they could opt out of that..
> 
> That sounds a lot like opt-out spam.  Is it OK for me to send you lots of
> unsolicted, form-letter, machine-generated emails? :-)
> 
> It wasn't pretty.

I understand what you are saying, but if it's part of the agreement when you
sign up for the php-general mailing list.. then...  And at any time you can
opt in again if you wanted.  Or if that is still too intrusive then have a
little notice at the bottom of each php-general mailing along with the other
footer stuff and let people opt in that way from the beginning...

Rick

Beauty of whatever kind, in its supreme development, invariably excites the
sensitive soul to tears. - Edgar Allan Poe

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



Re: [PHP] Re: (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code

2003-10-22 Thread Jason Wong
On Wednesday 22 October 2003 21:38, Bas wrote:
> Is it free?

> > For details, check us out at http://www.secureCents.com

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"The fundamental principle of science, the definition almost, is this: the
sole test of the validity of any idea is experiment."
-- Richard P. Feynman
*/

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Jason Wong
On Wednesday 22 October 2003 22:08, Shaun Campbell wrote:
> I've got a problem getting sessions to work and I wondered if anyone could
> offer any advice.
>
> The example I am using is to get one page to set variables in a session and
> then use another page to retrieve them.  I am using 4.3.4RC2 and prior to
> that 4.3..3 on Win2k with IE6 and Apache 1.3.22.

>
> The code is:

[snip]

Code looks OK. 

One explanation: you have not enabled transparent sessions, and your browser 
is not accepting cookies.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Sturgeon's Law:
90% of everything is crud.
*/

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



Re: [PHP] Session output question

2003-10-22 Thread Curt Zirzow
* Thus wrote Susan Ator ([EMAIL PROTECTED]):
> 
> 2) Is there any way to use a variable in a session name?
> 
>   can I do:
>   $msg="20031022"
>   $_SESSION["$msg.name"] becomes $_SESSION['20031022name']

In this case the _SESSION key is 20031022.name. You'll want
something like:

  $_SESSION["{$msg}name"] or
  $_SESSION[$msg.'name']


Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Passing array variables in a GET

2003-10-22 Thread Jason Wong
On Thursday 23 October 2003 02:41, Jeff McKeon wrote:

> I looked at the page you suggested but it vauge at best.  Basically from
> what I've gathered using serialize with an array screws up the pointers
> in the array.  Is this true?

If you mean the internal pointer, ie the one that is reset by calling reset(), 
then who cares. Keeping that pointer across pages has little/no value. What 
is important is that the structure and values of the array is intact.

> What I've done is this but it doesn't seem to be working...
>
> Pull data (two fields) from a mysql table and put the results into two
> arrays, one for each field
>
> Query results for field 1 -> Array1[]
> Query results for field 2 -> Array2[]
>
> Then I create a variable with the imploded data from the arrays
>
> $var1=implode(":", $Array1);
> $var2=implode(":", $Array2);
>
> Then serialize the variables...
>
> $varSER1=serialize($var1);
> $varSER2=serialize($var2);

AFAICS serialize() on a string seems to be redundant. serialize() is supposed 
to represent some complex entity (eg an array) as a string so it can be 
easily stored, transmitted etc.

So something like:

  $var_to_pass_in_url = urlencode(serialize($Array1));

Then construct your url like so:

  http://www.example.com/example.php?Array1=$var_to_pass_in_url

Then in example.php you reconstruct the array:

  $Array1 = unserialize($_GET['Array1']);

ought to work (but untested).

> Then pass the variables in the url via a GET.
>
> It doesn't work however

*How* doesn't *What* work?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The opposite of a correct statement is a false statement. But the opposite
of a profound truth may well be another profound truth.
-- Niels Bohr
*/

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



RE: [PHP] link question

2003-10-22 Thread Pablo Gosse
link

And on the receiving page access var via $_GET['var']

Of course, how you actually append the value in question to your link
will depend on your own code.

I use ADOdb for all my db work, so for me it would be something like
this:

echo '';
while (!$rs->EOF)
{
echo '
link
more table cells...

$rs->MoveNext();
}
echo '';

Cheers,
Pablo

-Original Message-
From: Davy Campano [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] link question

I have a php page that makes a table from data in a mySQL database.
What I want to do is make the first entry in the table be a Unique key
that is a link, that when you click on this key it opens another page
with some more information.  Basically I am trying to figure out how to
pass this key from this page to the next.  Thanks for any help!

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

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



Re: [PHP] (ANNOUNCE) New PHP mailing list *searchable* archives

2003-10-22 Thread David T-G
Richard, et al --

...and then Richard Baskett said...
% 
% on 10/21/03 16:40, David T-G at [EMAIL PROTECTED] wrote:
% 
% > ...and then Marco Tabini said...
% > % 
% > % php.general for new messages and send back an e-mail to the list with
...
% > 
% > A nice idea, but terribly difficult to implement practically.  It was
% > tried on the mutt-users list and the manitainer was roundly flamed :-)
% 
% It seems like it would be ok to have it sent to the person that asked the
% question...  And then if they did not want to receive those notices, then
% they could opt out of that..

That sounds a lot like opt-out spam.  Is it OK for me to send you lots of
unsolicted, form-letter, machine-generated emails? :-)

It wasn't pretty.


% 
% Rick


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] php with Interbase ?

2003-10-22 Thread Luiz Gustavo Sarubi Macchi
Hi all, 

Please, I´d like to compile my php with interbase. I know that i should
put --with-interbase[=DIR], but what else should i put in configure ?

Is anyone has a script to do this ?

Should I compile apache too ?

thanks a any help


I´m using:

Mandrake 9.1 kernel 2.4.21-0.13mdk
php-ini-4.3.0-1mdk
mod_php-4.3.1-1mdk
php-readline-4.3.0-1mdk
php-domxml-4.3.0-2mdk
php-xslt-4.3.0-3mdk
php-manual-en-4.3.0-2mdk
libphp_common430-430-11mdk
php-gd-4.3.0-2mdk
php-tclink-4.3.0_3.3.1-12mdk
php-cli-4.3.1-11mdk
php-cgi-4.3.1-11mdk
php-mysql-4.3.0-2mdk
phpgroupware-0.9.14-2mdk
php-xmlrpc-4.3.0-2mdk
php430-devel-430-11mdk
apache2-mod_php-2.0.44_4.3.1-2mdk
php-rrdtool-1.0.40-2mdk
php-xml-4.3.0-2mdk






gugao

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



[PHP] link question

2003-10-22 Thread Davy Campano
I have a php page that makes a table from data in a mySQL database.
What I want to do is make the first entry in the table be a Unique key
that is a link, that when you click on this key it opens another page
with some more information.  Basically I am trying to figure out how to
pass this key from this page to the next.  Thanks for any help!

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



Re: [PHP] Simple array question

2003-10-22 Thread Jason Wong
On Friday 24 October 2003 03:01, René Fournier wrote:
> Is there a simple way to return the key (name) of one element in an
> array? I looked up key() in the docs, but there are no examples or
> notes...

array_search()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Neuroses are red,
Melancholia's blue.
I'm schizophrenic,
What are you?
*/

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Chris Boget wrote:
Okay, so we're back to square onewhy his sessions aren't working. 
This thread has been snipped too much, and I've already deleted the 
original, so I don't have the code that wasn't working.


Sadly, I don't have the original, either. :|
I just pulled it from the archives on php.net, cut and pasted his code 
into two files on my machine, tested it, and it worked fine.  Guess we 
have to wait for the OP to come back and let us know what's wrong. :)

On a side note, Chris, are you in Louisiana?


Yes, why?

Chris

Just saw the wild.net email address, and I knew that they're located on 
my side of the lake (as well as in the UK).  I applied for a php 
position at Wild.net a while backy'all ready to hire me yet?  *L* 
Do you happen to know a guy by the name of Robert Collins?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Chris Boget
> Okay, so we're back to square onewhy his sessions aren't working. 
> This thread has been snipped too much, and I've already deleted the 
> original, so I don't have the code that wasn't working.

Sadly, I don't have the original, either. :|
 
> On a side note, Chris, are you in Louisiana?

Yes, why?

Chris

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



[PHP] Re: Simple array question

2003-10-22 Thread Rob Adams
"René fournier" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a simple way to return the key (name) of one element in an
> array? I looked up key() in the docs, but there are no examples or
> notes...

key() will do it, but you have to have the internal pointer already on the
element you want.  If you're not using next(), prev(), etc, then what you
probably want to use it array_search().

  -- Rob



>
> Thanks.
>
> ...Rene


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



[PHP] Simple array question

2003-10-22 Thread René Fournier
Is there a simple way to return the key (name) of one element in an 
array? I looked up key() in the docs, but there are no examples or 
notes...

Thanks.

...Rene

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


Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Chris Boget wrote:
";
echo "bar = {$_SESSION['bar']}";
Not when it's inside a string.
His statements should output the following:
foo = somevalue
bar = anothervalue
Also... he's using { and } because you can't access an array's value
unless it's within curly braces.


Not entirely true.  You can still do the following:

echo "foo = $_SESSION[foo]";
echo "bar = $_SESSION[bar]";
Chris

Okay, so we're back to square onewhy his sessions aren't working. 
This thread has been snipped too much, and I've already deleted the 
original, so I don't have the code that wasn't working.

On a side note, Chris, are you in Louisiana?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Chris Boget
>> >  echo "foo = {$_SESSION['foo']}";
>>  echo "bar = {$_SESSION['bar']}";
> Not when it's inside a string.
> His statements should output the following:
> foo = somevalue
> bar = anothervalue
> Also... he's using { and } because you can't access an array's value
> unless it's within curly braces.

Not entirely true.  You can still do the following:

echo "foo = $_SESSION[foo]";
echo "bar = $_SESSION[bar]";

Chris

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Chris W. Parker wrote:
John Nichel 
on Wednesday, October 22, 2003 11:33 AM said:

";
echo "bar = {$_SESSION['bar']}";
Get rid of the "foo =" and the "bar =".  when you use the single
equals sign, you're setting value


Not when it's inside a string.

His statements should output the following:

foo = somevalue
bar = anothervalue
Also... he's using { and } because you can't access an array's value
unless it's within curly braces.
Duh, that's what I get for just glancing at it.  This is why the 'other' 
John is wearing the crown now.  :)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Chris W. Parker
John Nichel 
on Wednesday, October 22, 2003 11:33 AM said:

>> >  echo "foo = {$_SESSION['foo']}";
>>  echo "bar = {$_SESSION['bar']}";
> 
> Get rid of the "foo =" and the "bar =".  when you use the single
> equals sign, you're setting value

Not when it's inside a string.

His statements should output the following:


foo = somevalue
bar = anothervalue

Also... he's using { and } because you can't access an array's value
unless it's within curly braces.


Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] Archives

2003-10-22 Thread Nathan Taylor
Thanks John and and Chris.
  - Original Message - 
  From: John Nichel 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, October 22, 2003 2:26 PM
  Subject: Re: [PHP] Archives


  Nathan Taylor wrote:
  > Hey guys,
  > 
  > Just a quickie: where are the archives for this list? What URL?
  > 
  > Thanks,
  > Nathan Taylor

  Here...
  http://marc.theaimsgroup.com/?l=php-general&r=1&w=2

  or here...
  http://news.php.net/group.php?group=php.general

  -- 
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com

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



RE: [PHP] there has to be a better way...

2003-10-22 Thread Daevid Vincent
Here is a snippet from my dhcp web page found on my site below... Not
exactly what you want, but could help you start...

// read in the dhcp_map.ini file to map MAC addresses to images
$mapFile = "./dhcp_map.ini";
if( $fp = @fopen($mapFile, "r") )
{
while( $line = fgets($fp, 1024) )
if ($line{0} != "#") $tempMap .= $line;  // strip
out # comments
} else echo "ERROR: Can't read ".$mapFile."";
fclose ($fp);
$map = explode("\n", $tempMap);
//print_r($map);
for($i = 0; $i < count($map); $i++)
{
list($mac, $image, $name) = preg_split("/\s/",$map[$i], -1,
PREG_SPLIT_NO_EMPTY);
//if ( array_key_exists($mac, $machine))
$machine[$mac]->setImage($image);
if ( isset($machine[$mac]) )
$machine[$mac]->setImage($image);
if ( isset($machine[$mac]) && $name != "" &&
$machine[$mac]->getName() == "") $machine[$mac]->name = $name;
}
unset($tempMap);
unset($map);


#  "dhcp_map.ini" file
#  MAC ADDRESS: GIF IMAGE:  NAME:
00:09:12:86:48:54   linux   LINUX
00:0B:AD:31:AA:A6   tivoThad's
00:0B:AD:08:38:C3   tivoDaevid's



Daevid Vincent
http://daevid.com
  

> -Original Message-
> From: jsWalter [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 22, 2003 1:11 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] there has to be a better way...
> 
> I need to read (write comes later) from a config file that we 
> used to handle
> manually.
> 
> I'm getting lazy, so I'm writing a web interface for this.
> 
> What I have does this...
>   - open a given file
>   - dump entire file into a string
>   - explode string into an array at the EOL marker
>   - walk down this new array
>   - decide if there is anything in current element
>   - decide if current line is a comment
>   - split line at '=' into 2 variables
>   - add new key and value from these variables back into array
>   - kill original array element
> 
> There must be a better way to do this.
> 
> All this seems a bit over kill to me.
> 
> Does anyone have any ideas on this?
> 
> Thanks
> 
> Walter
> 
> This is what I have...
> 
>  
> $config = $list . '/home/walter/vmd/config';
> 
> // Open the file
> $handle = fopen ($config, "r");
> 
> // Read entire file into var
> $content = fread($handle, filesize($config));
> 
> // convert var into array and explode file via line break
> $content = split("\r\n", $content);
> 
> // close file
> fclose($handle);
> 
> // Loop through file contents array
> foreach ($content as $i => $value)
> {
>// If we have any data in this line
>if (! empty ($value))
>{
>   // If this line is not a comment
>   if ( $value{0} != '#')
>   {
>  list($a, $b) = split("=", $value);
>  $content[$a] = $b;
>   }
> 
>   // kill original array element
>   unset($content[$i]);
>}
> }
> 
> // show me what I have
> echo '';
> echo print_r($content);
> echo '';
> 
> ?>
> 
> # Sample config file data, just 2 lines from the file...
> #
> # The "Personal Name" of the list, used in outgoing headers.
> # If empty, default is the same as the list's username.
> # if explicitly `false', then it is redefined empty.
> LIST_NAME="RMT Working Group"
> 
> # The address of the list's admin or owner.
> # if explicitly `false', then it is redefined empty.
> [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] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Daniel Guerrier wrote:
Your right :)

I think he's using the brackets instead of parenthesis
in the echo's.
Change the {} to ()
Yep, he is...didn't notice that on the first pass.  The code I cut and 
pasted from his with have errors

Fixed code

echo ( $_SESSION['foo'] . "\n" );
echo ( $_SESSION['bar'] );
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Passing array variables in a GET

2003-10-22 Thread Jeff McKeon
I looked at the page you suggested but it vauge at best.  Basically from
what I've gathered using serialize with an array screws up the pointers
in the array.  Is this true?

What I've done is this but it doesn't seem to be working...

Pull data (two fields) from a mysql table and put the results into two
arrays, one for each field

Query results for field 1 -> Array1[]
Query results for field 2 -> Array2[]

Then I create a variable with the imploded data from the arrays

$var1=implode(":", $Array1);
$var2=implode(":", $Array2);

Then serialize the variables...

$varSER1=serialize($var1);
$varSER2=serialize($var2);

Then pass the variables in the url via a GET.  

It doesn't work however

Jeff 

> -Original Message-
> From: Wouter van Vliet [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 22, 2003 1:06 PM
> To: Jeff McKeon; [EMAIL PROTECTED]
> Subject: RE: [PHP] Passing array variables in a GET
> 
> 
> Take a look at 
> http://nl.php.net/manual/en/function.serialize.php and 
> http://nl.php.net/manual/en/function.unseriali> ze.php. Or if 
> the keys don't matter and the array has just 
> one level (strange, I know there's a different term for that, 
> totally cannot find it in my memory :S) you can consider
> join() and split().
> 
> Wouter
> 
> -Original Message-
> From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday 22 October 2003 18:59
> To: [EMAIL PROTECTED]
> Subject: [PHP] Passing array variables in a GET
> 
> Is this possible???
> 
> $blah[]=(a, b, c);
> 
> link
> 
> So basically I have a page that need an array to perform some 
> function. Can I pass that array variable (and thus it's data) 
> to it from another page?
> 
> Thanks,
> 
> Jeff
> 
> --
> 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] Newbie - Can't get sessions to work

2003-10-22 Thread Daniel Guerrier
Your right :)

I think he's using the brackets instead of parenthesis
in the echo's.
Change the {} to ()

--- John Nichel <[EMAIL PROTECTED]> wrote:
> Daniel Guerrier wrote:
> > The second page should be
> > 
> >  > session_start();
> >  echo { $_SESSION['foo'] . "\n");
> >  echo { $_SESSION['bar'] };
> > ?>
> > 
> > you're missing the session_start()
> > 
> > You need it on every page that you plan to use
> session
> > on.
> 
> He has session_start() on page two.
> 
> 
> >>>
> >>>page2.php
> >>>--
> >>> >>> session_start();
> >>> echo "foo = {$_SESSION['foo']}";
> >>> echo "bar = {$_SESSION['bar']}";
> >>>?>
> >>
> >>Same here
> >>
> >> >> echo { $_SESSION['foo'] . "\n");
> >> echo { $_SESSION['bar'] };
> >>?>
> 
> 
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] command line arguments

2003-10-22 Thread Dan Joseph
Ahh ok, yeah, $_SERVER['argv'][1] works like a charm, thanks.

> Use $argv, that failing it definately works with $_SERVER['argv']

-Dan Joseph

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



[PHP] RE: Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Tian, Simon (Contractor) (DSCP)
Hi all,

i am also looking a person to maintain my website findhealer.com
with a monthly payment

thanks

simon 

-Original Message-
From: Tian, Simon (Contractor) (DSCP) 
Sent: Wednesday, October 22, 2003 2:22 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: '[EMAIL PROTECTED]'
Subject: Re: PHP3 files compatibilty with PHP4




Hi all,


I have a website written in php3 , but the isp just did a upgrade of PHP
4.3.3. it was
a php 4 and it worked fine with my php3 progarm

then some part of my website does not work right

radio button click get no response 

detail please go to my website

go to findhealer.com and click yellow pages
then click a profession like acupuncture ( radio button ) and chose a state
say carlifornia

then click the show list button

then you will find what is wrong,

any suggestion ?

let me know

Thanks for your help in advance


simon 

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Daniel Guerrier wrote:
The second page should be

\n");
 echo { $_SESSION['bar'] };
?>
you're missing the session_start()

You need it on every page that you plan to use session
on.
He has session_start() on page two.


page2.php
--

Same here

\n");
echo { $_SESSION['bar'] };
?>


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] command line arguments

2003-10-22 Thread Ray Hunter
> I have a php script that I want to run from a command line:
> 
> % /usr/local/bin/php script.php 47264
> 
> 47264 is the argument, however, I can't figure out how to access it inside
> the script.  I thought it was the $ARG array or $ARGV, but I am mistaken...
> can only refresh me?  searching did no good.

$argv is an array that will give you the values and $argc will give you
the total number (count) of arguments.

Also, make sure that you have your php.ini file set up to populate those
variables.

Check this tutorial out: http://www.phpb.com/columns/ray/cli/

To get you started.

--
Ray

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Daniel Guerrier
The second page should be

\n");
 echo { $_SESSION['bar'] };
?>

you're missing the session_start()

You need it on every page that you plan to use session
on.  

--- John Nichel <[EMAIL PROTECTED]> wrote:
> Shaun Campbell wrote:
> > I've got a problem getting sessions to work and I
> wondered if anyone could
> > offer any advice.
> > 
> > The example I am using is to get one page to set
> variables in a session and
> > then use another page to retrieve them.  I am
> using 4.3.4RC2 and prior to
> > that 4.3..3 on Win2k with IE6 and Apache 1.3.22.
> > 
> > The code is:
> > 
> > page1.php
> > --
> >  >  session_start();
> > 
> >  $_SESSION['foo'] = 'Hello';
> >  $_SESSION['bar'] = 'World';
> > 
> >  ?>
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Variables set in session - hopefully???
> > 
> >  >  echo "foo = {$_SESSION['foo']}";
> >  echo "bar = {$_SESSION['bar']}";
> > ?>
> 
> Get rid of the "foo =" and the "bar =".  when you
> use the single equals 
> sign, you're setting value
> 
>   echo { $_SESSION['foo'] . "\n");
>  echo { $_SESSION['bar'] };
> ?>
> 
> > 
> >  />
> > 
> > 
> > 
> > 
> > 
> > page2.php
> > --
> >  >  session_start();
> >  echo "foo = {$_SESSION['foo']}";
> >  echo "bar = {$_SESSION['bar']}";
> > ?>
> 
> Same here
> 
>   echo { $_SESSION['foo'] . "\n");
>  echo { $_SESSION['bar'] };
> ?>
> 
> > On page 1 I am seeing the session variables
> displayed correctly i.e. Hello
> > World and I can see a session file created in my
> temp directory with the
> > correct values in there.  However, when I display
> page 2 the variables are
> > always displayed blank and what seems to happen is
> that a new empty session
> > file is created in my temp directory.  It's as
> though the second page is not
> > related to the same session somehow.  I've also
> tried lots of other examples
> > from books and on the net and I still can't get
> sessions to work.
> > 
> > Am I doing something wrong in connecting the two
> pages although I don't
> > close the browser down at all between the two?
> > 
> > Any ideas would be greatly appreciated.
> > 
> > Thanks
> > 
> > Shaun Campbell
> 
> 
> 
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Tian, Simon (Contractor) (DSCP)


Hi all,


I have a website written in php3 , but the isp just did a upgrade of PHP
4.3.3. it was
a php 4 and it worked fine with my php3 progarm

then some part of my website does not work right

radio button click get no response 

detail please go to my website

go to findhealer.com and click yellow pages
then click a profession like acupuncture ( radio button ) and chose a state
say carlifornia

then click the show list button

then you will find what is wrong,

any suggestion ?

let me know

Thanks for your help in advance


simon 

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Shaun Campbell wrote:
I've got a problem getting sessions to work and I wondered if anyone could
offer any advice.
The example I am using is to get one page to set variables in a session and
then use another page to retrieve them.  I am using 4.3.4RC2 and prior to
that 4.3..3 on Win2k with IE6 and Apache 1.3.22.
The code is:

page1.php
--

 $_SESSION['foo'] = 'Hello';
 $_SESSION['bar'] = 'World';
 ?>






Variables set in session - hopefully???

";
 echo "bar = {$_SESSION['bar']}";
?>
Get rid of the "foo =" and the "bar =".  when you use the single equals 
sign, you're setting value

\n");
echo { $_SESSION['bar'] };
?>





page2.php
--

Same here

\n");
echo { $_SESSION['bar'] };
?>
On page 1 I am seeing the session variables displayed correctly i.e. Hello
World and I can see a session file created in my temp directory with the
correct values in there.  However, when I display page 2 the variables are
always displayed blank and what seems to happen is that a new empty session
file is created in my temp directory.  It's as though the second page is not
related to the same session somehow.  I've also tried lots of other examples
from books and on the net and I still can't get sessions to work.
Am I doing something wrong in connecting the two pages although I don't
close the browser down at all between the two?
Any ideas would be greatly appreciated.

Thanks

Shaun Campbell


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Tab index

2003-10-22 Thread Ray Hunter
On Wed, 2003-10-22 at 11:07, John Nichel wrote:
> Hardik Doshi wrote:
> > I am using the HTML. Javascript is not standard of W3C
> > organization and that's why i don't want to use it.
> > 
> > Is there any other solution for setting up the
> > tabindex on the Drop down menu?
> > 
> > Thanks
> > 
> > Hardik
> 
> Wrong list.  Better results if you ask this question on a 
> HTML/DHTML/JavaScript list.

Also check out groups on google, there is tons of great information
there on these types of groups.

--
Ray

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



[PHP] test

2003-10-22 Thread Reidar
Just testing prior problems

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



Re: [PHP] Archives

2003-10-22 Thread John Nichel
Nathan Taylor wrote:
Hey guys,

Just a quickie: where are the archives for this list? What URL?

Thanks,
Nathan Taylor
Here...
http://marc.theaimsgroup.com/?l=php-general&r=1&w=2
or here...
http://news.php.net/group.php?group=php.general
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Archives

2003-10-22 Thread Chris Garaffa
On Oct 22, 2003, at 2:27 PM, Nathan Taylor wrote:

Hey guys,

Just a quickie: where are the archives for this list? What URL?
You'll find the answer in the arch--- oops, nevermind.
This URL was just launched: http://phparch.com/mailinglists
--
Chris Garaffa
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   >