[PHP] RE: Can't Connect to INFORMIX DB

2002-06-05 Thread Juraj Hasko

Hi,

1. PHP native function for Informix will not work, because there is missing 
php_ifx.dll extension in latest PHP 4.2.1 bundle for win32.

2. you have probably error in instalation of Infomix ODBC drivers. The file 'csql.iem' 
is part of standart instalation. Check your instalation ...

Juraj
System Administrator

CAC LEASING Slovakia, a.s.
mailto:[EMAIL PROTECTED]
http://www.cacleasing.sk

-Original Message-
From: Gastn [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 8:19 PM
To: [EMAIL PROTECTED]
Subject: Can't Connect to INFORMIX DB


Hi,
I need some help (or maybe a lot), to get PHP connecting to my 
Informix DB.
I'm pretty new to PHP, and i don't have a clue of what i'm doing wrong.

I'm using IIS 4.0 under Win NT 4.0.
with PHP 4.2.1

I've tried to connect throw ODBC driver, and directly from 
native functions
but both fail.
The messages are:
When i use ODBC:
Warning: SQL error: [INTERSOLV][ODBC Informix 
driver][Informix]Cannot open
file 'csql.iem' , SQL state S1000 in SQLConnect

When i use native functions:
PHP Warning: Unable to load dynamic library
'C:\Php421\extensions\php_ifx.dll' - The specified procedure 
could not be
found. in Unknown on line 0


Thanks,
Gastn.





Re: [PHP] Retrieving Info from Cookies

2002-06-05 Thread Justin French

try wrapping the vars inside curly braces {$_COOKIE['var']} when using them
inside strings.

eg

echo your username is {$_COOKIE['uid']}BR\n;

Justin French



on 05/06/02 3:22 PM, Tom Ray ([EMAIL PROTECTED]) wrote:

 when I do that it comes up with
 
 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
 `T_NUM_STRING'
 
 
 Justin French wrote:
 
 you should be able to access it via $_COOKIE['name'], or what I do, $cookie
 = $_COOKIE['name'].
 
 Justin French
 
 
 on 05/06/02 2:19 PM, Tom Ray ([EMAIL PROTECTED]) wrote:
 
 
 
 I've been playing with cookies, and I've been able to write information
 to a cookie, but now what I want to do is pull that information from the
 cookie. Is there something special I need to do to pull that info or
 should I just be to get that data by delcaring a variable in the php
 script?
 
 
 
 
 
 .
 
 
 
 
 


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




[PHP] PHP Compile with sun 5.7

2002-06-05 Thread Moussa Dahadha




Hi, i know that this question was asked many times but i still
can't find any solution :-(

When i try to compile php


I alweys recive this error:

Making all in .
make[1]: Entering directory `/root/php-4.2.1'
/bin/sh /root/php-4.2.1/libtool --silent --mode=link gcc  -I. 
-I/root/php-4.2.1/ -I/root/php-4.2.1/main -I/root/php-4.2.1 
-I/www/include -I/root/php-4.2.1/Zend 
-I/root/php-4.2.1/ext/mysql/libmysql -I/root/php-4.2.1/ext/xml/expat  
-D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -DUSE_EXPAT 
-I/root/php-4.2.1/TSRM -g -O2 -prefer-pic   -o libphp4.la -rpath 
/root/php-4.2.1/libs -avoid-version -L/usr/ucblib  -R /usr/ucblib 
stub.lo  Zend/libZend.la sapi/apache/libsapi.la main/libmain.la 
regex/libregex.la /root/php-4.2.1/ext/ctype/libctype.la 
/root/php-4.2.1/ext/mysql/libmysql.la 
/root/php-4.2.1/ext/pcre/libpcre.la 
/root/php-4.2.1/ext/posix/libposix.la 
/root/php-4.2.1/ext/session/libsession.la 
/root/php-4.2.1/ext/standard/libstandard.la 
/root/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lpam -lcrypt -lresolv 
-lresolv -lm -ldl -lsocket -lsocket -lcrypt -ldl
/usr/local/sparc-sun-solaris2.7/bin/ld: 
/root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): Relocations in 
generic ELF (EM: 3)
/root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): could not read 
symbols: File in wrong format
make[1]: *** [libphp4.la] Error 1
make[1]: Leaving directory `/root/php-4.2.1'
make: *** [all-recursive] Error 1


So maybe anyone know how can i fix it?


-- 
 ¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾
 Moussa Dahadha
 System Administrator
 Palnet Communications Ltd
 www.palnet.com
 [EMAIL PROTECTED] 
 Tel.+972-2-240-3434   
 Fax.+972-2-240-3430
 CCNA,MCP,MCSE,MCSA,MCDBA. 
 ¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾¼½¾




[PHP] ob_start('gz_handler') and session_start()

2002-06-05 Thread Jason Caldwell

Is there a way to make ob_start('gz_handler') work with session_start()?

I got them each working independently -- however, when I try to compress a
session -- my page just comes up blank.

?
ob_start('gz_handler');
session_start();

// code and html

ob_end_flush();
ob_end_clean();
?

Or, is there another alternative? -- I'd like to use sessions and I'd
(definitely) like to compress my pages.

Thanks
Jason




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




[PHP] Re: ob_start('gz_handler') and session_start()

2002-06-05 Thread Jason Caldwell

I should add, that I also tried the code with session_start() first, then
ob_start('gz_handler') -- neither way worked.

Jason


Jason Caldwell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a way to make ob_start('gz_handler') work with session_start()?

 I got them each working independently -- however, when I try to compress a
 session -- my page just comes up blank.

 ?
 ob_start('gz_handler');
 session_start();

 // code and html

 ob_end_flush();
 ob_end_clean();
 ?

 Or, is there another alternative? -- I'd like to use sessions and I'd
 (definitely) like to compress my pages.

 Thanks
 Jason






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




[PHP] Re: Speed comparison of PHP vs. PERL (not conclusive)

2002-06-05 Thread Peter

You mention that you could have written the PHP code in a more efficient way
using continue(). Why not time this as surely a built in function would be
quicker than one written in the code.


Daniel Grace [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This all started in a little debate between me and a friend of mine who I
 think is as much a PERL zealot as I am a PHP zealot (I was briefly
pondering
 the idea of a Win32 API extension for PHP), and the results were rather
 surprising -- to me, at least..

 It all started when I asked him what PERL had that PHP didn't in terms of
 language (not taking community, modules, etc. into an account). We both
 believed that the two would be very similiar in speed -- he thought PERL
 would be a little faster but not enough to be noticeable. For the first
 test, I went with a program that computed prime numbers between 2 and
1,
 using no form of caching or anything like that. I gave him the PHP source
 with the task of writing something in PERL as close to the original PHP
 source as possible. The results:

 (note: I didn't know if PERL had PHP's continue(2), hence why I used the
 slightly less efficient method here:)

 prime.php:
 #!/usr/bin/php -q
 ?php

 echo 2\n;

 for($check = 3 ; $check  1 ; $check += 2) {
 $prime = 1;
 $half = (int) $check / 2;
 for($against = 2 ; $against = $half ; ++$against) {
 if(!($check % $against)) {
 $prime = 0;
 break;
 }
 }
 if($prime) echo $check\n;
 }


 prime.pl:
 #!/usr/bin/perl
 # print 2\n;
 my $num;
 for ($num = 3; $num  1; $num+=2)
 {
 my $prime = 1;
 for $check ( 2 .. int($num/2) )
 {
 if ($num % $check == 0)
 {
 $prime = 0;
 last;
 }
 }
 #print $num\n if $prime;
 }


 The test machine is an AMD Duron 700 MHz using an a-bit KT7A motherboard
 with 256 MB of PC100 SDRAM. uname -a reports Linux ulysses.venura.net
 2.4.17-ulysses1 #1 Sat Dec 29 14:44:46 PST 2001 i686 unknown, PHP 4.2.1
was
 configured with --enable-inline-optimization --prefix=[somepath], PERL
5.6.1
 was configured with -O3 (among other options) (PHP compiles with -g -O2
with
 no 'easy' (at-configure-time) way to change that, to my knowledge).

 Both programs were ran once normally to verify they actually generated
prime
 numbers, and then the bash time command was used to time them, piping
 their output to /dev/null to prevent that from being a factor. I re-ran
the
 tests a few times with results consistently similiar to those listed here:

 The results:

 [dewin@ulysses profiling]$ time ./prime.php  /dev/null

 real0m14.465s
 user0m8.610s
 sys 0m0.070s

 [dewin@ulysses profiling]$ time ./prime.pl  /dev/null

 real0m5.302s
 user0m3.180s
 sys 0m0.000s



 A second system, with PHP compiled the same way and a PERL 5.6.1 binary
 distributed by Red Hat, 1.2 ghz with 442 MB of RAM:

 [root@mrr-016 law]# time ./prime.pl  /dev/null
 real 0m2.078s
 user 0m2.040s
 sys 0m0.010s

 [root@mrr-016 law]# time ./prime.php  /dev/null
 real 0m5.512s
 user 0m5.430s
 sys 0m0.010s


 Comments? I was expecting the numbers to be very similiar -- rather
shocked
 that the PERL ended up being about 2.5x as fast as PHP was.





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




Re: [PHP] Secure File Upload

2002-06-05 Thread andy

// original question:
snip

 I would like to be able to really PREVENT uploads, let's say
  bigger than 10 MB?!
 
 Add this to your HTML form:

 input type=hidden name=MAX_FILE_SIZE value=1024

 HTH

/snip

I tryed this, too. But this does not work at all! I use IE 5.5 and it did
not make any difference. Is there something else we have to take care off?

Andy








Lowell Allen [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  From: Christoph Starkmann [EMAIL PROTECTED]
 
  Hi There!
 
  When uploading a file with PHP, AFAIK I can only control what will be
stored
  on the server. So if someone sends me 100 MB, these will be deleted
  immediately. But, unfortunately, the traffic is produced nevertheless.
Is
  there any way to check the file size before uploading the file or any
other
  way to keep the traffic under a certain limit? Last think I would like
to
  have is a script that disables all uploads after a certain traffic has
been
  produced, I would like to be able to really PREVENT uploads, let's say
  bigger than 10 MB?!
 
 Add this to your HTML form:

 input type=hidden name=MAX_FILE_SIZE value=1024

 HTH

 --
 Lowell Allen




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




[PHP] Re [PHP] Secure File Upload

2002-06-05 Thread Stephen Phillips



Hi,
Not sure if this would work in limiting the file size of an 
upload or not, but I noticed a line in my php.ini file which seems to limit the 
size of any data sent by a POST, of course this would be a serverwide setting I 
guess.

the line is;
post_max_size = 8M;

I'm assuming this would be set to less and would restrict 
uploads, however there must be a better way of doing it since this seems a bit 
brutal.

__Steve 
PhillipsMrICQ#:37350686

  
  
Current ICQ status:
 
  + More ways to contact me 
__


Re: [PHP] Secure File Upload

2002-06-05 Thread Jason Wong

On Wednesday 05 June 2002 16:41, andy wrote:
 // original question:
 snip

  I would like to be able to really PREVENT uploads, let's say

   bigger than 10 MB?!
 
  Add this to your HTML form:
 
  input type=hidden name=MAX_FILE_SIZE value=1024
 
  HTH

 /snip

 I tryed this, too. But this does not work at all! I use IE 5.5 and it did
 not make any difference. Is there something else we have to take care off?

Not all browsers respect this setting so basically it is useless as a 
'security' measure.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
It is far better to be deceived than to be undeceived by those we love.
*/


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




[PHP] Stopping multiple votes by IP

2002-06-05 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone.

I need to ensure that only one 'vote' per 'article' can be cast by each
visitor and was hoping you might share any opinions you have on my
solution:

IP's seem the way to go so I thought the simplest and most secure method
would be this:

Have a MySQL table with 2 fields: IP and ARTICLE_ID

Check the $REMOTE_ADDR against this table WHERE IP = $REMOTE_ADDR AND
$articl_id = $ARTICLE_ID

IF there is no match, record the vote and insert their IP and the
article id

IF /is/ a match, decline.


Anyone see any inherent problems with that?

Many thanks!
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8/ejLHpvrrTa6L5oRAjf5AJ98ew6rICv4DUAqACXXu1Ru7TxYBQCfbKxn
yzTmfMgihXvX65sY/bCMMDA=
=zRNV
-END PGP SIGNATURE-

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




Re: [PHP] multisite hit counter, includin session statistics

2002-06-05 Thread Martin Smetak

Completely misunderstood :o)

One more try:

I need to put into some page(www.some.com), which is not on my server, a
link to my script-counter, running on my server(www.my.com).
The easiest way to do that is to place it to the page in form of an blank
image, so in the index.html on www.some.com will
be code like
.
img src=http://www.my.com/counter.php?site=0011;
.

When user accesses www.some.com page, he gets my image and runs a script.
This way I can count number of page visits, store IP numbers of
visitorsbut don't know how to store
number of unique users that access page, number of sessions.
^^
This is what I need. You know how to do that?

Thanks a lot,
Minca


 No problem bud, sorry I tried to help.

 Anyhow, this does work, you just do not know how to write image.php so
that
 it returns the correct data for an image counter. maybe i misunderstood
your
 first email, but I thought you were looking for a hidden way of keeping
 track of page hit counts and user paths, etc.

 If your talking about files that can have PHP in them, then this is as
 simple as an include() file that generates the correct img calls to
 product the correct number, while tracking the other information you want.

 If you want to call this on a plain HTML page that can't parse PHP, then
the
 only way I know of is to create an image call to a PHP script. Maybe you
can
 do more with Javascript or SSI, if that's available...

 ---John Holmes...
 - Original Message -
 From: Martin Smetak [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, June 04, 2002 12:14 PM
 Subject: Re: [PHP] multisite hit counter, includin session statistics


  img src=http://www.yourserver.com/image.php?ID=xxx;
 
  Well, how can this help me? This is the way I need to use the counter on
 web
  page, it solves nothing.
  I need the same thing u are asking to, but this way it doesn't work. But
  there are counters-sites that uses
  this method(img) producing session statistics.
  Anyone know how they do that?
 
  Minca
 
  
   Do what you need to do with the PHP code as far as keeping a count of
   visitors, etc, and then create an image header and send it the data
for
 a
   1x1 pixel transparant image.
  
   Got a question for everyone else, b/c I'm not sure on this. If I have
a
  link
   like the above on www.example.com, say, and it linkes to
   www.yourserver.com/image.php, can I start a session in that file and
 have



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




Re: [PHP] Stopping multiple votes by IP

2002-06-05 Thread René Moonen


What then happens with users who are behind a firewall/proxy (probably 
have non-routable IP addresses on theire LAN) and share one internet 
connection. They all have the same remote IP address (routable IP 
address of the firewall).
This would mean that only one user of that group can vote.

I'm not sure if the solution below also works for non-routable 
IP-addresses behind a firewall. It works for proxies.

function clientIP()
{
  return (getenv(HTTP_X_FORWARDED_FOR))?
getenv(HTTP_X_FORWARDED_FOR):getenv(REMOTE_ADDR);
}


Other solution might be
- use cookies to store the vote on the client
- use login name / password to check votes



René


Nick Wilson wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone.

I need to ensure that only one 'vote' per 'article' can be cast by each
visitor and was hoping you might share any opinions you have on my
solution:

IP's seem the way to go so I thought the simplest and most secure method
would be this:

Have a MySQL table with 2 fields: IP and ARTICLE_ID

Check the $REMOTE_ADDR against this table WHERE IP = $REMOTE_ADDR AND
$articl_id = $ARTICLE_ID

IF there is no match, record the vote and insert their IP and the
article id

IF /is/ a match, decline.


Anyone see any inherent problems with that?

Many thanks!
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8/ejLHpvrrTa6L5oRAjf5AJ98ew6rICv4DUAqACXXu1Ru7TxYBQCfbKxn
yzTmfMgihXvX65sY/bCMMDA=
=zRNV
-END PGP SIGNATURE-



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




[PHP] Re: Speed comparison of PHP vs. PERL (not conclusive)

2002-06-05 Thread Daniel Grace

Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You mention that you could have written the PHP code in a more efficient
way
 using continue(). Why not time this as surely a built in function would be
 quicker than one written in the code.

-- snip to my old test results --
 
  [dewin@ulysses profiling]$ time ./prime.php  /dev/null
 
  real0m14.465s
  user0m8.610s
  sys 0m0.070s
 
  [dewin@ulysses profiling]$ time ./prime.pl  /dev/null
 
  real0m5.302s
  user0m3.180s
  sys 0m0.000s

My intent upon writing this program was to compare the relative speed of
execution between PERL and PHP, however it's been established that it's not
really a valid test as PERL is optimized for looping whereas PHP is better
in other areas. (Personally, I don't know the PHP source very well but I'm
curious as to whether trying to bring it closer to PERL's speed is an
eventual design goal -- I DO have some tightly-looping PHP code that does
see frequent use and it would be nice to speed it up. (but my own code could
be sped up with a better algorithm too -- I'd ask about it but it's not a
priority to me at the moment)). My intent was to make the scripts as equal
as possible so the results would reflect pure speed and not capabilities of
the language. (Of course, I've been told PERL has an equivalent to PHP's
continue(n) syntax, so the issue is moot.)

However, for the sake of completeness I'll profile both variants of
prime.php again:

Old method (set temp val, break, test temp val, continue if temp val set):

[dewin@ulysses profiling]$ time ./prime.php  /dev/null

real0m14.304s
user0m8.520s
sys 0m0.060s

new method: (continue(2);)

[dewin@ulysses profiling]$ time ./prime.php  /dev/null

real0m14.402s
user0m8.620s
sys 0m0.030s

Surprising?

To be fair, I only timed the old method once and took the average from three
times on the new method (I changed my only copy of the code and didn't feel
like changing it back to retest the old method). The times shown in my
original tests (above) probably more accurately reflect the old method than
the current ones.

That being said, it looks like continue(2) is actually a tiny tiny bit
slower (we're talking around 0.010s over a 1-iteration loop on a 700 mhz
machine here) than doing it by hand the old way. With an amount that small
though, I'm more inclined to believe it's just statistical error/random
variance than anything else.

-- Daniel Grace



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




[PHP] Unexpected addslashes/stripslashes-behaviour?

2002-06-05 Thread Trond Arve Nordheim

I'm just having a little problem using addslashes/stripslashes here, and I'm
wondering if this actually is the expected behaviour:

I get text from a form post, let's say This sucks :\.
I do $text = addslashes($_POST[fieldname]); and stick $text in a DB.

When I pull the text back out, and run stripslashes on the text, the result is:
This sucks :.. the \ is gone...

Is it supposed to do this? As far as I've seen I need stripslashes on data from
a DB already addslashed... so.. what's going on?

-- 
Trond Arve Nordheim
 - This message has been ROT13-encrypted twice for extra security

-
This mail sent through IMP: http://horde.org/imp/

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




Re: [PHP] Stopping multiple votes by IP

2002-06-05 Thread 1LT John W. Holmes

The only good way to do it is with authentication. Have the user log in
and then allow them one vote.

Any other method is going to be open to cheating, so be aware of it.

If the poll is important and the results need to be as exact as possible,
use some form of authentication. If it's just a simple web poll to see how
many fish people have, for example...just use cookies.

---John Holmes...

- Original Message -
From: Nick Wilson [EMAIL PROTECTED]
To: PHP-General [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 6:54 AM
Subject: Re: [PHP] Stopping multiple votes by IP


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 * and then René Moonen declared
  What then happens with users who are behind a firewall/proxy (probably
  have non-routable IP addresses on theire LAN) and share one internet
  connection. They all have the same remote IP address (routable IP
  address of the firewall).
  This would mean that only one user of that group can vote.

 Good point!


  Other solution might be
  - use cookies to store the vote on the client
  - use login name / password to check votes

 Well, I had considered cookies, but what if an author just switches
 browser to vote for his own article?

 I like the idea of cookies regardless, I guess I shouldn't be over
 paranoid about it. It's unlikely that anyone would really want to go to
 all the trouble anyway.

 Cheers
 - --
 Nick Wilson //  www.explodingnet.com



 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.6 (GNU/Linux)

 iD8DBQE8/e3sHpvrrTa6L5oRAuiVAJoCnzJbu/Pg2sYY/z0JeyPRWoW2pQCfX+b8
 zMEON0GiiPELQymdiCZYKD4=
 =krsl
 -END PGP SIGNATURE-

 --
 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] Unexpected addslashes/stripslashes-behaviour?

2002-06-05 Thread 1LT John W. Holmes

What are your settings for magic_quotes?

magic_quotes_gpc
magic_quotes_runtime

in your php.ini.

magic_quotes_gpc will automagically addslashes() to incoming GET, POST, and
COOKIE data. So you don't need to do it yourself. The defaults to On.

magic_quotes_runtime will autmagically addslashes() to data retrieved from a
database. This defaults to Off.

Also, note that you DO NOT have to stripslash data that comes out of a
database just because you used addslashes() on it when you inserted it. If
you have a string like What's up with the  character and you use
addslashes() on it (either automatic with magic_quotes, or manually), then
you'll have the string What\'s up with the \ character When you insert
that into the database, the \ character tells the database that the
character after it should be taken as a literal character and not the end of
the string. The actual \ doesn't go into the database. If you are seeing the
\ in your database, then  you are running addslashes() twice on your data.

HTH,

---John Holmes...


- Original Message -
From: Trond Arve Nordheim [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 6:59 AM
Subject: [PHP] Unexpected addslashes/stripslashes-behaviour?


 I'm just having a little problem using addslashes/stripslashes here, and
I'm
 wondering if this actually is the expected behaviour:

 I get text from a form post, let's say This sucks :\.
 I do $text = addslashes($_POST[fieldname]); and stick $text in a DB.

 When I pull the text back out, and run stripslashes on the text, the
result is:
 This sucks :.. the \ is gone...

 Is it supposed to do this? As far as I've seen I need stripslashes on data
from
 a DB already addslashed... so.. what's going on?

 --
 Trond Arve Nordheim
  - This message has been ROT13-encrypted twice for extra security

 -
 This mail sent through IMP: http://horde.org/imp/

 --
 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] Unexpected addslashes/stripslashes-behaviour?

2002-06-05 Thread Trond Arve Nordheim

Quoting 1LT John W. Holmes [EMAIL PROTECTED]:
 What are your settings for magic_quotes?
 magic_quotes_gpc
 magic_quotes_runtime

They're off.

Actually I just noticed that I didn't have to stripslashes() the data that came
out of the database myself.. don't know why, but I've always been sure I had to
use it.. ohwell, thanks :)

-- 
Trond Arve Nordheim
 - This message has been ROT13-encrypted twice for extra security

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




Re: [PHP] multisite hit counter, includin session statistics

2002-06-05 Thread 1LT John W. Holmes

What have you tried so far? I assume you know how to create the actual
image, or will learn later.

For your code, just try to start a session and set a variable within it.
Each time this script is run, that means a page is being requested. So after
you start your session, check and see if that variable is registered within
it. If it is, that means the user has already been browsing this page and
you shouldn't increase the count. If the variable isn't set, then the
session is new, and it's a new visitor.

Keep in mind that once the user closes the browser, and then comes back to
your site in a new window, then the session will not exist and they will be
considered a new user.

Have you tried anything so far?

---John Holmes...

- Original Message -
From: Martin Smetak [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 6:48 AM
Subject: Re: [PHP] multisite hit counter, includin session statistics


 Completely misunderstood :o)

 One more try:

 I need to put into some page(www.some.com), which is not on my server, a
 link to my script-counter, running on my server(www.my.com).
 The easiest way to do that is to place it to the page in form of an blank
 image, so in the index.html on www.some.com will
 be code like
 .
 img src=http://www.my.com/counter.php?site=0011;
 .

 When user accesses www.some.com page, he gets my image and runs a
script.
 This way I can count number of page visits, store IP numbers of
 visitorsbut don't know how to store
 number of unique users that access page, number of sessions.
 ^^
 This is what I need. You know how to do that?

 Thanks a lot,
 Minca


  No problem bud, sorry I tried to help.
 
  Anyhow, this does work, you just do not know how to write image.php so
 that
  it returns the correct data for an image counter. maybe i misunderstood

 your
  first email, but I thought you were looking for a hidden way of
keeping
  track of page hit counts and user paths, etc.
 
  If your talking about files that can have PHP in them, then this is as
  simple as an include() file that generates the correct img calls to
  product the correct number, while tracking the other information you
want.
 
  If you want to call this on a plain HTML page that can't parse PHP, then
 the
  only way I know of is to create an image call to a PHP script. Maybe you
 can
  do more with Javascript or SSI, if that's available...
 
  ---John Holmes...
  - Original Message -
  From: Martin Smetak [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, June 04, 2002 12:14 PM
  Subject: Re: [PHP] multisite hit counter, includin session statistics
 
 
   img src=http://www.yourserver.com/image.php?ID=xxx;
  
   Well, how can this help me? This is the way I need to use the counter
on
  web
   page, it solves nothing.
   I need the same thing u are asking to, but this way it doesn't work.
But
   there are counters-sites that uses
   this method(img) producing session statistics.
   Anyone know how they do that?
  
   Minca
  
   
Do what you need to do with the PHP code as far as keeping a count
of
visitors, etc, and then create an image header and send it the data
 for
  a
1x1 pixel transparant image.
   
Got a question for everyone else, b/c I'm not sure on this. If I
have
 a
   link
like the above on www.example.com, say, and it linkes to
www.yourserver.com/image.php, can I start a session in that file and
  have



 --
 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] multisite hit counter, includin session statistics

2002-06-05 Thread Martin Smetak

Well, I'm feeling like an idiot.
I was counting cookies must be sent before any other headers are
sentman, how is possible it is working?

I know how to program that, but haven't known cookies/sessions works also
when initialised this way...

Thanks a lot and sorry.

Minca



 What have you tried so far? I assume you know how to create the actual
 image, or will learn later.

 For your code, just try to start a session and set a variable within it.
 Each time this script is run, that means a page is being requested. So
after
 you start your session, check and see if that variable is registered
within
 it. If it is, that means the user has already been browsing this page and
 you shouldn't increase the count. If the variable isn't set, then the
 session is new, and it's a new visitor.

 Keep in mind that once the user closes the browser, and then comes back to
 your site in a new window, then the session will not exist and they will
be
 considered a new user.

 Have you tried anything so far?

 ---John Holmes...

 - Original Message -
 From: Martin Smetak [EMAIL PROTECTED]



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




RE: [PHP] multisite hit counter, includin session statistics

2002-06-05 Thread SP

I'm guessing you could just add as many variables
you want to collect at the end of the counter.php
script.  Does that help?

img
src=http://www.my.com/counter.php?site=0011PHPSE
SSID=lkjasfoia99sd9asfdsaf9




-Original Message-
From: Martin Smetak
[mailto:[EMAIL PROTECTED]]
Sent: June 5, 2002 6:48 AM
To: 1LT John W. Holmes; [EMAIL PROTECTED]
Subject: Re: [PHP] multisite hit counter, includin
session statistics


Completely misunderstood :o)

One more try:

I need to put into some page(www.some.com), which
is not on my server, a
link to my script-counter, running on my
server(www.my.com).
The easiest way to do that is to place it to the
page in form of an blank
image, so in the index.html on www.some.com will
be code like
.
img
src=http://www.my.com/counter.php?site=0011;
.

When user accesses www.some.com page, he gets my
image and runs a script.
This way I can count number of page visits, store
IP numbers of
visitorsbut don't know how to store
number of unique users that access page, number of
sessions.
^^
This is what I need. You know how to do that?

Thanks a lot,
Minca


 No problem bud, sorry I tried to help.

 Anyhow, this does work, you just do not know how
to write image.php so
that
 it returns the correct data for an image
counter. maybe i misunderstood
your
 first email, but I thought you were looking for
a hidden way of keeping
 track of page hit counts and user paths, etc.

 If your talking about files that can have PHP in
them, then this is as
 simple as an include() file that generates the
correct img calls to
 product the correct number, while tracking the
other information you want.

 If you want to call this on a plain HTML page
that can't parse PHP, then
the
 only way I know of is to create an image call to
a PHP script. Maybe you
can
 do more with Javascript or SSI, if that's
available...

 ---John Holmes...
 - Original Message -
 From: Martin Smetak [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, June 04, 2002 12:14 PM
 Subject: Re: [PHP] multisite hit counter,
includin session statistics


  img
src=http://www.yourserver.com/image.php?ID=xxx;
 
  Well, how can this help me? This is the way I
need to use the counter on
 web
  page, it solves nothing.
  I need the same thing u are asking to, but
this way it doesn't work. But
  there are counters-sites that uses
  this method(img) producing session statistics.
  Anyone know how they do that?
 
  Minca
 
  
   Do what you need to do with the PHP code as
far as keeping a count of
   visitors, etc, and then create an image
header and send it the data
for
 a
   1x1 pixel transparant image.
  
   Got a question for everyone else, b/c I'm
not sure on this. If I have
a
  link
   like the above on www.example.com, say, and
it linkes to
   www.yourserver.com/image.php, can I start a
session in that file and
 have



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



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




[PHP] How do I access a hash from an extention/module?

2002-06-05 Thread eric

Hi,

I am a bit stuck right now, I want to access the values of a global hash
(actually it is a session variable) from within my PHP extention/module.
So I want to be able to see which keys are defined in a hash, and what
the corresponding value in this hash is for each key.

Could someone please give me a small example how this is done? I have
looked in the source code of the other extentions but I couldn't find
anything that could be of any help (I might have missed it though).

-- 
#!perl #   Life ain't fair, but root passwords help.
# Eric Veldhuyzen  [EMAIL PROTECTED]
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~   # Perl Monger
/.(.)...(.)(.)(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_$;`

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




