RE: [PHP] random letter/character?[Scanned]

2003-03-19 Thread Michael Egan
I put together the following function to give me a password consisting of random 
letters and numbers.  It should be fairly clear as to how you'd need to tweak it to 
just give you the characters you'd need interspersed with spaces.

Hope this helps - I also hope anybody else is fairly gentle with their criticisms and 
pointers to whatever is wrong with the script - this is the first time I've ventured 
to include something like this in a response to an email on the list :-(


   function get_password()
   {
  // Create the password variable as an array
  $temp_password = array();
  // Create an array of the letters of the alphabet
  $letters = array(a, b, c, d, e, f, g, h, i, j, k,
   l, m, n, o, p, q, r, s, t, u, v,
   w, x, y, z);
  // Get the first three alpha characters of the password
  for($row = 0; $row  3; $row ++)
  {
srand ((double) microtime() * 100);
$rand_number = rand(0, 25);
$letter = $letters[$rand_number];
array_push($temp_password, $letter);
  }
  // Get five numeric characters to complete the password
  for($row = 0; $row  5; $row ++)
  {
srand ((double) microtime() * 100);
$rand_number = rand(0, 9);
array_push($temp_password, $rand_number);
  }
  // Convert the array into a single string
  for ($row = 0; $row  count($temp_password); $row ++)
  {
$password .=  $temp_password[$row];
  }
  // Return the password to the script that called the function
  return $password;
   }


By the way - I put this together one evening after consuming five pints of Jameson's 
with one arm tied behind my back and whilst wearing a blindfold!


Michael Egan



-Original Message-
From: Bryan Koschmann - GKT [mailto:[EMAIL PROTECTED]
Sent: 19 March 2003 07:44
To: PHP General
Subject: [PHP] random letter/character?[Scanned]


Hi,

I need to get a php script to print out a list of random characters. This
is the list:

a'
b'
c'
d'
e'
f'
g'
a''
b''
c''
d''
e''
f''
g''

They would be printed to a maximum of 50 in a row separated by spaces. Can
anyone give me a pointer as to how to do this? Since the rand functions
are only for numbers, maybe assign each character group a number?

Thanks in advance!

Bryan


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


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



[PHP] running PHP through command shell

2003-03-19 Thread Foong
Does anybody knows why I get call to undefined function for mysql_connect
when running PHP through command shell. but it works fine when accessing the
script through web browser.


Foong



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



[PHP] Mailing list addon for PHP-Nuke-type app

2003-03-19 Thread David Russell
Hi all,

I am looking for a PHP-Nuke/Slashdot -type of php-based application, which
can run on an Interbase database. On drawback I currently have with the
others is that it does not seem to have a listserv type of interface, with
subscription/unsubscription requests/archives/digests/etc.

Does anyone know about something written in PHP that I can use for this. A
modular approach which allows for other things later on
(cataloguing/download management/etc) would be useful.

Oh, it also needs access control.

Anyone??



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



Re: [PHP] running PHP through command shell

2003-03-19 Thread Jason Wong
On Wednesday 19 March 2003 16:34, Foong wrote:

 Does anybody knows why I get call to undefined function for mysql_connect
 when running PHP through command shell. but it works fine when accessing
 the script through web browser.

Most likely your php binary (CLI, not module) was not compiled with mysql 
support.

-- 
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
--
/*
Only people with names beginning with 'A' are getting mail this week (a la 
Microsoft)
*/


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



[PHP] mail() function.

2003-03-19 Thread Fredrik
Hi

I have a problem whith the mail() function.

I have used this function several times, but to day it don't work..

I use it like this:

mail(  $to,  $subjekt,  $body,  $from );

and i got this warning:

  Warning: Failed to Connect in \\HQ-ADMIN\mail.php on line 237


  Fred





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



RE: [PHP] I.P. range authentication

2003-03-19 Thread Ernest E Vogelsinger
At 02:51 19.03.2003, John W. Holmes said:
[snip]
 $abytes = explode('.', $ip); // explode the IP string
 $ip = 0;
 foreach ($abytes as $byte) $ip = ($ip  8) + $byte;
 
 This will give you the valid numeric equivalent of the IP address.

Isn't that what ip2long() does?

Also, the man page on ip2long() has some good notes and code that may
help the OP. 

http://www.php.net/manual/en/function.ip2long.php
[snip] 

Thanks - didn't come around this function yet...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] Apache and PHP Problem

2003-03-19 Thread t-systems-fitz
Hello guys,

we have a strange problem with apache and php. apache 1.3.27 and php 4.23 is
running on a solaris-machine with 2 ipadresses. apache serves request at
both interfaces.

Everything works fine, but every 6 days at one ip-address the clients get no
response from apache. Apache logs this requests with statuscode 200 but
where normally the transfered bytes stands is a '-', meaning that null bytes
are transferred. The same request to the other ipaddress works fine. Only a
restart of apache fix the problem.

Can anyone help me or give an advice

best regards fitz



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



Re: [PHP] Which is quicker, if-else statements

2003-03-19 Thread Ernest E Vogelsinger
At 04:38 19.03.2003, -{ Rene Brehmer }- said:
[snip]
I'm totally lost here ... what does that mean???

Reminds me of assembler, except that assembler is more like:
0001 jnp e002 e003 0005
0002 jmp e002 e003 0008

And so on (not sure if that's fully correct ... haven't touched assembler
since '92) ...

Please ellaborate Ernest ...
[snip] 

Yup, assembler, specifically Intel x86 using the 32bit registers (I said
Intel speak before the code). The code you present must be for a
different processor that I don't know... well, haven't programmed in asm
since - wait let me think - 85? Have still some asm manuals around, but I
don't think the timing numbers are still relevant for todays caching cpu's...


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] remove ' from string

2003-03-19 Thread Fredrik
Hi

Any functions to remove'from a longstring?


Fred



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



Re: [PHP] remove ' from string

2003-03-19 Thread Dan Hardiker
 Any functions to remove'from a longstring?

?php

  $myLongString = ..'..'.'.;
  $myLongString = str_replace(', , $myLongString);

?

et voila! Simple huh ;)

For more info, check out: http://www.php.net/str_replace


-- 
Dan Hardiker [EMAIL PROTECTED]
ADAM Software  Systems Engineer
First Creative



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



[PHP] Re: Need help with coding problem

2003-03-19 Thread Tony Burgess
You seem to be missing your last bracket for the while loop that you started
to state the end of the block.

Ben C. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have a subscription service and am trying to not allow the buyer to
 proceed purchasing another subscription if one of their subscriptions is
 over 29 days past due in their payment.  I am trying to query each invoice
 and checking to see if it is past due more than 29 days, if it is I want a
 message to come up saying that it can not proceed because they account is
 not current.  Can you look at the code below and let me know if you see
 something wrong.  It is not working for me. Thanks.


 --START CODE--

 $sql_1 =SELECT * FROM $table_name
  WHERE buyerid = \$buyerid\ AND paidinfull is NULL;
 $result_1 = @mysql_query($sql_, $connection) or die(Error # .
 mysql_errno() . :  . mysql_error());

 if(mysql_num_rows($result_1)  0){
  while($row = mysql_fetch_array($result_1)) {

  $duedate1 = $row['duedate'];
$paiddate1 = $row['paiddate'];
  $paidinfull = $row['paidinfull'];

 $duedatestamp = strtotime($duedate1);  // due date unix
 timestamp
 $difference = time() - $duedatestamp; // diff in seconds
 $differencedays  = $difference / 86400;  // 60 x 60 x 24 hours
floor
 rounds the days down
 $differencedays1 = floor($differencedays);

 $paiddatestamp = strtotime($paiddate1);// paid date unix timestamp
 $diffdays = floor(((paiddatestamp - duedatestamp) / 86400));


 if (!$paiddate1)
 {
 $daysout = $differencedays1;
 }
 else
 {
 $daysout = $diffdays;
 }

 if ($daysout  29)
 {
 echo You cannot add this product as your account is 30 days past due;
 exit;
 }

 END CODE--



 --
 The content of this email message and any attachments are confidential and
 may be legally privileged, intended solely for the addressee.  If you are
 not the intended recipient, be advised that any use, dissemination,
 distribution, or copying of this e-mail is strictly prohibited.  If you
 receive this message in error, please notify the sender immediately by
reply
 email and destroy the message and its attachments.




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



[PHP] MySQL qusetion

2003-03-19 Thread Marc Bakker
Hello,

I want have a Apache/PHP/MySQL configuration running on Win2000 (SP3). In my
website I have a file-upload page where uses can upload a file. The max size
of the upload has to be set in the mysql.ini file but I am not able to do
this.

I use winMySQLAdmin v1.4. When I add in the tab 'my.ini Setup' under
[mysqld] 'max_allowed_packet=8M' to increase the max allowed upload filesize
the corresponding value in the tab 'Variables' does not change (it stays at
the default value of 1048567). Also when I restart te server (using the same
winMySQLAdmintool) this value doesn't change.

Funny thing is that in tab 'Environment' under 'Uptime' the value doesn't
change - even after restarting the server.

Is this tool buggy?

Thanks,

Marc


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



php-general Digest 19 Mar 2003 11:12:59 -0000 Issue 1947

2003-03-19 Thread php-general-digest-help

php-general Digest 19 Mar 2003 11:12:59 - Issue 1947

Topics (messages 140213 through 140271):

Re: Using PHP to get a word count of a MSword doc
140213 by: Pete James
140236 by: -{ Rene Brehmer }-
140237 by: -{ Rene Brehmer }-

php and javascript
140214 by: Antoine
140215 by: Jim Lucas
140217 by: Oscar F
140218 by: Kevin Stone
140220 by: Chris Hayes
140243 by: -{ Rene Brehmer }-

Recommended package for online editing of HTML files
140216 by: Brad Hubbard
140226 by: Marco Tabini

Re: Encrypt data to base for authentication...
140219 by: Abdul-wahid Paterson

Re: Which is quicker, if-else statements
140221 by: Ernest E Vogelsinger
140240 by: -{ Rene Brehmer }-
140245 by: Jason Sheets
140247 by: daniel
140267 by: Ernest E Vogelsinger

Re: I.P. range authentication
140222 by: Ernest E Vogelsinger
140232 by: John W. Holmes
140265 by: Ernest E Vogelsinger

How to define a path of download file in header?
140223 by: Ruo Zhang
140225 by: Abdul-wahid Paterson

Re: what's the best way to handle this?
140224 by: Justin French

Does PHP run better under any specific unix os?
140227 by: Charles Kline
140229 by: Jason Sheets
140244 by: -{ Rene Brehmer }-

test
140228 by: Ryan A

Shopping cart question and FREE HOSTING OFFER
140230 by: Ryan A
140231 by: Ryan A

Posting Query Results to an HTML form
140233 by: Jason Eley
140235 by: John W. Holmes

php to perl
140234 by: Sebastian
140248 by: Daniel Andersen

Re: Mailing List Digest
140238 by: -{ Rene Brehmer }-

Re: nstalling PHP
140239 by: -{ Rene Brehmer }-

Re: mass mail and selected mailings
140241 by: -{ Rene Brehmer }-

Re: Mail attachment
140242 by: -{ Rene Brehmer }-

LIsting all the Members who have not loged in for 60 days ...
140246 by: Philip J. Newman
140249 by: Sebastian

Need help with coding problem
140250 by: Ben C.
140270 by: Tony Burgess

Getting linux server's country
140251 by: Martin Towell

Detecting if GET field is Numeric or Alpha numeric
140252 by: Stephen of Blank Canvas
140254 by: Foong

connecting securely to remote database
140253 by: Dennis Gearon
140255 by: Joshua Moore-Oliva

md5() number of aruments
140256 by: Dennis Gearon
140257 by: Jason k Larson

random letter/character?
140258 by: Bryan Koschmann - GKT
140259 by: Jason Wong

Re: random letter/character?[Scanned]
140260 by: Michael Egan

running PHP through command shell
140261 by: Foong
140263 by: Jason Wong

Mailing list addon for PHP-Nuke-type app
140262 by: David Russell

mail() function.
140264 by: Fredrik

Apache and PHP Problem
140266 by: t-systems-fitz

remove  ' from string
140268 by: Fredrik
140269 by: Dan Hardiker

MySQL qusetion
140271 by: Marc Bakker

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
The tokenizer that Erik was referring to is actually a PHP lexer, not a 
general tokenizer.  Perhaps you would be looking for the strtok() function?

www.php.net/strtok

Brad Wright wrote:
Erik, 
thanks, are you able to pint me to some good reference sources on
tokenizer's... i have never come across them before

I have been scouring the web, and am coming up a decided blank. :)

Cheers,

Brad 

Nel vino la verità, nella birra la forza, nell'acqua i bacilli
--
In wine there is truth, in beer there is strength, in water there are
bacteria

From: Erik Price [EMAIL PROTECTED]
Date: Tue, 18 Mar 2003 16:45:47 -0500
To: Brad Wright [EMAIL PROTECTED]
Cc: PHP General List [EMAIL PROTECTED]
Subject: Re: [PHP] Using PHP to get a word count of a MSword doc


Brad Wright wrote:

Thanks for the reply Rene,

Any change of a code sample of how u did this?? Im not at all experienced in
Java.
According to the manual, PHP does have some tokenizer functions:

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

However, the documentation appears to be lacking as they are still under
development.  Using it might be somewhat straightforward if you are
accustomed to using a tokenizer in another language (like Java) but if
not, it's really a little too difficult to explain in an email.
A less elegant but ultimately quicker and probably more reliable
solution might be to investigate some kind of external word-counting
program that knows how to parse .DOC files (good luck on that part), and
call this from your PHP script using 

RE: [PHP] random letter/character?[Scanned]

2003-03-19 Thread Abdul-wahid Paterson
Hi,

It is not a good idea to seed the random number generator inside the for
loop. It should only be seeded once during the execution of a script.
Your function could be susceptible to time attacks as it may not be
difficult to guess the seeding pattern and hence guess what random
numbers were actually produced (in this case always the first random
number in a given sequence).

Also, note from the documentation

snip
Note:  Since PHP 4.2.0 it's no longer necessary to seed the random
number generator before using it. 
/snip

Regards,

Abdul-Wahid



On Wed, 2003-03-19 at 08:30, Michael Egan wrote:
 I put together the following function to give me a password consisting of random 
 letters and numbers.  It should be fairly clear as to how you'd need to tweak it to 
 just give you the characters you'd need interspersed with spaces.
 
 Hope this helps - I also hope anybody else is fairly gentle with their criticisms 
 and pointers to whatever is wrong with the script - this is the first time I've 
 ventured to include something like this in a response to an email on the list :-(
 
 
function get_password()
{
   // Create the password variable as an array
   $temp_password = array();
   // Create an array of the letters of the alphabet
   $letters = array(a, b, c, d, e, f, g, h, i, j, k,
l, m, n, o, p, q, r, s, t, u, v,
w, x, y, z);
   // Get the first three alpha characters of the password
   for($row = 0; $row  3; $row ++)
   {
 srand ((double) microtime() * 100);
 $rand_number = rand(0, 25);
 $letter = $letters[$rand_number];
 array_push($temp_password, $letter);
   }
   // Get five numeric characters to complete the password
   for($row = 0; $row  5; $row ++)
   {
 srand ((double) microtime() * 100);
 $rand_number = rand(0, 9);
 array_push($temp_password, $rand_number);
   }
   // Convert the array into a single string
   for ($row = 0; $row  count($temp_password); $row ++)
   {
 $password .=  $temp_password[$row];
   }
   // Return the password to the script that called the function
   return $password;
}
 
 
 By the way - I put this together one evening after consuming five pints of Jameson's 
 with one arm tied behind my back and whilst wearing a blindfold!
 
 
 Michael Egan
 
 
 
 -Original Message-
 From: Bryan Koschmann - GKT [mailto:[EMAIL PROTECTED]
 Sent: 19 March 2003 07:44
 To: PHP General
 Subject: [PHP] random letter/character?[Scanned]
 
 
 Hi,
 
 I need to get a php script to print out a list of random characters. This
 is the list:
 
 a'
 b'
 c'
 d'
 e'
 f'
 g'
 a''
 b''
 c''
 d''
 e''
 f''
 g''
 
 They would be printed to a maximum of 50 in a row separated by spaces. Can
 anyone give me a pointer as to how to do this? Since the rand functions
 are only for numbers, maybe assign each character group a number?
 
 Thanks in advance!
 
   Bryan
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Abdul-Wahid Paterson

Lintrix Networking  Communications ltd.
Web: http://www.lintrix.net/
Tel: +44 7801 070621
Email/Jabber: [EMAIL PROTECTED]

Web-Hosting  |  Development  |  Security  |  Consultancy  |  Domains



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Does PHP run better under any specific unix os?

2003-03-19 Thread reven

-{ Rene Brehmer }- wrote:

 But all *nix share the same issue: You need to build the files yourself,
 from the same source files. So the config is the same nomatter what.

I'm working with RH 8.0 out of the box and it only needed a few minor tweaks
to get php going with everything else (MySQL, etc).

It's my first time around linux, first time building a server and first time
with PHP. I didn't have to build anything from source, just installed
default RPM's.

Reven



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



RE: [PHP] remove ' from string

2003-03-19 Thread John W. Holmes
 Any functions to remove'from a longstring?

Care to say why you need to do this? You may be doing a workaround
instead of a solution...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] Need help with coding problem

2003-03-19 Thread John W. Holmes
 I have a subscription service and am trying to not allow the buyer to
 proceed purchasing another subscription if one of their subscriptions
is
 over 29 days past due in their payment.  I am trying to query each
invoice
 and checking to see if it is past due more than 29 days, if it is I
want a
 message to come up saying that it can not proceed because they account
is
 not current.  Can you look at the code below and let me know if you
see
 something wrong.  It is not working for me. Thanks.

There's a problem in your code below, but you could just use this query:

$query = SELECT * FROM $table_name WHERE buyerid='$buyerid' AND
paidinfull IS NULL AND duedate  CURDATE() - INTERVAL 29 DAY;

If that query returns any rows, the buyer is more than 29 days past due.

If you need to get the days, you can do something like this:

$query = SELECT *, TO_DAYS(CURDATE()) - TO_DAYS(duedate) AS difference
FROM $table_name WHERE buyerid = '$buyerid' AND paidinfull IS NULL;

Now, $row['difference'] will contain the number of days between now and
their last duedate. Check in PHP if it's over 29 and act accordingly.

Adapt to your needs...

 
 
 --START
CODE--
 
 $sql_1 =SELECT * FROM $table_name
   WHERE buyerid = \$buyerid\ AND paidinfull is NULL;
 $result_1 = @mysql_query($sql_, $connection) or die(Error # .
 mysql_errno() . :  . mysql_error());
 
 if(mysql_num_rows($result_1)  0){
  while($row = mysql_fetch_array($result_1)) {
 
  $duedate1 = $row['duedate'];
  $paiddate1 = $row['paiddate'];
  $paidinfull = $row['paidinfull'];
 
 $duedatestamp = strtotime($duedate1);  // due date unix
 timestamp
 $difference = time() - $duedatestamp; // diff in seconds
 $differencedays  = $difference / 86400;  // 60 x 60 x 24 hours
 floor
 rounds the days down
 $differencedays1 = floor($differencedays);
 
 $paiddatestamp = strtotime($paiddate1);// paid date unix
timestamp
 $diffdays = floor(((paiddatestamp - duedatestamp) / 86400));

You're missing some dollar signs on your variables here...

 
 
 if (!$paiddate1)
 {
   $daysout = $differencedays1;
 }
 else
 {
   $daysout = $diffdays;
 }
 
 if ($daysout  29)
 {
 echo You cannot add this product as your account is 30 days past
due;
 exit;
 }

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] LIsting all the Members who have not loged in for 60 days ...

2003-03-19 Thread John W. Holmes
 $lastDate is a unix time stamp in mySql ... how can i list ONLY the
users
 who have not logged in for 60days?

SELECT name FROM table WHERE FROM_UNIXTIME(lastDate)  CURDATE() -
INTERVAL 60 DAY

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] random letter/character?[Scanned]

2003-03-19 Thread Abdul-wahid Paterson
BTW,

This is one of the functions I use you might find it helpful in trimming
down your function.

function gen_password($length = 8) {

  $chars =
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789;

  for($i = 0; $i  $length; $i++) {
$x = rand(0, strlen($chars) -1);
$password .= $chars{$x};
  }
  
  return $password;
}




 Hope this helps - I also hope anybody else is fairly gentle with their criticisms 
 and pointers to whatever is wrong with the script - this is the first time I've 
 ventured to include something like this in a response to an email on the list :-(
 

Peer review is the best way we can improve our programming. It is good
to post code so that we can all get a better understanding of better
techniques and tricks.

Regards,

AW


-- 
Abdul-Wahid Paterson

Lintrix Networking  Communications ltd.
Web: http://www.lintrix.net/
Tel: +44 7801 070621
Email/Jabber: [EMAIL PROTECTED]

Web-Hosting  |  Development  |  Security  |  Consultancy  |  Domains



signature.asc
Description: This is a digitally signed message part


[PHP] MySQL Date

2003-03-19 Thread shaun
Hi,

I have a date stored in a table in my MySQL Database using a DATE type for
the column.

How can i compare the date in the table to today

e.g.

$today = mysql_result($result, $i, Booking_Date);

if($today = *HELP*){
echo you are booked today;
}else{
echo you are free today;
}

thanks for your help



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



Re: [PHP] MySQL qusetion

2003-03-19 Thread Marek Kilimajer
I don't know about the tool, but maximum file upload is set in php.ini - 
upload_max_filesize, post_max_size must be higher. Restart apache afterwards

Marc Bakker wrote:

Hello,

I want have a Apache/PHP/MySQL configuration running on Win2000 (SP3). In my
website I have a file-upload page where uses can upload a file. The max size
of the upload has to be set in the mysql.ini file but I am not able to do
this.
I use winMySQLAdmin v1.4. When I add in the tab 'my.ini Setup' under
[mysqld] 'max_allowed_packet=8M' to increase the max allowed upload filesize
the corresponding value in the tab 'Variables' does not change (it stays at
the default value of 1048567). Also when I restart te server (using the same
winMySQLAdmintool) this value doesn't change.
Funny thing is that in tab 'Environment' under 'Uptime' the value doesn't
change - even after restarting the server.
Is this tool buggy?

Thanks,

Marc

 



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


[PHP] Proc_open() problems

2003-03-19 Thread Piero B. Contezini
I'm having problems while opening a ssh session thru proc_open(), anyone
knows why i can see the remote terminal prompt while reading the stdout?
It just doesn't appear!


Piero

It occurred to me by intuition, and music was the driving force behind
that intuition. My discovery was the result of musical perception. 
Albert Einstein 


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



RE: [PHP] MySQL qusetion

2003-03-19 Thread Mike Hillyer
WinMySQLAdmin has been discontinued, it is replaces by MyCC, also available
from the mysql web site.

Mike Hillyer

-Original Message-
From: Marc Bakker [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 4:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL qusetion


Hello,

I want have a Apache/PHP/MySQL configuration running on Win2000 (SP3). In my
website I have a file-upload page where uses can upload a file. The max size
of the upload has to be set in the mysql.ini file but I am not able to do
this.

I use winMySQLAdmin v1.4. When I add in the tab 'my.ini Setup' under
[mysqld] 'max_allowed_packet=8M' to increase the max allowed upload filesize
the corresponding value in the tab 'Variables' does not change (it stays at
the default value of 1048567). Also when I restart te server (using the same
winMySQLAdmintool) this value doesn't change.

Funny thing is that in tab 'Environment' under 'Uptime' the value doesn't
change - even after restarting the server.

Is this tool buggy?

Thanks,

Marc


--
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] random letter/character?[Scanned]

2003-03-19 Thread Jon Haworth
Hi,

 function gen_password($length = 8) {
 
   $chars =
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789;

[snip]

Just as a tip - if you want to save hassle for yourself and your users,
remove the following characters from that string:

- 1 (number one)
- l (lower-case letter L)
- I (upper-case letter I)
- 0 (number zero)
- O (upper-case letter O)

These often look the same (for instance, in Courier New at 9pt, 1/l and 0/O
are pixel-perfect matches of each other) and can cause major confusion
amongst less technically gifted users :-)

Cheers
Jon


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



RE: [PHP] MySQL Date

2003-03-19 Thread Barajas, Arturo
Shaun,

It should be: date(Y-m-d). MySQL stores the dates as -mm-dd, and that function 
returns the current date on the format you need.

Check the date() function on the php manual.
--
Un gran saludo/Big regards...
   Arturo Barajas, IT/Systems PPG MX (SJDR)
   (427) 271-9918, x448

 -Original Message-
 From: shaun [mailto:[EMAIL PROTECTED]
 Sent: Miercoles, 19 de Marzo de 2003 07:19 a.m.
 To: [EMAIL PROTECTED]
 Subject: [PHP] MySQL Date
 
 
 Hi,
 
 I have a date stored in a table in my MySQL Database using a 
 DATE type for
 the column.
 
 How can i compare the date in the table to today
 
 e.g.
 
 $today = mysql_result($result, $i, Booking_Date);
 
 if($today = *HELP*){
 echo you are booked today;
 }else{
 echo you are free today;
 }
 
 thanks for your 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] php and javascript

2003-03-19 Thread Antoine
thank you so much... I got the function working
On Tue, 2003-03-18 at 17:52, Jim Lucas wrote:
 you are trying to include a variable inside a single quoted string.
 
 change the echo line to this.
 
 echo script language='javascript'  window.location = '$thepage'
 /script;
 
 Jim
 - Original Message -
 From: Antoine [EMAIL PROTECTED]
 To: php list [EMAIL PROTECTED]
 Sent: Tuesday, March 18, 2003 2:52 PM
 Subject: [PHP] php and javascript
 
 
  I wrote a function to redirect my page to another one.   But for some
  reason I keep getting an error.
  here is the function I made
 
  function js_pointer_login($thepage)
  {
   echo 'script language=javascript  window.location = '$thepage'
  /script';
  }
 
 
  --
  Antoine [EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Antoine [EMAIL PROTECTED]


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



Re: [PHP] Proc_open() problems

2003-03-19 Thread Marek Kilimajer
The problem is that ssh (and various others, like passwd) command does 
not use the standard input/output functions, but there is a workaround 
program for this, but I don't remember its name.

Piero B. Contezini wrote:

I'm having problems while opening a ssh session thru proc_open(), anyone
knows why i can see the remote terminal prompt while reading the stdout?
It just doesn't appear!
Piero

It occurred to me by intuition, and music was the driving force behind
that intuition. My discovery was the result of musical perception. 
Albert Einstein 

 



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


Re: [PHP] Using PHP to get a word count of a MSword doc

2003-03-19 Thread Erik Price


Brad Wright wrote:
Erik, 
thanks, are you able to pint me to some good reference sources on
tokenizer's... i have never come across them before

I have been scouring the web, and am coming up a decided blank. :)
The only tokenizers I have used are the StringTokenizer and 
StreamTokenizer classes in Java.  If you want to learn about these, go 
to this web page: http://www.mindview.net/Books/TIJ/ and download the 
book Thinking in Java.  Chapter 9 is the chapter that covers File I/O 
and discusses how to use them.  I have a feeling that the PHP tokenizers 
work very similarly to the Java one (just judging from the docs on the 
PHP site).

Good luck,

Erik

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


[PHP] register_globals per virtual host

2003-03-19 Thread Dave [Hawk-Systems]
a while ago we upgraded the php installations on our servers.  for a quick fix
we set register_globals to on for code compatibility.  Since then we have been
cleaning up code to eliminate this.  We likely still have some virtual hosts who
are using these globals though, so while we are wanting them to modify their
code, we wish to turn globals off for the rest of the server, and allow those
sites to be the exception to the rule.

Assumption is that adding a php_admin_value register_globals on to selected
virtual host containers in apache will allow that particular site access to the
globals while allowing the default (off) for the remainder of the sites.

Is the assumption correct?  Ramifications or caveats that should be considered?

Dave



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



Re: [PHP] Posting Query Results to an HTML form

2003-03-19 Thread -{ Rene Brehmer }-
On Tue, 18 Mar 2003 22:13:13 -0500, John W. Holmes wrote about RE: [PHP]
Posting Query Results to an HTML form what the universal translator
turned into this:

No, there's no PHP function, but there is an HTML trick that you can
use: putting quotes around your values!

input type=text name=name value=value

That's not a trick, that's actually required with HTML 4 and up. And
XML...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



[PHP] iODBC PHP

2003-03-19 Thread pinnockio
Hello,

I'm using PHP/Apache and iODBC on a Linux-box to access a database on a 
Win2K-box.  Everything works fine, but I wondered if there exists an 
PEAR abstraction-layer over iODBC (so I could use DB::function() - 
calls).  Or does the unixODBC- Driver Manager (or any other driver 
manager) make this possible?

Kind regards,

A belgian guy

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


[PHP] Passing variable from webpage to php (newbie?)

2003-03-19 Thread Joe Kupiszewski
I think I already tried to post once, so sorry if this is a duplicate, but I
don't see my first attempt.  I am trying to do what should be a relatively
simple and basic task.  I've got a php script/page that has a switch/case
selection statement in it.  Obviously, depending on what value a particular
variable takes when passed to the script, the script SHOULD :) do different
things.  However, when I invoke the script using
www.somedomain.com/somephpscript.php?action=1  (substitute one with, 2, 3, 4
or whatever) and then do a check whether any value is passed to my script,
it always tells me the value is empty ( if (empty ($action)) - it just
always thinks its empty.  I'm copying this script from a book, so I do not
have any reason to believe there is an error in the code, but obviously
something is not happening properly.  My thought is that perhaps something
needs to be turned on in the php.ini or in the apache httpd.conf file to
allow this variable passing to work.  Is there some other way to do this?

Sorry for the long paragraph sentence.  I'll be happy to post the code if
needed or provide any additional information or give the actual URL so you
can see what is happening.

Thanks for any thoughts



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



[PHP] PHP and IIS 5.0

2003-03-19 Thread Beauford.2002
Hi,

I am putting together a website for a customer who insists on using IIS
running on Windows XP and I'm running into some problems. It appears that no
matter what PHP script I run, I'm getting tons of errors saying this
variable or that variable is undefined. I have global variables turned on in
the php.ini file - so I'm not sure what would be causing the problem (other
than it is a Microsoft product). The same scripts work perfectly on my Linux
box running Apache.

Any help is appreciated.

BTW - thanks to those that answered previous questions regarding
authentication.

B.



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



[PHP] Re: Passing variable from webpage to php (newbie?)

2003-03-19 Thread Bobby Patel
You have register_globals set to off (read up on register globals in
php.net).
your code should read
$HTTP_POST_VARS['action'] or $_POST['action'] (depending on PHP version)
INSTEAD of just $action.

so to test an if::
if ($HTTP_POST_VARS['action']==1) {
/*
Code for if action is equal to 1
*/
}

Of course checkingif the variable is set or empty might be a good idea as
well, is set example:
if (isset($HTTP_POST_VARS['action'])) {
/*
Code if the variable POSTed is set
*/
}



Joe Kupiszewski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I think I already tried to post once, so sorry if this is a duplicate, but
I
 don't see my first attempt.  I am trying to do what should be a relatively
 simple and basic task.  I've got a php script/page that has a switch/case
 selection statement in it.  Obviously, depending on what value a
particular
 variable takes when passed to the script, the script SHOULD :) do
different
 things.  However, when I invoke the script using
 www.somedomain.com/somephpscript.php?action=1  (substitute one with, 2, 3,
4
 or whatever) and then do a check whether any value is passed to my script,
 it always tells me the value is empty ( if (empty ($action)) - it just
 always thinks its empty.  I'm copying this script from a book, so I do not
 have any reason to believe there is an error in the code, but obviously
 something is not happening properly.  My thought is that perhaps something
 needs to be turned on in the php.ini or in the apache httpd.conf file to
 allow this variable passing to work.  Is there some other way to do this?

 Sorry for the long paragraph sentence.  I'll be happy to post the code if
 needed or provide any additional information or give the actual URL so you
 can see what is happening.

 Thanks for any thoughts





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



Re: [PHP] Subtotal

2003-03-19 Thread Marek Kilimajer
SELECT *, SUM(units) subtotal FROM table GROUP BY date

- do you mean this?

Mike Smith wrote:

I'm trying to present a simple SELECT statement GROUPED by date.
Ex.
   WOUNITSOEMCOMMENTSDATE
   123 10MeNotes03/18/2003
   456 5  You   More Notes  03/18/2003
Total   15
...
I have it working grouping the dates together, but I can't seem to get the
Total Units for a group. You'll see  $body .=  instead of echo... because
this is sent as an email. Here is the relevent code:
?php
//table headers
...
while($row = mssql_fetch_array($result)) {
// $row[10] = SHIP DATE (What I'm grouping by)
// $row[0] = Unit Qty (What I want to SUM, based on each Group)
If ($lastship!='') { // skip the first record
If ($lastship!=$row[10]) {
$body .= tr\n;
$body .= tdstrongTotal/strong\n;
$body .= /td\n;
$body .= td align=centerstrong$total/strong\n;
$body .= /td\n;
$body .= td colspan=5\n;
$body .= /td\n;
$body .= /tr\n;
$totqty=0;
$lastqty=0;
}
$total=0;
}
$totqty=$lastqty+$row[0];
$total = $totqty+$total;
$lastship = $row[10];
$lastqty=$row[0];
$body .= tr\n;
$body .= td align=\center\\n;
$body .= $row[11]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[0]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[1]\n;
$body .= /td\n;
$body .= td\n;
$body .= $row[12]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[8]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[9]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[10]\n;
$body .= /td\n;
$body .= /tr\n;
}
...
//close table, html
?
Any help is appreciated.

Thanks,
Mike Smith


 



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


Re: [PHP] Re: Passing variable from webpage to php (newbie?)

2003-03-19 Thread Adam Voigt
That's actually a GET request, so $_GET['action'], instead of $_POST.

On Wed, 2003-03-19 at 11:18, Bobby Patel wrote:
You have register_globals set to off (read up on register globals in
php.net).
your code should read
$HTTP_POST_VARS['action'] or $_POST['action'] (depending on PHP version)
INSTEAD of just $action.

so to test an if::
if ($HTTP_POST_VARS['action']==1) {
/*
Code for if action is equal to 1
*/
}

Of course checkingif the variable is set or empty might be a good idea as
well, is set example:
if (isset($HTTP_POST_VARS['action'])) {
/*
Code if the variable POSTed is set
*/
}



Joe Kupiszewski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I think I already tried to post once, so sorry if this is a duplicate, but
I
 don't see my first attempt.  I am trying to do what should be a relatively
 simple and basic task.  I've got a php script/page that has a switch/case
 selection statement in it.  Obviously, depending on what value a
particular
 variable takes when passed to the script, the script SHOULD :) do
different
 things.  However, when I invoke the script using
 www.somedomain.com/somephpscript.php?action=1  (substitute one with, 2, 3,
4
 or whatever) and then do a check whether any value is passed to my script,
 it always tells me the value is empty ( if (empty ($action)) - it just
 always thinks its empty.  I'm copying this script from a book, so I do not
 have any reason to believe there is an error in the code, but obviously
 something is not happening properly.  My thought is that perhaps something
 needs to be turned on in the php.ini or in the apache httpd.conf file to
 allow this variable passing to work.  Is there some other way to do this?

 Sorry for the long paragraph sentence.  I'll be happy to post the code if
 needed or provide any additional information or give the actual URL so you
 can see what is happening.

 Thanks for any thoughts





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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


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



Re: [PHP] md5() number of aruments

2003-03-19 Thread Dennis Gearon
oops, miscounted a postion of the md5 parentheses :-0

Jason k Larson wrote:
First of all, the example you gave is only using one argument to the MD5 
function.
Secondly, if you *want* to seed/salt the MD5 with a key you can use:
http://www.php.net/manual/en/ref.mhash.php

--
Jason k Larson
aka: der Ritter
Dennis Gearon wrote:

The usage of md5() in PHPLIB show TWO arguments, a seed and the 
string. Nothing in the online manual shows 2 args. What's the dealio?

Line 111 from PHPLIB7.2c - session.inc:

$id = $this-that-ac_newid(md5(uniqid($this-magic)), $this-name);







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


RES: [PHP] Proc_open() problems

2003-03-19 Thread Piero B. Contezini
Do you have any idea where I can find more info about it?

Piero

-Mensagem original-
De: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Enviada em: quarta-feira, 19 de março de 2003 12:02
Para: Piero B. Contezini
Cc: [EMAIL PROTECTED]
Assunto: Re: [PHP] Proc_open() problems


The problem is that ssh (and various others, like passwd) command does 
not use the standard input/output functions, but there is a workaround 
program for this, but I don't remember its name.

Piero B. Contezini wrote:

I'm having problems while opening a ssh session thru proc_open(), 
anyone knows why i can see the remote terminal prompt while reading the

stdout? It just doesn't appear!


Piero

It occurred to me by intuition, and music was the driving force behind

that intuition. My discovery was the result of musical perception. 
Albert Einstein


  



-- 
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] md5() number of aruments

2003-03-19 Thread Dennis Gearon
I don't see anywhere on that page where it shows using a seed. It shows 
**selecting a hash algorithm**, but no salt. Maybe that's the second 
argument that you're looking at.

Jason k Larson wrote:
First of all, the example you gave is only using one argument to the MD5 
function.
Secondly, if you *want* to seed/salt the MD5 with a key you can use:
http://www.php.net/manual/en/ref.mhash.php

--
Jason k Larson
aka: der Ritter
Dennis Gearon wrote:

The usage of md5() in PHPLIB show TWO arguments, a seed and the 
string. Nothing in the online manual shows 2 args. What's the dealio?

Line 111 from PHPLIB7.2c - session.inc:

$id = $this-that-ac_newid(md5(uniqid($this-magic)), $this-name);







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


Re: [PHP] PHP and IIS 5.0

2003-03-19 Thread Lowell Allen
The error reporting level setting is set higher on the Windows box than on
your Linux box. See info in the manual about changing, or define all those
variables.

HTH

--
Lowell Allen


 From: Beauford.2002 [EMAIL PROTECTED]
 Date: Wed, 19 Mar 2003 11:11:42 -0500
 To: PHP General [EMAIL PROTECTED]
 Subject: [PHP] PHP and IIS 5.0
 
 Hi,
 
 I am putting together a website for a customer who insists on using IIS
 running on Windows XP and I'm running into some problems. It appears that no
 matter what PHP script I run, I'm getting tons of errors saying this
 variable or that variable is undefined. I have global variables turned on in
 the php.ini file - so I'm not sure what would be causing the problem (other
 than it is a Microsoft product). The same scripts work perfectly on my Linux
 box running Apache.
 
 Any help is appreciated.
 
 BTW - thanks to those that answered previous questions regarding
 authentication.
 
 B.
 
 
 
 -- 
 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: RES: [PHP] Proc_open() problems

2003-03-19 Thread Marek Kilimajer
search freshmeat.net

Piero B. Contezini wrote:

Do you have any idea where I can find more info about it?

Piero

-Mensagem original-
De: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Enviada em: quarta-feira, 19 de março de 2003 12:02
Para: Piero B. Contezini
Cc: [EMAIL PROTECTED]
Assunto: Re: [PHP] Proc_open() problems

The problem is that ssh (and various others, like passwd) command does 
not use the standard input/output functions, but there is a workaround 
program for this, but I don't remember its name.

Piero B. Contezini wrote:

 

I'm having problems while opening a ssh session thru proc_open(), 
anyone knows why i can see the remote terminal prompt while reading the
   

 

stdout? It just doesn't appear!

Piero

It occurred to me by intuition, and music was the driving force behind
   

 

that intuition. My discovery was the result of musical perception. 
Albert Einstein



   



 



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


RE: [PHP] Subtotal

2003-03-19 Thread Mike Smith
Here is my query (MSSQL 2000):

SELECT [rushqty], [wooem], [rushglschk], [rushglsdate], [rushmtlchk],
[rushmtldate], 
[rushpartschk], [rushpartsdate], [category],
CONVERT(nvarchar,[rushdate],101) AS 'rushdate', 
CONVERT(nvarchar,[rushship],101) AS 'rushship', [wo], [rushcomm]
FROM [tblworush]
WHERE compdate IS NULL
ORDER BY [rushship]

I'm trying to use PHP to do the grouping and subtotals In my HTML I'm trying
to group by [rushship] (that works), and trying to subtotal (SUM) [rushqty]
for each grouping. My code below correctly SUMs only the last 2 values.

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 8:19 AM
To: Mike Smith
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Subtotal


SELECT *, SUM(units) subtotal FROM table GROUP BY date

- do you mean this?

Mike Smith wrote:

I'm trying to present a simple SELECT statement GROUPED by date.
Ex.
WOUNITSOEMCOMMENTSDATE
123 10MeNotes03/18/2003
456 5  You   More Notes  03/18/2003
Total   15
...

I have it working grouping the dates together, but I can't seem to get the
Total Units for a group. You'll see  $body .=  instead of echo... because
this is sent as an email. Here is the relevent code:

?php
//table headers
...
while($row = mssql_fetch_array($result)) {
// $row[10] = SHIP DATE (What I'm grouping by)
// $row[0] = Unit Qty (What I want to SUM, based on each Group)

If ($lastship!='') { // skip the first record
 If ($lastship!=$row[10]) {
 $body .= tr\n;
 $body .= tdstrongTotal/strong\n;
 $body .= /td\n;
 $body .= td align=centerstrong$total/strong\n;
 $body .= /td\n;
 $body .= td colspan=5\n;
 $body .= /td\n;
 $body .= /tr\n;
 $totqty=0;
 $lastqty=0;

 }
 $total=0;
}

 $totqty=$lastqty+$row[0];
 $total = $totqty+$total;
 $lastship = $row[10];
 $lastqty=$row[0];

$body .= tr\n;
$body .= td align=\center\\n;
$body .= $row[11]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[0]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[1]\n;
$body .= /td\n;
$body .= td\n;
$body .= $row[12]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[8]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[9]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[10]\n;
$body .= /td\n;
$body .= /tr\n;

}
...
//close table, html
?

Any help is appreciated.

Thanks,
Mike Smith



  


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



RE: [PHP] Subtotal

2003-03-19 Thread Adam Voigt
Umm, add:

SUM([rushqty]) AS 'rushsub'

To your select, wouldn't that work?

On Wed, 2003-03-19 at 11:19, Mike Smith wrote:
Here is my query (MSSQL 2000):

SELECT [rushqty], [wooem], [rushglschk], [rushglsdate], [rushmtlchk],
[rushmtldate], 
[rushpartschk], [rushpartsdate], [category],
CONVERT(nvarchar,[rushdate],101) AS 'rushdate', 
CONVERT(nvarchar,[rushship],101) AS 'rushship', [wo], [rushcomm]
FROM [tblworush]
WHERE compdate IS NULL
ORDER BY [rushship]

I'm trying to use PHP to do the grouping and subtotals In my HTML I'm trying
to group by [rushship] (that works), and trying to subtotal (SUM) [rushqty]
for each grouping. My code below correctly SUMs only the last 2 values.

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 8:19 AM
To: Mike Smith
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Subtotal


SELECT *, SUM(units) subtotal FROM table GROUP BY date

- do you mean this?

Mike Smith wrote:

I'm trying to present a simple SELECT statement GROUPED by date.
Ex.
WOUNITSOEMCOMMENTSDATE
123 10MeNotes03/18/2003
456 5  You   More Notes  03/18/2003
Total   15
...

I have it working grouping the dates together, but I can't seem to get the
Total Units for a group. You'll see  $body .=  instead of echo... because
this is sent as an email. Here is the relevent code:

?php
//table headers
...
while($row = mssql_fetch_array($result)) {
// $row[10] = SHIP DATE (What I'm grouping by)
// $row[0] = Unit Qty (What I want to SUM, based on each Group)

If ($lastship!='') { // skip the first record
 If ($lastship!=$row[10]) {
 $body .= tr\n;
 $body .= tdstrongTotal/strong\n;
 $body .= /td\n;
 $body .= td align=centerstrong$total/strong\n;
 $body .= /td\n;
 $body .= td colspan=5\n;
 $body .= /td\n;
 $body .= /tr\n;
 $totqty=0;
 $lastqty=0;

 }
 $total=0;
}

 $totqty=$lastqty+$row[0];
 $total = $totqty+$total;
 $lastship = $row[10];
 $lastqty=$row[0];

$body .= tr\n;
$body .= td align=\center\\n;
$body .= $row[11]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[0]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[1]\n;
$body .= /td\n;
$body .= td\n;
$body .= $row[12]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[8]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[9]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[10]\n;
$body .= /td\n;
$body .= /tr\n;

}
...
//close table, html
?

Any help is appreciated.

Thanks,
Mike Smith



  


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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


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



Re: RES: [PHP] Proc_open() problems

2003-03-19 Thread Marek Kilimajer
Just found it:
http://expect.nist.gov/
Piero B. Contezini wrote:

Do you have any idea where I can find more info about it?

Piero

-Mensagem original-
De: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Enviada em: quarta-feira, 19 de março de 2003 12:02
Para: Piero B. Contezini
Cc: [EMAIL PROTECTED]
Assunto: Re: [PHP] Proc_open() problems

The problem is that ssh (and various others, like passwd) command does 
not use the standard input/output functions, but there is a workaround 
program for this, but I don't remember its name.

Piero B. Contezini wrote:

 

I'm having problems while opening a ssh session thru proc_open(), 
anyone knows why i can see the remote terminal prompt while reading the
   

 

stdout? It just doesn't appear!

Piero

It occurred to me by intuition, and music was the driving force behind
   

 

that intuition. My discovery was the result of musical perception. 
Albert Einstein



   



 



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


[PHP] PHP and IIS - More info

2003-03-19 Thread Beauford.2002
These are some of the errors I am getting

Notice: Undefined index: login in
C:\Inetpub\wwwroot\..\login\checklogin.php on line 74

and 75, and other similar errors.

Line 74 is: $login = $HTTP_SESSION_VARS['login'];
Line 75 is: $password = $HTTP_SESSION_VARS['password'];

Another one is: echo $HTTP_ENV_VARS[QUERY_STRING];


Thanks



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



[PHP] date problem

2003-03-19 Thread shaun
hi,

using date(dS); how can i can increase the days so that it shows

19th 20th 21st

I have tried

while ($i  2){
  $day++;
  echo' td'.$day.'/td';
  $i++;
 }

but i get:

19th 19ti 19tj

thanks for your help



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



Re: [PHP] register_globals per virtual host

2003-03-19 Thread Abdul-wahid Paterson
Hi,

I think you want to use:

php_value register_globals Off


I have this setup in VirtualHost's and in .htaccess files. The
difference between php_value and php_admin_value is that php_admin_value
can not be overridden in a .htaccess file or VirtualHost. So if you want
to enforce some settings and allow users to change others you can force
them with php_admin_value.


-- 
Abdul-Wahid Paterson

Lintrix Networking  Communications ltd.
Web: http://www.lintrix.net/
Tel: +44 7801 070621
Email/Jabber: [EMAIL PROTECTED]

Web-Hosting  |  Development  |  Security  |  Consultancy  |  Domains



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Subtotal

2003-03-19 Thread Mike Smith
This query:
***denotes new
SELECT ***SUM([rushqty]) AS 'rushsub'***, [rushqty], [wooem], [rushglschk],
[rushglsdate], [rushmtlchk], [rushmtldate], 
[rushpartschk], [rushpartsdate], [category],
CONVERT(nvarchar,[rushdate],101) AS 'rushdate', 
CONVERT(nvarchar,[rushship],101) AS 'rushship', [wo], [rushcomm]
FROM [junction].[dbo].[tblworush]
WHERE compdate IS NULL
***GROUP BY [rushship], [rushdate], [rushqty], [wooem], [rushglschk],
[rushglsdate], [rushmtlchk], ***[rushmtldate], [rushpartschk],
[rushpartsdate], [category],  
[wo], [rushcomm]
ORDER BY [rushship]

Returns...
rushsub rushqty ... rushdate...
20  20  03/12/2003  ...
20  20  03/17/2003
70  70  03/17/2003

I still need (I think) to programatically subtotal [rushqty] rather than
having SQL do it. Since my grouping is working I could do a SELECT
[rushdate] ,SUM([rushqty]) AS 'rushsub' ... GROUP BY [rushdate] and put it
in an array. I was hoping to just have PHP handle the math. I'll have to try
it, but I think the GROUP BY rushdate may pose a problem, since the dates
will have different timestamps.

-Original Message-
From: Adam Voigt [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 8:37 AM
To: Mike Smith
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Subtotal


Umm, add:

SUM([rushqty]) AS 'rushsub'

To your select, wouldn't that work?

On Wed, 2003-03-19 at 11:19, Mike Smith wrote:
Here is my query (MSSQL 2000):

SELECT [rushqty], [wooem], [rushglschk], [rushglsdate], [rushmtlchk],
[rushmtldate], 
[rushpartschk], [rushpartsdate], [category],
CONVERT(nvarchar,[rushdate],101) AS 'rushdate', 
CONVERT(nvarchar,[rushship],101) AS 'rushship', [wo], [rushcomm]
FROM [tblworush]
WHERE compdate IS NULL
ORDER BY [rushship]

I'm trying to use PHP to do the grouping and subtotals In my HTML I'm
trying
to group by [rushship] (that works), and trying to subtotal (SUM)
[rushqty]
for each grouping. My code below correctly SUMs only the last 2 values.

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 8:19 AM
To: Mike Smith
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Subtotal


SELECT *, SUM(units) subtotal FROM table GROUP BY date

- do you mean this?

Mike Smith wrote:

I'm trying to present a simple SELECT statement GROUPED by date.
Ex.
WOUNITSOEMCOMMENTSDATE
123 10MeNotes03/18/2003
456 5  You   More Notes  03/18/2003
Total   15
...

I have it working grouping the dates together, but I can't seem to get
the
Total Units for a group. You'll see  $body .=  instead of echo...
because
this is sent as an email. Here is the relevent code:

?php
//table headers
...
while($row = mssql_fetch_array($result)) {
// $row[10] = SHIP DATE (What I'm grouping by)
// $row[0] = Unit Qty (What I want to SUM, based on each Group)

If ($lastship!='') { // skip the first record
 If ($lastship!=$row[10]) {
 $body .= tr\n;
 $body .= tdstrongTotal/strong\n;
 $body .= /td\n;
 $body .= td align=centerstrong$total/strong\n;
 $body .= /td\n;
 $body .= td colspan=5\n;
 $body .= /td\n;
 $body .= /tr\n;
 $totqty=0;
 $lastqty=0;

 }
 $total=0;
}

 $totqty=$lastqty+$row[0];
 $total = $totqty+$total;
 $lastship = $row[10];
 $lastqty=$row[0];

$body .= tr\n;
$body .= td align=\center\\n;
$body .= $row[11]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[0]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[1]\n;
$body .= /td\n;
$body .= td\n;
$body .= $row[12]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[8]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[9]\n;
$body .= /td\n;
$body .= td align=\center\\n;
$body .= $row[10]\n;
$body .= /td\n;
$body .= /tr\n;

}
...
//close table, html
?

Any help is appreciated.

Thanks,
Mike Smith



  


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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

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



[PHP] Re: date problem

2003-03-19 Thread Philip Hallstrom
Try:

$ts = time();

$i = 0;
while( $i  2 ) {
$day = date(dS, $ts + $i * 86400);
print(td$day/td);
$i++;
}

On Wed, 19 Mar 2003, shaun wrote:

 hi,

 using date(dS); how can i can increase the days so that it shows

 19th 20th 21st

 I have tried

 while ($i  2){
   $day++;
   echo' td'.$day.'/td';
   $i++;
  }

 but i get:

 19th 19ti 19tj

 thanks for your 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] connecting securely to remote database

2003-03-19 Thread Dennis Gearon
I saw that, Joshua,I am on that list. Amazing that it came up just after 
 I posted to the PHP list.

The reason I posted it here is that I still probably need someway to 
initiate an SSH/SSL connection from PHP, and I doubt it autoswitches 
when connecting to a database.

Joshua Moore-Oliva [EMAIL PROTECTED] wrote:
-
You should put this on the postgres general list not here...
I've heard a lot of talk about this lately, though I haven't gotten 
around to
implementing it yet..  There is also a section in the online postgres 
docs on
how to do this.

And if you're fast someone just posted a question 2 minutes ago on the
pgsql-general list that went like this...
I'm using redhat 8.0 and postgresql 7.2.4 (rpm from postgresql.org). I want
to enable ssl.
START QUOTE

I have edited postgresql.conf to ssl = true. I also follow the 7.3 manual
(from postgresql.org) to create certificates and placed them in
/var/lib/pgsql/data/. Then restart the server with /etc/init.d/postgresql
restart. The result is [Failed]. What else should I do? Or procedure for 7.3
is different from 7.2.4? Or the rpm does not have ssl enabled when compile?
-Jason

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
END QUOTE

I'd suggest hopping onto the postgres list

Josh.

On March 19, 2003 01:25 am, Dennis Gearon wrote:

 how do I connect securely to a postgres database on another server / DNS
 name / IP?

 Some way to do SSL/SSH easily from PHP?
On March 19, 2003 01:25 am, Dennis Gearon wrote:

 how do I connect securely to a postgres database on another server / DNS
 name / IP?

 Some way to do SSL/SSH easily from PHP?




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


Re: [PHP] Posting Query Results to an HTML form

2003-03-19 Thread CPT John W. Holmes
 No, there's no PHP function, but there is an HTML trick that you can
 use: putting quotes around your values!
 
 input type=text name=name value=value
 
 That's not a trick, that's actually required with HTML 4 and up. And
 XML...

Umm.. yeah, got that. I was being sarcastic. ;)

---John Holmes...

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



Re: [PHP] PHP and IIS 5.0

2003-03-19 Thread CPT John W. Holmes
 I am putting together a website for a customer who insists on using IIS
 running on Windows XP and I'm running into some problems. It appears that
no
 matter what PHP script I run, I'm getting tons of errors saying this
 variable or that variable is undefined. I have global variables turned on
in
 the php.ini file - so I'm not sure what would be causing the problem
(other
 than it is a Microsoft product). The same scripts work perfectly on my
Linux
 box running Apache.

Read all about it here...

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

Either fix your code or adjust the error_reporting level.

Actually, it could be a register_globals problem also. They are off by
default, so you may need to re-write your code or turn them on in php.ini.

---John Holmes...


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



RE: [PHP] PHP and IIS - More info

2003-03-19 Thread John W. Holmes
 These are some of the errors I am getting
 
 Notice: Undefined index: login in
 C:\Inetpub\wwwroot\..\login\checklogin.php on line 74
 
 and 75, and other similar errors.
 
 Line 74 is: $login = $HTTP_SESSION_VARS['login'];
 Line 75 is: $password = $HTTP_SESSION_VARS['password'];
 
 Another one is: echo $HTTP_ENV_VARS[QUERY_STRING];

There is no 'login' or 'password' index in the $HTTP_SESSION_VARS array.
How are you registering these variables? Try using the new method with
$_SERVER. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] MySQL Date

