[PHP] best way to turn a text file into tables in PHP

2002-09-09 Thread Peter

Hi,
  I have 'test_file.txt' with the contents:

label1label2label3comments
name1  name2 name3
name4  name5 name6This is a comment
...

How can I turn this into a table using PHP?


Thanks,
-Peter



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




Re: [PHP] best way to turn a text file into tables in PHP

2002-09-09 Thread Justin French

So, you have a text file with tab delimited values, one row per line yes?

---
TABLE
?
$file = 'path/to/your/file.txt';
$fp = fopen ($file,r);
$row = 0;
while ($myrow = fgetcsv ($fp, 1000, \t))
{
echo TR;
foreach($myrow as $k = $v)
{
if($row == 0) { $v = B{$v}/B; }
echo TD{$v}/TD;
}
echo /TR\n;
$row++;
}
fclose ($fp);  
?
/TABLE
---

Notes:

1. untested code, but should be fine
2. if you're not using a tab to separate your column values, it won't work
3. I'm wrapping the first rows values in Btags/B to give some sort of
heading, hence the need for the $row++ stuff...
4. for more information on it all, check out all the functions used in the
manual, in particular fgetcsv()

Enjoy!


Justin French



on 09/09/02 4:29 PM, Peter ([EMAIL PROTECTED]) wrote:

 Hi,
 I have 'test_file.txt' with the contents:
 
 label1label2label3comments
 name1  name2 name3
 name4  name5 name6This is a comment
 ...
 
 How can I turn this into a table using PHP?
 
 
 Thanks,
 -Peter
 
 


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




Re: [PHP] Upgrading PHP on Redhat

2002-09-09 Thread ing.Martin Prásek


- Original Message -
From: David Yee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 08, 2002 10:59 PM
Subject: [PHP] Upgrading PHP on Redhat


 Hi all. What's the correct procedure to upgrade PHP (in this case 4.0.6)
on
 a Red Hat system?  Usually I just get the PHP tarball compile it myself
but
 for this particular machine I just want to upgrade the Redhat PHP that's
on
 the system.  As you guys know Redhat puts its PHP (and Apache) files in
 different locations- e.g. php.ini is in /etc.  I looked for some RPMs but
I
 kept getting failed dependencies when trying to install them- e.g.:

 # rpm -Uvh php-4.1.2-7.2.4.i386.rpm
 error: failed dependencies:
 php = 4.0.6-15 is needed by php-manual-4.0.6-15
 php = 4.0.6-15 is needed by php-imap-4.0.6-15
 php = 4.0.6-15 is needed by php-ldap-4.0.6-15
 php = 4.0.6-15 is needed by php-mysql-4.0.6-15
 php = 4.0.6-15 is needed by php-odbc-4.0.6-15
 php = 4.0.6-15 is needed by php-pgsql-4.0.6-15

 I'm not an expert in using rpm so I'm probably doing something completely
 wrong???

 David


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




This is a small script with step by step guide to recompile php from php
source tarball, to be full suitable for your distribution (RH 7.3 in my
case)



 cut here ---
# config_php.sh

# This is simple 11 step guide to recompile PHP from tarball,suitable
#  for your distro (RedHat 7.3 im my case, users of other
distributions/versions should follow steps in comment and create your own
script... )
#
#   (assuming, you have php tarball installed, of course,and that you read
the small notes on the end of this file)
#
#  1: Get you PHP configuration  Create script, that calls phpinfo() and
see its output
# in the 3rd line you could see Configure command. Copy it all down to
your clipboard
#  2: create shell script config_php.sh, insert there content of prevoiusly
stored clipboard,
# remove all apostrofs ( ' ), make sure, that everything is on one single
line.
# (Yes, this is the way, how this script was created)
#  3: get your distro CDs, ie that contain RPMs
#  4: copy the script config_php.sh in  the top level of your php sourcecode
tree and run it.
#  5: If you see any error like extension blabla not found you have to
chose if you need it or not
#  6: if you need it, just get your distros CD and instal
blablabla-devel.versionnumer.machine.rpm
#  Maybe you should install some other rpms too, to solve the
dependencies,
# probably it take a lot of disk space
#  7: if you  don't need the particular extension , edit your config_php.sh
script ,
#deleting from ./configure line --with-blabla=something and run your
script config_php.sh again
#  8: once script ended with no errors, you can do a standard MAKE procedure
#  9: make
#  10: make install
#  11 restart your system or just the affected things (db engines, web
servers etc)
# and finito. This is called ZAVES  (zadny velky srani) in czech
#




# A small note 1. Sometimes make_install may not overwrite your old
extensions and create   other directory
# whwere extensions lives. You must copy the extensions where they should be
manually . ie
# /usr/lib/2002xxx contain something like extension_name.so and all content
of that directory
# MUST be copied by hand to /usr/lib/php4



# A small note 2: You MUST have apache-devel installed to have core
feature - apxs,
# that allow you to recompile PHP (and any other apache modules)  without
recompilling apache itself



echo Redhat  PHP configconfig 


  ./configure
i386-redhat-linux   --prefix=/usr   --exec-prefix=/usr   --bindir=/usr/bin  
 --sbindir=/usr/sbin   --sysconfdir=/etc   --datadir=/usr/share   --included
ir=/usr/include   --libdir=/usr/lib   --libexecdir=/usr/libexec   --localsta
tedir=/var   --sharedstatedir=/usr/com   --mandir=/usr/share/man   --infodir
=/usr/share/info   --prefix=/usr   --with-config-file-path=/etc   --enable-f
orce-cgi-redirect   --disable-debug   --enable-dbg=shared   --with-dbg-profi
ler   --enable-pic   --disable-rpath   --enable-inline-optimization   --with
-bz2   --with-db3   --with-curl   --with-dom=/usr   --with-exec-dir=/usr/bin
   --with-freetype-dir=/usr   --with-png-dir=/usr   --with-gd   --enable-gd-
native-ttf   --with-ttf   --with-gdbm   --with-gettext   --with-ncurses   --
with-gmp   --with-iconv   --with-jpeg-dir=/usr   --with-mm   --with-openssl 
  --with-png   --with-pspell   --with-regex=system   --with-xml   --with-exp
at-dir=/usr   --with-zlib   --with-layout=GNU   --enable-bcmath   --enable-d
ebugger   --enable-exif   --enable-ftp   --enable-magic-quotes   --enable-sa
fe-mode   --enable-sockets   --enable-sysvsem   --enable-sysvshm   --enable-
discard-path   --enable-track-vars   --enable-trans-sid   --enable-yp   --en
able-wddx   --without-oci8   --with-imap=shared   --with-imap-ssl   --with-k
erberos=/usr/kerberos   

Re: [PHP] How to program very basic chat on PHP?

2002-09-09 Thread M

Justin French wrote:

 An extremely basic chat would be a frame or iframe which has a meta tag
 refresh (or javascript refresh) of a plain HTML page every 10-20 seconds.

 As far as the flash stuff goes, have a look at macromedia.com or the 1000's
 of flash sites... I'm positive you'll find some development tools for a
 pre-built chat room that you can modify.  I'm certain I got one of
 macromedia.com a few years back (flash 4 days i think).

 Justin

Hello Justin

Ok, you are right, I know it is possible to get complete chat services at free (just
install it in your page).

I think I forgot mention something. The reason I don't want use these services is
because I want people be able to retrieve info of my database when chatting.

Since I have profiles and pictures of people stored in databases, I want people
instantly getting these info through chat services.

For instance, when presenting list of chatters, just with a click you can see
picture and profile of that person.

This connection is impossible to stablish when using predefined chats, thats the
reason I want to make my own chat.

Thanks

Mig


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




RE: [PHP] imagecopyresized problems

2002-09-09 Thread joakim . andersson

Hi,

 imagejpeg($dst_img);

This actually outputs the image, so your result is not unexpected.
Try this instead:
imagejpeg($dst_img, /path/and/filename/to/newfile.jpg);

Regards
Joakim Andersson

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




[PHP] Fw: combine 2 integer

2002-09-09 Thread Meltem Demirkus


 Hi,
 
 I want to add one integer to the end of another , which function can I
 use?..
 
 thanks
 
 meltem
 


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




[PHP] combine 2 integer

2002-09-09 Thread Meltem Demirkus

Hi,

I want to add one integer to the end of another , which function can I
use?..

thanks

meltem


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




Re: [PHP] combine 2 integer

2002-09-09 Thread mhe

I'm not shure what you mean, but is it something like this...

$var1 = $var1 + $var2;

regards

Martin Hjort Eriksen

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




Re: [PHP] combine 2 integer

2002-09-09 Thread Zak Greant

On September 9, 2002 03:38, Meltem Demirkus wrote:
 Hi,

 I want to add one integer to the end of another , which function can I
 use?..

  Hi Meltem,

  You can use the concatenation operator (.)

  ? echo 2 . 4; ?

Cheers!
--zak


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




Re: [PHP] combine 2 integer

2002-09-09 Thread Marek Kilimajer

$string = $int1 . $int2

Meltem Demirkus wrote:

Hi,

I want to add one integer to the end of another , which function can I
use?..

thanks

meltem


  



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




RE: [PHP] combine 2 integer

2002-09-09 Thread Scott Houseman

Hi there.

You could join the two using a period(.) this will concatenate the two
strings.

$a = 1;
$b = 2;
$together = $a.$b; // $together  == '12'

regards

-|Scott

 -Original Message-
 From: Meltem Demirkus [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 09, 2002 11:39 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] combine 2 integer


 Hi,

 I want to add one integer to the end of another , which function can I
 use?..

 thanks

 meltem


 --
 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] checkbox question

2002-09-09 Thread Marek Kilimajer

If you cannot use square brackets, get the values yourself from 
$_SERVER['QUERY_STRING']

Alex Shi wrote:

How to ontain data from a group of checkbox using same name?
For example, in a form there're 6 checkboxes and all named as
Interesting_Area. I know if put a pairs of square brackets at the
end of the name then in php all the values of them can be ontained.
However, for some reason I cannot use square brackets. Please
help me out if anyone know how to do the trick. THanks!

Alex


  



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




[PHP] file upload 2 MB

2002-09-09 Thread andy

Hi there,

I am trying to configure php inside the httpd.conf to allow file uploads
inside a special directory with more than 2 MB.

Somehow the syntax is wrong, since I do get the errormsg that there are 2
arguments required. Here is the code:

# special settings for webmailer
Directory /home/email
   php_flag upload_max_filesize = 50M
/Directory

Does anybody has an idea?

Thanx for any help,

Andy



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




[PHP] Load / Stress Testing

2002-09-09 Thread Dan Hardiker

Hi All,

I have a CPU intensive PHP application, and would like to stress test it
to find out the number of concurrent connections I can have before the
response rate from my script is 5 seconds or more.

The tests will initally take place over a 100mbs LAN.

The following are in use:
  PHP 4.2.3 (using APXS) [also v4.3.0-dev will be tested]
  Apache 1.3
  MySQL 3.23
  FreeBSD 4.6-STABLE

Ive thought of writting a load testing script, but Im not after
reinventing the wheel.


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



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




[PHP] select box

2002-09-09 Thread Meltem Demirkus

Hi,

Can I put the selected option of select box   later by using php?

thanks



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




[PHP] Re: file upload 2 MB

2002-09-09 Thread Erwin

Andy wrote:
 Hi there,

 I am trying to configure php inside the httpd.conf to allow file
 uploads inside a special directory with more than 2 MB.

 Somehow the syntax is wrong, since I do get the errormsg that there
 are 2 arguments required. Here is the code:

 # special settings for webmailer
 Directory /home/email
php_flag upload_max_filesize = 50M
 /Directory

Remove the = and use php_value

php_value upload_max_filesize 2M

HTH
Erwin



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




[PHP] date question

2002-09-09 Thread Meltem Demirkus

Hi,

Is there any function which returns the day , month or  year of a date ?

thanks 
 meltem

 


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




[PHP] Re: date question

2002-09-09 Thread Erwin

Meltem Demirkus wrote:
 Hi,

 Is there any function which returns the day , month or  year of a
 date ?

You need two functions actually ;-))

use the date() function to generate the day, month or year from a timestamp
use the strtotime() function to generate a timestamp from a date

For example

?
echo date( 'd', strtotime( '2002-03-26' ) ); // prints 26
?

HTH
Erwin



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




Re: [PHP] Upload Progress

2002-09-09 Thread Luke Welling


Jed Verity [EMAIL PROTECTED] wrote:
 There really isn't a great solution for this, that I know of. It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing).

How is this an argument for ASP?  HTTP has no way of tracking file upload
progress, no matter what scripting language you are using.

Luke Welling.
--
PHP and MySQL Web Development
by Luke Welling and Laura Thomson
http://www.amazon.com/exec/obidos/ASIN/0672317842/tangledwebdesign




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




Re: [PHP] file upload 2 MB

2002-09-09 Thread Paul Nicholson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,
I have not tested this but I think the correct syntax is:
php_value upload_max_filesize 50M
If the above doesn't work my next bet would be:
php_admin_value  upload_max_filesize 50M
Hope that helps!
~Pauly

On Monday 09 September 2002 07:04 am, andy wrote:
 Hi there,

 I am trying to configure php inside the httpd.conf to allow file uploads
 inside a special directory with more than 2 MB.

 Somehow the syntax is wrong, since I do get the errormsg that there are 2
 arguments required. Here is the code:

 # special settings for webmailer
 Directory /home/email
php_flag upload_max_filesize = 50M
 /Directory

 Does anybody has an idea?

 Thanx for any help,

 Andy

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
The webthe way you want it!
[EMAIL PROTECTED]

It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9fIZdDyXNIUN3+UQRAjNTAJ47ByGezeKHW/C+wuNEljOyzgMO8QCfU85S
saMM2bBQORm8ReXS/K+kIu0=
=DqKb
-END PGP SIGNATURE-

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