Re: [PHP] findin colors in gif files

2002-06-05 Thread Tom Rogers

HI
Just a thought, if your on a windows box you will need to ad a 'b' to the 
fiopen function like
fopen($file, br)
Tom

At 09:43 PM 5/06/2002, freestylez wrote:
it almost works :) unfortunatly the gif file seems to be corrupted at some
point,
but anyhow - i am not good in these hex and bin things, could you explain me
the lines
that are dealing with hex conversino, flag, unpack this stuff? or do you
have a good link
explaining this?

would be great! thanks!


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




Re: [PHP] findin colors in gif files

2002-06-05 Thread Tom Rogers

hi
what gif is getting corrupted?, it works ok with the one you gave.
To see what all those flag things are have a look at the gif spec at
http://www.goice.co.jp/member/mo/formats/gif.html
unpack puts the binary string into an array, flag gives some info as to the 
colour index table
Tom


At 09:43 PM 5/06/2002, freestylez wrote:
it almost works :) unfortunatly the gif file seems to be corrupted at some
point,
but anyhow - i am not good in these hex and bin things, could you explain me
the lines
that are dealing with hex conversino, flag, unpack this stuff? or do you
have a good link
explaining this?

would be great! thanks!


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




[PHP] probelem with script

2002-06-05 Thread _michael