2003-03-19 Thread John W. Holmes
 I have a date stored in a table in my MySQL Database using a DATE type
for
 the column.
 
 How can i compare the date in the table to today

... WHERE your_date = CURDATE() ...

 e.g.
 
 $today = mysql_result($result, $i, Booking_Date);
 
 if($today = *HELP*){

or...

if($today == date('Y-m-d'))

(notice the second equals sign!)

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP] Anybody have any thoughts on Smarty?

2003-03-19 Thread Charles Kline
Was reading this and it sounds really cool. I do work as a consultant 
to designers and thought this may be a good way to improve work flow? I 
have read mixed thoughts on this, but was wondering what this list 
thought? Anyone using it? Real world?

http://www.zend.com/zend/tut/tutorial-cezar.php

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


[PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Hello,

I'd like to uncompress to the Hard disk a zip file send by the browser.

At this time I do this:

function uncompresszip($zipfile) {
  copy($zipfile, dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip) ;
}
But I do not understand how to uncompress the zip file, I tried for exemple:
$retour = 
readgzfile(dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip);

But as mentionned in the php doc it outputs the content of the zip file 
in the browser :-(

How to uncompress a zip file in a directory ? I just want all the files 
which are in the zip file...

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


RE: [PHP] random letter/character?[Scanned]

2003-03-19 Thread Bryan Koschmann - GKT
On Wed, 19 Mar 2003, Michael Egan wrote:

|I put together the following function to give me a password consisting
|of random letters and numbers.  It should be fairly clear as to how
|you'd need to tweak it to just give you the characters you'd need
|interspersed with spaces.
|
|Hope this helps - I also hope anybody else is fairly gentle with their
|criticisms and pointers to whatever is wrong with the script - this is
|the first time I've ventured to include something like this in a
|response to an email on the list :-(
|
|
|   function get_password()
|   {
|  // Create the password variable as an array
|  $temp_password = array();
|  // Create an array of the letters of the alphabet


Michael-

Very cool, and works like a charm! And, I think I may even just use it for
a password script as well, if you don't mind :)

I appreciate the extremely helpful and quick response!

Bryan



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



RE: [PHP] Anybody have any thoughts on Smarty?

2003-03-19 Thread John W. Holmes
 Was reading this and it sounds really cool. I do work as a consultant
 to designers and thought this may be a good way to improve work flow?
I
 have read mixed thoughts on this, but was wondering what this list
 thought? Anyone using it? Real world?

Once you get used to the syntax, it is great. I think it makes
maintaining your site a lot easier (any templating engine could do that,
though). The speed is very quick. It's beat out every other templating
system I've seen plus it has a huge set of features. 

The only online program I have running it is a Survey System demo at
http://sepodati.realxl.net (admin password is 'password').

I've never used it in a mixed developer/designer environment. I don't
know how effective it is at that. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] Zip Way of life.

2003-03-19 Thread Marek Kilimajer
readgzfile is for *.gz files.
Either use zip file functions (rarely supported) or PclZip 
(http://www.phpconcept.net/pclzip/index.en.php)

Vincent M. wrote:

Hello,

I'd like to uncompress to the Hard disk a zip file send by the browser.

At this time I do this:

function uncompresszip($zipfile) {
  copy($zipfile, 
dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip) ;
}

But I do not understand how to uncompress the zip file, I tried for 
exemple:
$retour = 
readgzfile(dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip);

But as mentionned in the php doc it outputs the content of the zip 
file in the browser :-(

How to uncompress a zip file in a directory ? I just want all the 
files which are in the zip file...

Thanks,
Vincent.



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


[PHP] error message ... never seen this one before.

2003-03-19 Thread Daniel McCullough
I get this error.

Unknown column 'B' in 'where clause'

From this code.
$sql = SELECT * FROM store;
$result = mysql_query($sql) or die(mysql_error());
$store = mysql_fetch_array($result);
$count = mysql_num_rows($result);
$id = $store['id'];
$name = $store['name'];
$address = $store['address'];
$state = $store['state'];
$groups = $store['groups'];
for ($i=0; $i$count; $i++) {
	$sql2 = SELECT id FROM store_name WHERE name = .$name[$i].;
	$result2 = mysql_query($sql2) or die(mysql_error());
	$store_name = mysql_fetch_object($result2);
	$sql3 = SELECT id FROM store_address WHERE address = .$address[$i].;
	$result3 = mysql_query($sql3) or die(mysql_error());
	$store_address = mysql_fetch_object($result3);
	$sql4 = SELECT id FROM store_state WHERE state_name = .$state[$i].;
	$result4 = mysql_query($sql4) or die(mysql_error());
	$store_state = mysql_fetch_object($result4);
	$build_sql .= $id. - .$store_name. - .$store_address. - 
.$store_state. - .$groups[$i].br\n;
}

any thoughts?

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Re: [PHP] error message ... never seen this one before.

2003-03-19 Thread Marek Kilimajer
Put single quotes around the strings in your sql statementS:

$sql2 = SELECT id FROM store_name WHERE name = '.$name[$i].';
   ^ ^
if this does not help, print out the query strings. 

Daniel McCullough wrote:

I get this error.

Unknown column 'B' in 'where clause'

From this code.


$sql = SELECT * FROM store;
$result = mysql_query($sql) or die(mysql_error());
$store = mysql_fetch_array($result);
$count = mysql_num_rows($result);
$id = $store['id'];
$name = $store['name'];
$address = $store['address'];
$state = $store['state'];
$groups = $store['groups'];
for ($i=0; $i$count; $i++) {
$sql2 = SELECT id FROM store_name WHERE name = .$name[$i].;
$result2 = mysql_query($sql2) or die(mysql_error());
$store_name = mysql_fetch_object($result2);
$sql3 = SELECT id FROM store_address WHERE address = 
.$address[$i].;
$result3 = mysql_query($sql3) or die(mysql_error());
$store_address = mysql_fetch_object($result3);
$sql4 = SELECT id FROM store_state WHERE state_name = 
.$state[$i].;
$result4 = mysql_query($sql4) or die(mysql_error());
$store_state = mysql_fetch_object($result4);
$build_sql .= $id. - .$store_name. - .$store_address. - 
.$store_state. - .$groups[$i].br\n;
}

any thoughts?

_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail




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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Marek Kilimajer wrote:
readgzfile is for *.gz files.
Either use zip file functions (rarely supported) or PclZip 
(http://www.phpconcept.net/pclzip/index.en.php)

No, it works with .zip files too, I just don't know how to manage it :-(



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


Re: [PHP] PHP and IIS 5.0

2003-03-19 Thread Beauford.2002
 I have it running on Windows XP using Apache and Linux using Apache with
perfect results - It does not work on IIS, which tells me this is a IIS
problem, not a coding problem or an error reporting problem -
register_globals are on on all three platforms.

Thanks


- Original Message -
From: CPT John W. Holmes [EMAIL PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]; PHP General
[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 11:21 AM
Subject: Re: [PHP] PHP and IIS 5.0


  I am putting together a website for a customer who insists on using IIS
  running on Windows XP and I'm running into some problems. It appears
that
 no
  matter what PHP script I run, I'm getting tons of errors saying this
  variable or that variable is undefined. I have global variables turned
on
 in
  the php.ini file - so I'm not sure what would be causing the problem
 (other
  than it is a Microsoft product). The same scripts work perfectly on my
 Linux
  box running Apache.

 Read all about it here...

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

 Either fix your code or adjust the error_reporting level.

 Actually, it could be a register_globals problem also. They are off by
 default, so you may need to re-write your code or turn them on in php.ini.

 ---John Holmes...


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





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



Re: [PHP] PHP and IIS - More info

2003-03-19 Thread Beauford.2002
Further note that it is not just this script, but many PHP scripts that I
run on IIS - they all work perfectly on Apache (on Windows and Linux)..

- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Beauford.2002' [EMAIL PROTECTED]; 'PHP General'
[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 12:21 PM
Subject: RE: [PHP] PHP and IIS - More info


  These are some of the errors I am getting
 
  Notice: Undefined index: login in
  C:\Inetpub\wwwroot\..\login\checklogin.php on line 74
 
  and 75, and other similar errors.
 
  Line 74 is: $login = $HTTP_SESSION_VARS['login'];
  Line 75 is: $password = $HTTP_SESSION_VARS['password'];
 
  Another one is: echo $HTTP_ENV_VARS[QUERY_STRING];

 There is no 'login' or 'password' index in the $HTTP_SESSION_VARS array.
 How are you registering these variables? Try using the new method with
 $_SERVER.

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/



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





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



[PHP] 2 databases

2003-03-19 Thread Iwan van Kanten
Is it possible to connect to 2 different databases??
2 different dtabase typs I mean
postgresql and Mysql



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



[PHP] Breadcrumbs help

2003-03-19 Thread Sebastian
hello all.

this code creates dynamic breadcrumbs, ie: home  site nav  community

I am having a bit of a time trying to make it so it doesn't hyperlink the
current page thats being viewed, any help is appreciated.

?

   $LocationMappings = array(
view.php   = site map,
company   = about,
articles  = news
);

function LocatorLine()
{
   global $SCRIPT_NAME, $LocationMappings;
   $file=1; // 1 Doesn't show the file name, 0 Does

   $locationArray = explode(/,$SCRIPT_NAME);
   $locationHref = ;

   echo 'span class=smalltext:: a href=/main page/a/span';
   for($i=1; $icount($locationArray)-$file; $i++)
   {
  if ( !empty($LocationMappings[$locationArray[$i]]) ) {
 $locationText = $LocationMappings[$locationArray[$i]];
  }
  else {
 $locationText = ucwords($locationArray[$i]);  //Uppercase
letters
  }
  $locationHref .= / . $locationArray[$i];
  echo nbsp;braquo;/bnbsp;a
href=\$locationHref\$locationText/a;
   }
   echo \n;
}

LocatorLine()
?

cheers,
- Sebastian


Re: [PHP] 2 databases

2003-03-19 Thread Jimmy Brake
yes -- i connect to oracle and mysql simultaneously .. 

On Wed, 2003-03-19 at 15:21, Iwan van Kanten wrote:
 Is it possible to connect to 2 different databases??
 2 different dtabase typs I mean
 postgresql and Mysql
 
 


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



Re: [PHP] PHP and IIS - More info

2003-03-19 Thread Chris Hewitt
Beauford.2002 wrote:

Further note that it is not just this script, but many PHP scripts that I
run on IIS - they all work perfectly on Apache (on Windows and Linux)..
As well as configuration differences it could be different versions of 
php. Modern ones expect $_SERVER for example. I might like to blame IIS 
for a lot of things, but I think you will probably find its not.

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


Re: [PHP] md5() number of aruments

2003-03-19 Thread Jason k Larson
mhash (PHP 3= 3.0.9, PHP 4 )

mhash -- Compute hash
Description:
string mhash ( int hash, string data [, string key])
   ^ salt/seed/key - whatever you want to 
call it
--
Jason k Larson
Dennis Gearon wrote:
I don't see anywhere on that page where it shows using a seed. It shows 
**selecting a hash algorithm**, but no salt. Maybe that's the second 
argument that you're looking at.

Jason k Larson wrote:

First of all, the example you gave is only using one argument to the 
MD5 function.
Secondly, if you *want* to seed/salt the MD5 with a key you can use:
http://www.php.net/manual/en/ref.mhash.php

--
Jason k Larson
aka: der Ritter
Dennis Gearon wrote:

The usage of md5() in PHPLIB show TWO arguments, a seed and the 
string. Nothing in the online manual shows 2 args. What's the dealio?

Line 111 from PHPLIB7.2c - session.inc:

$id = $this-that-ac_newid(md5(uniqid($this-magic)), $this-name);



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


Re: [PHP] 2 databases

2003-03-19 Thread Ray Hunter
yes, as long as you have them compiled and configured into php.

I have used up to 4 database type for a given application: mysql, pgsql,
oracle, and sybase...

That is the beauty of PHP...

--
Ray

On Wed, 2003-03-19 at 16:21, Iwan van Kanten wrote:
 Is it possible to connect to 2 different databases??
 2 different dtabase typs I mean
 postgresql and Mysql
 
 


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



Re: [PHP] PHP and IIS - More info

2003-03-19 Thread CPT John W. Holmes
 Further note that it is not just this script, but many PHP scripts that I
 run on IIS - they all work perfectly on Apache (on Windows and Linux)..

HOW DOES IT NOT WORK!?

---John Holmes...

 - Original Message -
 From: John W. Holmes [EMAIL PROTECTED]
 To: 'Beauford.2002' [EMAIL PROTECTED]; 'PHP General'
 [EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2003 12:21 PM
 Subject: RE: [PHP] PHP and IIS - More info


   These are some of the errors I am getting
  
   Notice: Undefined index: login in
   C:\Inetpub\wwwroot\..\login\checklogin.php on line 74
  
   and 75, and other similar errors.
  
   Line 74 is: $login = $HTTP_SESSION_VARS['login'];
   Line 75 is: $password = $HTTP_SESSION_VARS['password'];
  
   Another one is: echo $HTTP_ENV_VARS[QUERY_STRING];
 
  There is no 'login' or 'password' index in the $HTTP_SESSION_VARS array.
  How are you registering these variables? Try using the new method with
  $_SERVER.
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your copy
  today. http://www.phparch.com/
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 




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



Re: [PHP] Breadcrumbs help

2003-03-19 Thread Sebastian
well, the problem with that is most of my files are called 'index.php'

cheers,
- Sebastian

- Original Message -
From: Diego Fulgueira [EMAIL PROTECTED]


| Sebastian wrote:
|  hello all.
| 
|  this code creates dynamic breadcrumbs, ie: home  site nav  community
| 
|  I am having a bit of a time trying to make it so it doesn't hyperlink
the
|  current page thats being viewed, any help is appreciated.
| 
|  ?
| 
| $LocationMappings = array(
|  view.php   = site map,
|  company   = about,
|  articles  = news
|  );
| 
|  function LocatorLine()
|  {
| global $SCRIPT_NAME, $LocationMappings;
| $file=1; // 1 Doesn't show the file name, 0 Does
| 
| $locationArray = explode(/,$SCRIPT_NAME);
| $locationHref = ;
| 
| echo 'span class=smalltext:: a href=/main
page/a/span';
| for($i=1; $icount($locationArray)-$file; $i++)
| {
|if ( !empty($LocationMappings[$locationArray[$i]]) ) {
|   $locationText = $LocationMappings[$locationArray[$i]];
|}
|else {
|   $locationText = ucwords($locationArray[$i]);  //Uppercase
|  letters
|}
|$locationHref .= / . $locationArray[$i];
|echo nbsp;braquo;/bnbsp;a
|  href=\$locationHref\$locationText/a;
| }
| echo \n;
|  }
| 
|  LocatorLine()
|  ?
| 
|  cheers,
|  - Sebastian
|
| I would have an array for directories and another for files. Putting all
in
| the same array makes it messy. Cheers.
|


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



Re: [PHP] md5() number of aruments

2003-03-19 Thread Dennis Gearon
What page is that on?

BTW, I figured out I could just prepend a long, complex string to 
whatever I am hashing and it will 'seed' it before it gets to my stuff.

Jason k Larson wrote:
mhash (PHP 3= 3.0.9, PHP 4 )

mhash -- Compute hash
Description:
string mhash ( int hash, string data [, string key])
   ^ salt/seed/key - 
whatever you want to call it

--
Jason k Larson
Dennis Gearon wrote:

I don't see anywhere on that page where it shows using a seed. It 
shows **selecting a hash algorithm**, but no salt. Maybe that's the 
second argument that you're looking at.

Jason k Larson wrote:

First of all, the example you gave is only using one argument to the 
MD5 function.
Secondly, if you *want* to seed/salt the MD5 with a key you can use:
http://www.php.net/manual/en/ref.mhash.php

--
Jason k Larson
aka: der Ritter
Dennis Gearon wrote:

The usage of md5() in PHPLIB show TWO arguments, a seed and the 
string. Nothing in the online manual shows 2 args. What's the dealio?

Line 111 from PHPLIB7.2c - session.inc:

$id = $this-that-ac_newid(md5(uniqid($this-magic)), $this-name);






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


[PHP] $array_nam[$variable][0]

2003-03-19 Thread Michael Smith
Hi,

I'm trying to do a:

$var = $array_name[$var2][0];

where $var2 is an integer. I've got this array from a database and I
want to use a variable in the array... what's the exact syntax of this?

-Michael
-- 
Michael Smith [EMAIL PROTECTED]
Custom87.net


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



Re: [PHP] $array_nam[$variable][0]

2003-03-19 Thread CPT John W. Holmes
 $var = $array_name[$var2][0];

 where $var2 is an integer. I've got this array from a database and I
 want to use a variable in the array... what's the exact syntax of this?

That is the correct syntax. Use print_r() on $array_name to see what it
contains.

---John Holmes...


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



RE: [PHP] Zip Way of life.

2003-03-19 Thread Daevid Vincent
You could use the exec() or shell_exec() and just do it via command line
method...

 -Original Message-
 From: Vincent M. [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, March 19, 2003 12:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Zip Way of life.
 
 
 Hello,
 
 I'd like to uncompress to the Hard disk a zip file send by 
 the browser.
 
 At this time I do this:
 
 function uncompresszip($zipfile) {
copy($zipfile, 
 dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip) ;
 }
 
 But I do not understand how to uncompress the zip file, I 
 tried for exemple:
 $retour = 
 readgzfile(dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip);
 
 But as mentionned in the php doc it outputs the content of 
 the zip file 
 in the browser :-(
 
 How to uncompress a zip file in a directory ? I just want all 
 the files 
 which are in the zip file...
 
 Thanks,
 Vincent.
 
 
 -- 
 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] $array_nam[$variable][0]

2003-03-19 Thread Leif K-Brooks
Exactly the syntax you used.

Michael Smith wrote:

Hi,

I'm trying to do a:

$var = $array_name[$var2][0];

where $var2 is an integer. I've got this array from a database and I
want to use a variable in the array... what's the exact syntax of this?
-Michael
 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] date question

2003-03-19 Thread Charles Kline
Hi all,

I have a form where users will be adding publication dates for uploaded 
files. I want to store the date in mySQL as date('U') format. If the 
date is entered as mm/dd/ - will the date function know this or is 
there some way of 'telling' php how the date to be converted is 
formatted, if you all get what I am saying...

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


[PHP] Re: Anybody have any thoughts on Smarty?

2003-03-19 Thread rush
Charles Kline [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Was reading this and it sounds really cool. I do work as a consultant
 to designers and thought this may be a good way to improve work flow? I
 have read mixed thoughts on this, but was wondering what this list
 thought? Anyone using it? Real world?

I think that Smarty can definitely help workflow, especially in
designer-programer teams. For that situation, maybe you could also take a
look at TemplateTamer, which I believe has stricter separation of code and
html.

rush
--
http://www.templatetamer.com/




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



Re: [PHP] date question

2003-03-19 Thread Kevin Stone
- Original Message -
From: Charles Kline [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 2:17 PM
Subject: [PHP] date question


 Hi all,

 I have a form where users will be adding publication dates for uploaded
 files. I want to store the date in mySQL as date('U') format. If the
 date is entered as mm/dd/ - will the date function know this or is
 there some way of 'telling' php how the date to be converted is
 formatted, if you all get what I am saying...

 Thanks
 Charles

Many people prefer to do their date conversions in the SQL query.  But if
you have to do it in PHP then you can use the strtotime() function to
convert that date into a timestamp then store it in mySQL.  You shouldn't
have to do anything special with the string.. strtotime() will convert any
standard recognized date format.
http://www.php.net/manual/en/function.strtotime.php

HTH,
Kevin



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



[PHP] Max Array Size in Post?

2003-03-19 Thread Rob
I have a database driven music web site that allows the admin to create
photo galleries. The photos and captions are entered using a form which
allows the admin to upload a small and large photo. The number of photos is
requested in a form that calls this entry form. The code looks like this:

   for($a=1;$a$requestCount+1;$a++){
   ?
tr
 td align=right
  PhotoBig #?echo$a?:
 /td
 td
  input type=file name=userfile[]
 /td
/tr
tr
 td align=right
  PhotoSmall #?echo$a?:
 /td
 td
  input type=file name=userfile[]
 /td
/tr
tr
 td align=right
  Caption #?echo$a?:
 /td
 td
  input type = text name = NewCaption?echo$a?
 /td
/tr
   ?
   }

The problem is, there seems to be a maximum of 12 small and 12 large photos.
If I change to only large photos, the maximum becomes 25, which leads me to
believe that php puts a limit on the size an array from a form can be. The
error displayed comes from apache (internal server error) and in the apache
error log, I get the premature end of script headers php.exe message which
of course is no help.

Does anyone know of a setting in Apache or php to fix this?

Thanks



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



RE: [PHP] Getting linux server's country

2003-03-19 Thread Martin Towell
So noone has any ideas at all ? Surely not ?
If my question's too vague, please let me know and I'll try to expand on
it...

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 4:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting linux server's country


I've been looking for an answer to this question for ages, but have failed.
Hopefully one of you guys can help.

I'm looking for a way of finding out what the linux server's country is set
to.

I notice there's setlocale(), but I want something more like getlocale(),
which there doesn't seen to be one.

I'm using PHP 4.0.6

TIA
Martin

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



[PHP] How to figure out from which domain the PHP script was called?

2003-03-19 Thread Philarmon
Hi !

Im a completely PHP newbie, so please spare me :)

Is there any way to figure out from which page a script was called ?

I want that the PHP script check it and will be executed only if the request
came from my domain (so nobody could execute it by typing its name in the
browser or something like that).

Thanks for answering !

Cheers,
Philarmon



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



[PHP] Date Conversion

2003-03-19 Thread shaun
Hi,

when retrieving a date from MySQL in n/MM/DD, how can I present this to
the user of a site in readable format i.e. 19th March 2003?

Thanks for your help



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



Re: [PHP] How to figure out from which domain the PHP script was called?

2003-03-19 Thread Joshua Moore-Oliva
YOu can check the HTTP_REFERRER...  but really though, that's no security.  
Anyone can use Curl to simulate a request that looks like it comes from your 
domain.

All security measures needs to happen on the server, not from what the users 
web browser gives you.

Josh.

On March 19, 2003 05:13 pm, Philarmon wrote:
 Hi !

 Im a completely PHP newbie, so please spare me :)

 Is there any way to figure out from which page a script was called ?

 I want that the PHP script check it and will be executed only if the
 request came from my domain (so nobody could execute it by typing its name
 in the browser or something like that).

 Thanks for answering !

 Cheers,
 Philarmon


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



Re: [PHP] Zip Way of life.

2003-03-19 Thread David T-G
Vincent, et al --

...and then Vincent M. said...
% 
% Marek Kilimajer wrote:
% readgzfile is for *.gz files.
...
% No, it works with .zip files too, I just don't know how to manage it :-(

You mentioned wanting the files (note the plural) in the zip file.
AFAIK gunzip can unzip an archive containing a single file, but if you
have more than one in there then you need to use an actual unzip tool
(like, say, unzip :-)

While a class or a built-in command might be nice, if you just want to
get them out then a simple system call might be the easiest way to go.


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] Hmmm, and how to do THAT ? ;)

2003-03-19 Thread Philarmon
Ok, thanks for the info, Josh !

 All security measures needs to happen on the server, not from what the
users
 web browser gives you.

And how to do something like that on the server ? Is there a tutorial
somewhere about this or something ? A few words about that would be great !
:)

Philarmon




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



Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
David T-G wrote:
Vincent, et al --

...and then Vincent M. said...
% 
% Marek Kilimajer wrote:
% readgzfile is for *.gz files.
...
% No, it works with .zip files too, I just don't know how to manage it :-(

You mentioned wanting the files (note the plural) in the zip file.
AFAIK gunzip can unzip an archive containing a single file, but if you
have more than one in there then you need to use an actual unzip tool
(like, say, unzip :-)
While a class or a built-in command might be nice, if you just want to
get them out then a simple system call might be the easiest way to go.
HTH  HAND

:-D
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by on Unix servers. :-(

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


Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Daevid Vincent wrote:
You could use the exec() or shell_exec() and just do it via command line
method...
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by default on Unix servers. :-(





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


Re: [PHP] Hmmm, and how to do THAT ? ;)

2003-03-19 Thread Joshua Moore-Oliva
Nono, I'm saying that you can never be 100% sure where someone came from, 
since they are responsible for storing that data, and they can modify before 
sending it back to you.

If you really want to make sure someone came from another page before the 
current page, create a uniq ID and md5 it or something, store it in the 
database and then when someone comes to that page check the cookie value 
against what you stored in the database..  that's the only way to really 
enforce that someone came from a previous page of yours.

The http_referrer stuff is really built in just for statistics not security.

Josh.

On March 19, 2003 05:28 pm, Philarmon wrote:
 Ok, thanks for the info, Josh !

  All security measures needs to happen on the server, not from what the

 users

  web browser gives you.

 And how to do something like that on the server ? Is there a tutorial
 somewhere about this or something ? A few words about that would be great !

 :)

 Philarmon


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



Re: [PHP] Hmmm, and how to do THAT ? ;)

2003-03-19 Thread Abdul-wahid Paterson
Hi,

On Wed, 2003-03-19 at 22:28, Philarmon wrote:

  All security measures needs to happen on the server, not from what the
 users
  web browser gives you.
 
 And how to do something like that on the server ? Is there a tutorial
 somewhere about this or something ? A few words about that would be great !
 :)

Perhaps you could generate a cookie when they fist enter your site and
then check that that cookie is valid when retrieving the content. If
then they don't have the cookie set you would know that they have linked
to the page directly rather than from following a link on your site.

The cookie would have to be some sort of random identifier that you also
stored on the web server somewhere so that you could validate the cookie
was authentic.

Regards,

AW


-- 
Abdul-Wahid Paterson

Lintrix Networking  Communications ltd.
Web: http://www.lintrix.net/
Tel: +44 7801 070621
Email/Jabber: [EMAIL PROTECTED]

Web-Hosting  |  Development  |  Security  |  Consultancy  |  Domains



signature.asc
Description: This is a digitally signed message part


Re: [PHP] Hmmm, and how to do THAT ? ;)

2003-03-19 Thread Philarmon
Hmmm, the PHP script is not a webpage but just a script which is called from
a flash movie, so i guess i cant check cookies with that :(

But thanks anyway !



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



[PHP] Indonesia

2003-03-19 Thread Ludi Sasnita
Anybody in this mailing list from Indonesia?
Thanks, God Bless You All

best regards,
Ludi


 Ikuti polling TELKOM Memo 166 di www.plasa.com dan menangkan hadiah masing-masing Rp 
250.000 tunai
 

[PHP] Imagerotate() Problems

2003-03-19 Thread Mike Brum
I'm having some problems with imagerotate() - e.g. it won't work.

I've tried many different ways to get it to work, but I have yet to see it
do anything at all. I'm using PHP 4.3.1 on XP. I know that GD is working
properly because I can do other image-manipulation with it without error.
Plus, I installed PHP manually, not with the Windows installer (which I've
had problems getting GD to work properly on in the past).

I've added the last attempt at getting the code to work. Note that the
imagecopy() works fine and the new image displayed always ends up being an
exact copy of the destination image.

Any help would be greatly appreciated!


  if (($degrees == 90) || ($degrees == 180) || ($degrees == 270)){
foreach($image_check as $temp_file){

  $src_img = imagecreatefromjpeg($inbox_dir\\$temp_file);
  $new_img = imagecreatetruecolor(imagesx($src_img),imagesy($src_img));


imagecopy($new_img,$src_img,0,0,0,0,imagesx($new_img),imagesy($new_img));

  if (function_exists(imagerotate)){
  if(imagerotate($new_img, $degrees, 0)){
print Image Rotated Successfullybr;
  } else {
print Error Rotating Imagebr;
  }
  }
  imagejpeg($new_img, $inbox_dir\\new_image_path.jpg);

  imagedestroy($src_img);
  imagedestroy($new_img);

*code left off that's not important - though there's no syntax/compile
errors



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



[PHP] Zero Fill - Number Format

2003-03-19 Thread Harry.de
How can I put out a Zero Fill for numbers
The result should be

$something=26;
echo $something;

e.g.
026

I didn't found a solution with number format. Is there any other way?



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



RE: [PHP] Zero Fill - Number Format

2003-03-19 Thread Martin Towell
sprintf/printf(%7d, $num)

-Original Message-
From: Harry.de [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 10:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Zero Fill - Number Format


How can I put out a Zero Fill for numbers
The result should be

$something=26;
echo $something;

e.g.
026

I didn't found a solution with number format. Is there any other way?



-- 
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] running PHP through command shell

2003-03-19 Thread Travers Carter
Jason Wong wrote:

 On Wednesday 19 March 2003 16:34, Foong wrote:
 
 Does anybody knows why I get call to undefined function for mysql_connect
 when running PHP through command shell. but it works fine when accessing
 the script through web browser.
 
 Most likely your php binary (CLI, not module) was not compiled with mysql
 support.
 

If mysql is dynamicly loaded from php.ini your CLI php may also be using a
different php.ini file, eg some RPM distributions use
/etc/php-standalone/php.ini for CLI and /etc/php.ini for the mod_php
version, if that's the case you might just need to add the extension into
that php.ini as well


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



RE: [PHP] Zero Fill - Number Format

2003-03-19 Thread Mike Brum
This is what I did for a dynamic zero-fill for renaming batches of files:

// Get Zero Padding For New Image Names
$zero_padding = strlen(count($image_array));

  foreach($image_array as $temp){
$n++;
$n_length = strlen($n);
for($i = 0; $i  ($zero_padding - $n_length); $i++){
$n = 0 . $n;
  }
$new_name = $image_inbox . / . $newName . - . $n . .jpg;
rename($image_inbox/$temp, $new_name);
  }


I'm not sure if this will be applicable to your situation, but it works
perfectly for me since it will zero-fill for any length of numbers and pad
the shorter numbers appropriately.

-M

-Original Message-
From: Harry.de [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 19, 2003 6:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Zero Fill - Number Format


How can I put out a Zero Fill for numbers
The result should be

$something=26;
echo $something;

e.g.
026

I didn't found a solution with number format. Is there any other way?



--
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] Zero Fill - Number Format

2003-03-19 Thread Kevin Waterson
This one time, at band camp,
Harry.de [EMAIL PROTECTED] wrote:

 How can I put out a Zero Fill for numbers
 The result should be
 
 $something=26;
print str_pad($something, 7, 0, STR_PAD_LEFT);

Kevin
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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



RE: [PHP] Anybody have any thoughts on Smarty?

2003-03-19 Thread Dennis Gearon
Smarty is very wonderful. If both the coder and the designer work 
together, layout and code logic can be completely separate.

I am doing a form for entering in about 25 fields. As long as the 
template the designer comes up with has:

The required form variables,
and template variables to put success/failure notices up,
I don't have to know anything about colors, css, layout, fonts, mostly 
don't have to know about graphics,etc. It might get a little more 
involved in multi language sites, however.

My form has two versions, a submit template, and a approve template. 
After sanitizing the input rigorously, the user may not like what I will 
be submitting. So I send all the values I've cleaned to him/her in a 
text layout (up to the designer) and a hidden form contains the same 
values. The template variables are just duplicated in both those places, 
so I get back what they see and approve. I've also added a md5 hash with 
a page local salt so that I can test if they have alterered what I've 
sent them to be approved. And I filter it again anyways before checking 
the hash.

so when the form comes back, the submit button has a value of 'approve' 
and I check the hash, and store it in the database.

I never have to know what it looks like. It's a little good to know what 
order the user is presented the fields, because they can fix the errors 
in order as I parse them. It's not necessary though, just good practice.

My designer is awesome too.

We both get to do what we want and we enjoy it a LOT.

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


  1   2   >