Re: [PHP] Upload Progress

2002-09-09 Thread Erwin

 How is this an argument for ASP?  HTTP has no way of tracking file
 upload progress, no matter what scripting language you are using.

Asp has some nice upload components (ATL/COM), which handle the upload
progress. Therefor they will be able to put nice upload dialogs to the user.
On the other side, the ASP solution is kind of the same as Jed's, so you are
right, it isn't an argument.


Grtz Erwin



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




RE: [PHP] date question

2002-09-09 Thread Rudolf Visagie

Hi Meltem,

The PHP manual is at http://www.php.net/manual/en (mirror sites as well).


-Original Message-
From: Meltem Demirkus [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 1:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date question


Hi,

Is there any function which returns the day , month or  year of a date ?

thanks 
 meltem

 


-- 
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] POST form variables not being sent to destination page

2002-09-09 Thread Howard Roscoe

Hi all,

I'm assuming this is an installation error, hence the posting to this group.

I've got an html form but when I use the POST method the form variables
don't make it to the destination page, when I use the GET method, there's no
problem.  I've uploaded the test pages to our web servers and the POST and
GET methods both work fine, therefore I'm assuming it's a problem with my
installation, which is;

PHP 4.2.2
Apache 2.0.40 on Windows XP Pro with as many MS patches as I can find
!!.

I've tried this with and without the register_globals, I've also tried
setting the always_populate_raw_post_data to on by way of a stab in the
dark.

The only thing I can think of is something to do with the Apache
configuration, but I can't find anythnin in there re this.

The test PHP is;

Form Page:

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

form action=b.php method=post name=bb
input name=aa type=text value=12 size=10br
input name=a1 type=submit
/form
body

/body
/html



Target Page:

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
?php

 echo POSTED :.$_POST[aa].br;
 echo GET :.$_GET[aa].br;

?
body

/body
/html


Any help / pointers will be much appreciated as this is starting to drive me
nuts.

Thanks,
Howard






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




[PHP] Re: checkbox question

2002-09-09 Thread Craig Donnelly

Why cant you use square brackets??

call all your checkboxes the following:

interesting_area[]

Then post it to whatever page, now all the checkboxes that were checked are
held in a array (interesting_area)

To see what is contained in the array, do the following:

?php
echo pre;
print_r($_POST[interesting_area]);
echo /pre;
?

From here it depends on what you want to do with the data..

You can loop through the array, using for(), foreach() or while(), or
alternatively write a function to manipulate the data.

Hope that helps,

Craig