/*
what i'm trying to do is read the files and folders in the directory and
output them into an xml document - when i try to find the size of the file i
get an error - can someone please tell me why this is

thanks

mike
*/

// SCRIPT [dir.php]
?
function folder2XML(){
$fp = opendir('.');// make $fp hold the
current directory
while (false !== ($file = readdir($fp))) { // for each file or
folder in the directory...
if ($file != .  $file != ..) {   // if it's not the
current folder or the parent folder...
if (is_dir($file)) {   // if it's a
folder...
echo folder name='$file';// open the folder tag and
put the folder name in it
chdir($file);  // change to that
directory
folder2XML();  // make our recursive
call to display this directory too.
chdir(../);  // change back to
previous directory
echo /folder;  // close the folder
tag
} else {   // if it's a file...
// the error is bieng caused here
$size = int filesize($file)
echo file name='$file' size='$size' /;
// if you comment out the above 2 lines and include the below instead 
it
works
// echo file name='$file' /;
}
}
}
closedir($fp); // close the open
directory
}
echo(?xml version='1.0' ?);

?folder name='/'?  // Open the root
element's tag (it's the root folder, of course)
folder2XML();  // Display the folder
as XML (and all sub folders!)
?/folder?  // close the root element
?
// END


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




Re: [PHP] probelem with script

2002-06-05 Thread Stuart Dallas

On Wednesday, June 5, 2002 at 1:57:09 PM, you wrote:
 // the error is bieng caused here
 $size = int filesize($file)

You don't need the int and you were missing a semicolon...

$size = filesize($file);

-- 
Stuart


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




[PHP] Crontab

2002-06-05 Thread Mauricio Cuenca

Hello,

I need to run a daily script on our website but I'm trying to avoid using
CRONTAB.

Is there any way that I can run this daily ?
Is there any equivalent to ASP's Application_OnStart for PHP ?

Thanks,

_
Mauricio Cuenca
[EMAIL PROTECTED]



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




RE: [PHP] problems with attachment to email for mail() function

2002-06-05 Thread Dave

anyone on this...

a few have suggested install this class and so forth.  That is not the point.
the goal is to correctly format and encode the simple message with attachment so
we can customize things from there.  The classes available for this are great,
but defeat the purpose of understanding.

looking forward to comments or suggestions.

Dave

-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 5:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] problems with attachment to email for mail() function


have a form where user uploads attachment and provides email address and a
brief note regarding the attachment.  The below script should grab all that and
email the note with the attachment to our target user.

Email appears with text portion and attachment icon, but no attachment (Outlook
2000).  In viewing the email prior to delivery to the client, it appears to be
formatted correctly.  The following is the email script, and below that the
headers from the email.

if \n is replaced with \r\n then no attachment flag appears, otherwise same
problem

help or insight appreciated.

Dave

 php file code

?php
# $from, $to, $body, and $attachment are provided in the previous form
$sig = \n--\nWebsite Mailer\n;
$body .= $sig;
$headers = From: $from\n;
$boundary = =WSM. . md5(uniqid(time())) . =;
$headers .= MIME-Version: 1.0\n;
$headers .= Content-Type: multipart/mixed;\n\tboundary=\$boundary\\n\n;
$str = --$boundary\n;
$str .= Content-Type: text/plain;\n\tcharset=\us-ascii\\n;
$str .= Content-Transfer-Encoding: 7bit\n\n;
$str .= $body\n\n;
$fp = fopen($attachment, rb);
$data = fread($fp, filesize($attachment));
$data = chunk_split(base64_encode($data),76,\n);
fclose($fp);
$str .= --$boundary\n;
$str .= Content-Type: .$attachment_type.;\n\tname=\.$attachment_name .
\\n;
$str .= Content-Transfer-Encoding: base64\n;
$str .= Content-Disposition: attachment; \n\tfilename=\.$attachment_name .
\\n\n;
$str .= $data;
$str .= --$boundary--\n;
$body = $str;

if(mail($to, $subject, $body, $headers)){
   $status.='brSuccessfully sent.';
}else{
   $status.='brAn error occurred while sending.';
}
?


email header info

Return-Path: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 96549 invoked by uid 81); 4 Jun 2002 21:45:49 -
Date: 4 Jun 2002 21:45:49 -
Message-ID: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary==WSM.38ef75d9c66623ee87e302bad63e79b3=



--=WSM.38ef75d9c66623ee87e302bad63e79b3=
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: 7bit

test
test
test
--
Website Mailer


--=WSM.38ef75d9c66623ee87e302bad63e79b3=
Content-Type: application/octet-stream;
name=FixKlez.com
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=FixKlez.com

TVqQAAME//8AALgAQAAA
+A4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v
ZGUuDQ0KJABo6XodLIgUTiyIFE4siBROV5QYTi+IFE5Dlx9OJogUTq+UGk43iBROQ5ce
TluIFE5VqR9OHogUTiyIFU6GiRROTpcHTj2IFE4siBROJIgUTiqrH04oiBRO644STi2IFE5SaWNo
LIgUTgBQRQAATAEDAL9J4zwAAOAADwELAQYAABACAAAg
clipped
DBt6MUOTCWeZFsi39DQGvapqsVo/VLIKnbrS15vO5+7fIzhl+Kjhha8azcbokj7NTTK6cF6Dy8Qn
4LceXyJzQT9bstNNJJT56sz9XJ8lzOFwcv/hpgK2f3QNPSrjU7PKYlerj0kSUpE9DZJqpi+stPFm
GKrmkNx1Pzv1jBXgMX+r4g7Jz5dnbpgg3tAZMTHHROCAyWsW1JWeaZ6zFSh+7zFodgkbOjZ7hKUy
nAXiZ0/Z+I+w4fmUwZuJ9kjixNM6MHWSTzVXrBG5XCLm6mEcSGThGP4BUA5wN54K2ace0SA0r9x/
PsT0J3BGtQ==
--=WSM.38ef75d9c66623ee87e302bad63e79b3=--


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

2002-06-05 Thread DragosB

Hi,

How can I check how many options has been selected from a select list? I
tried in many ways, but it returns the last option selected.

DragosB





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




[PHP] global variables without sessions on apache

2002-06-05 Thread Zac Hillier

Hi,

Is it possible using php on our own apache server to create global variables
for virtual host without having to use session variables.

We would like to have three variables that are constant for each virtual
host and that are available from every page, I thought it would be possible
with htaccess or http.conf but am struggling to find documentation for it.

Thanks

Zac


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




Re: [PHP] multisite hit counter, includin session statistics

2002-06-05 Thread 1LT John W. Holmes

I said try it...I'm not guaranteeing it works.

---John Holmes...

- Original Message -
From: Martin Smetak [EMAIL PROTECTED]
To: 1LT John W. Holmes [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 7:56 AM
Subject: Re: [PHP] multisite hit counter, includin session statistics


 Well, I'm feeling like an idiot.
 I was counting cookies must be sent before any other headers are
 sentman, how is possible it is working?

 I know how to program that, but haven't known cookies/sessions works also
 when initialised this way...

 Thanks a lot and sorry.

 Minca



  What have you tried so far? I assume you know how to create the actual
  image, or will learn later.
 
  For your code, just try to start a session and set a variable within it.
  Each time this script is run, that means a page is being requested. So
 after
  you start your session, check and see if that variable is registered
 within
  it. If it is, that means the user has already been browsing this page
and
  you shouldn't increase the count. If the variable isn't set, then the
  session is new, and it's a new visitor.
 
  Keep in mind that once the user closes the browser, and then comes back
to
  your site in a new window, then the session will not exist and they will
 be
  considered a new user.
 
  Have you tried anything so far?
 
  ---John Holmes...
 
  - Original Message -
  From: Martin Smetak [EMAIL PROTECTED]
 


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



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




Re: [PHP] Crontab

2002-06-05 Thread 1LT John W. Holmes

Program it into the homepage to run once a day. As long as  you get one hit
per day, then it'll run.

---John Holmes...

- Original Message -
From: Mauricio Cuenca [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 9:15 AM
Subject: [PHP] Crontab


 Hello,

 I need to run a daily script on our website but I'm trying to avoid using
 CRONTAB.

 Is there any way that I can run this daily ?
 Is there any equivalent to ASP's Application_OnStart for PHP ?

 Thanks,

 _
 Mauricio Cuenca
 [EMAIL PROTECTED]



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



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




Re: [PHP] problems with attachment to email for mail() function

2002-06-05 Thread Jason Wong

On Wednesday 05 June 2002 21:36, Dave wrote:
 anyone on this...

 a few have suggested install this class and so forth.  That is not the
 point. the goal is to correctly format and encode the simple message with
 attachment so we can customize things from there.  The classes available
 for this are great, but defeat the purpose of understanding.

 looking forward to comments or suggestions.

Find a class that works, dissect and understand how it works. Incorporate what 
you have learnt into your own class.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Many people are secretly interested in life.
*/


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




Re: [PHP] Select-List

2002-06-05 Thread Devrim GUNDUZ


Hi,

On Wed, 5 Jun 2002, DragosB wrote:

 How can I check how many options has been selected from a select list? I
 tried in many ways, but it returns the last option selected.

Let's say your select box code is similar to  this:

SELECT name=day[] size=7 multiple
...
/SELECT

in PHP form,

$number = count ($day);

gives you the number of options selected.

Regards and best wishes.
-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-



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




Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Jason Wong

On Wednesday 05 June 2002 20:40, Zac Hillier wrote:
 Hi,

 Is it possible using php on our own apache server to create global
 variables for virtual host without having to use session variables.

 We would like to have three variables that are constant for each virtual
 host and that are available from every page, I thought it would be possible
 with htaccess or http.conf but am struggling to find documentation for it.

Use an auto-prepend file.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
QOTD:
The baby was so ugly they had to hang a pork chop around its
neck to get the dog to play with it.
*/


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




RE: [PHP] Crontab

2002-06-05 Thread Jay Blanchard

[snip]
Program it into the homepage to run once a day. As long as  you get one hit
per day, then it'll run.
...

 I need to run a daily script on our website but I'm trying to avoid using
 CRONTAB.

 Is there any way that I can run this daily ?
[/snip]

But if you need to run it only once per day you will have to have a method
to do it. Using John's suggested homepage method have the daily script open
a file and record the date. Then each successive hit during the day should
also open that file...if today's date is already there it will not run the
script again else it will run and set today's date.

HTH!

Jay



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




[PHP] open a new html page

2002-06-05 Thread Renaldo De Silva

is there a simple way to automatically load a new page according  to a
choice made by a user.

If one persons logs in they go to one page, If another peson logs in they go
to another page?

Any help appreciated.




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




RE: [PHP] open a new html page

2002-06-05 Thread Cal Evans

store the user's preference in a database.  Once they have logged in, use
their login or userID to retrieve it form the database and redirect to the
appropriate page.

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] open a new html page


is there a simple way to automatically load a new page according  to a
choice made by a user.

If one persons logs in they go to one page, If another peson logs in they go
to another page?

Any help appreciated.




--
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] open a new html page