Alex Shi [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 How to ontain data from a group of checkbox using same name?
 For example, in a form there're 6 checkboxes and all named as
 Interesting_Area. I know if put a pairs of square brackets at the
 end of the name then in php all the values of them can be ontained.
 However, for some reason I cannot use square brackets. Please
 help me out if anyone know how to do the trick. THanks!

 Alex


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




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




[PHP] Re: select box

2002-09-09 Thread Craig Donnelly

Can you be a bit more clearer with your question?



Meltem Demirkus [EMAIL PROTECTED] wrote in message
011c01c257f0$c4499780$5583@hiborya">news:011c01c257f0$c4499780$5583@hiborya...
 Hi,

 Can I put the selected option of select box   later by using php?

 thanks





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




Re: [PHP] Load / Stress Testing

2002-09-09 Thread Leonid Mamtchenkov

Dear Dan Hardiker,

Once you wrote about [PHP] Load / Stress Testing:
DH I have a CPU intensive PHP application, and would like to stress test it
DH to find out the number of concurrent connections I can have before the
DH response rate from my script is 5 seconds or more.
DH 
DH The tests will initally take place over a 100mbs LAN.
DH 
DH The following are in use:
DH   PHP 4.2.3 (using APXS) [also v4.3.0-dev will be tested]
DH   Apache 1.3
DH   MySQL 3.23
DH   FreeBSD 4.6-STABLE
DH 
DH Ive thought of writting a load testing script, but Im not after
DH reinventing the wheel.

There is a benchmarking utlity that comes with apache, called ab.

HTH.

-- 
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi  Stephanou Ltd.

BOFH excuse #159:

Stubborn processes

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




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

2002-09-09 Thread Jay Blanchard

[snip]
I would like to be able to sum up a collumns values already in 
MySQL. The following query will sum up all values of the column 
'id':
SELECT idsum:=(IFNULL(idsum, id)+id), id FROM yourtable;

Now a question to the PHP/MySQL experienced: Why does this type 
of query not work in combination with PHP? I am using query 
above as $query and do the following standard procedure:
[/snip]

Good point! Now as to your question, try this...

SELECT idsum:=(IFNULL(idsum, id)+id) AS idsum, id FROM yourtable;

When you output your query info output the value as $row-idsum;

HTH!

Jay


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




RE: [PHP] Troubles Inserting into MYSQL

2002-09-09 Thread Jay Blanchard

[snip]
if ($update_type == update_Williams) {
mysql_query(INSERT INTO events ('user', 'detaildesc', 'index', 'reference',
'date_added') VALUES (\'$cookiewho\',
\'$add_Williams\',\'\',\'$row_num\',\'$last_update\'), $sql4)
or die (could not do update);
}
[/snip]

Try this

if ($update_type == update_Williams) {
mysql_query(INSERT INTO events (user, detaildesc, index, reference,
date_added)
VALUES (' . $cookiewho . ', ' . $add_Williams . ', '', ' . $row_num .
', ' . $last_update . '), $sql4)
or die (could not do update);
}

First of all, seems there is extra stuff in the query that shouldn't be
there (what is $sql4?) and you may have parentheses out of place.

HTH!

Jay



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




[PHP] PHP web mail forward feature

2002-09-09 Thread Santosh Pasi

Hi,

I need suggestion regarding handling multipart/mixed mail with attachment and 
embedded image, I need to forward this mail using php, what can be best and 
safe way !!!

Is there any class, example on the net !!!

Thanks in advance 

Regards,
Santosh Pasi

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




Re: [PHP] help me regarding redirecting a page

2002-09-09 Thread Support @ Fourthrealm.com

Anjali,

Use a BUTTON type element, and some javascript:

INPUT TYPE=button VALUE=Cancel  Return to menu 
ONCLICK=self.location=menu.ihtml'


Peter

At 01:57 PM 9/8/2002 -0700, you wrote:
hello,

i dont know how to redirect a page... i mean i want to
have the effect of submit button without clicking on
the submit button.

thank you
anjali

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

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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Re: POST form variables not being sent to destination page

2002-09-09 Thread @ Edwin
Hi there,

I don't really see any "serious" problem in your code except that your
opening body tag is in the wrong place :).

Since I don't have php/apache running on my XP I cannot really tell if this
is an installation problem. Anyway, I have php/apache (4.2.2/1.3.26) on
Linux  and (4.2.2/2.0.40) on Windows 2000 Pro. Your code works whether it's
GET or POST.

So, one thing that you might want to try is to install the latest version of
PHP. Esp., as the php.net site says that the latest version (4.2.3) is
"recommended update for all users of PHP, and Windows users in particular ".

Also, you may want to check previous posts regarding 4.2.2/2.0.40
combination--doesn't look so stable on XP(?)...

- E

"Howard Roscoe" [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I'm assuming this is an installation error, hence the posting to this
group.

 I've got an html form but when I use the POST method the form variables
 don't make it to the destination page, when I use the GET method, there's
no
 problem.  I've uploaded the test pages to our web servers and the POST and
 GET methods both work fine, therefore I'm assuming it's a problem with my
 installation, which is;

 PHP 4.2.2
 Apache 2.0.40 on Windows XP Pro with as many MS patches as I can find
 !!.

 I've tried this with and without the register_globals, I've also tried
 setting the "always_populate_raw_post_data" to on by way of a stab in the
 dark.

 The only thing I can think of is something to do with the Apache
 configuration, but I can't find anythnin in there re this.

 The test PHP is;

 Form Page:

 html
 head
 titleUntitled Document/title
 meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
 /head

 form action="b.php" method=post name="bb"
 input name="aa" type="text" value="12" size="10"br
 input name="a1" type="submit"
 /form
 body

 /body
 /html



 Target Page:

 html
 head
 titleUntitled Document/title
 meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
 /head
 ?php

  echo "POSTED :".$_POST["aa"]."br";
  echo "GET :".$_GET["aa"]."br";

 ?
 body

 /body
 /html


 Any help / pointers will be much appreciated as this is starting to drive
me
 nuts.

 Thanks,
 Howard







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


Re: [PHP] POST form variables not being sent to destination page

2002-09-09 Thread @ Edwin
Hi there,

I don't really see any "serious" problem in your code except that your 
opening body tag is in the wrong place :).

Since I don't have php/apache running on my XP I cannot really tell if this 
is an installation problem. Anyway, I have php/apache (4.2.2/1.3.26) on 
Linux  and (4.2.2/2.0.40) on Windows 2000 Pro. Your code works whether it's 
GET or POST.

So, one thing that you might want to try is to install the latest version 
of PHP. Esp., as the php.net site says that the latest version (4.2.3) is 
"recommended update for all users of PHP, and Windows users in particular 
".

Also, you may want to check previous posts regarding 4.2.2/2.0.40 
combination--doesn't look so stable on XP(?)...

- E

"Howard Roscoe" [EMAIL PROTECTED] wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

Hi all,

I'm assuming this is an installation error, hence the posting to this 
group.

I've got an html form but when I use the POST method the form variables
don't make it to the destination page, when I use the GET method, there's 
no
problem.  I've uploaded the test pages to our web servers and the POST and
GET methods both work fine, therefore I'm assuming it's a problem with my
installation, which is;

 PHP 4.2.2
 Apache 2.0.40 on Windows XP Pro with as many MS patches as I can find
!!.

I've tried this with and without the register_globals, I've also tried
setting the "always_populate_raw_post_data" to on by way of a stab in the
dark.

The only thing I can think of is something to do with the Apache
configuration, but I can't find anythnin in there re this.

The test PHP is;

Form Page:

html
head
titleUntitled Document/title
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/head

form action="b.php" method=post name="bb"
input name="aa" type="text" value="12" size="10"br
input name="a1" type="submit"
/form
body

/body
/html



Target Page:

html
head
titleUntitled Document/title
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/head
?php

  echo "POSTED :".$_POST["aa"]."br";
  echo "GET :".$_GET["aa"]."br";

?
body

/body
/html


Any help / pointers will be much appreciated as this is starting to drive 
me
nuts.

Thanks,
Howard






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




_
$B%-%c%j%"%"%C%W$rL\;X$9$"$J$?$N%J%S%2!<%?!<(B MSN $B="?&!>?&(B 
http://career.msn.co.jp/


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


RE: [PHP] Troubles Inserting into MYSQL

2002-09-09 Thread bbonkosk

If you read:
http://www.php.net/manual/en/function.mysql-query.php
You will see what $sql4 can be.

My guess would be he is connected to 2 or more different databases, and this is 
specifiying which one to execute the query on.
-Brad

 [snip]
 if ($update_type == update_Williams) {
 mysql_query(INSERT INTO events ('user', 'detaildesc', 'index', 'reference',
 'date_added') VALUES (\'$cookiewho\',
 \'$add_Williams\',\'\',\'$row_num\',\'$last_update\'), $sql4)
   or die (could not do update);
   }
 [/snip]
 
 Try this
 
 if ($update_type == update_Williams) {
 mysql_query(INSERT INTO events (user, detaildesc, index, reference,
 date_added)
 VALUES (' . $cookiewho . ', ' . $add_Williams . ', '', ' . $row_num .
 ', ' . $last_update . '), $sql4)
   or die (could not do update);
   }
 
 First of all, seems there is extra stuff in the query that shouldn't be
 there (what is $sql4?) and you may have parentheses out of place.
 
 HTH!
 
 Jay
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 





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




Re: [PHP] select box

2002-09-09 Thread Support @ Fourthrealm.com


If you want to put the SELECTED option into your select list while you are 
building the page, use an if statement in the option... ... something 
like this:

OPTION VALUE=1 ?php if ($this==$that) {echo SELECTED; } ? Option 1
OPTION VALUE=2 ?php if ($this==$that2) {echo SELECTED; } ? Option 2


Peter



At 02:05 PM 9/9/2002 +0300, you wrote:
Hi,

Can I put the selected option of select box   later by using php?

thanks



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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] Re: POST form variables not being sent to destination page

2002-09-09 Thread Erwin

 I've got an html form but when I use the POST method the form
 variables don't make it to the destination page, when I use the GET
 method, there's no problem.  I've uploaded the test pages to our web
 servers and the POST and GET methods both work fine, therefore I'm
 assuming it's a problem with my installation, which is;
 The test PHP is;

 Form Page:

 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-
 1 /head

 form action=b.php method=post name=bb
 input name=aa type=text value=12 size=10br
 input name=a1 type=submit
 /form
 body

Try adding another input name...etc. We've had a problem where we *always*
lost the first POST variable.

Grtz Erwin



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




[PHP] Session problem

2002-09-09 Thread John Wards

I am having problems with my sessions.

This function registered my username password and userid in the session no
problem.

function login_chk($username, $password){
 global $user_id;
 $user_res = mysql_query(SELECT * FROM fan_users WHERE name = '$username'
and password ='$password') or die(Line 21 .mysql_error());
 $count = mysql_num_rows($user_res);
 if($count ==1){
  $user_data = mysql_fetch_row($user_res);
  $user_id = $user_data[0];
  if(!session_is_registered(user_id)) session_register(user_id);
  if(!session_is_registered(username)) session_register(username);
  if(!session_is_registered(password)) session_register(password);
  $ok = 2;
 }
 else $ok =1;

 return $ok;
}//E-OF login_chk()

But this function will not  register the details in the session. It
registeres the variable but puts an ! before it.

function get_data($user_id){
 global $user_id;
 $data_res = mysql_query(SELECT t.*, l.* FROM fan_teams as t, fan_league as
l WHERE t.league_id = l.lid AND user_id =$user_id) or die(Line 93
.mysql_error());
 $count = mysql_num_rows($data_res);
 if($count != 1){
  setup_team_html($user_id);
  exit();
 }
 else{
  $data = mysql_fetch_row($data_res);
  if(!session_is_registered(data)) session_register(data);
 }

}//E-OF get_data($user_id)

The $data array is definatly an array as I have done foreach echo tests and
it dumps the information i am needing. but it won't put it in the session.

Would it have anything to do with me testing it on my windoze box?

Cheers
John Wards
SportNetwork.net


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




Re: [PHP] Session problem

2002-09-09 Thread John Wards

h I dunno why but if I returned $data from my function and registered it
out side the function it works fine and yes my session_start() is above my
function

John


 I am having problems with my sessions.

 This function registered my username password and userid in the session no
 problem.

 function login_chk($username, $password){
  global $user_id;
  $user_res = mysql_query(SELECT * FROM fan_users WHERE name = '$username'
 and password ='$password') or die(Line 21 .mysql_error());
  $count = mysql_num_rows($user_res);
  if($count ==1){
   $user_data = mysql_fetch_row($user_res);
   $user_id = $user_data[0];
   if(!session_is_registered(user_id)) session_register(user_id);
   if(!session_is_registered(username)) session_register(username);
   if(!session_is_registered(password)) session_register(password);
   $ok = 2;
  }
  else $ok =1;

  return $ok;
 }//E-OF login_chk()

 But this function will not  register the details in the session. It
 registeres the variable but puts an ! before it.

 function get_data($user_id){
  global $user_id;
  $data_res = mysql_query(SELECT t.*, l.* FROM fan_teams as t, fan_league
as
 l WHERE t.league_id = l.lid AND user_id =$user_id) or die(Line 93
 .mysql_error());
  $count = mysql_num_rows($data_res);
  if($count != 1){
   setup_team_html($user_id);
   exit();
  }
  else{
   $data = mysql_fetch_row($data_res);
   if(!session_is_registered(data)) session_register(data);
  }

 }//E-OF get_data($user_id)

 The $data array is definatly an array as I have done foreach echo tests
and
 it dumps the information i am needing. but it won't put it in the session.

 Would it have anything to do with me testing it on my windoze box?

 Cheers
 John Wards
 SportNetwork.net


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


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




[PHP] Weird fileupload problem

2002-09-09 Thread Trond Arve Nordheim

Hi!

I'm working on a simple file upload form here, where the user can upload
large zip files containing images to be added to the selected image
gallery...

However, uploading large files seems to be a little problem.. Whenever I
upload large files (the file I'm experimenting with is about 8MB) both
the $_POST and the $_FILES-arrays become completely empty.

In my post form I have POST_MAX set to 107374182400, and in a
.htaccess-file placed in the same directory as the upload scripts I have
the following lines;
php_flag upload_max_filesize 107374182400
php_flag max_file_size 107374182400
php_flag post_max_size 107374182400

...so, uploading small files works perfectly, but large files just
empties the superglobal arrays... Is there any other settings I have to
change for this to work?

-- 
Trond Arve Nordheim
 - This message is ROT13-encrypted twice for extra security.



msg78312/pgp0.pgp
Description: PGP signature


[PHP] Moduli per sablot

2002-09-09 Thread Agnoletto Christian

I need the sablot extension
Can someone send me the dll file? sablot.dll  LIBEXPAT.dll
 
Thank's

I can't log in Internet so please send me by email


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




Re: [PHP] checkbox question

2002-09-09 Thread Alex Shi

Thanks for your reply!

I tested $_SERVER['QUERY_STRING']. Seems like it only return the
string for get method but not for post. Any idea?

Alex



Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 If you cannot use square brackets, get the values yourself from
 $_SERVER['QUERY_STRING']

 Alex Shi wrote:

 How to ontain data from a group of checkbox using same name?
 For example, in a form there're 6 checkboxes and all named as
 Interesting_Area. I know if put a pairs of square brackets at the
 end of the name then in php all the values of them can be ontained.
 However, for some reason I cannot use square brackets. Please
 help me out if anyone know how to do the trick. THanks!
 
 Alex
 
 
 
 



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




php-general Digest 9 Sep 2002 14:31:11 -0000 Issue 1575

2002-09-09 Thread php-general-digest-help


php-general Digest 9 Sep 2002 14:31:11 - Issue 1575

Topics (messages 115697 through 115744):

Re: How to program very basic chat on PHP?
115697 by: M
115698 by: Justin French
115708 by: M

Problems with GD 2.0.1
115699 by: Ville Mattila

Re: turn register_globals on
115700 by: Tom Rogers
115702 by: Jome
115703 by: Steve Yates

Re: Upload Progress
115701 by: Jed Verity
115723 by: Luke Welling
115725 by: Erwin

Re: HTTP_SERVER_VARS not working. Please help
115704 by: Steve Yates

best way to turn a text file into tables in PHP
115705 by: Peter
115706 by: Justin French

Re: Upgrading PHP on Redhat
115707 by: ing.Martin Prásek

Re: imagecopyresized problems
115709 by: joakim.andersson.cybercom.se

Re: combine 2 integer
115710 by: Meltem Demirkus
115711 by: Meltem Demirkus
115712 by: mhe.ruc.dk
115713 by: Zak Greant
115714 by: Marek Kilimajer
115715 by: Scott Houseman

Re: checkbox question
115716 by: Marek Kilimajer
115728 by: Craig Donnelly
115744 by: Alex Shi

file upload  2 MB
115717 by: andy
115720 by: Erwin
115724 by: Paul Nicholson

Load / Stress Testing
115718 by: Dan Hardiker
115730 by: Leonid Mamtchenkov

select box
115719 by: Meltem Demirkus
115729 by: Craig Donnelly
115738 by: Support . Fourthrealm.com

date question
115721 by: Meltem Demirkus
115722 by: Erwin
115726 by: Rudolf Visagie

POST form variables not being sent to destination page
115727 by: Howard Roscoe
115735 by: . Edwin
115736 by: . Edwin
115739 by: Erwin

Re: Calculating Totals from table columns without a second query to the DB
115731 by: Jay Blanchard

Re: Troubles Inserting into MYSQL
115732 by: Jay Blanchard
115737 by: bbonkosk.tampabay.rr.com

PHP web mail forward feature
115733 by: Santosh Pasi

Re: help me regarding redirecting a page
115734 by: Support . Fourthrealm.com

Session problem
115740 by: John Wards
115741 by: John Wards

Weird fileupload problem
115742 by: Trond Arve Nordheim

Moduli per sablot
115743 by: Agnoletto Christian

Administrivia:

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

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

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


--

---BeginMessage---

Gerhard Hoogterp wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

  Hello Phil, your idea is interesting. I am evaluating it because it is not
  a true 'chat' (if user doesnt load any page he will never see incoming
  msg), but your idea is the only thing I have to this time.

 But with a frame or iframe and a little javascript the reloading can be
 automated..

 gerhard

Hello Gerhard, I had an idea, and would like  you say to me if it is possible or
not. I program little javascript, and I think there is a timer function into JS.

My question is: what if some timer start every nn seconds a function to read
stored msgs table?

My doubt is: how to start a function in JS to read a table?. Remember PHP and
Mysql are server-sided operations, while JS is cliente side op.

Maybe your idea is JS start a new window embedded into iframe, and this window
then would exec a PHP script to check msgs table.

Is this true?

Thanks

Mig



---End Message---
---BeginMessage---

An extremely basic chat would be a frame or iframe which has a meta tag
refresh (or javascript refresh) of a plain HTML page every 10-20 seconds.

As far as the flash stuff goes, have a look at macromedia.com or the 1000's
of flash sites... I'm positive you'll find some development tools for a
pre-built chat room that you can modify.  I'm certain I got one of
macromedia.com a few years back (flash 4 days i think).


Justin


on 09/09/02 12:37 PM, M ([EMAIL PROTECTED]) wrote:

 Gerhard Hoogterp wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hello Phil, your idea is interesting. I am evaluating it because it is not
 a true 'chat' (if user doesnt load any page he will never see incoming
 msg), but your idea is the only thing I have to this time.
 
 But with a frame or iframe and a little javascript the reloading can be
 automated..
 
 gerhard
 
 Hello Gerhard, I had an idea, and would like  you say to me if it is possible
 or
 not. I program little javascript, and I think there is a timer function into
 JS.
 
 My question is: what if some timer start every nn seconds a function to read
 stored msgs table?
 
 My doubt is: how to start a function in JS to read a table?. Remember PHP and
 Mysql are server-sided operations, while JS is cliente side op.
 
 Maybe your idea is JS start a new window embedded into iframe, and this window
 then would exec a 

[PHP] help with installation

2002-09-09 Thread R'twick Niceorgaw

Sure I'm missing some thing silly here but its monday morning :)
I have just installed php 4.2.3 with apache 1.3.26.
I have all loadmodule/addmodule as well as AddType x-httpd-php .php
directives present in httpd.conf. http://myhost/server-info  shows I have
php module loaded. But, when I browse a .php page, it asks me to save/open
the file and if I open it contains the actual source ofthe php file.

Any hints to fix it ?

R'twick



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




Re: [PHP] Weird fileupload problem

2002-09-09 Thread Paul Nicholson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,
First of all, you can *not* set the upload size via .htaccess. You have to 
set it in httpd.conf or php.ini. And you need to use php_value instead of 
php_flag.
Directory /dir/
   php_value upload_max_filesize 8M
/Directory
btw, this was discussed on the list within this monthread the archives  
the manual! :)
~Pauly

On Monday 09 September 2002 10:02 am, you wrote:
 Hi!

 I'm working on a simple file upload form here, where the user can upload
 large zip files containing images to be added to the selected image
 gallery...

 However, uploading large files seems to be a little problem.. Whenever I
 upload large files (the file I'm experimenting with is about 8MB) both
 the $_POST and the $_FILES-arrays become completely empty.

 In my post form I have POST_MAX set to 107374182400, and in a
 .htaccess-file placed in the same directory as the upload scripts I have
 the following lines;
 php_flag upload_max_filesize 107374182400
 php_flag max_file_size 107374182400
 php_flag post_max_size 107374182400

 ...so, uploading small files works perfectly, but large files just
 empties the superglobal arrays... Is there any other settings I have to
 change for this to work?

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
The webthe way you want it!
[EMAIL PROTECTED]

It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9fLAyDyXNIUN3+UQRAsnJAJ92QNDBWPdjkBjETbVSjlMlisF05wCghnDe
UFzBfSnQTEfZhvxgErpcMN0=
=6CvM
-END PGP SIGNATURE-

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




RE: [PHP] help with installation

2002-09-09 Thread Matt Schroebel

 From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, September 09, 2002 10:32 AM
 Subject: [PHP] help with installation
 
 Sure I'm missing some thing silly here but its monday morning :)
 I have just installed php 4.2.3 with apache 1.3.26.
 I have all loadmodule/addmodule as well as AddType x-httpd-php .php

Isn't it:
Addtype application/x-httpd-php .php


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




Re: [PHP] help with installation

2002-09-09 Thread R'twick Niceorgaw

I'm sorry.
but that's what I have in the config file. I just wrote it wronge here.
Here's my complete php related configuration


IfDefine PHP4
LoadModule php4_moduleextramodules/libphp4.so
/IfDefine

IfDefine PHP4
AddModule mod_php4.c
/IfDefine

AddType aplication/x-httpd-php .php
AddType application/x-httpd-php-source .phps

- Original Message -
From: Matt Schroebel [EMAIL PROTECTED]
To: 'R'twick Niceorgaw' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, September 09, 2002 10:37 AM
Subject: RE: [PHP] help with installation


  From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]]
  Sent: Monday, September 09, 2002 10:32 AM
  Subject: [PHP] help with installation
 
  Sure I'm missing some thing silly here but its monday morning :)
  I have just installed php 4.2.3 with apache 1.3.26.
  I have all loadmodule/addmodule as well as AddType x-httpd-php .php

 Isn't it:
 Addtype application/x-httpd-php .php





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




Re: [PHP] Session problem

2002-09-09 Thread @ Edwin


I think this one worked because

   if($count ==1){
$user_data = mysql_fetch_row($user_res);
$user_id = $user_data[0];  // --- of this
if(!session_is_registered(user_id)) session_register(user_id);
if(!session_is_registered(username)) session_register(username);
if(!session_is_registered(password)) session_register(password);
$ok = 2;
   }

The way you did here is kind of different from the above.

   else{
$data = mysql_fetch_row($data_res);
if(!session_is_registered(data)) session_register(data); //
[trouble*]
   }
 
  }//E-OF get_data($user_id)
 
  The $data array is definatly an array as I have done foreach echo tests
 and
  it dumps the information i am needing. but it won't put it in the
session.
 

*The reason _I think_ is because:

quoted
Note:  It is not currently possible to register resource variables in a
session. For example, you can not create a connection to a database and
store the connection id as a session variable and expect the connection to
still be valid the next time the session is restored. PHP functions that
return a resource are identified by having a return type of resource in
their function definitions. A list of functions that return resources are
available in the resource types appendix.
/quoted

from here: http://www.php.net/manual/en/function.session-register.php

- E

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




Re: [PHP] Load / Stress Testing

2002-09-09 Thread Chris Hewitt

Dan Hardiker wrote:


Ive thought of writting a load testing script, but Im not after
reinventing the wheel.

Dan,

Apache comes with ab for this sort of testing. man ab for details.

HTH
Chris




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




Re: [PHP] help with installation

2002-09-09 Thread @ Edwin

Of course, you restarted Apache?

Also, try leaving this out --- IfDefine PHP4/IfDefine and just write

  LoadModule php4_moduleextramodules/libphp4.so

(Applies to AddModule as well...)

And make sure that the extramodules folder does exists!

- E

On Monday, September 09, 2002 11:43 PM
R'twick Niceorgaw wrote:
 I'm sorry.
 but that's what I have in the config file. I just wrote it wronge here.
 Here's my complete php related configuration
 
 
 IfDefine PHP4
 LoadModule php4_moduleextramodules/libphp4.so
 /IfDefine
 
 IfDefine PHP4
 AddModule mod_php4.c
 /IfDefine
 
 AddType aplication/x-httpd-php .php
 AddType application/x-httpd-php-source .phps

/snip

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




Re: [PHP] Weird fileupload problem

2002-09-09 Thread Trond Arve Nordheim

On Mon, Sep 09, 2002 at 10:29:04AM -0400, Paul Nicholson wrote:
 Hey,
 First of all, you can *not* set the upload size via .htaccess. You have to 
 set it in httpd.conf or php.ini. And you need to use php_value instead of 
 php_flag.
 Directory /dir/
    php_value upload_max_filesize 8M
 /Directory

Actually, that didn't help :)
$_POST and $_FILES is still empty, and the httpd.conf (in the
virtualhost) reads like this;
php_value upload_max_filesize 100M
php_value max_file_size 100M
php_value post_max_size 100M
(tried to apply this both globally in the virtualhost and on a specified directory)

..and there's no .htaccess involved anymore.

 btw, this was discussed on the list within this monthread the archives  
 the manual! :)

I've read the manual, and all about the php variables I have to change... just can't 
recall reading anything about superglobals beeing emptied out :)
Reading the list archives as we speak ;)

-- 
Trond Arve Nordheim
 - This message is ROT13-encrypted twice for extra security.




msg78323/pgp0.pgp
Description: PGP signature


Re: [PHP] Calling info from mySQL inside flash

2002-09-09 Thread Thomas Edison Jr.

THANKS A TON!!!

--- Brad Bonkoski [EMAIL PROTECTED] wrote:
 How about giving this page a look over:
 http://www.macromedia.com/desdev/topics/php.html
 
 Here's an article especially for using PHP and MySQL
 with Flash MX

http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php.html
 
 HTH
 -Brad
 
 Thomas Edison Jr. wrote:
  
  I have a mySQL db, and a bunch of tables in it.
  What i want to do, is to pick up some data, and
  display in my Flash Movie.
  
  For example. I have a table with a list. Now on my
  main page, i display the total number of people in
 the
  list so far (By counting the rows). Now i want to
  display the same in my Flash movie.
  
  How can we exactly insert PHP Coding inside Flash
  Movie to make the code work? Any tips...
  
  Thanks,
  T. Edison Jr.
  
  __
  Do You Yahoo!?
  Yahoo! Finance - Get real-time stock quotes
  http://finance.yahoo.com
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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

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

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




[PHP] Re: POST form variables not being sent to destination page

2002-09-09 Thread Howard Roscoe

Hi Erwin,

Thanks for the reply but it turned out to be a slightly odd installation
bug.

On the PHP Bug board, I managed to find that it was to do with the Apache
configuration settings, namely, you should put

  AddType application/x-httpd-php .php .php3

instead of;

FilesMatch \.php$
  SetOutputFilter PHP
/FilesMatch

in the httpd.conf file.

This took ages to find and was only posted within that last few days on the
PHP bug board, hope it helps you with your elusive first POST variable.

Thanks for you help though,
Regards
Howard


Erwin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I've got an html form but when I use the POST method the form
  variables don't make it to the destination page, when I use the GET
  method, there's no problem.  I've uploaded the test pages to our web
  servers and the POST and GET methods both work fine, therefore I'm
  assuming it's a problem with my installation, which is;
  The test PHP is;
 
  Form Page:
 
  html
  head
  titleUntitled Document/title
  meta http-equiv=Content-Type content=text/html; charset=iso-8859-
  1 /head
 
  form action=b.php method=post name=bb
  input name=aa type=text value=12 size=10br
  input name=a1 type=submit
  /form
  body

 Try adding another input name...etc. We've had a problem where we
*always*
 lost the first POST variable.

 Grtz Erwin





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




Re: [PHP] Weird fileupload problem

2002-09-09 Thread Paul Nicholson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,
http://php.net/manual/en/features.file-upload.php
hmm.the max_file_size won't do anything - you should remove it.
The post_max_size should be larger than the upload_max_filesize  you might 
just to check memory limit..that has to be larger than the 
post_max_size. 
You might want to look at the html form as wellshould have a
hidden field like:
input type=hidden name=MAX_FILE_SIZE value=a value in bytes
Make sure that the value is high enough. 
If it still fails, get the output of phpinfo() and send it to me. Also 
include the html form and target file size...100M is a lot, I hope its just a 
temp value:)
HTH!
~Pauly

On Monday 09 September 2002 11:22 am, Trond Arve Nordheim wrote:
 On Mon, Sep 09, 2002 at 10:29:04AM -0400, Paul Nicholson wrote:
  Hey,
  First of all, you can *not* set the upload size via .htaccess. You have
  to set it in httpd.conf or php.ini. And you need to use php_value instead
  of php_flag.
  Directory /dir/
     php_value upload_max_filesize 8M
  /Directory

 Actually, that didn't help :)
 $_POST and $_FILES is still empty, and the httpd.conf (in the
 virtualhost) reads like this;
 php_value upload_max_filesize 100M
 php_value max_file_size 100M
 php_value post_max_size 100M
 (tried to apply this both globally in the virtualhost and on a specified
 directory)

 ..and there's no .htaccess involved anymore.

  btw, this was discussed on the list within this monthread the
  archives  the manual! :)

 I've read the manual, and all about the php variables I have to change...
 just can't recall reading anything about superglobals beeing emptied out :)
 Reading the list archives as we speak ;)

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
The webthe way you want it!
[EMAIL PROTECTED]

It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9fMMKDyXNIUN3+UQRArY2AJ9rQkjp1DthR6P/gfTJrWhU4tPavQCeN1Io
/xOnrZsxVlgJ0HwXfxweymw=
=hevu
-END PGP SIGNATURE-

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




[PHP] IMAP - Moving messages between folders

2002-09-09 Thread N. Pari Purna Chand

Hi all imap gurus out there,

I have sruggling for quite some time to get the
imap_mail_move() function to work.

Imap server : Courier IMAP
PHP Version : 4.1.2

?
...
$connectstring = $usr_inmailserver. / . $usr_accessmethod . : .
$usr_inmailport;
$mbox = imap_open({ . $connectstring . }INBOX, $usr_username,
$usr_password);
if (!$mbox) {echo NOT LOGGED IN TO IMAP SERVER;exit();}

reset($msg);
$messageset = implode (,,$msg);
imap_mail_move($mbox,$messageset,Inbox..$movetofolder);
imap_expunge($mbox);
imap_close($mbox);
.
?

where $msg is an array of imap-mailid's which are to be moved from INBOX to
$movetofolder.

But the above code is not working and is not giving any errors also !!?

regards
/Chandu





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




Re: [PHP] \n to BR Problem

2002-09-09 Thread yasin inat

try   this   function 

nltobr()



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




[PHP] Re: date question

2002-09-09 Thread yasin inat

oradaki   bir   gun  kavramini  biraz  daha  açarsan  yardim  edebilirim -
umarim -

timestamp  mi   yoksa   baska  -daha  özel  bir-   formatta   mi  ?



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




[PHP] Re: select box

2002-09-09 Thread yasin inat

evet   koyabilirsin


degerini   bastan   verdigin   bir   degiskenle :
?  $selected=SELECTED;  ?

select
option name=bla blabla  bla
option?=$selected ?display  first
/select

her   defasindaselected   olan   degisecekse ...

? $selected=option selecteddisplay  first  or.$baskadegisken; ?

select
option name=bla blabla  bla
?=$selected ?
/select

   kolay   gelsin 



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




[PHP] PHP + Flash Die??????

2002-09-09 Thread Wilfredo I. Pachón López

Hello every body:

I'm creating a web aplication that allow modify dinamically a Flash 
movie with data extracted from a data base.

I download PHP 4.2.3 and the libswf library from sgi... and compile PHP with 
swf, aparently this work: the configure step is done without problems, too 
make and make install, when i try with the phpinfo() funtion appear that swf 
support was enable, but when i try to run de example or try with other 
parameters my browser show: Conection broken or when i view trought a proxy 
say  error void answer (size 0).

I don't understand why, because all other functions in PHP (Databases and 
others) funtion properly, the only problem is with SWF.
In the error log of the web server (Apache on R.H. Linux) appear  [notice] 
child pid xxx exit signal Segmentation fault (11)

Please help me.



Att:
 ,, 
/  \ 
   ((__-^^-,-^^-__)).-.
`-_---' `---_-'  Wilfredo I. Pachón López   /v\
 `--|o` 'o|--'   GNU/Linux registered user // \\