2002-06-05 Thread Devrim GUNDUZ


Hi,
On Wed, 5 Jun 2002, Renaldo De Silva wrote:

 is there a simple way to automatically load a new page according  to a
 choice made by a user.
 
 If one persons logs in they go to one page, If another peson logs in they go
 to another page?

You could keep the following information in a table of a database, or in a 
text file and evaluate it whenever you need:

- username
- page_url

if $username logs on, user will go to $page_url. You only must do some 
coding to get this data from text file or a database.

If you have only very very  few users, maybe you could place this data in 
the code.

Regards and best wishes.

-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-





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




RE: [PHP] open a new html page

2002-06-05 Thread Jay Blanchard

[snip]
is there a simple way to automatically load a new page according  to a
choice made by a user.

If one persons logs in they go to one page, If another peson logs in they go
to another page?
[/snip]

Use a switch statement as below;

//start session
session_start();
session_register(emailid);
session_register(level);

$dbuser = mysql_fetch_object($dbresult);
$emailid = $dbuser-email;
$level = $dbuser-accesslevel;

//send the user to a page based on their user level

switch($level)
{
case author:
header(Location: myart.php); exit;
break;
case editor:
header(Location: editor.php); exit;
break;
case approve:
header(Location: approve.php); exit;
break;
case schedule:
header(Location: sched.php); exit;
break;
case admin:
header(Location: admin.php); exit;
break;
default:
header(Location: loginfail.php); exit;
}

Each type of user is sent to a particular page based on their $level.

HTH!

Jay



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




Re: [PHP] problems with attachment to email for mail() function

2002-06-05 Thread Analysis Solutions

Hi Dave:

On Tue, Jun 04, 2002 at 05:45:17PM -0400, Dave wrote:
 
 Email appears with text portion and attachment icon, but no attachment (Outlook
 2000).

By no attachment I assume you mean you can't get the attachment through the user
interface.  But, I bet the attachment is there if you look at the source code of the
message itself.  Right?  That indicates the attachment was sent and received.  The 
trick is then getting Lookout to properly allow you to save the attachment.

One thought, someone told me of a seting in Internet Explorer:

* On the menu bar click on Tools, then Options, then choose the tab Security.
* There is a check box for Do not allow attachments to be saved or opened
* that could potentially be a virus.

Now, regarding your code, let's see if we can find something that could be the 
problem.  I'm going to touch on things that aren't the problem and things that could 
be the problem w/o distinction...


 if \n is replaced with \r\n then no attachment flag appears, otherwise same
 problem

\r\n is the line break protocol specified by RFC 822.  I suggest using it.


 # $from, $to, $body, and $attachment are provided in the previous form

 $sig = \n--\nWebsite Mailer\n;
 $body .= $sig;

Why assign that string to $sig, then assign it to $body only to assign IT to $str.  
Just add the string directly to $str further down in your script.


 $headers = From: $from\n;
 $boundary = =WSM. . md5(uniqid(time())) . =;

Add an underscore _ to the end of the boundary.


 $headers .= MIME-Version: 1.0\n;
 $headers .= Content-Type: multipart/mixed;\n\tboundary=\$boundary\\n\n;

Trailing line breaks aren't necessary.  Also, take out the line breaks and tabs in 
the middle of the lines just to make sure that's not mucking up things.


 $str = --$boundary\n;
 $str .= Content-Type: text/plain;\n\tcharset=\us-ascii\\n;
 $str .= Content-Transfer-Encoding: 7bit\n\n;
 $str .= $body\n\n;

 $fp = fopen($attachment, rb);
 $data = fread($fp, filesize($attachment));
 $data = chunk_split(base64_encode($data),76,\n);
 fclose($fp);

Doing the following is simpler than the previous four lines...
   $data = chunk_split( base64_encode( implode('', file($attachment) ) ) );

Better yet, forget about this step of assigning it to $data here.  Just add it 
directly to the $str variable below via a 
   $str .= chunk_split( . you get the idea 

Do note, I think one of my email programs is experiencing some sort of corruption
with the chunk_split() and/or base64_encode().  This may be your problem.  I haven't
had time to isolate it though, so can't explain further.


 $str .= --$boundary\n;
 $str .= Content-Type: .$attachment_type.;\n\tname=\.$attachment_name .
 \\n;
 $str .= Content-Transfer-Encoding: base64\n;
 $str .= Content-Disposition: attachment; \n\tfilename=\.$attachment_name .
 \\n\n;
 $str .= $data;
 $str .= --$boundary--\n;
 $body = $str;

Again, don't waste memory and time reassigning things.  Delete that last line.  Just
put $str in the mail()  function.  Or, if you want, rename $str to $body.


 if(mail($to, $subject, $body, $headers)){
   $status.='brSuccessfully sent.';
 }else{
   $status.='brAn error occurred while sending.';
 }

Well, that's everything I can think of.  Let us know what happens.

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Justin French

I'm not sure about at a htaccess level, but at a php.ini level I believe you
can set a file to always include at the top of every php page.  This file
could simply be:

?
$var1 = foo;
$var2 = bah;
?

Not sure on the specifics, but it was discussed on the list in the last two
weeks, and i'm sure there is documentation for the php.ini file IN the the
php.ini file, and on the website.


Justin French


on 05/06/02 10:40 PM, Zac Hillier ([EMAIL PROTECTED]) wrote:

 Hi,
 
 Is it possible using php on our own apache server to create global variables
 for virtual host without having to use session variables.
 
 We would like to have three variables that are constant for each virtual
 host and that are available from every page, I thought it would be possible
 with htaccess or http.conf but am struggling to find documentation for it.
 
 Thanks
 
 Zac
 


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




Re: [PHP] Secure File Upload

2002-06-05 Thread Lowell Allen

 From: andy [EMAIL PROTECTED]
 
 // original question:
 snip
 
 I would like to be able to really PREVENT uploads, let's say
 bigger than 10 MB?!
 
 Add this to your HTML form:
 
 input type=hidden name=MAX_FILE_SIZE value=1024
 
 HTH
 
 /snip
 
 I tryed this, too. But this does not work at all! I use IE 5.5 and it did
 not make any difference. Is there something else we have to take care off?
 
What doesn't work for you? You're saying that you can upload a file size
beyond the limit specified by this setting in your form?

The manual says:

The MAX_FILE_SIZE is advisory to the browser. It is easy to circumvent this
maximum. So don't count on it that the browser obeys you (sic) wish! The
PHP-settings for maximum-size, however, cannot be fooled.

The main controls are the ini-settings for post_max_size and
upload_max_filesize. If you haven't already, check out the manual:

http://www.php.net/manual/en/features.file-upload.php

I read the original question to be asking what can be done to prevent tying
up the server with large uploads -- that the too-large files will be
successfully rejected, but the person was asking if there was a way to avoid
using system resources in these cases. From my limited experience, it seems
that the script for checking the upload and copying the file somewhere
doesn't run until the upload is completed -- that the real tie-up is on the
client machine during upload. For example, I did a site where uploads of 24
Mb are possible, but the max_execution_time is only set to 50 (and I'm
pretty sure it could be lower).

HTH

--
Lowell Allen


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




[PHP] redirection

2002-06-05 Thread Renaldo De Silva

is there any way other than

header(Location: http://www.php.net/;);

to redirect to another page.



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




Re: [PHP] redirection

2002-06-05 Thread Tyler Longren

I think that's pretty much your only option.  You could use javascript to
redirect if you wanted.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message -
From: Renaldo De Silva [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 1:45 PM
Subject: [PHP] redirection


 is there any way other than

 header(Location: http://www.php.net/;);

 to redirect to another page.



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

2002-06-05 Thread Leotta, Natalie (NCI/IMS)

You can use JavaScript:

document.location=URL;

You can do that in an onClick (make sure that it's not a type submit, just a
type button if you're using a button).

-Natalie

-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, June 05, 2002 2:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] redirection 


is there any way other than

header(Location: http://www.php.net/;);

to redirect to another page.



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

2002-06-05 Thread Ray Hunter

You can also set up redirects in your web server as well...


Thank you,

RAY HUNTER



-Original Message-
From: Renaldo De Silva [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] redirection 


is there any way other than

header(Location: http://www.php.net/;);

to redirect to another page.



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



RE: [PHP] redirection

2002-06-05 Thread Martin Clifford

You can pretty much use ANY JavaScript event handler to accomplish the redirection.  
I'm new to PHP, so the header is the only place I know of to redirect.

onclick
onmouseup
onmousedown
onmouseover
onmousemove
onkeydown
onkeypress
onkeyup
onchange

etc.


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




RE: [PHP] redirection

2002-06-05 Thread Jay Blanchard

[snip]
I think that's pretty much your only option.  You could use javascript to
redirect if you wanted.
 is there any way other than

 header(Location: http://www.php.net/;);

 to redirect to another page.
[/snip]

Using the switch() function that I showed before here is what I have done...

login.php has the login form with an action of login1.php which is script
containing the case statement. It is just a script with no output until it
reaches its chosen header info.

HTH!

Jay



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




[PHP] Template's, that is the question!

2002-06-05 Thread Juan Pablo Aqueveque

- UltraTemplate
- FastTemplate
- PHPLib Template
- TemplatePower
- Smarty
- (there are others?)

Hi folks:
I am about to begin a new project. Can somebody give me some references 
above templates?
Experience, opinions, complaints, All will be appreciated.

Thanks!


Juan Pablo Aqueveque [EMAIL PROTECTED]
Ingeniero de Sistemas
Departamento de Redes y Comunicaciones http://www.drc.uct.cl
Universidad Católica de Temuco.
Tel:(5645) 205 630 Fax:(5645) 205 628


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




Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Zac Hillier

Jason,

Could you expand on this a little more? I've tried searching for
auto-prepend in both php documentation and apache and cannot find anything
thats relates to our needs.

Thanks for your help

Zac
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 2:46 PM
Subject: Re: [PHP] global variables without sessions on apache


 On Wednesday 05 June 2002 20:40, Zac Hillier wrote:
  Hi,
 
  Is it possible using php on our own apache server to create global
  variables for virtual host without having to use session variables.
 
  We would like to have three variables that are constant for each virtual
  host and that are available from every page, I thought it would be
possible
  with htaccess or http.conf but am struggling to find documentation for
it.

 Use an auto-prepend file.

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
 QOTD:
 The baby was so ugly they had to hang a pork chop around its
 neck to get the dog to play with it.
 */


 --
 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] days between two timestamps

2002-06-05 Thread Tyler Longren

Hi,

I have two different timestamps:
20020603164114
and
20020605054710

Is there a simple way to get the number of days between the two dates?

thanks,
tyler


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




Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Jason Wong

On Wednesday 05 June 2002 22:45, Zac Hillier wrote:

 Could you expand on this a little more? I've tried searching for
 auto-prepend in both php documentation and apache and cannot find anything
 thats relates to our needs.

In php.ini there is a setting called auto_prepend_file. Set it to whatever 
file you want then in that file define your 'global variables'.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Banacek's Eighteenth Polish Proverb:
The hippo has no sting, but the wise man would rather be sat upon
by the bee.
*/


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




Re: [PHP] days between two timestamps

2002-06-05 Thread 1LT John W. Holmes

Since those look like MySQL timestamps, I would suggest you do it in your
query.

SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table

Adapt to your needs.

Explain what your overall mission is and there is probably a query that'll
return just that.

If you want to use PHP, format those timestamps into something strtotime()
will convert to a unix timestamp, find the difference in seconds, and
convert the number of seconds into days.

---John Holmes...

- Original Message -
From: Tyler Longren [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 11:01 AM
Subject: [PHP] days between two timestamps


 Hi,

 I have two different timestamps:
 20020603164114
 and
 20020605054710

 Is there a simple way to get the number of days between the two dates?

 thanks,
 tyler


 --
 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] OT cron/perl/php..

2002-06-05 Thread Kelly Meeks

I've found a really handy php script (mysqlphpbak) that will backup all mysql 
databases for me via mysqldump.

I'm using a cobalt raq server, and according to them, I can create a script and put it 
in a cron-daily directory, and that script will be executed.

How do I create that script?  Does it have to be in perl, and if so, how would you 
code it?  Or could it be a php file?

Sorry for the exceedingly off-topic post, I'm obviously new to the sysadmin side of 
things...

Kelly



Re: [PHP] days between two timestamps

2002-06-05 Thread Jason Wong

On Wednesday 05 June 2002 23:01, Tyler Longren wrote:
 Hi,

 I have two different timestamps:
 20020603164114
 and
 20020605054710

 Is there a simple way to get the number of days between the two dates?

These look like mysql timestamps. If you're getting them from mysql, you might 
try and do your date calculations there -- mysql has a rich range of 
functions for date manipulation/calculation.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Dyslexics have more fnu.
*/


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




Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford

laughs

Well, I had the right idea... John is just more advance than me. :o)

 1LT John W. Holmes [EMAIL PROTECTED] 06/05/02 11:09AM 
Since those look like MySQL timestamps, I would suggest you do it in your
query.

SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table

Adapt to your needs.

Explain what your overall mission is and there is probably a query that'll
return just that.

If you want to use PHP, format those timestamps into something strtotime()
will convert to a unix timestamp, find the difference in seconds, and
convert the number of seconds into days.

---John Holmes...

- Original Message -
From: Tyler Longren [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 11:01 AM
Subject: [PHP] days between two timestamps


 Hi,

 I have two different timestamps:
 20020603164114
 and
 20020605054710

 Is there a simple way to get the number of days between the two dates?

 thanks,
 tyler


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



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



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




[PHP] Thanks all I used javascript.

2002-06-05 Thread Renaldo De Silva

Thanks all I used javascript.




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




Re: [PHP] days between two timestamps

2002-06-05 Thread Tyler Longren

Hi All,

Yes, they are mysql timestamps.  I'll just use the query John suggested and
modify it to fit my needs.  I was originally going to do something like
Martin suggested, but if I can do it right in MySQL, I'll do it that way.

Thanks all!
tyler

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 10:09 AM
Subject: Re: [PHP] days between two timestamps


 Since those look like MySQL timestamps, I would suggest you do it in your
 query.

 SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table

 Adapt to your needs.

 Explain what your overall mission is and there is probably a query that'll
 return just that.

 If you want to use PHP, format those timestamps into something strtotime()
 will convert to a unix timestamp, find the difference in seconds, and
 convert the number of seconds into days.

 ---John Holmes...

 - Original Message -
 From: Tyler Longren [EMAIL PROTECTED]
 To: php-general [EMAIL PROTECTED]
 Sent: Wednesday, June 05, 2002 11:01 AM
 Subject: [PHP] days between two timestamps


  Hi,
 
  I have two different timestamps:
  20020603164114
  and
  20020605054710
 
  Is there a simple way to get the number of days between the two dates?
 
  thanks,
  tyler
 
 
  --
  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] OT cron/perl/php..

2002-06-05 Thread 1LT John W. Holmes

You already have the php script, so use that. modify it so that it does
exactly what you need on your system, so that when you call it up through
www.youdomain.com/script.php, it does what you need without any user
interaction or producing any output to the screen (email or log file is
okay).

Then, you can use lynx as the program to call in your cron job.

lynx -dump http://www.yourdomain.com/script.php

It may be --dump, can't remember. You can use wget, too, if nec. Read the
man pages on cron for how to set that up or do a search on google.

---John Holmes...

- Original Message -
From: Kelly Meeks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 11:08 AM
Subject: [PHP] OT cron/perl/php..


I've found a really handy php script (mysqlphpbak) that will backup all
mysql databases for me via mysqldump.

I'm using a cobalt raq server, and according to them, I can create a script
and put it in a cron-daily directory, and that script will be executed.

How do I create that script?  Does it have to be in perl, and if so, how
would you code it?  Or could it be a php file?

Sorry for the exceedingly off-topic post, I'm obviously new to the sysadmin
side of things...

Kelly



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




Re: [PHP] Secure File Upload

2002-06-05 Thread Rodolfo Gonzalez

On Wed, 5 Jun 2002, Lowell Allen wrote:

 Add this to your HTML form:
 input type=hidden name=MAX_FILE_SIZE value=1024

The manual says this can be easily bypassed.

Regards.



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




[PHP] Q: Rogue Processes

2002-06-05 Thread Bucky Kaufman

What's the deal with Rogue or Zombie processes?  To do error handling
with MySQL, I use something like this:
if (!mysql_connect() = TRUE) {
echo Connected;
} else {
echo Connection failed;
}

I've been told that if I don't use the or die() method of error handling
that I could spawn rogue processes.  Wassat and is it for real?




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




RE: [PHP] OT cron/perl/php..

2002-06-05 Thread Jay Blanchard

[snip]
You already have the php script, so use that. modify it so that it does
exactly what you need on your system, so that when you call it up through
www.youdomain.com/script.php, it does what you need without any user
interaction or producing any output to the screen (email or log file is
okay).

Then, you can use lynx as the program to call in your cron job.

lynx -dump http://www.yourdomain.com/script.php
[/snip]

Also, if you use PHP compiled for CGI you don't have to do the lynx --dump
at all. You can just call the PHP script from the CRON same as you would a
PERL script.

HTH!

Jay



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




[PHP] mail() problem

2002-06-05 Thread César L . Aracena

Hi all,

I have this strange problem where I can send e-mails from a PHP script to a common 
e-mail address such as Hotmail's, but I can't send to my ISP-given e-mail address 
(@infovia.com.ar). Does anyone happen to know why is it that makes it different???

Thanks,

Cesar Aracena
[EMAIL PROTECTED]
Neuquen, Argentina



[PHP] Alocating file in memory...

2002-06-05 Thread Paulo Cesar

Hi,

I'd like to know if there is a way to keep a file alocated in the server memory, so 
when the users access a page that includes the file the server doesn't need to alocate 
it in memory each time.

Thanks

Paulo Cesar



Re: [PHP] Stopping multiple votes by IP

2002-06-05 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then 1LT John W. Holmes declared
 The only good way to do it is with authentication. Have the user log in
 and then allow them one vote.
 
 Any other method is going to be open to cheating, so be aware of it.

Okay, I've been working on the 'paper design' all afternoon in the sun
;-) and have pretty much got what I want with a 'member object'

The only small problem I see is if a user logs out and then registers as
another user and votes again. I will be verifying emails of memebers so
I think this an unlikely scenario but it still bugs me a little.

Any thoughts guys?

- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8/kAxHpvrrTa6L5oRAtShAJ4ozLMEysSZfCnK8/Vf8QdDaNYVhgCfSz+/
chjIThp9tnI5vSApB6M6yhc=
=uYqL
-END PGP SIGNATURE-

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




Re: [PHP] mail() problem

2002-06-05 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then César L. Aracena declared
 I have this strange problem where I can send e-mails from a PHP script to a common 
e-mail address such as Hotmail's, but I can't send to my ISP-given e-mail address 
(@infovia.com.ar). Does anyone happen to know why is it that makes it different???

Yes. I had something similar. Try putting 'Reply-To: [EMAIL PROTECTED]' in
the fourth argument for mail. For some reason some systems balk without
a reply address, I'm not certain why?
- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8/kDMHpvrrTa6L5oRAu6BAJ9NSHXU3PBaEqJp3dBFK2XapByivACfQypM
5H9KkD+BXFoeYF3kV59K2MI=
=XGSQ
-END PGP SIGNATURE-

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




Re: [PHP] Template's, that is the question!

2002-06-05 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Juan Pablo Aqueveque declared
 I am about to begin a new project. Can somebody give me some references 
 above templates?
 Experience, opinions, complaints, All will be appreciated.

Only ever used PHPLib but find it a very simple, fast and effective
class.
- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8/kEMHpvrrTa6L5oRAj7IAJ4+C1jjyWCOoyjy9lGppGLhGrtqoACeIUCu
/Lly+6/QL8Wz0PRw2bkzHng=
=ZBn2
-END PGP SIGNATURE-

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




Re: [PHP] mail() problem

2002-06-05 Thread Ivan Hernandez

Cesar:

What's the exact error message you are getting? or
there's no error message?

Are you running the PHP script in a local machine or a
server? What MTA are you using?

Regards,
Ivan

--- César_L._Aracena [EMAIL PROTECTED]
wrote:
 Hi all,
 
 I have this strange problem where I can send e-mails
 from a PHP script to a common e-mail address such as
 Hotmail's, but I can't send to my ISP-given e-mail
 address (@infovia.com.ar). Does anyone happen to
 know why is it that makes it different???
 
 Thanks,
 
 Cesar Aracena
 [EMAIL PROTECTED]
 Neuquen, Argentina
 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: [PHP] Secure File Upload

2002-06-05 Thread Jim lucas

ok, here are a few questions for you to clarify things.

A)  Do you want to place a limit on the size of a single file being
uploaded?
B)  Do you want to place a restriction that says after n'th number of files
that have been uploaded equal 'X' ammount of space on the server disable
file uploads? (this is what it sounds like you are asking, to me anyways)

Answer these two questions and it will help me alot

Jim Lucas
- Original Message -
From: Christoph Starkmann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 04, 2002 8:34 AM
Subject: [PHP] Secure File Upload


 Hi There!

 When uploading a file with PHP, AFAIK I can only control what will be
stored
 on the server. So if someone sends me 100 MB, these will be deleted
 immediately. But, unfortunately, the traffic is produced nevertheless. Is
 there any way to check the file size before uploading the file or any
other
 way to keep the traffic under a certain limit? Last think I would like to
 have is a script that disables all uploads after a certain traffic has
been
 produced, I would like to be able to really PREVENT uploads, let's say
 bigger than 10 MB?!

 Cheers,

 Kiko

 --
 It's not a bug, it's a feature.
 christoph starkmann
 mailto:[EMAIL PROTECTED]
 http://www.gruppe-69.com/
 ICQ: 100601600
 --

 --
 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] Regular Expressions Help

2002-06-05 Thread J. Younker

Hi,
I'm trying to use eregi_replace to check a user-submitted URL, but I
keep getting the following error message:
Warning: Invalid range end in /var/www/html/_db_db/db_input.php
This what I'm using:
$pattern = (http://)?([^[:space:]]+)([[:alnum:]\.-_?/=]);
$replace = http://\\2\\3;;
$URL = eregi_replace($pattern, $replace, $URL);
I've stared at this expression for too long and can't figure out what's
wrong.
Thanks,
J. Younker

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




[PHP] PHP Apache Module AND command Line

2002-06-05 Thread Steve Buehler

Is there doc somewhere to would tell how to install PHP as a command line 
interpreter (like perl) without messing up the installation of PHP that is 
installed as a module in/for Apache?  Basically, I want to have both on the 
same server.  Or can this even be done?

Thank You
Steve


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




Re: [PHP] Stopping multiple votes by IP

2002-06-05 Thread Jason Wong

On Thursday 06 June 2002 00:45, Nick Wilson wrote:
 * and then 1LT John W. Holmes declared

  The only good way to do it is with authentication. Have the user log in
  and then allow them one vote.
 
  Any other method is going to be open to cheating, so be aware of it.

 Okay, I've been working on the 'paper design' all afternoon in the sun
 ;-) and have pretty much got what I want with a 'member object'

 The only small problem I see is if a user logs out and then registers as
 another user and votes again. I will be verifying emails of memebers so
 I think this an unlikely scenario but it still bugs me a little.

There is no 100% 'foolproof' method. Perhaps you can consider charging them 
per vote ;-)

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Star Trek Lives!
*/


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