\  `  /  #175316  /(   )\
 ): :( ^^-^^
 :o_o: 
  - 
No a los adjuntos de Word(http://www.gnu.org/philosophy/no-word-
attachments.es.html) 
--
Visita nuestro portal web www.canapro.org.co

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




Re: [PHP] about whitespace

2002-09-09 Thread yasin inat

http://www.php.net/manual/en/function.trim.php

for   the  beginning   of   string   use  ltrim()
vice  versa   rtrim()



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




[PHP] PHP Source files

2002-09-09 Thread OrangeHairedBoy

I'm wondering if anyone knows where I can find information about how PHP
parser processes commands like:

$a=$b+$c;
if ($b  $a) {}

(Ones with operators)

I've downloaded the source code, but I'm having much luck narrowing down my
search. Can anyone help me??

Thanks!



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




[PHP] RE: A straightforward user login coding

2002-09-09 Thread YC Nyon

I been searching for a user authentication codes all night but got no where
with the results.
Therefore, if someone can tell me where to find
1. a user authentication using Mysql
2. don't use cookies.
3. also a logout script.

my os is windows.

TIA
Nyon


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




Re: [PHP] RE: A straightforward user login coding

2002-09-09 Thread Adam Williams

search google for using PHP sessions and you will print the session ID
into the URL.

Adam

On Tue, 10 Sep 2002, YC Nyon wrote:

 I been searching for a user authentication codes all night but got no where
 with the results.
 Therefore, if someone can tell me where to find
 1. a user authentication using Mysql
 2. don't use cookies.
 3. also a logout script.

 my os is windows.

 TIA
 Nyon





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




Re: [PHP] PHP Source files

2002-09-09 Thread Adam Voigt

Umm, maybe I'm confused, but here's an answer, not
sure if it's right:

The code in the braces will never be executed
because $a will always be ateast $b if not greater
(assuming $c has a value) which means that it couldn't
be greater, however it could be = if $c was 0.

Adam Voigt
[EMAIL PROTECTED]

On Mon, 2002-09-09 at 12:40, OrangeHairedBoy wrote:
 I'm wondering if anyone knows where I can find information about how PHP
 parser processes commands like:
 
 $a=$b+$c;
 if ($b  $a) {}
 
 (Ones with operators)
 
 I've downloaded the source code, but I'm having much luck narrowing down my
 search. Can anyone help me??
 
 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] PHP Source files

2002-09-09 Thread Matt Schroebel

 From: OrangeHairedBoy [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, September 09, 2002 12:41 PM
 Subject: [PHP] PHP Source files
 
 I'm wondering if anyone knows where I can find information 
 about how PHP
 parser processes commands like:
 
 $a=$b+$c;
 if ($b  $a) {}
 
 (Ones with operators)
 
 I've downloaded the source code, but I'm having much luck 
 narrowing down my
 search. Can anyone help me??

http://www.php.net/manual/en/language.operators.php

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




RE: [PHP] RE: A straightforward user login coding

2002-09-09 Thread Steve Bradwell

Hey there,

This is a page I wrote that does that with sessions, sorry its a little
messy but it should help you with the general idea.

HTH,
Steve.


//Copy the below into a php file and change all the variables and sql
statement to reflect your own data.

?
session_start();
if(isset($level)) session_destroy();
if (isset($submitbutton)):
$dbname   = 'put yours here';
$hostname = 'put yours here';
$username = 'put yours here';
$password = 'put yours here';
$table = 'put yours here';

$id_link = mysql_connect($hostname, $username, $password);

if (!$id_link  || !mysql_select_db($dbname)):
echo 'htmlheadtitleError/title/headbody';
echo '1:Connection to PHP has failed.';
echo '/body/html';
exit();
endif;


$login_query = SELECT l.LEVEL, l.Name, s.PLANT, s.Super_Index, p.PLANT as
itemtable FROM Master.login l;
$login_query.=  INNER JOIN Master.supervisors s ON l.Paswd_Index =;
$login_query.=  s.Login_Index INNER JOIN Master.plant_code p ON s.PLANT =
p.PLANT_CODE;
$login_query.=  WHERE l.USER='$user' AND l.PASSWORD='$pwd';

$class_login = mysql_db_query($dbname,$login_query,$id_link) or die(Please
contact HR to be added to supervisors list.);

while ($login_arr = mysql_fetch_array($class_login)):
 $level = $login_arr['LEVEL'];
 $Name = $login_arr['Name'];
 $Location = $login_arr['PLANT'];
 $Super = $login_arr['Super_Index'];
 $Items_Table = Stores.items_.$login_arr['itemtable'];
endwhile;
if (isset($level)){
session_start();
session_register(level);
session_register(Name);
session_register(Super);
session_register(Location);
session_register(Items_Table);
$page = main.php?option=vieworders;
header(Location: $page);
}
 else
  echo div align=centerh3font color=redLogin bNOT/b Successful,
Please try again./font/h3/div;
endif;
?
link rel=stylesheet href=nice.css type=text/css
html
body bgcolor=#F5F5F5 OnLoad=document.login.user.focus();
divnbsp;/div
p
p
divnbsp;/div
p
div align=centerh3Enter user/pwd to enter Stores Administration
Panel./h3/div
FORM METHOD=post name=login ACTION=?
echoindex.php?option=vieworders?
table border=0 width=75% align=center
tr
td align=center bgcolor=#FFimg src=../../imgs/LOGO3_18.bmp
height=250 width=500/td
/tr
tr
td bgcolor=#CC align=centernbsp;nbsp;font
color=#00biUser Name: /i/b/fontinput type=text
name=user class=TextBox_b
nbsp;nbsp;font color=#00biPassword: /i/b/fontinput
type=password name=pwd class=TextBox_bnbsp;nbsp;input
type=submit name=submitbutton value=Login class=Button_F/td
/tr
/table
/body
/html

-Original Message-
From: YC Nyon [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: A straightforward user login coding


I been searching for a user authentication codes all night but got no where
with the results.
Therefore, if someone can tell me where to find
1. a user authentication using Mysql
2. don't use cookies.
3. also a logout script.

my os is windows.

TIA
Nyon


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

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




Re: [PHP] PHP Source files

2002-09-09 Thread OrangeHairedBoy

No, but that's ok...

What am looking to learn is HOW php makes those kind of expressiong work. I
know how to write php intematly, but I'd like to know where in the
downloadable PHP source code it processes these statements.

Any help on that??

Lewis


Adam Voigt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Umm, maybe I'm confused, but here's an answer, not
 sure if it's right:

 The code in the braces will never be executed
 because $a will always be ateast $b if not greater
 (assuming $c has a value) which means that it couldn't
 be greater, however it could be = if $c was 0.

 Adam Voigt
 [EMAIL PROTECTED]

 On Mon, 2002-09-09 at 12:40, OrangeHairedBoy wrote:
  I'm wondering if anyone knows where I can find information about how PHP
  parser processes commands like:
 
  $a=$b+$c;
  if ($b  $a) {}
 
  (Ones with operators)
 
  I've downloaded the source code, but I'm having much luck narrowing down
my
  search. Can anyone help me??
 
  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] PHP Source files

2002-09-09 Thread OrangeHairedBoy

I know how to use these statements. What I'd like to know is how the PHP
parser makes it happen. Where in the downloadble PHP source code is the C
code that actually reads the statement, figures out what needs to happen,
and makes it happen?

Can you help me on this?

Lewis


Matt Schroebel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  From: OrangeHairedBoy [mailto:[EMAIL PROTECTED]]
  Sent: Monday, September 09, 2002 12:41 PM
  Subject: [PHP] PHP Source files
 
  I'm wondering if anyone knows where I can find information
  about how PHP
  parser processes commands like:
 
  $a=$b+$c;
  if ($b  $a) {}
 
  (Ones with operators)
 
  I've downloaded the source code, but I'm having much luck
  narrowing down my
  search. Can anyone help me??

 http://www.php.net/manual/en/language.operators.php



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




Re: [PHP] PHP Source files

2002-09-09 Thread Adam Voigt

Oh, ok, I was wondering cause I thought the question was
fairly basic, as for where in the actual source code to PHP expressions
are processed I have no idea. I bet they know in the php-dev mailing
list though, you might want to try there.

Adam Voigt
[EMAIL PROTECTED]

On Mon, 2002-09-09 at 12:55, OrangeHairedBoy wrote:
 No, but that's ok...
 
 What am looking to learn is HOW php makes those kind of expressiong work. I
 know how to write php intematly, but I'd like to know where in the
 downloadable PHP source code it processes these statements.
 
 Any help on that??
 
 Lewis
 
 
 Adam Voigt [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Umm, maybe I'm confused, but here's an answer, not
  sure if it's right:
 
  The code in the braces will never be executed
  because $a will always be ateast $b if not greater
  (assuming $c has a value) which means that it couldn't
  be greater, however it could be = if $c was 0.
 
  Adam Voigt
  [EMAIL PROTECTED]
 
  On Mon, 2002-09-09 at 12:40, OrangeHairedBoy wrote:
   I'm wondering if anyone knows where I can find information about how PHP
   parser processes commands like:
  
   $a=$b+$c;
   if ($b  $a) {}
  
   (Ones with operators)
  
   I've downloaded the source code, but I'm having much luck narrowing down
 my
   search. Can anyone help me??
  
   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
 



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




Re: [PHP] PHP Source files

2002-09-09 Thread OrangeHairedBoy

Hey, that's a starting point!!! :)

Thanks


Adam Voigt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Oh, ok, I was wondering cause I thought the question was
 fairly basic, as for where in the actual source code to PHP expressions
 are processed I have no idea. I bet they know in the php-dev mailing
 list though, you might want to try there.

 Adam Voigt
 [EMAIL PROTECTED]

 On Mon, 2002-09-09 at 12:55, OrangeHairedBoy wrote:
  No, but that's ok...
 
  What am looking to learn is HOW php makes those kind of expressiong
work. I
  know how to write php intematly, but I'd like to know where in the
  downloadable PHP source code it processes these statements.
 
  Any help on that??
 
  Lewis
 
 
  Adam Voigt [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Umm, maybe I'm confused, but here's an answer, not
   sure if it's right:
  
   The code in the braces will never be executed
   because $a will always be ateast $b if not greater
   (assuming $c has a value) which means that it couldn't
   be greater, however it could be = if $c was 0.
  
   Adam Voigt
   [EMAIL PROTECTED]
  
   On Mon, 2002-09-09 at 12:40, OrangeHairedBoy wrote:
I'm wondering if anyone knows where I can find information about how
PHP
parser processes commands like:
   
$a=$b+$c;
if ($b  $a) {}
   
(Ones with operators)
   
I've downloaded the source code, but I'm having much luck narrowing
down
  my
search. Can anyone help me??
   
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
 





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




RE: [PHP] Upload Progress

2002-09-09 Thread Jay Blanchard

[snip]
There really isn't a great solution for this, that I know of. It's one of
the few things that makes an argument for ASP over PHP, as far as I'm
concerned (if you have the luxury of choosing). Below is what I did once to
try to get around the problem. It worked *okay*.
[/snip]

How does this argue for ASP over PHP? I don't see how. File upload on PHP is
built in and therefore free. ASP file upload mechs cost more money. And,
having used ASP for a while, and having looked for this feature, no upload
progress bar exists there either. And PHP is a language, where ASP is a
service ... please do not confuse the two. If you want to argue VBScript vs.
PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
curly-brace tied behind its back.

I mentioned a while back, when this came up before (see the archives) that
this could probably be done with an IFRAME in the upload dialog box. Now I
haven't given this much thought, but maybe it could be done. The largest
problem that I see is the communication back and forth between client and
server. The server would have to know the original size of the file at the
point the upload is started, then it would be checked for original_size
minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph, and
continue to do this as it went on.

Another method is to start the upload with a non-progressive animation that
quits when is_upload_file() returns true.

Jay



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




Re: [PHP] Upload Progress

2002-09-09 Thread Jed Verity

You're right about it costing more money. But we had one server handling a
bunch of uploads, most of them over 25 MB, and 99% being instigated by very
impatient, not very technical, people. People who kept canceling and
canceling, despite our directions, because they thought it was stuck or
frozen or taking too long. It was worth $150 for us to buy the ASP component
(I think we used ABCUpload, maybe?). The development time required for a
creative PHP solution -- and one that might not have worked as well -- would
have been dramatically more expensive than the almost out-of-the-box
solution with ASP's components. (And much of the site was already written in
ASP.)

Other than that, you'll get know argument from me about ASP vs. PHP. I'm
head over heels for PHP and, in any context other than the one stated above
(and maybe one or two others), I would choose to use God Blessed PHP over
anything else.

Cheers!
Jed

P.S. I knew I'd get some fighters with that comment. Haven't learned my
lesson yet... ;-)

On the threshold of genius, Jay Blanchard wrote:

 [snip]
 There really isn't a great solution for this, that I know of. It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing). Below is what I did once to
 try to get around the problem. It worked *okay*.
 [/snip]
 
 How does this argue for ASP over PHP? I don't see how. File upload on PHP is
 built in and therefore free. ASP file upload mechs cost more money. And,
 having used ASP for a while, and having looked for this feature, no upload
 progress bar exists there either. And PHP is a language, where ASP is a
 service ... please do not confuse the two. If you want to argue VBScript vs.
 PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
 curly-brace tied behind its back.
 
 I mentioned a while back, when this came up before (see the archives) that
 this could probably be done with an IFRAME in the upload dialog box. Now I
 haven't given this much thought, but maybe it could be done. The largest
 problem that I see is the communication back and forth between client and
 server. The server would have to know the original size of the file at the
 point the upload is started, then it would be checked for original_size
 minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph, and
 continue to do this as it went on.
 
 Another method is to start the upload with a non-progressive animation that
 quits when is_upload_file() returns true.
 
 Jay
 
 


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




[PHP] RE: Session seams to be clearing randomly

2002-09-09 Thread David Cramblett

   Hello,

I am having trouble with my session clearing after a few clicks around 
the application.  The session is started in a header which is loaded 
first on every page in my application and I can not isolate the clearing 
to one page or link, it seams to be random.  I can click maybe 10 - 20 
links, even back and forth between the same two links and then the 
session clears for no apparent reason.  I use almost identical session 
handling and startup on many other applications on different servers, I 
only seem to have this problem on this particular server.

PHP is running as an Apache module on a Linux/Intel server and my 
application uses a Postgres DB Back End.  PHP is version 4.1.2. (Yes I 
would like to be using the most current version but this is not my 
server, so please don't suggest an update, unless you know that there 
was a problem with this in older versions of PHP that can be worked around.)

Session Lifetime is set to 0  and Session Garbage Collection is set to 
24 minutes in the php.ini file.

Thanks,

David

-- 
David Cramblett
Multnomah Education Service Dist.
Network and Information Services
503-257-1535
fax 503-257-1538



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




Re: [PHP] RE: Session seams to be clearing randomly

2002-09-09 Thread David Cramblett

Additionally,

I forgot to mention that the session file is still viewable in the tmp 
directory after the session clears.

David

David Cramblett wrote:

   Hello,

 I am having trouble with my session clearing after a few clicks around 
 the application.  The session is started in a header which is loaded 
 first on every page in my application and I can not isolate the 
 clearing to one page or link, it seams to be random.  I can click 
 maybe 10 - 20 links, even back and forth between the same two links 
 and then the session clears for no apparent reason.  I use almost 
 identical session handling and startup on many other applications on 
 different servers, I only seem to have this problem on this particular 
 server.

 PHP is running as an Apache module on a Linux/Intel server and my 
 application uses a Postgres DB Back End.  PHP is version 4.1.2. (Yes I 
 would like to be using the most current version but this is not my 
 server, so please don't suggest an update, unless you know that there 
 was a problem with this in older versions of PHP that can be worked 
 around.)

 Session Lifetime is set to 0  and Session Garbage Collection is set to 
 24 minutes in the php.ini file.

 Thanks,

 David





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




RE: [PHP] Upload Progress

2002-09-09 Thread David Buerer

Ya' know guys i'm sitting here thinking about this problem because I have
the same problem on one of my sites.  A bunch of inpatient stupid users whom
are click happy when they get impatient. Event a 100K upload can take to
long!

I don't like the ASP idea.  It's really not a good solution.  I'm almost
wondering if a JAVA solution which can do FTP directly or maybe a direct
socket connection/transfer with Macromedia Flash would work. Both of these
ways you could better monitor what's going on at the packet level and
therefore giving a lot of control over something like a progress bar.  Who
knows.  It's got to be something other than PHP though because PHP is after
all only a server side language.

-Original Message-
From: Jed Verity [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:08 AM
To: Jay Blanchard; [EMAIL PROTECTED]
Subject: Re: [PHP] Upload Progress


You're right about it costing more money. But we had one server handling a
bunch of uploads, most of them over 25 MB, and 99% being instigated by very
impatient, not very technical, people. People who kept canceling and
canceling, despite our directions, because they thought it was stuck or
frozen or taking too long. It was worth $150 for us to buy the ASP component
(I think we used ABCUpload, maybe?). The development time required for a
creative PHP solution -- and one that might not have worked as well -- would
have been dramatically more expensive than the almost out-of-the-box
solution with ASP's components. (And much of the site was already written in
ASP.)

Other than that, you'll get know argument from me about ASP vs. PHP. I'm
head over heels for PHP and, in any context other than the one stated above
(and maybe one or two others), I would choose to use God Blessed PHP over
anything else.

Cheers!
Jed

P.S. I knew I'd get some fighters with that comment. Haven't learned my
lesson yet... ;-)

On the threshold of genius, Jay Blanchard wrote:

 [snip]
 There really isn't a great solution for this, that I know of. It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing). Below is what I did once
to
 try to get around the problem. It worked *okay*.
 [/snip]
 
 How does this argue for ASP over PHP? I don't see how. File upload on PHP
is
 built in and therefore free. ASP file upload mechs cost more money. And,
 having used ASP for a while, and having looked for this feature, no upload
 progress bar exists there either. And PHP is a language, where ASP is a
 service ... please do not confuse the two. If you want to argue VBScript
vs.
 PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
 curly-brace tied behind its back.
 
 I mentioned a while back, when this came up before (see the archives) that
 this could probably be done with an IFRAME in the upload dialog box. Now I
 haven't given this much thought, but maybe it could be done. The largest
 problem that I see is the communication back and forth between client and
 server. The server would have to know the original size of the file at the
 point the upload is started, then it would be checked for original_size
 minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph,
and
 continue to do this as it went on.
 
 Another method is to start the upload with a non-progressive animation
that
 quits when is_upload_file() returns true.
 
 Jay
 
 


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




RE: [PHP] RE: Session seams to be clearing randomly

2002-09-09 Thread David Buerer

I would bet money on the fact that one of your pages doesn't have a session
start in it. Or there is a link which which requires resets the browser and
initiates the creation of  new session. I've had some problems before with
javascript and top.window.location redirections that when set to
http://site/file.php instead of just  /file.php it resets the session.

-Original Message-
From: David Cramblett [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:38 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: Session seams to be clearing randomly


Additionally,

I forgot to mention that the session file is still viewable in the tmp 
directory after the session clears.

David

David Cramblett wrote:

   Hello,

 I am having trouble with my session clearing after a few clicks around 
 the application.  The session is started in a header which is loaded 
 first on every page in my application and I can not isolate the 
 clearing to one page or link, it seams to be random.  I can click 
 maybe 10 - 20 links, even back and forth between the same two links 
 and then the session clears for no apparent reason.  I use almost 
 identical session handling and startup on many other applications on 
 different servers, I only seem to have this problem on this particular 
 server.

 PHP is running as an Apache module on a Linux/Intel server and my 
 application uses a Postgres DB Back End.  PHP is version 4.1.2. (Yes I 
 would like to be using the most current version but this is not my 
 server, so please don't suggest an update, unless you know that there 
 was a problem with this in older versions of PHP that can be worked 
 around.)

 Session Lifetime is set to 0  and Session Garbage Collection is set to 
 24 minutes in the php.ini file.

 Thanks,

 David





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




[Fwd: Re: [PHP] RE: Session seams to be clearing randomly]

2002-09-09 Thread David Cramblett



David B,

Thanks for suggestions, but this is a very basic app, again it has only 
three php scripts which it runs and all three load (include) the exact 
same header file which starts the session.  Also, again, when clicking 
on the links, which basically just switch between the three php scripts, 
I can click  the the same link over and over again (or back and forth 
between two links) and it works just fine (for 5-10 clicks for 
instance), then all of a sudden the next time it clears. There is no 
javascript being used in this application.  Your notion of giving a 
complete url with a link or redirection sounded intriguing, 
unfortunately after a quick scan of my app they do not use the full url 
only file.php example.

Thanks again,

David

-- 
David Cramblett
Multnomah Education Service Dist.
Network and Information Services
503-257-1535
fax 503-257-1538




David Buerer wrote:

I would bet money on the fact that one of your pages doesn't have a session
start in it. Or there is a link which which requires resets the browser and
initiates the creation of  new session. I've had some problems before with
javascript and top.window.location redirections that when set to
http://site/file.php instead of just  /file.php it resets the session.

-Original Message-
From: David Cramblett [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:38 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: Session seams to be clearing randomly


Additionally,

I forgot to mention that the session file is still viewable in the tmp 
directory after the session clears.

David

David Cramblett wrote:

  Hello,

I am having trouble with my session clearing after a few clicks around 
the application.  The session is started in a header which is loaded 
first on every page in my application and I can not isolate the 
clearing to one page or link, it seams to be random.  I can click 
maybe 10 - 20 links, even back and forth between the same two links 
and then the session clears for no apparent reason.  I use almost 
identical session handling and startup on many other applications on 
different servers, I only seem to have this problem on this particular 
server.

PHP is running as an Apache module on a Linux/Intel server and my 
application uses a Postgres DB Back End.  PHP is version 4.1.2. (Yes I 
would like to be using the most current version but this is not my 
server, so please don't suggest an update, unless you know that there 
was a problem with this in older versions of PHP that can be worked 
aro
und.)

Session Lifetime is set to 0  and Session Garbage Collection is set to 
24 minutes in the php.ini file.

Thanks,

David







-- 
David Cramblett
Multnomah Education Service Dist.
Network and Information Services
503-257-1535
fax 503-257-1538





Re: [PHP] Upload Progress

2002-09-09 Thread Paul Roberts

why not just get creative, pop up a window on submit with an animated gif of a dot 
moving back and forth or similar and an uploading message and then close it when the 
page reloads.

most of these things on have nothing to do with progress of what's really happening in 
my experience.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]

- Original Message - 
From: David Buerer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 09, 2002 7:20 PM
Subject: RE: [PHP] Upload Progress


Ya' know guys i'm sitting here thinking about this problem because I have
the same problem on one of my sites.  A bunch of inpatient stupid users whom
are click happy when they get impatient. Event a 100K upload can take to
long!

I don't like the ASP idea.  It's really not a good solution.  I'm almost
wondering if a JAVA solution which can do FTP directly or maybe a direct
socket connection/transfer with Macromedia Flash would work. Both of these
ways you could better monitor what's going on at the packet level and
therefore giving a lot of control over something like a progress bar.  Who
knows.  It's got to be something other than PHP though because PHP is after
all only a server side language.

-Original Message-
From: Jed Verity [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:08 AM
To: Jay Blanchard; [EMAIL PROTECTED]
Subject: Re: [PHP] Upload Progress


You're right about it costing more money. But we had one server handling a
bunch of uploads, most of them over 25 MB, and 99% being instigated by very
impatient, not very technical, people. People who kept canceling and
canceling, despite our directions, because they thought it was stuck or
frozen or taking too long. It was worth $150 for us to buy the ASP component
(I think we used ABCUpload, maybe?). The development time required for a
creative PHP solution -- and one that might not have worked as well -- would
have been dramatically more expensive than the almost out-of-the-box
solution with ASP's components. (And much of the site was already written in
ASP.)

Other than that, you'll get know argument from me about ASP vs. PHP. I'm
head over heels for PHP and, in any context other than the one stated above
(and maybe one or two others), I would choose to use God Blessed PHP over
anything else.

Cheers!
Jed

P.S. I knew I'd get some fighters with that comment. Haven't learned my
lesson yet... ;-)

On the threshold of genius, Jay Blanchard wrote:

 [snip]
 There really isn't a great solution for this, that I know of. It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing). Below is what I did once
to
 try to get around the problem. It worked *okay*.
 [/snip]
 
 How does this argue for ASP over PHP? I don't see how. File upload on PHP
is
 built in and therefore free. ASP file upload mechs cost more money. And,
 having used ASP for a while, and having looked for this feature, no upload
 progress bar exists there either. And PHP is a language, where ASP is a
 service ... please do not confuse the two. If you want to argue VBScript
vs.
 PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
 curly-brace tied behind its back.
 
 I mentioned a while back, when this came up before (see the archives) that
 this could probably be done with an IFRAME in the upload dialog box. Now I
 haven't given this much thought, but maybe it could be done. The largest
 problem that I see is the communication back and forth between client and
 server. The server would have to know the original size of the file at the
 point the upload is started, then it would be checked for original_size
 minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph,
and
 continue to do this as it went on.
 
 Another method is to start the upload with a non-progressive animation
that
 quits when is_upload_file() returns true.
 
 Jay
 
 


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




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




Re: [PHP] Upload Progress

2002-09-09 Thread Paul Roberts

your problem is nothing seems to happen when they click the submit button, you can use 
JavaScript to prevent re-submission, change the text on the submit button or you could 
even pop up a window on submit with an animated gif of a dot moving back and forth or 
similar and an uploading message and then close it when the page reloads.

Just a few ideas.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]

- Original Message - 
From: David Buerer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 09, 2002 7:20 PM
Subject: RE: [PHP] Upload Progress


Ya' know guys i'm sitting here thinking about this problem because I have
the same problem on one of my sites.  A bunch of inpatient stupid users whom
are click happy when they get impatient. Event a 100K upload can take to
long!

I don't like the ASP idea.  It's really not a good solution.  I'm almost
wondering if a JAVA solution which can do FTP directly or maybe a direct
socket connection/transfer with Macromedia Flash would work. Both of these
ways you could better monitor what's going on at the packet level and
therefore giving a lot of control over something like a progress bar.  Who
knows.  It's got to be something other than PHP though because PHP is after
all only a server side language.

-Original Message-
From: Jed Verity [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:08 AM
To: Jay Blanchard; [EMAIL PROTECTED]
Subject: Re: [PHP] Upload Progress


You're right about it costing more money. But we had one server handling a
bunch of uploads, most of them over 25 MB, and 99% being instigated by very
impatient, not very technical, people. People who kept canceling and
canceling, despite our directions, because they thought it was stuck or
frozen or taking too long. It was worth $150 for us to buy the ASP component
(I think we used ABCUpload, maybe?). The development time required for a
creative PHP solution -- and one that might not have worked as well -- would
have been dramatically more expensive than the almost out-of-the-box
solution with ASP's components. (And much of the site was already written in
ASP.)

Other than that, you'll get know argument from me about ASP vs. PHP. I'm
head over heels for PHP and, in any context other than the one stated above
(and maybe one or two others), I would choose to use God Blessed PHP over
anything else.

Cheers!
Jed

P.S. I knew I'd get some fighters with that comment. Haven't learned my
lesson yet... ;-)

On the threshold of genius, Jay Blanchard wrote:

 [snip]
 There really isn't a great solution for this, that I know of. It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing). Below is what I did once
to
 try to get around the problem. It worked *okay*.
 [/snip]
 
 How does this argue for ASP over PHP? I don't see how. File upload on PHP
is
 built in and therefore free. ASP file upload mechs cost more money. And,
 having used ASP for a while, and having looked for this feature, no upload
 progress bar exists there either. And PHP is a language, where ASP is a
 service ... please do not confuse the two. If you want to argue VBScript
vs.
 PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
 curly-brace tied behind its back.
 
 I mentioned a while back, when this came up before (see the archives) that
 this could probably be done with an IFRAME in the upload dialog box. Now I
 haven't given this much thought, but maybe it could be done. The largest
 problem that I see is the communication back and forth between client and
 server. The server would have to know the original size of the file at the
 point the upload is started, then it would be checked for original_size
 minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph,
and
 continue to do this as it went on.
 
 Another method is to start the upload with a non-progressive animation
that
 quits when is_upload_file() returns true.
 
 Jay
 
 


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





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




[PHP] Output Buffering issues with 4.1.2

2002-09-09 Thread Ron Dyck

I seem to have some trouble with a script using the output buffering
functions on a server running v4.1.2.
Everything works fine on the box with 4.2.2. Is this an issue with 4.1.2?

===
  Ron Dyck
  WebbTech
  www.webbtech.net
  [EMAIL PROTECTED]



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




[PHP] Web Client - How to open applications by their own.

2002-09-09 Thread Okar

I m using the following attachment handling code in my web client
?
// supposing that:
// $encoding = 'BASE64';
// $pid = attachment's pid;
// $file = attachment's file name;
// $size = $object-bytes;
// $type = $object-type;
// $subtype = $object-subtype;
//...
$attch = imap_base64(imap_fetchbody($mbox, $id, $pid));
//...
$types = array(text, multipart, message, application, audio,
image, video, other);
$cont_type = $types[$type]./.$subtype;
header(Content-transfer-encoding: binary\n);
header(Content-type: $cont_type\n);
if (strstr($_SERVER[HTTP_USER_AGENT], MSIE))
  header(Content-Disposition: filename=$file\n); // For IE
else
  header(Content-Disposition: attachment; filename=$file\n); // For non-IE
browsers
header(Content-length: $size\n );
print $attch;
?
Regardless the nature of the attachment, things are happening expectedly (as
far as I tested) as long as the SAVE button of the browser's save-file
dialog is clicked.
The OPEN button works fine as well, for browser compatible files such as
.jpeg, .gif, .txt, etc...
But when it's matter of opening per ex. a MSPoverPoint *.pps slide-show file
as attachment through the browser's save-file dialog (well, the button is
there and any user may click it) the smooth running web client turns into a
PoverPoint application opened through the browser's window with an empty
project in design view.
Wrapping above code with
?
 $tmpfname = tempnam (0, 0);
 $fp = fopen($tmpfname, w);
 fwrite($fp, $attch);
 fclose($fp);
...
 unlink($tmpfname);
?
didn't help too much.
Would there be a way to force the browser to download the attachment in a
temporary location and launch the application (MSPowerPoint in this case) by
its own?

Okar



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




[PHP] Variable Assignment

2002-09-09 Thread Kicenko, Frank


Hi,
I apologize for asking this question as it must have been asked many times
before but I can't find it in any of the archives.. 

What I would like to do is setup forms in javascript and then on a submit to
assign these variables to PHP variables. I know how to assign PHP to
javascript with the ?= $foo ? or ?= echo $foo ? but I don't know how
to do the reverse. Can anyone help?

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




Re: [PHP] How to program very basic chat on PHP?

2002-09-09 Thread timo stamm

Hi Mig,


you have to look for the XMLSocket (data will be transported in 
XML documents). It is available since Flash 5.

But building a socket deamon on the server appears to be not 
that easy. The easiest way should be to use Pearl if you are 
unfamiliar with C.


Timo

 timo stamm wrote:

 Hi Mig,

 to create something that behaves more like a true chat, you
 need an active client side.
 For example, you could let a frame with the PHP be reloaded in a
 short interval.

 To create a real chat, you need a socket connection. The best
 solution would be Flash (which has great functions for that).
 Java is another option.

 Timo

 Hello Timo, thanks very much. I don't know flash, but do you 
 think Flash
 5 has this option also?. I read a basic Flash manual and didn't find
 some feature for 'sockets' or something else.
 For Java, I know a very basic programming of it, I will try study more
 of it to understand socket functions.

 Thanks all of you for your responses.

 Mig




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




[PHP] Error when going to PHP page

2002-09-09 Thread FlipinMonkeyPie

I started off, with my php program in c:/PHP and it worked fine, but i wanted to 
rearrange aa few things, so i moved it to c:/usr/php, i edited my apache config files 
to the new dir, when i go to a php file, it says 404 cannot find file, even if i go to 
the directory index and click on it, it says that. I tried deleting the c:/usr/php 
dir, and downloading a new copy of the php binary to install, but it still gives me 
the same thing, ive restarted my server, checked everything in the server, done 
everything i can.. will anybody please help me.

thanks
stephen cross



[PHP] Problems with filesize() and large files

2002-09-09 Thread Kurt Glazemakers


Hi,

I need the filesize in PHP for very large files, over 2 Gigabyte. The
problem is that the integer returns the size in byte as an integer. If
the integer is too big, it returns an negative value. 

Is it possible to extend the integer to 64 bit ? Or any other solution,
to solve this problem ?

Example:

C:\php423\phpphp -q c:\devel\filesize.php
int(-834864026)

Which checks the size of a 3 Gigabyte file.

Many thanks,

Kurt

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




[PHP] update: Error when going to PHP page

2002-09-09 Thread FlipinMonkeyPie

I was able to get it to work, thanks anyways



Re: [PHP] Problems with filesize() and large files

2002-09-09 Thread Evan Nemerson

Just figure out what the limits of 32-bit integers are. It might be enough to 
do something like $num = INT_MAX + abs( INT_MIN - filesize(bigFile) );

I'm not sure if that's the right math, but I hope you get the idea.

If memory serves, what's happening is that the 32nd bit (which represents the 
sign- 0='+', 1='-') is getting flipped because you're trying to store 8 bits 
of data in 7 bits of space.



On Monday 09 September 2002 15:07, Kurt Glazemakers wrote:
 Hi,

 I need the filesize in PHP for very large files, over 2 Gigabyte. The
 problem is that the integer returns the size in byte as an integer. If
 the integer is too big, it returns an negative value.

 Is it possible to extend the integer to 64 bit ? Or any other solution,
 to solve this problem ?

 Example:

 C:\php423\phpphp -q c:\devel\filesize.php
 int(-834864026)

 Which checks the size of a 3 Gigabyte file.

 Many thanks,

 Kurt


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




RE: [PHP] Problems with filesize() and large files

2002-09-09 Thread Kurt Glazemakers

Yep,

I was thinking about a similar solution, but if the file exceeds the 4
Gigabyte limit, the solution won't help anymore. And it wil be a matter
of time to exceed this limit.

But I'm afraid there is no other solution for this.

Kurt

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 10, 2002 12:27 AM
To: Kurt Glazemakers; [EMAIL PROTECTED]
Subject: Re: [PHP] Problems with filesize() and large files

Just figure out what the limits of 32-bit integers are. It might be
enough to 
do something like $num = INT_MAX + abs( INT_MIN - filesize(bigFile) );

I'm not sure if that's the right math, but I hope you get the idea.

If memory serves, what's happening is that the 32nd bit (which
represents the 
sign- 0='+', 1='-') is getting flipped because you're trying to store 8
bits 
of data in 7 bits of space.



On Monday 09 September 2002 15:07, Kurt Glazemakers wrote:
 Hi,

 I need the filesize in PHP for very large files, over 2 Gigabyte. The
 problem is that the integer returns the size in byte as an integer. If
 the integer is too big, it returns an negative value.

 Is it possible to extend the integer to 64 bit ? Or any other
solution,
 to solve this problem ?

 Example:

 C:\php423\phpphp -q c:\devel\filesize.php
 int(-834864026)

 Which checks the size of a 3 Gigabyte file.

 Many thanks,

 Kurt


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




Re: [PHP] PHP Source files

2002-09-09 Thread timo stamm

Hi Adam,

Am Montag den, 9. September 2002, um 18:45, schrieb Adam Voigt:
 The code in the braces will never be executed
 because $a will always be ateast $b if not greater
 (assuming $c has a value) which means that it couldn't
 be greater, however it could be = if $c was 0.

$c could also have a negative value :-)


Hi orange boy,

I think there is a mailing list for PHP developers (i.e. 
developers _of_ PHP) on PHP.net. But I am not sure if you will 
get the answer you want.


Timo


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




Re: [PHP] Web Client - How to open applications by their own.

2002-09-09 Thread timo stamm

Hi Okar,


the client decides what to do with incoming data in regard of 
the MIME type.

Usually, there is a list of MIME type and corresponding action 
in the clients browser, and you can't change it from the server.


Timo



 Regardless the nature of the attachment, things are happening 
 expectedly (as
 far as I tested) as long as the SAVE button of the browser's save-file
 dialog is clicked.
 The OPEN button works fine as well, for browser compatible 
 files such as
 .jpeg, .gif, .txt, etc...
 But when it's matter of opening per ex. a MSPoverPoint *.pps 
 slide-show file
 as attachment through the browser's save-file dialog (well, the 
 button is
 there and any user may click it) the smooth running web client 
 turns into a
 PoverPoint application opened through the browser's window with 
 an empty
 project in design view.


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




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

2002-09-09 Thread timo stamm

Hi Jay,


you suggestion does not make any difference.


The problem is that idsum seems to be destroyed for every row!

Is there any other access method on a query that works properly 
or do I have to live with different results of the very same 
query asked directly in MySQL and asked through PHP?


Timo


Am Montag den, 9. September 2002, um 15:04, schrieb Jay Blanchard:

 [snip]
 I would like to be able to sum up a collumns values already in
 MySQL. The following query will sum up all values of the column
 'id':
 SELECT idsum:=(IFNULL(idsum, id)+id), id FROM yourtable;

 Now a question to the PHP/MySQL experienced: Why does this type
 of query not work in combination with PHP? I am using query
 above as $query and do the following standard procedure:
 [/snip]

 Good point! Now as to your question, try this...

 SELECT idsum:=(IFNULL(idsum, id)+id) AS idsum, id FROM yourtable;

 When you output your query info output the value as $row-idsum;

 HTH!

 Jay



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




Re: [PHP] Upload Progress

2002-09-09 Thread timo stamm

Regarding the idea of using a socket connection with Flash:

It's not possible. You neither have file access with Flash (at 
least not from the browser plugin), nor access to a low level of 
the data to send it packet-wise.


It would be nice if the POST method did handle more details 
(total file size). But  then we would still have to wait for PHP 
and the whole bunch of browsers to support it. (Maybe there 
already is a related RFC?)


Timo


Am Montag den, 9. September 2002, um 20:20, schrieb David Buerer:

 Ya' know guys i'm sitting here thinking about this problem 
 because I have
 the same problem on one of my sites.  A bunch of inpatient 
 stupid users whom
 are click happy when they get impatient. Event a 100K upload 
 can take to
 long!

 I don't like the ASP idea.  It's really not a good solution.  
 I'm almost
 wondering if a JAVA solution which can do FTP directly or maybe 
 a direct
 socket connection/transfer with Macromedia Flash would work. 
 Both of these
 ways you could better monitor what's going on at the packet level and
 therefore giving a lot of control over something like a 
 progress bar.  Who
 knows.  It's got to be something other than PHP though because 
 PHP is after
 all only a server side language.

 -Original Message-
 From: Jed Verity [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 09, 2002 11:08 AM
 To: Jay Blanchard; [EMAIL PROTECTED]
 Subject: Re: [PHP] Upload Progress


 You're right about it costing more money. But we had one server 
 handling a
 bunch of uploads, most of them over 25 MB, and 99% being 
 instigated by very
 impatient, not very technical, people. People who kept canceling and
 canceling, despite our directions, because they thought it was stuck or
 frozen or taking too long. It was worth $150 for us to buy the 
 ASP component
 (I think we used ABCUpload, maybe?). The development time 
 required for a
 creative PHP solution -- and one that might not have worked as 
 well -- would
 have been dramatically more expensive than the almost out-of-the-box
 solution with ASP's components. (And much of the site was 
 already written in
 ASP.)

 Other than that, you'll get know argument from me about ASP vs. 
 PHP. I'm
 head over heels for PHP and, in any context other than the one 
 stated above
 (and maybe one or two others), I would choose to use God 
 Blessed PHP over
 anything else.

 Cheers!
 Jed

 P.S. I knew I'd get some fighters with that comment. Haven't learned my
 lesson yet... ;-)

 On the threshold of genius, Jay Blanchard wrote:

 [snip]
 There really isn't a great solution for this, that I know of. 
 It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing). Below is what 
 I did once
 to
 try to get around the problem. It worked *okay*.
 [/snip]

 How does this argue for ASP over PHP? I don't see how. File 
 upload on PHP
 is
 built in and therefore free. ASP file upload mechs cost more 
 money. And,
 having used ASP for a while, and having looked for this 
 feature, no upload
 progress bar exists there either. And PHP is a language, where 
 ASP is a
 service ... please do not confuse the two. If you want to 
 argue VBScript
 vs.
 PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
 curly-brace tied behind its back.

 I mentioned a while back, when this came up before (see the 
 archives) that
 this could probably be done with an IFRAME in the upload 
 dialog box. Now I
 haven't given this much thought, but maybe it could be done. 
 The largest
 problem that I see is the communication back and forth between 
 client and
 server. The server would have to know the original size of the 
 file at the
 point the upload is started, then it would be checked for 
 original_size
 minus bits_uploaded, flush the reults to the IFRAME drawing a 
 GD graph,
 and
 continue to do this as it went on.

 Another method is to start the upload with a non-progressive animation
 that
 quits when is_upload_file() returns true.

 Jay




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



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




Re: [PHP] Upload Progress

2002-09-09 Thread timo stamm

Regarding the idea of using a socket connection with Flash:

It's not possible. You neither have file access with Flash (at 
least not from the browser plugin), nor access to a low level of 
the data to send it packet-wise.


It would be nice if the POST method did handle more details 
(total file size). But  then we would still have to wait for PHP 
and the whole bunch of browsers to support it. (Maybe there 
already is a related RFC?)


Timo


Am Montag den, 9. September 2002, um 20:20, schrieb David Buerer:

 Ya' know guys i'm sitting here thinking about this problem 
 because I have
 the same problem on one of my sites.  A bunch of inpatient 
 stupid users whom
 are click happy when they get impatient. Event a 100K upload 
 can take to
 long!

 I don't like the ASP idea.  It's really not a good solution.  
 I'm almost
 wondering if a JAVA solution which can do FTP directly or maybe 
 a direct
 socket connection/transfer with Macromedia Flash would work. 
 Both of these
 ways you could better monitor what's going on at the packet level and
 therefore giving a lot of control over something like a 
 progress bar.  Who
 knows.  It's got to be something other than PHP though because 
 PHP is after
 all only a server side language.

 -Original Message-
 From: Jed Verity [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 09, 2002 11:08 AM
 To: Jay Blanchard; [EMAIL PROTECTED]
 Subject: Re: [PHP] Upload Progress


 You're right about it costing more money. But we had one server 
 handling a
 bunch of uploads, most of them over 25 MB, and 99% being 
 instigated by very
 impatient, not very technical, people. People who kept canceling and
 canceling, despite our directions, because they thought it was stuck or
 frozen or taking too long. It was worth $150 for us to buy the 
 ASP component
 (I think we used ABCUpload, maybe?). The development time 
 required for a
 creative PHP solution -- and one that might not have worked as 
 well -- would
 have been dramatically more expensive than the almost out-of-the-box
 solution with ASP's components. (And much of the site was 
 already written in
 ASP.)

 Other than that, you'll get know argument from me about ASP vs. 
 PHP. I'm
 head over heels for PHP and, in any context other than the one 
 stated above
 (and maybe one or two others), I would choose to use God 
 Blessed PHP over
 anything else.

 Cheers!
 Jed

 P.S. I knew I'd get some fighters with that comment. Haven't learned my
 lesson yet... ;-)

 On the threshold of genius, Jay Blanchard wrote:

 [snip]
 There really isn't a great solution for this, that I know of. 
 It's one of
 the few things that makes an argument for ASP over PHP, as far as I'm
 concerned (if you have the luxury of choosing). Below is what 
 I did once
 to
 try to get around the problem. It worked *okay*.
 [/snip]

 How does this argue for ASP over PHP? I don't see how. File 
 upload on PHP
 is
 built in and therefore free. ASP file upload mechs cost more 
 money. And,
 having used ASP for a while, and having looked for this 
 feature, no upload
 progress bar exists there either. And PHP is a language, where 
 ASP is a
 service ... please do not confuse the two. If you want to 
 argue VBScript
 vs.
 PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
 curly-brace tied behind its back.

 I mentioned a while back, when this came up before (see the 
 archives) that
 this could probably be done with an IFRAME in the upload 
 dialog box. Now I
 haven't given this much thought, but maybe it could be done. 
 The largest
 problem that I see is the communication back and forth between 
 client and
 server. The server would have to know the original size of the 
 file at the
 point the upload is started, then it would be checked for 
 original_size
 minus bits_uploaded, flush the reults to the IFRAME drawing a 
 GD graph,
 and
 continue to do this as it went on.

 Another method is to start the upload with a non-progressive animation
 that
 quits when is_upload_file() returns true.

 Jay




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



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




Re: [PHP] Problems with filesize() and large files

2002-09-09 Thread timo stamm

Hi Kurt,


not pretty, but what about using the CLI tool ls with an exec() call?


Timo


Am Dienstag den, 10. September 2002, um 00:07, schrieb Kurt Glazemakers:


 Hi,

 I need the filesize in PHP for very large files, over 2 Gigabyte. The
 problem is that the integer returns the size in byte as an integer. If
 the integer is too big, it returns an negative value.

 Is it possible to extend the integer to 64 bit ? Or any other solution,
 to solve this problem ?

 Example:

 C:\php423\phpphp -q c:\devel\filesize.php
 int(-834864026)

 Which checks the size of a 3 Gigabyte file.

 Many thanks,

 Kurt

 --
 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] debug apache dump on windows

2002-09-09 Thread screen

Where should I post to find information on how to debug an apache crash on 
windows using the latest 4.3.0-dev snapshot?

-lucas


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




Re: [PHP] Variable Assignment

2002-09-09 Thread Tom Rogers

Hi,

Tuesday, September 10, 2002, 7:08:27 AM, you wrote:

KF Hi,
KF I apologize for asking this question as it must have been asked many times
KF before but I can't find it in any of the archives.. 

KF What I would like to do is setup forms in javascript and then on a submit to
KF assign these variables to PHP variables. I know how to assign PHP to
KF javascript with the ?= $foo ? or ?= echo $foo ? but I don't know how
KF to do the reverse. Can anyone help?

Use a form with hidden fields named the same as the php variables you
need and use javascript to assign values to
them then submit.

-- 
regards,
Tom


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




[PHP] Problem with session handling with frameset.

2002-09-09 Thread Jiaqing Wang

Hello, Everyone,
I'm having some problem with the session handling in my code, it's kind of
hard to explain the whole problem but let me try.
I currently have a login page login.php which will take user input for
userid and passwd and check them against my backend PostgreSQL database,
after the password is verified I then open a session with

session_name($_POST['userid']);
session_start();  --  presumebly this will set a cookie with session_name
as the cookie name and session_id as the cookie value

then I redirect user to his/her own custome page (like my place or my site)
using header(Location: https://www.domain.com/cgi/mysite?userid=$userid;)
function call. in mysite.php script I will then open the session with the
session_name with

session_name($_GET['userid']);
session_start();  --presumebaly this will get the session opened previously
by login page.

This arrangement works correctly in the regular IE v5 and Netscape v4.72
without a problem, I can tell the session is being opened by login.pho page
and passed onto mysite.php page. However, it doesn't work in frameset/frame
setup at all, for example, if I put the whole login.php page which is
login.php under a frame within a frameset

frame src=cgi/login.php target=body

The problem is that I can't get the same session previously opened in
login.php in mysite.php, mysite.php will start a different session if it
can't find previous opened session with session_name as userid as this is
the default behavior of session_start() function. So I assume that login.php
either didn't set the cookie or the cookie can't be read by mysite.php.

If it helps the situation, I also noticed that my SSL cerificate warning
page being prompt twice, the first time is when opening page login.php(it's
also under https), the second time is when opening mysite.php, I'm currently
using self-signed certificate so every time the https page opens up in a new
browser it will prompt you for whether or not accept the ceritificate).

I'm currently runing php v4.2.0 on a solaris 2.7 box with apache
v1.3.26/mod_ssl-2.8.10-1.3.26. If you need any more info to help me with it,
let me know.

JJW
9/9/2002





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




Re: [PHP] Upload Progress

2002-09-09 Thread joshua

 A bunch of inpatient stupid users whom
 are click happy when they get impatient.

 impatient, not very technical, people. People who kept canceling and
 canceling, despite our directions, because they thought it was stuck or
 frozen or taking too long.

the simplest and most elegant work around i've seen is to use javascript 
to disable the submit button after it has been clicked. a second click 
creates a javascript alert that says 'be patient, your request is being 
handled'.

josh


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




[PHP] Compiling as BOTH DSO and CGI under apache.

2002-09-09 Thread php

Hi all,

I need to build php as a CGI for some scripts that need to run as the user
(image gallery scripts, where safe mode isn't enough to write to user
directories, I need the files written AS a user, and chmodding the
directory 6777 is just nuts.).

To this end I figure I can add a new mime type to apache and a new
extension to the scripts, and be good to go.

What I've seen a lot of on the lists is either some requirement that the
php binary be installed in each user's cgi-bin, or that all scripts start
with php.  (I run suexec, but I'm not sure if the suexec restrictions
apply to HANDLERS (I'm pretty sure they don't, but then again I'm not
100 percent sure they will run as the user if defined this way.)

Has anyone here successfully set up php to work both ways?

You would think searching the entirety of the lists and google groups I'd
find one working config file.

-Dan Mahoney

--

If you need web space, give him a hard drive.  If you need to do something really 
heavy, build him a computer.

-Ilzarion, late friday night

Dan Mahoney
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144   AIM: LarpGM
Web: http://prime.gushi.org
finger [EMAIL PROTECTED]
for pgp public key and tel#
---




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




[PHP] Simple Progress Bar (was Upload Progress)

2002-09-09 Thread Jacob Miller

Well, for lack of a better solution (and mainly lack of time to invent one) 
I decided to go with a simple indeterminate progress bar.  I've already 
found more uses for this than just uploading files and thought some of you 
might have a use for it in your scripts which take a while to complete.

- Jacob

//
// In the referring page (i.e. submitting a form):

head
script type=text/javascript

var progress_window;

function open_progress_window(caption) {

 progress_window = window.open(progress.php?caption= + caption, 
progress_window, width=350, height=120, menubar=no, statusbar=no, 
toolbar=no);

}

function close_progress_window() {

 if (progress_window != null) {
 progress_window.close();
 }

}

/script

body onUnload=close_progress_window();

form onSubmit=open_progress_window('Work+In+Progress...');
!-- form vars here --
/form

/body

//
// Source for progress.php

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;
html

head

title?php echo $caption; ?/title

meta http-equiv=Content-Type content=text/html; charset=utf-8
meta http-equiv=Content-Style-Type content=text/css
meta http-equiv=Content-Script-Type content=text/javascript

style type=text/css

body {
 background: #ff;
 color: #00;
 font-family: Arial, sans-serif;
}

td.ProgressOn {
 background: #ff;
}

td.ProgressOff {
 background: #ff;
}

td.PageHeader {
 font-weight: bold;
 font-size: 18px;
 text-align: center;
 padding-bottom: 10px;
}

/style

script type=text/javascript

function begin_progress() {

 var i = 0;

 setTimeout(update_progress( + i + , true), 100);

}

function update_progress(i, forward) {

 if (forward) {
 if (i == 0) { off = i; }
 else { off = (i - 1); }
 } else {
 if (i == 19) { off = i; }
 else { off = (i + 1); }
 }

 eval(document.all.td + off + .className = \ProgressOff\;);
 eval(document.all.td + i + .className = \ProgressOn\;);

 if (forward) {
 if (i == 19) {
 forward = false;
 i--;
 } else {
 i++;
 }
 } else {
 if (i == 0) {
 forward = true;
 i++;
 } else {
 i--;
 }
 }

 setTimeout(update_progress( + i + ,  + forward + ), 100);

}

/script

/head

body onLoad=begin_progress();

table border=0 width=100% height=100% cellpadding=0 cellspacing=0
tr
 td align=center valign=middle
 table border=0 cellpadding=5 cellspacing=0
 tr
 td class=PageHeader?php echo $caption; ?/td
 /tr
 tr
 td
 table border=0 cellpadding=5 
cellspacing=0 style=border: 1px inset;
 tr
 ?php
 for ($i = 0; $i  20; $i++) {
 echo td 
class=\ProgressOff\ id=\td.$i.\nbsp;/td\n;
 }
 ?
 /tr
 /table
 /td
 /tr
 /table
 /td
/tr
/table

/body

/html


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




[PHP] Simple Progress Bar (was Upload Progress) (2nd Try)

2002-09-09 Thread Jacob Miller

Well, for lack of a better solution (and mainly lack of time to invent one) 
I decided to go with a simple indeterminate progress bar.  I've already 
found more uses for this than just uploading files and thought some of you 
might have a use for it in your scripts which take a while to complete.

- Jacob

//
// In the referring page (i.e. submitting a form):

head
script type=text/javascript

var progress_window;

function open_progress_window(caption) {

progress_window = window.open(progress.php?caption= + caption, 
progress_window, width=350, height=120, menubar=no, statusbar=no, 
toolbar=no);

}

function close_progress_window() {

if (progress_window != null) {
progress_window.close();
}

}

/script

body onUnload=close_progress_window();

form onSubmit=open_progress_window('Work+In+Progress...');
!-- form vars here --
/form

/body

//
// Source for progress.php

head

title?php echo $caption; ?/title

meta http-equiv=Content-Type content=text/html; charset=utf-8
meta http-equiv=Content-Style-Type content=text/css
meta http-equiv=Content-Script-Type content=text/javascript

style type=text/css

body {
background: #ff;
color: #00;
font-family: Arial, sans-serif;
}

td.ProgressOn {
background: #ff;
}

td.ProgressOff {
background: #ff;
}

td.PageHeader {
font-weight: bold;
font-size: 18px;
text-align: center;
padding-bottom: 10px;
}

/style

script type=text/javascript

function begin_progress() {

var i = 0;

setTimeout(update_progress( + i + , true), 100);

}

function update_progress(i, forward) {

if (forward) {
if (i == 0) { off = i; }
else { off = (i - 1); }
} else {
if (i == 19) { off = i; }
else { off = (i + 1); }
}

eval(document.all.td + off + .className = \ProgressOff\;);
eval(document.all.td + i + .className = \ProgressOn\;);

if (forward) {
if (i == 19) {
forward = false;
i--;
} else {
i++;
}
} else {
if (i == 0) {
forward = true;
i++;
} else {
i--;
}
}

setTimeout(update_progress( + i + ,  + forward + ), 100);

}

/script

/head

body onLoad=begin_progress();

table border=0 width=100% height=100% cellpadding=0 cellspacing=0
tr
td align=center valign=middle
table border=0 cellpadding=5 cellspacing=0
tr
td class=PageHeader?php echo $caption; ?/td
/tr
tr
td
table border=0 cellpadding=5 cellspacing=0 
style=border: 1px 
inset;
tr
?php
for ($i = 0; $i  20; $i++) {
echo td 
class=\ProgressOff\ id=\td.$i.\nbsp;/td\n;
}
?
/tr
/table
/td
/tr
/table
/td
/tr
/table

/body


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




Re: [PHP] Problem with session handling with frameset.

2002-09-09 Thread Justin French

on 10/09/02 1:01 PM, Jiaqing Wang ([EMAIL PROTECTED]) wrote:

 Hello, Everyone,
 I'm having some problem with the session handling in my code, it's kind of
 hard to explain the whole problem but let me try.
 I currently have a login page login.php which will take user input for
 userid and passwd and check them against my backend PostgreSQL database,
 after the password is verified I then open a session with
 
 session_name($_POST['userid']);
 session_start();  --  presumebly this will set a cookie with session_name
 as the cookie name and session_id as the cookie value

usually PHPSESSID is the name of the cookie, and I tend to leave it like
that.  I'd name it something else other than $_POST['userid'] though... the
whole point of sessions is to store a session id on the client side (usually
a long number), and store all the sensitive data (usernames, passwords, etc)
on the SERVER SIDE, associating them with the session ID.

at this point you haven't assigned any values to the session.  If you want
the userid to be available on other pages (a session!!!), you shouldn't name
the session after the userid.

assuming you have PHP  4.1:

?
// login page
// validate $_POST['userid'] first

if($validuser)
{
session_start();
$_SESSION['userid'] = $_POST['userid'];
}
?


 then I redirect user to his/her own custome page (like my place or my site)
 using header(Location: https://www.domain.com/cgi/mysite?userid=$userid;)
 function call. in mysite.php script I will then open the session with the
 session_name with
 
 session_name($_GET['userid']);
 session_start();  --presumebaly this will get the session opened previously
 by login page.

No.  The whole point of sessions is that you don't have to carry the userid
around in the URL.  You just redirect to wherever you want:

?
// login page
// validate $_POST['userid'] first

if($validuser)
{
session_start();
$_SESSION['userid'] = $_POST['userid'];
header(Location: https://www.domain.com/cgi/mysite.php;);  // added
}
?

Then on subsequent pages (the rest of your site), you check to see who your
user is with this code:

?
session_start();
echo $_SESSION['userid'];
?

Make sense?

I've been trying tog et enough time together to write an article about this
stuff, but for the moment, you need to do some more research and get a grip
on what sessions are really used for.

Just as an example, you could assign more variables (user preferences for
example) to the session at login time (or at any time during the session):

$_SESSION['favcolor'] = 'blue';
$_SESSION['shoesize'] = '14';
$_SESSION['language'] = 'en';
$_SESSION['pageviews'] = $_SESSION['pageviews']++;
$_SESSION['blah'] = 'foo';
$_SESSION['blahblah'] = 'foo foo';


There's a nice article on webmasterbase.com in the PHP section by Kevin
Yank.  The code is a little out-dated (pre $_SESSION and all the superglobal
arrays, so you'll need register_globals on in your php.ini for it all to
work), however, it's clean, and he does a great job of explaining it all.
You should read it, twice :)

It was the basis of my session code a while back.


In theory, any pages you call on your site which have
? session_start(); ? as the first line will maintain a COOKIE based
session.  If you do not call session_start(), you *may* loose the session,
even under cookies.

If users don't have cookies, your sessions won't work at this stage... the
sid needs to be passed around in the URL.


 This arrangement works correctly in the regular IE v5 and Netscape v4.72
 without a problem, I can tell the session is being opened by login.pho page
 and passed onto mysite.php page. However, it doesn't work in frameset/frame
 setup at all, for example, if I put the whole login.php page which is
 login.php under a frame within a frameset
 
 frame src=cgi/login.php target=body

The concept of having framed content is fine if you are using cookie based
sessions, as long as each framed page (the frameset and all pages within it)
call session_start()... otherwise (again) you need to pass the sid to the
framed page through the URL.


 The problem is that I can't get the same session previously opened in
 login.php in mysite.php, mysite.php will start a different session if it
 can't find previous opened session with session_name as userid as this is
 the default behavior of session_start() function. So I assume that login.php
 either didn't set the cookie or the cookie can't be read by mysite.php.

see above :)  I think your session setting code aint working the way you
intended, and certain not the way PHP developers intended.


 If it helps the situation, I also noticed that my SSL cerificate warning
 page being prompt twice, the first time is when opening page login.php(it's
 also under https), the second time is when opening mysite.php, I'm currently
 using self-signed certificate so every time the https page opens up in a new
 browser it will prompt you for whether or not accept the ceritificate).

Sure, there may 

  1   2   >