Re: [PHP] Comparing array elements

2002-06-05 Thread Mark Heintz PHP Mailing Lists

Well, it sounds like something that could be done through the db
query, but if you want to use arrays, it'd be something like this...

$servers = arrray('s1','s2','s3','s4','s5');
$group1 = array('s1','s4','s5');

$in_group = array_intersect($servers, $group1);
$not_in_group = array_diff($servers, $group1);


mh.


On Wed, 5 Jun 2002, Chris Knipe wrote:

 hey everyone,

 Does anyone have and ideas of wisdom on how to compare arrays (mysql result
 sets) and group items based on if they exist in two or more arrays?

 For example:

 I have a table, with a list of servers:
 server1
 server2
 server3
 server4
 server5
 ...
 serverX

 I have a table that specifies which of the servers are grouped:
 group1
   server1
   server4
   server5

 Now, I want to compare group1 against the server list, and do something like
 the following:
 In group:
   server1
   server4
   server5

 Not in group:
   server2
   server3
   serverX



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




[PHP] what is the format of the filemtime string

2002-06-05 Thread _michael

i am trying to find out when my files were last modified (accessing all
files on the server is not a problem)

to try and find this i am using:   filemtime($file) - but this ruturns a
string - 1015171598

what is the format of the string? - are there ways to return the last
modified data in the format Tue, 19, 200, 20:53 (something along that
line?





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




Re: [PHP] PHP Apache Module AND command Line

2002-06-05 Thread Jason Wong

On Thursday 06 June 2002 01:26, Steve Buehler wrote:
 Is there doc somewhere to would tell how to install PHP as a command line
 interpreter (like perl) without messing up the installation of PHP that is
 installed as a module in/for Apache?  

Manual - Installation - Servers-CGI/Commandline

 Basically, I want to have both on the
 same server.  Or can this even be done?

Yes.

./configure
make

Then copy the resulting php binary to wherever you like.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Isn't it strange that the same people that laugh at gypsy fortune
tellers take economists seriously?
*/


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




Re: [PHP] what is the format of the filemtime string

2002-06-05 Thread Jason Wong

On Thursday 06 June 2002 01:34, _michael wrote:
 i am trying to find out when my files were last modified (accessing all
 files on the server is not a problem)

 to try and find this i am using:   filemtime($file) - but this ruturns a
 string - 1015171598

 what is the format of the string? - are there ways to return the last
 modified data in the format Tue, 19, 200, 20:53 (something along that
 line?

That's a unix timestamp. Use the date functions to convert to something human 
readable.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
QOTD:
Money isn't everything, but at least it keeps the kids in touch.
*/


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




RE: [PHP] PHP Apache Module AND command Line

2002-06-05 Thread Ray Hunter

Or you can run the configuration with the bin dir option so that it places
it where you want:


Example:

./configure --bindir=/usr/bin
make
make install



Thank you,

RAY HUNTER



-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP Apache Module AND command Line


On Thursday 06 June 2002 01:26, Steve Buehler wrote:
 Is there doc somewhere to would tell how to install PHP as a command line
 interpreter (like perl) without messing up the installation of PHP that is
 installed as a module in/for Apache?  

Manual - Installation - Servers-CGI/Commandline

 Basically, I want to have both on the
 same server.  Or can this even be done?

Yes.

./configure
make

Then copy the resulting php binary to wherever you like.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Isn't it strange that the same people that laugh at gypsy fortune
tellers take economists seriously?
*/


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



Re: [PHP] Comparing array elements

2002-06-05 Thread Pushkar Pradhan

Never used those before, that's the way to do it! I think array_search and
in_array are suited for looking up one or two values.
 Well, it sounds like something that could be done through the db
 query, but if you want to use arrays, it'd be something like this...

 $servers = arrray('s1','s2','s3','s4','s5');
 $group1 = array('s1','s4','s5');

 $in_group = array_intersect($servers, $group1);
 $not_in_group = array_diff($servers, $group1);


 mh.


 On Wed, 5 Jun 2002, Chris Knipe wrote:

  hey everyone,
 
  Does anyone have and ideas of wisdom on how to compare arrays (mysql result
  sets) and group items based on if they exist in two or more arrays?
 
  For example:
 
  I have a table, with a list of servers:
  server1
  server2
  server3
  server4
  server5
  ...
  serverX
 
  I have a table that specifies which of the servers are grouped:
  group1
server1
server4
server5
 
  Now, I want to compare group1 against the server list, and do something like
  the following:
  In group:
server1
server4
server5
 
  Not in group:
server2
server3
serverX



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


-Pushkar S. Pradhan


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




Re: [PHP] Only one value from a msSQL field.

2002-06-05 Thread Miguel Cruz

On Wed, 19 Jun 2002, Philip J. Newman wrote:
 Only one value from a msSQL field.
 I have many values the same in a field and would like to know how i can select one 
of each (not mating).
 
 $sql = SELECT * FROM brands WHERE 1 ORDER BY `sId` DESC LIMIT 6;
 
 lists everything ..

I'm not sure I understand your question (samples are always nice), but I'd 
suggest looking into GROUP BY or SELECT DISTINCT.

miguel


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




Re: [PHP] open a new html page

2002-06-05 Thread Miguel Cruz

On Wed, 5 Jun 2002, Renaldo De Silva wrote:
 is there a simple way to automatically load a new page according  to a
 choice made by a user.
 
 If one persons logs in they go to one page, If another peson logs in they go
 to another page?

?

  session_start();
  if ($_SESSION['userid'] == 1) include 'page1.php';
  else include 'page2.php';

?


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




Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Miguel Cruz

On Wed, 5 Jun 2002, Zac Hillier wrote:
 Is it possible using php on our own apache server to create global
 variables for virtual host without having to use session variables.
 
 We would like to have three variables that are constant for each virtual
 host and that are available from every page, I thought it would be possible
 with htaccess or http.conf but am struggling to find documentation for it.

When you say that are constant do you mean that they never change or 
just that they are the same for each page at any given time? 

If you need dynamic variables shared between all your pages, you're going 
to have to either use a database or shared memory as documented at:

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

miguel


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




RE: [PHP] what is the format of the filemtime string

2002-06-05 Thread _michael

tight i have tried what you said:

$last_mod = filemtime($file);
$tdate = date($last_mod);

but now the output is in this format - c707-b076

sorry to be ask again but can you give me more of a clue as you've probably
guessed - i'm a novice

thanks


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




Re: [PHP] Stopping multiple votes by IP

2002-06-05 Thread Miguel Cruz

On Wed, 5 Jun 2002, Nick Wilson wrote:
 The only small problem I see is if a user logs out and then registers as
 another user and votes again. I will be verifying emails of memebers so
 I think this an unlikely scenario but it still bugs me a little.

Any web-based unique-user-identification process that does not involve a
human can be fooled. The only exceptions would be if you had access to 
government-issued unique ID databases, such as passport or tax ID numbers. 
Nobody else takes the time to uniquely enumerate the population.

Therefore the only way you can do it reliably is by looking the person in 
the eye, listening to their voice, or applying human judgment to the 
combination of evidence they have transmitted to you electronically.

Anything that relies on email, name, credit card number, etc., for ID is
doomed to failure in this regard because it's too easy to manufacture or
appropriate new identities. Additionally, some of the methods (credit 
card) are, in addition to being susceptible to spoofing, sufficiently 
intrusive as to deter participation by legitimate users.

So decide how much hassle it's worth making it (both for yourself and for
your users) and run with it. My feeling would be that a cookie + email 
token is enough for anything but high-security or money-based operations; 
after those measures the amount of hassle rises steeply.

miguel


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




Re: [PHP] Regular Expressions Help

2002-06-05 Thread Jim lucas

not sure why you have such a complex reg there, but will this work for you.

preg_replace(/(http:\/\/)?([^\/ ]*)(.*);/, http://\\2\\3;, $str);

\\1  = http://  ;  if there
\\2  = domain
\\3  = request_uri

Jim Lucas
- Original Message - 
From: J. Younker [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 8:22 AM
Subject: [PHP] Regular Expressions Help


 Hi,
 I'm trying to use eregi_replace to check a user-submitted URL, but I
 keep getting the following error message:
 Warning: Invalid range end in /var/www/html/_db_db/db_input.php
 This what I'm using:
 $pattern = (http://)?([^[:space:]]+)([[:alnum:]\.-_?/=]);
 $replace = http://\\2\\3;;
 $URL = eregi_replace($pattern, $replace, $URL);
 I've stared at this expression for too long and can't figure out what's
 wrong.
 Thanks,
 J. Younker
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] what is the format of the filemtime string

2002-06-05 Thread Jim lucas

the date() function takes two arguments.

$date_time_format = m-d-Y;
echo date($date_time_format, $unix_time_string);

Jim Lucas
- Original Message -
From: _michael [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 11:15 AM
Subject: RE: [PHP] what is the format of the filemtime string


 tight i have tried what you said:

 $last_mod = filemtime($file);
 $tdate = date($last_mod);

 but now the output is in this format - c707-b076

 sorry to be ask again but can you give me more of a clue as you've
probably
 guessed - i'm a novice

 thanks


 --
 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] problems with attachment to email for mail() function -- solved

2002-06-05 Thread Dave

By no attachment I assume you mean you can't get the attachment
through the user
interface.  But, I bet the attachment is there if you look at the
source code of the
message itself.  Right?  That indicates the attachment was sent and
received.  The
trick is then getting Lookout to properly allow you to save the attachment.

you are correct

One thought, someone told me of a seting in Internet Explorer:

* On the menu bar click on Tools, then Options, then choose the tab Security.
* There is a check box for Do not allow attachments to be saved or opened
* that could potentially be a virus.


bingo...

Your other points are noted,  alot of that is from stipping down more
complicated code in an effort to get to the guts of the attachment problem.  I
do appreciate your comments though.

Well, that's everything I can think of.  Let us know what happens.


happened to have fixklez.com in the directory when I was testing it, and just
kept using that file.  Outlook was kindly blocking the attachment for me.
Changed my example to a .doc file and everything worked as expected.  Will
change the \n to \r\n since Netscape reportedly has problems with it, and as you
said, RFC compliancy.

Figured it was something stupid.

Thanks for the objective views Dan,

Dave


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




Re: [PHP] mail() problem

2002-06-05 Thread Jim lucas

you might want to test with a hotmail account as the return email address
and find out if they are bouncing your email.  I had this problem once, and
in the return email it told me that I had miss formed headers.  I got an
error 550 from the mail server.  you might try setting in the headers of you
mail that you are sending, a) the content type, b) bit number 8bit, 7 bit,
etc...  that solved the problem for me.

Jim Lucas
- Original Message -
From: César L. Aracena [EMAIL PROTECTED]
To: PHP General List [EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 9:29 AM
Subject: [PHP] mail() problem


Hi all,

I have this strange problem where I can send e-mails from a PHP script to a
common e-mail address such as Hotmail's, but I can't send to my ISP-given
e-mail address (@infovia.com.ar). Does anyone happen to know why is it that
makes it different???

Thanks,

Cesar Aracena
[EMAIL PROTECTED]
Neuquen, Argentina



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




[PHP] javascript and php question

2002-06-05 Thread kemu

I have a page first he generates a var in javascript
my next question is
is it possible to use that var in php on the same page
first he does the javascript then the php ?



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




[PHP] php and javascript question

2002-06-05 Thread kemu

I have a page first he generates a var in javascript
my next question is
is it possible to use that var in php on the same page
first he does the javascript then the php ?




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




[PHP] Passing variable to new page and pulling the rest of info from database

2002-06-05 Thread Igor Portnoy

Hello,

 

I am passing a variable to the new page, when user clicks on the link.
Something like that:

a href=showimage.php?ID=38img src=/some/image.jpg/a

 

How can I extract all other information out of my database for that ID
in the next page (showimage.php)?

 

Thanks

 




[PHP] Finding out how a variable was registered

2002-06-05 Thread Joe Pemberton

Is there a function call to figure out how a variable was registered?  I am writing a 
page that handles a form and I need to know whether or not a variable was created 
using the GET or POST method (I don't want the user to be able to to 
'foo.php?var=value' and mess with the results)
- - Joe

[EMAIL PROTECTED]



[PHP] Re: php and javascript question

2002-06-05 Thread Michael Davey

Not unless you pass the variable to the next page explicitly.  You can do
this by either encoding it into the URL of the next page:
http://your.com/page.php?var=value or by putting the variable into an HTML
form and submitting it.

regards,

Mikey

Kemu [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a page first he generates a var in javascript
 my next question is
 is it possible to use that var in php on the same page
 first he does the javascript then the php ?






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




[PHP] Re: Finding out how a variable was registered

2002-06-05 Thread Michael Davey

Iff you asre using the latest version of PHP, use the $_GET/$_POST
superglobals

regards,

Mikey

Joe Pemberton [EMAIL PROTECTED] wrote in message
000f01c20cc1$1df6f320$9b6ee60c@c1195782a">news:000f01c20cc1$1df6f320$9b6ee60c@c1195782a...
Is there a function call to figure out how a variable was registered?  I am
writing a page that handles a form and I need to know whether or not a
variable was created using the GET or POST method (I don't want the user to
be able to to 'foo.php?var=value' and mess with the results)
- - Joe

[EMAIL PROTECTED]




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




[PHP] sorting a list using regex

2002-06-05 Thread Joshua E Minnie

I am trying to sort a list by their first character, my problem comes when
that first character is a number.  When the character is a number I should
be able to display just the values which begin with a number.  When the
value is a letter, I have no problem sorting this out.  Here is the code
that I am using to determine that, any help will be greatly appreciated.

?
[snip]
while(!feof($fp)) {
  $artist = fgetcsv($fp,128,:);
  if(isset($_GET[sort])) {
if(($_GET[sort] != substr(strtoupper($artist[0]),0,1)) ||
($_GET[sort] == 0-9  !preg(^[0-9],$artist[0]))) continue;
  }
  // do something here
}
[snip]
?

Running PHP 4.2.1 on IIS 5 W2K

Thanks

-josh



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




[PHP] Re: Passing variable to new page and pulling the rest of info from database

2002-06-05 Thread Michael Davey

By reading the manual section relevant to your specific database...


Igor Portnoy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,



I am passing a variable to the new page, when user clicks on the link.
Something like that:

a href=showimage.php?ID=38img src=/some/image.jpg/a



How can I extract all other information out of my database for that ID
in the next page (showimage.php)?



Thanks






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




Re: [PHP] Stopping multiple votes by IP

2002-06-05 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Miguel Cruz declared
 So decide how much hassle it's worth making it (both for yourself and for
 your users) and run with it. My feeling would be that a cookie + email 
 token is enough for anything but high-security or money-based operations; 
 after those measures the amount of hassle rises steeply.

I agree entirely. I've never worked on a user login thingy before so
just wondered if I'd missed anything. 

The user id is stored in a cookie and the email, pass, etc is stored in
a db. The only trouble now is what if 2 users share the same computer?
Should I provide a 'login as different user'? That seems to invite
abuse.

The alternative is to not bother as the likehood of 2 people sharing a
computer both wanting accounts on my site is minimal: It's good, but not
/that/ good!

Any opinions on this most welcome ;-)
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8/mFGHpvrrTa6L5oRAr94AKCGUwvJBNzJw2LCG9B1lyVjH4GcKwCfa3iC
rRf86gMz1yv5yIDjEIRaAK0=
=bYBY
-END PGP SIGNATURE-

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




[PHP] Re: sorting a list using regex

2002-06-05 Thread Joshua E Minnie

I am trying to sort a list by their first character, my problem comes when
that first character is a number.  When the character is a number I should
be able to display just the values which begin with a number.  When the
value is a letter, I have no problem sorting this out.  Here is the code
that I am using to determine that, any help will be greatly appreciated.

?
[snip]
while(!feof($fp)) {
  $artist = fgetcsv($fp,1024,:);
  if(isset($_GET[sort])) {
if(($_GET[sort] != substr(strtoupper($artist[0]),0,1)) 
!($_GET[sort] == #  ereg(^[0-9],$artist[0]))) continue;
  }
}
[snip]
?

Running PHP 4.2.1 on IIS 5 W2K

Thanks

-josh





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




[PHP] Retrieving data from a URL in PHP

2002-06-05 Thread Anthony Ritter

The code that follows is from Welling and Thomson's book on PHP and mysql
(page 372)

I've tried it on Apache/ MS Windows 98 / PHP and I get the following line:

No quote available.

Questions...

1. Why can't I retrieve the present stock quote?

2. What is the variable
$quote

represent in the script?

I cannot find where $quote has been assigned.

Thanking all in advance.
Tony Ritter
..


html
head
titleStock Quote from NYSE/title
/head
body
?
$symbol=IBM;
echo h1Stock Quote for $symbol/h1;
$theurl=http://finance.yahoo.com/q?s=ibmd=v1;;
if (!($fp=fopen($theurl, r)))
 {
  echo Could not open the URL;
  exit;
 }
$contents= fread($fp, 100);
fclose($fp);
$pattern=(\\\$[0-9]+\\.[0-9]+);
if (eregi($pattern,$contents,$quote))
 {
  echo $symbol was sold at:  ;
  echo $quote[1];
 }
else
 {
  echo No quote available.;
 }
echo br.This information retrieved frombr.a
href=\$theurl\$theurl/abr.on .(date(l jS F Y g:i a T));
?
/body
/html





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




[PHP] setup php apache

2002-06-05 Thread Mac Ne

Hi

I need help to setup php , apache and my sql on
Freebsd 4.5...I am moving from windows 2000 to
Freedbsd 4.5..I know basic stuff on Freebsd..can some
please send me a step by step to install,setup and
configure it

Thx



__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




[PHP] E-Commerce and small intranet solution

2002-06-05 Thread Jay Fitzgerald

Does anyone know where I can find the best (not just good) shopping cart solution that
also has small intranet functionality?

Im not too worried about the intranet aspect right now, but I really need examples of 
some
of the best carts that are out there.

--
Should you have any questions, comments or concerns, feel free to call me at 
318-338-2034.

Thank you for your time,

Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A
=
Bayou Internet..(888) 30-BAYOU...http://www.bayou.com
Mississippi Internet...(800) MISSISSIPPIhttp://www.mississippi.net
Vicksburg Online..(800) MISSISSIPPIhttp://www.vicksburg.com
Bama Online.(877) GETCONNECTED...http://www.bamaonline.net
=
Tel: (318) 338-2034ICQ: 38823829Fax: (318) 323-5053




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




  1   2   3   >