[PHP] Re: FTP Synching

2003-07-23 Thread Jean-Christian IMbeault
Jwulff wrote:
 How would I download any new files on a remote machine to my local one (in a
 specific folder) via ftp?

And how does this relate to PHP? I can't see a PHP question in there ...
if there is one please make it clear :)

Jean-Christian Imbeault


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

[PHP] Hi All

2003-07-23 Thread Shishir Kumar Mishra

Hi All,

I am reading one XML which has some german characters.  I am sending this data to PHP 
script but when try to echo ;it  prints some other character. 
eg. XML has fr   but output  is coming like  fr ; 

My script is like following:

?php

$loc = UTF-8;
putenv(LANG=$loc);
setlocale (LC_ALL, 'de_DE');
echo br.$producttext[2]; 
?  

in XML file : producttext  has value like fr ;


regards..
Shishir Kumar Mishra
Agni Software (P) Ltd.
www.agnisoft.com


Re: [PHP] php interbase problem.....

2003-07-23 Thread Wei
I already set the charset but still cannot work. By the way, I can retrieve
the data in other program.

Anyway, thanks for your reply


Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 * Thus wrote Wei ([EMAIL PROTECTED]):
  Hope someone can solve my problem.
 
  I'm using Interbase as a database. I get error message when  I retrieve
data
  from the database (ibase_fetch_row) which contain chinese character.
 
  Warning: ibase_fetch_row(): arithmetic exception, numeric overflow, or
  string truncation Cannot transliterate character between character sets
in
  .

 Not sure if this helps:

 http://bdn.borland.com/article/0,1410,29891,00.html

 then this should:

 http://php.net/ibase_connect

 snip
 int ibase_connect ( string database [, string username [, string
 password [, string charset [, int buffers [, int dialect [, string
 role]])
 /snip

 Notice the charset parater, you need to set that to the appropriate
 charset chinese is defined as. (Big5, Big5HKHCS, etc...)


 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.



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



[PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread sebab
Hi,

I have to convince one guy to not move our site from Linux box where
it runs with Apache/PHP + MySQL to Windows box where it's going to deal
with Windows 2k/IIS/PHP(CGI) + MySQL and I need really good arguments,
cause it's only way I can convince him (cause his position in company
is much stronger than mine).

I know that PHP under windows is intended to be used only as test
platform, but this is not enough to convince him.

Can you help me? I need some reasons like things that won't work under
windows version of PHP (or at least MySQL) and that are not easy to
fix. I've already found that IIS doesn't provide
$_SERVER[DOCUMENT_ROOT] but it's not too much work to fix that..

Please help!

Big thanks in advance!
Sebastian


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



RE: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread George Pitcher
 I know that PHP under windows is intended to be used only as test
 platform, but this is not enough to convince him.

Errr ... says who?

I'm out of a job here if this is true as I'm doing quite a bit of PHP
development on NT/IIS with both MySQL and MS Access (not my choice, but a
clients).

I'm quite happy with NT but I'll be switching over to Linux later in the
year - company policy to gradually move away from Win to Linux for servers.

I'd look at security as the main argument.

George


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



Re: [PHP] REDIRECT STATUS CGI

2003-07-23 Thread Freek van de Griendt
Can I just change this status to 0 en then start my Xitami? Or do I have to
reinstall it after I have changed the status to 0? The first option didn't
seem to work properly.

Thanks in advance,

Freek
Curt Zirzow [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
 * Thus wrote Freek van de Griendt ([EMAIL PROTECTED]):
  Hi,
 
  I just started using PHP and installed it on my Windows machine,
together
  with Xitami (Web server). But now, when I try to write a simple PHP file
I
  get the following error:
 
  Security Alert! The PHP CGI cannot be accessed directly.
  This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means
  that a page will only be served up if the REDIRECT_STATUS CGI variable
is
  set, e.g. via an Apache Action directive.

 php.net has all your answers
 http://php.net/manual/en/install.xitami.php

 Curt
 --
 I used to think I was indecisive, but now I'm not so sure.



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



RE: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread Adrian Teasdale

 I have to convince one guy to not move our site from Linux box where
 it runs with Apache/PHP + MySQL to Windows box where it's going to deal
 with Windows 2k/IIS/PHP(CGI) + MySQL and I need really good arguments,
 cause it's only way I can convince him (cause his position in company
 is much stronger than mine).

Firstly Sebastian I would try to find out his reasoning for it - there may
be something that you don't know. ie, does he have something else that he
wishes to run on the same server that will only run under a Windows box?

 I know that PHP under windows is intended to be used only as test
 platform, but this is not enough to convince him.

I disagree with you on this :)  Although I generally push for Linux wherever
I can, the reality is that many clients do run Windows exclusively for
internal operations and don't have the in-house capability to manage Linux
boxes.  We have quite a number of installations that run fine under Windows.

 Can you help me? I need some reasons like things that won't work under
 windows version of PHP (or at least MySQL) and that are not easy to
 fix. I've already found that IIS doesn't provide
 $_SERVER[DOCUMENT_ROOT] but it's not too much work to fix that..

I'd suggest trying to work with the guy rather than against him.  Find out
his reasoning and then this way you can look at the positive and negative
aspects of what he is trying to do. I know that this isn't the answer that
you were expecting, but it's the approach that I would take

Adrian
sourceguardian.com


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



Re: [PHP] Hi

2003-07-23 Thread skate
the poker game is actually really weak anyway...

a pair of 6's shouldn't win anything...

- Original Message -
From: Rausch Alexandru [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 9:42 AM
Subject: [PHP] Hi


MYSQL problems problems.
I want to install an user login aplicationa on my site, but it is intarely
in FLASH. ( www.poker.club66.ro ).
What do u think?




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



[PHP] Re: Hi All

2003-07-23 Thread Peter Clarke
Shishir Kumar Mishra wrote:

Hi All,

I am reading one XML which has some german characters.  I am sending this data to PHP script but when try to echo ;it  prints some other character. 
eg. XML has fr   but output  is coming like  fr ; 

My script is like following:

?php

$loc = UTF-8;
putenv(LANG=$loc);
setlocale (LC_ALL, 'de_DE');
echo br.$producttext[2]; 
?  

in XML file : producttext  has value like fr ;

regards..
Shishir Kumar Mishra
Agni Software (P) Ltd.
www.agnisoft.com
What are you outputting to?
Is it able to display UTF-8?
Does it know that the string is UTF-8?
an html page would tell a browser with:
meta http-equiv=Content-Type content=text/html; charset=UTF-8
Peter



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


[PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread Phil Powell
I have concluded that Bill Gates is Satan!

Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on the hour 
every day for eternity to go and run a series of Java files I wrote that connect 
remotely to a remote server to do remote cleanup of stray XML files, etc.; things I 
cannot do on the remote machine box itself because it's remote and I don't have 
permissions were I physically on the box anyway.

However, on 7/18 all 26 of my scheduled tasks stopped running; one of which 
continuously ran for 4 days straight w/o stopping (nor could I manually stop it).  I 
deleted the runaway process and recreated it; now not a single one of my 26 scheduled 
Win2000 tasks I created using MS-DOS AT commands work (which were working since 7/2).

I am now looking into programmatic alternatives.  I really could use some ideas that 
are practical given my situation.  I'm thinking PHP since I am very comfortable with 
it, were it possible within my bizarre Win2000 environment, but I need something that 
will clean those XML files remotely on a regular basis, it's important for website 
maintenance.  Any help appreciated.

Thanx
Phil


Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread skate
you could have a look at AINTX, it's a windows port of the *nix cron

alternatively, if you've got a few bucks lying around, go buy yourself a
really old PC, install *nix on it, and use that to run your scheduled
cron's. they're much more reliable and obviously, if your not using that
machine, then there's a much lower chance of anything dying.

if you can't do this, and AINTX doesn't do the job, run a quick google
search for cron on windows. there's lots of versions ported across...
- Original Message -
From: Phil Powell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:13 AM
Subject: [PHP] I need a PHP alternative to Windows Scheduled Tasks


I have concluded that Bill Gates is Satan!

Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on
the hour every day for eternity to go and run a series of Java files I wrote
that connect remotely to a remote server to do remote cleanup of stray XML
files, etc.; things I cannot do on the remote machine box itself because
it's remote and I don't have permissions were I physically on the box
anyway.

However, on 7/18 all 26 of my scheduled tasks stopped running; one of which
continuously ran for 4 days straight w/o stopping (nor could I manually stop
it).  I deleted the runaway process and recreated it; now not a single one
of my 26 scheduled Win2000 tasks I created using MS-DOS AT commands work
(which were working since 7/2).

I am now looking into programmatic alternatives.  I really could use some
ideas that are practical given my situation.  I'm thinking PHP since I am
very comfortable with it, were it possible within my bizarre Win2000
environment, but I need something that will clean those XML files remotely
on a regular basis, it's important for website maintenance.  Any help
appreciated.

Thanx
Phil




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



Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread skate
sorry, i should have also pointed out...

this isn't something that PHP could handle on it's own, well, it COULD, but
you shouldn't. you could write a PHP code to run continuosly in the
background, but people would poke and laugh at you... ideally you have
something to schedule the PHP script to run when you need it, rather than
the PHP script waking up and doing it's stuff when it should...


- Original Message -
From: skate [EMAIL PROTECTED]
To: Phil Powell [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:23 AM
Subject: Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks


 you could have a look at AINTX, it's a windows port of the *nix cron

 alternatively, if you've got a few bucks lying around, go buy yourself a
 really old PC, install *nix on it, and use that to run your scheduled
 cron's. they're much more reliable and obviously, if your not using that
 machine, then there's a much lower chance of anything dying.

 if you can't do this, and AINTX doesn't do the job, run a quick google
 search for cron on windows. there's lots of versions ported across...
 - Original Message -
 From: Phil Powell [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, July 23, 2003 10:13 AM
 Subject: [PHP] I need a PHP alternative to Windows Scheduled Tasks


 I have concluded that Bill Gates is Satan!

 Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on
 the hour every day for eternity to go and run a series of Java files I
wrote
 that connect remotely to a remote server to do remote cleanup of stray XML
 files, etc.; things I cannot do on the remote machine box itself because
 it's remote and I don't have permissions were I physically on the box
 anyway.

 However, on 7/18 all 26 of my scheduled tasks stopped running; one of
which
 continuously ran for 4 days straight w/o stopping (nor could I manually
stop
 it).  I deleted the runaway process and recreated it; now not a single one
 of my 26 scheduled Win2000 tasks I created using MS-DOS AT commands work
 (which were working since 7/2).

 I am now looking into programmatic alternatives.  I really could use some
 ideas that are practical given my situation.  I'm thinking PHP since I am
 very comfortable with it, were it possible within my bizarre Win2000
 environment, but I need something that will clean those XML files remotely
 on a regular basis, it's important for website maintenance.  Any help
 appreciated.

 Thanx
 Phil




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






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



[PHP] Mail functions in php

2003-07-23 Thread Uma Shankari T.

Hello,

I need to send audio/video files through PHP mail() function.
What is the MIME type i need to use?
or else
Is there any other way to send attachment as a mail?

Please help me.

Thanx in advance,
Uma


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



[PHP] reading in files

2003-07-23 Thread bob pilly
Hello all
 
I have a page where a user uses a browse button in html to upload a file from there 
client pc. They then click upload which submits the form to the second page: example
form name=form1 method=post action=/test2.php
input type=file name=file
input name=upload type=submit id=upload value=upload
 /form
I am then wanting to read the info in that file in the test2.php page but are 
struggling. At the moment im trying to use:
$file=file($_GET[file]);
echo $file[0];
 
which i thought would output the first line of the file but it doesnt. Can someone 
point me to some good docs on how php deals with files and how i can readthrough the 
file uploaded from a user please?
 
Thanks for any help in advance! 


-
Want to chat instantly with your online friends?Get the FREE Yahoo!Messenger

[PHP] direcorty listing

2003-07-23 Thread FB
Hi,

I have a directory like structure below

- cityname
--townname
---busname
day
-info.zip

I want to write a script and let it search the directory and find the zip
files open them do the operation and save the out file as

cityname_townname_busname_day_info.txt

I am doing it for any zip files so the last part is O.K. by now but I need a
loop to go under the direcoty structure and search for them. Cause if the
info file is at level 2 (I mean under the townname direcotry) than it means
a brief info of the time table so it will be save as
cityname_townname_info.txt

I am not familiar with the direcotry functions. Can anybody help me with
that?

regards
FB









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



Re: [PHP] classes v. functions

2003-07-23 Thread Joel Rees
 Say I have a database class with all kinds of functions for connection, 
 data manipulation, errors, etc:
 
  $db = new db_sql;
 $db-connect();
 $db-do_this();
 $db-do_that();
 
 How would that be different from an include file with a bunch of functions 
 doing the same thing?

As far as I'm concerned, the primary benefit of classes is that you
don't clutter up your namespace. If you have, for instance, 
$accesses-count, you know more about that count than if you have 
just $count. It's a method of organizing your code that doesn't (once
you get used to it) get in the way.

Also, you can be really sure that $accesses-resetCounter() is somehow
related to $accesses-count, whereas $accesses_count and 
accesses_resetCounter() might win your confidence incorrectly. Or maybe
you slip and use access_resetCounter() instead, which might be the cause
of no end of grief.

(You know that $accesses-count and $accesses-resetCounter() are at
least declared in the same class declaration. $accesses_count and
accesses_resetCounter() could be declared in entirely unrelated include
files for entirely different purposes.)

 Is there any performance benefit one way or the other?

Programmer performance?

 I used EZ_Sql which is cool but didn't seem to speed things up in 
 comparison to the said include file.
 Still don't see the beef.

Execution speed isn't all that matters. In fact, speed is not the point
at all.

 Brad recommended I spend even more time with google looking for OOP, maybe 
 that's why I'm so confused:).

I think he's trying to point you to the mind-set. Do you like complex
puzzles with intricate interactions where you have to keep tens of
thousands of lines of code constantly in your head? Or do you like to
focus on several hundred lines at a time, get those to behave, then move
on to another part with a fairly high level of confidence that you won't
shoot yourself in the foot by using the wrong count or resetCount()
somewhere?

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


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



Re: [PHP] reading in files

2003-07-23 Thread Marek Kilimajer
www.php.net/uploads

1. use $_FILES
2. $_FILES['file'] would be na array holding info about the uploded file
bob pilly wrote:

Hello all
 
I have a page where a user uses a browse button in html to upload a file from there client pc. They then click upload which submits the form to the second page: example
form name=form1 method=post action=/test2.php
input type=file name=file
input name=upload type=submit id=upload value=upload
 /form
I am then wanting to read the info in that file in the test2.php page but are struggling. At the moment im trying to use:
$file=file($_GET[file]);
echo $file[0];
 
which i thought would output the first line of the file but it doesnt. Can someone point me to some good docs on how php deals with files and how i can readthrough the file uploaded from a user please?
 
Thanks for any help in advance! 

-
Want to chat instantly with your online friends? Get the FREE Yahoo!Messenger


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


[PHP] Re: Selectoption....../select

2003-07-23 Thread sven
sorry, i didn't understand your problem.

can you give an example what you can get from your database (your keys,
years, months, ...) and how it should be transformed?

ciao SVEN

Etienne Mathot wrote:
 I am quite new to web programming and PHP/mySQL, I try to find my way
 between all these tools.

 Currently, I have a problem with a page where activities happen in 3
 steps.

 Encoding Key Fields is the first step, than reading the customer...etc

 Key Fields is composed by Year, month and auto-increment field.

 Up to this step, everything is Ok.



 But the form recalls themselves for going on.

 I use SELECTOPTION../SELECT for the year and the month.

 If anybody knows a way to redisplay the correct values of these
 fields and not Pick Up yours?



 Thanks four your help.



 Etienne Mathot

 Email: [EMAIL PROTECTED]



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



RE: [PHP] radio button arrays and php3

2003-07-23 Thread Svar fjr
This is the very nature of radiobuttons. They are ment to return only
one value because you can only select one of them. If you want all
values returned in an array you have to use checkbox. Checkboxes allow
multiple selections.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 23. jl 2003 03:12
To: [EMAIL PROTECTED]
Subject: [PHP] radio button arrays and php3

hi there i dont know if this happens in php4 but say i have a list of
radio
buttons in an array like
input type=radio name=secondary_banner[]
input type=radio name=secondary_banner[]

it only returns the one selected into the array, so instead of having 2
keys i only get the one , the empty one doesnt seem to get submitted ,
how
can i make both turn up in the array ?



-- 
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] Session problem

2003-07-23 Thread tana dsasa
I have installed an user-login aplication on my website ( http://www.norbertnet.ro ) 
but i have problems with session controls.
I receive all kinds of warnings and i don't know how to interpret them
 
thanks advanced


-
Want to chat instantly with your online friends?Get the FREE Yahoo!Messenger

Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread Chris Hayes
At 11:13 23-7-03, you wrote:
I have concluded that Bill Gates is Satan!
um, what about moving to linux and use cron?

But if you want to try it on satanic Windows:  SINC 
(http://sourceforge.net/projects/sinc/) can be used to start programmes but 
also to invoke PHP scripts. I was not so happy with the little windows 
popping up and away whenever a PHP file was activated but then i got it 
moved to a windows server and that's not a workstation so the flashing 
windows where no pain.



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


[PHP] header headers_sent BUG

2003-07-23 Thread James M. Luedke
Hello all:
   I am having a hard time with a small piece of code. I was wondering
if someone may be able to explain why the following code will not work... I
have been scratching my head for a few hours now and I am stumped.
?php

header(Location: http://someplace.com;);

if( ! headers_sent())
   header(Location: http://somplaceelse.com;);
?

So I would expect this  piece of code to direct me to somplace.com.
However it does not, and I always end up at somplaceelse.com.
I have done a tcpdump to assist with debugging here is the output below.
From the look of it the first header is getting ignored all toghether. Is
there some way to force changes I made to the headers, that will make
headers_sent return TRUE?
Thanks,

-James

---
GET /tracking/test.php HTTP/1.1
Host: dev.www.someplace.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) 
Gecko/20020623 Debian/1.0.0-0.woody.1
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Keep-Alive: 300
Connection: keep-alive
Cookie: toolkitAccess=1

HTTP/1.1 302 Found
Date: Wed, 23 Jul 2003 10:04:55 GMT
Server: Apache/1.3.27 (Unix) mod_ssl/2.8.14 OpenSSL/0.9.6d PHP/4.3.1 
mod_perl/1.27
X-Powered-By: PHP/4.3.1
Location: http://someplaceelse.com
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
---

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


[PHP] homemade authentication function

2003-07-23 Thread Svar fjr
Im making an authentication script with groups and roles. This function
checks if the groups the user belongs to specified groups and compares
them to the groups required. However, since this is a loop, the function
doesnt return true or false as expected. If I call the function and
require 3 groups, and the user belongs to only one of them, he is still
accepted. Is this method right thinking? Should I make the function stop
somehow when it returns false for the first time? All suggestions and
comments are appreciated. Thanks.
 
This is the function:
 
function require_groups() {
if (!isset($this-user['groups'])) {
$this-user['groups'] =
$this-get_user_groups($this-id);
}
$groups = func_get_args();
foreach ($groups as $value) {
if
(!isset($this-user['groups'][$value]) ||
!$this-user['groups'][$value]) {
return false;
}
else{
return true;
}
}
}
 
And I call it like this: require_groups(admins,
moderators,members);
This returns true. 
 
Kveja,
Svar fjr
[EMAIL PROTECTED]
etta reddast - hnnunarlausnir
 
file:///C:\Documents%20and%20Settings\S%E6var\Application%20Data\Micros
oft\Signatures\www.reddast.is www.reddast.is
 


RE: [PHP] Session problem

2003-07-23 Thread Svar fjr
You have to specify which warnings and errors if you want someone to
help

-Original Message-
From: tana dsasa [mailto:[EMAIL PROTECTED] 
Sent: 23. jl 2003 09:58
To: [EMAIL PROTECTED]
Subject: [PHP] Session problem

I have installed an user-login aplication on my website (
http://www.norbertnet.ro ) but i have problems with session controls.
I receive all kinds of warnings and i don't know how to interpret them
 
thanks advanced


-
Want to chat instantly with your online friends?Get the FREE
Yahoo!Messenger


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



[PHP] Session problem

2003-07-23 Thread tana dsasa
I have installed an user-login aplication on my website ( 
http://www.norbertnet.ro ) but i have problems with session controls.
I receive all kinds of warnings and i don't know how to interpret them, for instance 
when i want to register a session it is not very good registered
 
thanks advanced


-
Want to chat instantly with your online friends?Get the FREE Yahoo!Messenger

[PHP] Session problem

2003-07-23 Thread tana dsasa
I have installed an user-login aplication on my website ( 
http://www.norbertnet.ro ) but i have problems with session controls.
I receive all kinds of warnings and i don't know how to interpret them, for instance 
when i want to register a session it is not very good registered

thanks advanced




-
Want to chat instantly with your online friends?Get the FREE Yahoo!Messenger

RE: [PHP] Redirection Question

2003-07-23 Thread Ow Mun Heng
Hi,

I'm not sure if this is going to help or not.. Since I understand
your issue only barely.. If I understand correctly, regardless of whether
the user comes from a.php, b.php or z.php, if they're not authenticated on
the system (via sessions or cookies) then the only place for them to go is
login.php. RIGHT???

Here's my 2 cents. (part of code I'm working on)


=login.php===
if ( check_if_authenticated() )   --- I have this fucntion located at the
top of a.php,b.php,c.php
{
header_refresh_html(home.php);  --- Function call - back to
Home.php if logged in
exit;
}
else--- display login form is not already logged in
{
top_html(); 
display_welcome_msg_html();
}
==

===html_functions.php ==
# ===
# This is where I print headers to redirect pages
# Default wait time is 2 seconds
# NOTE : WE MUST PRINT THE REDIRECTION BEFORE WE OUTPUT ANYTHING!
#Just put the redirection BEFORE the outputs!
# ===
function header_refresh_html($l_refresh_url) --- the page to redirect to is
given as an argument
{
// This is taken from php-manual
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
// Date in the past
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);  //
always modified
header(Cache-Control: no-store, no-cache, must-revalidate);   //
HTTP/1.1
header(Cache-Control: post-check=0, pre-check=0, false);
header(Pragma: no-cache);
// HTTP/1.0

header( Refresh:2;url=$l_refresh_url );   // Wait
default of 2 seconds
}

function header_redirect_html($l_redirect_url)
{
header( Location:$l_redirect_url);// Instant
Redirection
}

=




Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Beauford.2005 [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 8:55 AM
To: 'PHP'
Subject: RE: [PHP] Redirection Question


Thanks to all, I got it working - sort of. It works perfectly on
Windows, but will not work on Linux. I am using the same versions of
PHP, Apache and MySQL on both. I have asked this before and have been
told they are interchangeable, but more times than not I have to make a
bunch of changes to get it to work on Linux - and this is just another
example. I use Windows to do all the coding and design as it has all the
tools. Linux is just a bare bones box with no gui or tools. The php.ini
and httpd.conf are the same on both platforms (other than what is needed
for the specific platform). This makes it a real pain.

Oh well, back to my debugging.


-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
Sent: July 22, 2003 7:04 PM
To: PHP
Subject: Re: [PHP] Redirection Question


* Thus wrote Beauford.2005 ([EMAIL PROTECTED]):
 Maybe I didn't explain enough. What if they come from b.php or c.php. 
 How do I automatically log what page they tried to access. So hard 
 coding login.php?next=a.php would only work for one page.

Use the code that Grant Rutherford posted earlier, its the same concept
just a whole lot more flexible than mine. Not to mention a bit more
secured.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
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] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread Joel Rees
 However, on 7/18 all 26 of my scheduled tasks stopped running; one of 
 which continuously ran for 4 days straight w/o stopping (nor could I
 manually stop it).  I deleted the runaway process and recreated it; now
 not a single one of my 26 scheduled Win2000 tasks I created using
 MS-DOS AT commands work (which were working since 7/2).

I really don't know what I'm talking about here, but I think you have to
register those scheduled tasks. Is the registry ok?

 I am now looking into programmatic alternatives.  I really could use 
 some ideas that are practical given my situation.  I'm thinking PHP
 since I am very comfortable with it, were it possible within my bizarre
 Win2000 environment, but I need something that will clean those XML
 files remotely on a regular basis, it's important for website
 maintenance.  Any help appreciated.

Just a random suggestion, but how about having one scheduled task, and
it's job is to run the 26 jobs you are presently trying to run as
scheduled tasks. You reduce the load on MSW's scheduling, and you get
more control over things like which tasks have to complete before others
run.

Of course, moving it all to Linux or one of the BSDs might help, but you
might also want to check the design -- maybe there are some
interdependencies, so that it would help to be able to make sure certain
tasks are done before others, and that they all finish before starting
over.

I did a little script to mail out files on a regular basis. A co-worker
wrote a C program that was called by the MSW2k scheduler, and that C
program checked that my mailing script had completed before it tried to
start another instance of the script.

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


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



[PHP] Re: Mail functions in php

2003-07-23 Thread sven
hi,

1. for mime-types try rfc2046. there are two top-level media types for you:
'audio' and 'video'. the subtypes depend on your media files.

2. to send files simply as attachment you can use
'application/octet-stream'. or use a readymade php-mime-mail-class.

ciao SVEN

Uma Shankari T. wrote:
 Hello,

 I need to send audio/video files through PHP mail() function.
 What is the MIME type i need to use?
 or else
 Is there any other way to send attachment as a mail?

 Please help me.

 Thanx in advance,
 Uma



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



RE: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Ow Mun Heng
I'm new but.. aren't you also supposed to register the session??

My code ..

session_start();
session_register('username'); 
$_SESSION['username'] = $row['username'];
session_register('user_id');
$_SESSION['user_id'] = $row['user_id'];
session_register('access_level');
$_SESSION['access_level'] = $row['access_level'];



Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Jeff Stillwall [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 12:02 PM
To: Tom Rogers; Warren Vail
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Some SESSION Vars not Registering


Tom Rogers wrote:

 I am sure they do not but
 I just tried reading the docs and it is as clear as mud so its back to
 the suck it and see method

From the on-line docs, regarding $_SESSION (at
http://us3.php.net/manual/en/reserved.variables.php#reserved.variables.sessi
on):

This is a 'superglobal', or automatic global, variable. This simply means
that it is available in all scopes throughout a script. You don't need to do
a global $_SESSION; to access it within functions or methods, as you do with
$HTTP_SESSION_VARS.

So, this gets more perplexing.

I should also note that I did try to use the global keyword, and it didn't
help.  Also, I tried setting the $_SESSION variables in question to
something else ($_SESSION[fname] =  ) before calling the function.
Didn't help either.

I have just never had a problem with sessions before.  But I'm guessing it's
my code, as I can replicate the behavior on three different installations of
PHP/Apache.
-- 
Jeff Stillwall


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



[PHP] Re: header headers_sent BUG

2003-07-23 Thread Ivo Fokkema
You might want to check whether or not your header output is getting
buffered. My suggestion is a flush() after the fist call. I'm not an expert
on this, it's just an idea.

HTH


--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands

James M. Luedke [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello all:
 I am having a hard time with a small piece of code. I was wondering
 if someone may be able to explain why the following code will not work...
I
 have been scratching my head for a few hours now and I am stumped.

 ?php

 header(Location: http://someplace.com;);

 if( ! headers_sent())
 header(Location: http://somplaceelse.com;);

 ?

 So I would expect this  piece of code to direct me to somplace.com.
 However it does not, and I always end up at somplaceelse.com.

 I have done a tcpdump to assist with debugging here is the output below.
  From the look of it the first header is getting ignored all toghether. Is
 there some way to force changes I made to the headers, that will make
 headers_sent return TRUE?

 Thanks,

 -James

 ---
 GET /tracking/test.php HTTP/1.1
 Host: dev.www.someplace.com
 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0)
 Gecko/20020623 Debian/1.0.0-0.woody.1
 Accept:

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
 Accept-Encoding: gzip, deflate, compress;q=0.9
 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
 Keep-Alive: 300
 Connection: keep-alive
 Cookie: toolkitAccess=1

 HTTP/1.1 302 Found
 Date: Wed, 23 Jul 2003 10:04:55 GMT
 Server: Apache/1.3.27 (Unix) mod_ssl/2.8.14 OpenSSL/0.9.6d PHP/4.3.1
 mod_perl/1.27
 X-Powered-By: PHP/4.3.1
 Location: http://someplaceelse.com
 Keep-Alive: timeout=15, max=100
 Connection: Keep-Alive
 Transfer-Encoding: chunked
 Content-Type: text/html
 ---




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



[PHP] Re: homemade authentication function

2003-07-23 Thread sven
i think the problem isn't only your 'return false' but also your 'return
true' in your first loop through your foreach will definetly a 'return' be
passed. and return means return a value AND stop the function. not?

try it this way:

foreach ($groups as $value)
{
if(!isset($this-user['groups'][$value]) ||
!$this-user['groups'][$value])
{
return false;
}
}
return true;

ciao SVEN

Sv lyp wrote:
 I'm making an authentication script with groups and roles. This
 function checks if the groups the user belongs to specified groups
 and compares them to the groups required. However, since this is a
 loop, the function doesn't return true or false as expected. If I
 call the function and require 3 groups, and the user belongs to only
 one of them, he is still accepted. Is this method right thinking?
 Should I make the function stop somehow when it returns false for the
 first time? All suggestions and comments are appreciated. Thanks.

 This is the function:

 function require_groups() {
 if (!isset($this-user['groups'])) {
 $this-user['groups'] =
 $this-get_user_groups($this-id);
 }
 $groups = func_get_args();
 foreach ($groups as $value) {
 if
 (!isset($this-user['groups'][$value]) ||
 !$this-user['groups'][$value]) {
 return false;
 }
 else{
 return true;
 }
 }
 }

 And I call it like this: require_groups(admins,
 moderators,members);
 This returns true.

 Kveja,
 Svar fjr
 [EMAIL PROTECTED]
 etta reddast - hnnunarlausnir

 file:///C:\Documents%20and%20Settings\S%E6var\Application%20Data\Micros
 oft\Signatures\www.reddast.is www.reddast.is



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



RE: [PHP] Re: Redirection Question (I spoke to soon)

2003-07-23 Thread Ow Mun Heng
Hi Curt,

I'm confused..

quote
 With $_SESSION, there is no need to use the session_register(),
 session_unregister(), session_is_registered() functions. Session
 variables are accessible like any other variables. 
/quote

I'm using

session_start();
session_register('username');
$_SESSION['username'] = $row['username'];
session_register('user_id');
$_SESSION['user_id'] = $row['user_id'];
session_register('access_level');
$_SESSION['access_level'] = $row['access_level'];

and checking if user is authenticated using

if ( session_is_registered('user_id') ) 
{
return true;
}
else
{   
return false;
}


Am I in error? (I'm trying to code using register_globals=off)

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 12:20 PM
To: PHP
Subject: Re: [PHP] Re: Redirection Question (I spoke to soon)


* Thus wrote Beauford.2005 ([EMAIL PROTECTED]):
 Sorry all, apparently this doesn't work on either Windows or Linux.
 Again, I thought it was working and once I got farther along I see that
 it really wasn't. Basically what I get after I login is an empty screen.
 Here is what I have :
 
 This is the script that runs to see if the user is logged in.
 
 session_start();
 if(!$_SESSION['logged']) {  
 
   session_register('goto');
   $_SESSION['goto'] = http://; . $_SERVER['SERVER_NAME'] .
 $_SERVER['REQUEST_URI'];
 
   $url = http://www.mysite.org/login/login.php;;
   header(Location: $url); 
 }
 
 The above works and redirects me to the login page and has the right
 referring page as shown below.
 
 goto|s:59:http://www.mysite.org/setup/inputs.php;;
 
 This is in my login.php script. After I verify the user login is
 correct, this piece of code is executed.
 
   session_start();
 session_register('logged');
 session_register('user');  

You don't need those two lines, they are only needed if ini.register_globals
is on and you want the variables $logged and $user to automatically be
sessioned as:
  $_SESSION['logged'] 
  $_SESSION['user'] 

quote
 With $_SESSION, there is no need to use the session_register(),
 session_unregister(), session_is_registered() functions. Session
 variables are accessible like any other variables. 
/quote

I think this is were your problem is.

Also what php version?
quote CAUTION
If you are using $_SESSION and disable register_globals, do not use
session_register(), session_is_registered() and session_unregister(), if
your scripts shall work in PHP 4.2 and earlier. You can use these
functions in 4.3 and later. 
/quote


Hmm.. After looking at the session_* documentation there are CAUTIONS
all over the place..  The all seem to say dont use sesion_register,
unregister, and is_registered when your using $_SESSION;


 
 $_SESSION['logged'] = True;
 $_SESSION['user'] = $row['user'];
 
 $target = Location:  . $_SESSION['goto'];
 
 session_unregister('goto');

Use: unset($_SESSION['goto']);

 
 header($target);
what does echo($target) yeild?

 
 What I get after this is a blank page. The user has been logged in and
 shows in the session file, but it just isn't redirecting.
 

HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Opinon please - Host refuses to install a later version than 4.2.3 - says they're too buggy.

2003-07-23 Thread Steve Childs
Ok, I recently upgraded to 4.2.3 or rather my hosts did. However, I'm now
getting some mySQL crashes (we upgraded to mySQL 4 at the same time) which
didn't happen on 4.1.6 and also phpMyAdmin is reporting a bug with strings
in 4.2.3 and advises upgrading.

The problem is the hosts refuse to upgrade to anything after 4.2.3 as 4.2.3
is the only one packaged up with Debian (the OS used on the server) and
anything over 4.2.3 is too buggy to install, in particular 4.3.2 has quote
In particular there are severe memory and semaphore issues with
4.3.2 that make it almost unusable in a production environment.

If that's the case, why hasn't 4.3.2 been fixed since late May? Or is my
hosting company just making up excuses?

I would like to get away from 4.2.3, just wondering what people's thoughts
on the current version of php are.

Thanks  Regards


Steve Childs,



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



RE: [PHP] Re: homemade authentication function [SOLVED]

2003-07-23 Thread Svar fjr
Hey, thanks Sven. This seems to be working for me.

-Original Message-
From: sven [mailto:[EMAIL PROTECTED] 
Sent: 23. jl 2003 10:35
To: [EMAIL PROTECTED]
Subject: [PHP] Re: homemade authentication function

i think the problem isn't only your 'return false' but also your 'return
true' in your first loop through your foreach will definetly a 'return'
be
passed. and return means return a value AND stop the function. not?

try it this way:

foreach ($groups as $value)
{
if(!isset($this-user['groups'][$value]) ||
!$this-user['groups'][$value])
{
return false;
}
}
return true;

ciao SVEN

Sv lyp wrote:
 I'm making an authentication script with groups and roles. This
 function checks if the groups the user belongs to specified groups
 and compares them to the groups required. However, since this is a
 loop, the function doesn't return true or false as expected. If I
 call the function and require 3 groups, and the user belongs to only
 one of them, he is still accepted. Is this method right thinking?
 Should I make the function stop somehow when it returns false for the
 first time? All suggestions and comments are appreciated. Thanks.

 This is the function:

 function require_groups() {
 if (!isset($this-user['groups'])) {
 $this-user['groups'] =
 $this-get_user_groups($this-id);
 }
 $groups = func_get_args();
 foreach ($groups as $value) {
 if
 (!isset($this-user['groups'][$value]) ||
 !$this-user['groups'][$value]) {
 return false;
 }
 else{
 return true;
 }
 }
 }

 And I call it like this: require_groups(admins,
 moderators,members);
 This returns true.

 Kveja,
 Svar fjr
 [EMAIL PROTECTED]
 etta reddast - hnnunarlausnir


file:///C:\Documents%20and%20Settings\S%E6var\Application%20Data\Micros
 oft\Signatures\www.reddast.is www.reddast.is



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



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



[PHP] Re: Opinon please - Host refuses to install a later version than 4.2.3 - says they're too buggy.

2003-07-23 Thread Ivo Fokkema
 I would like to get away from 4.2.3, just wondering what people's thoughts
 on the current version of php are.
When my hosting provider installed 4.3.2 in the beginning of june, the
get_browser() function which is used for my statistics didn't work correctly
anymore and didn't return all the information necessary. I'm not sure about
other bugs but I haven't encountered other problems.

--
Ivo Fokkema
PHP  MySQL programmer



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



Re: [PHP] Re: header headers_sent BUG

2003-07-23 Thread James M. Luedke
according to the php doc, online the headers are not affected by the 
Output Buffer,
so any functions that manipulate the OB should have no effect. flush I 
do not beleive
will fix this issue. (* I have tested it and it did not *)

Still need a good way to accomplish this.

Thanks, James

Ivo Fokkema wrote:

You might want to check whether or not your header output is getting
buffered. My suggestion is a flush() after the fist call. I'm not an expert
on this, it's just an idea.
HTH

--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands
James M. Luedke [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Hello all:
   I am having a hard time with a small piece of code. I was wondering
if someone may be able to explain why the following code will not work...
   

I
 

have been scratching my head for a few hours now and I am stumped.

?php

header(Location: http://someplace.com;);

if( ! headers_sent())
   header(Location: http://somplaceelse.com;);
?

So I would expect this  piece of code to direct me to somplace.com.
However it does not, and I always end up at somplaceelse.com.
I have done a tcpdump to assist with debugging here is the output below.
From the look of it the first header is getting ignored all toghether. Is
there some way to force changes I made to the headers, that will make
headers_sent return TRUE?
Thanks,

-James

---
GET /tracking/test.php HTTP/1.1
Host: dev.www.someplace.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0)
Gecko/20020623 Debian/1.0.0-0.woody.1
Accept:
   

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
 

Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Keep-Alive: 300
Connection: keep-alive
Cookie: toolkitAccess=1
HTTP/1.1 302 Found
Date: Wed, 23 Jul 2003 10:04:55 GMT
Server: Apache/1.3.27 (Unix) mod_ssl/2.8.14 OpenSSL/0.9.6d PHP/4.3.1
mod_perl/1.27
X-Powered-By: PHP/4.3.1
Location: http://someplaceelse.com
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
---
   



 





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


RE: [PHP] Re: Redirection Question (I spoke to soon)

2003-07-23 Thread Ford, Mike [LSS]
 -Original Message-
 From: Ow Mun Heng [mailto:[EMAIL PROTECTED]
 Sent: 23 July 2003 11:37
 
   I'm confused..
 
 quote
  With $_SESSION, there is no need to use the session_register(),
  session_unregister(), session_is_registered() functions. Session
  variables are accessible like any other variables. 
 /quote
 
   I'm using
 
 session_start();
 session_register('username');
 $_SESSION['username'] = $row['username'];
 session_register('user_id');
 $_SESSION['user_id'] = $row['user_id'];
 session_register('access_level');
 $_SESSION['access_level'] = $row['access_level'];
 
 and checking if user is authenticated using
 
 if ( session_is_registered('user_id') ) 
   {
   return true;
   }
   else
   {   
   return false;
   }
 
 
 Am I in error? (I'm trying to code using register_globals=off)

Yes.

If you use only the $_SESSION array to set/get the values of your session
variables, you do not need (and, in some versions of PHP, MUST NOT use)
session_register() or any of its friends.

The proper coding for what you are doing above is:

  session_start();
  $_SESSION['username'] = $row['username'];
  $_SESSION['user_id'] = $row['user_id'];
  $_SESSION['access_level'] = $row['access_level'];

and

  if (isset($_SESSION['user_id']) ) 
{
return true;
}
else
{   
return false;
}

(or even just

return isset($_SESSION['user_id']);

! ;)

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



RE: [PHP] header headers_sent BUG

2003-07-23 Thread Ford, Mike [LSS]
 -Original Message-
 From: James M. Luedke [mailto:[EMAIL PROTECTED]
 Sent: 22 July 2003 07:07
 I am having a hard time with a small piece of code. I was 
 wondering
 if someone may be able to explain why the following code will 
 not work... I
 have been scratching my head for a few hours now and I am stumped.
 
 ?php
 
 header(Location: http://someplace.com;);

At this point, you have specified that you want the header Location: 
http://someplace.com; to be sent when headers are sent -- but headers are not sent 
until you output some actual content to your page.  So...
 
 if( ! headers_sent())

... headers haven't been sent yet, so this test always triggers, so...

  header(Location: http://somplaceelse.com;);

... this call always executes, specifying that, actually, you want *this* Location 
header to be sent when headers are sent, not the one specified before.

I haven't the faintest idea what you might be trying to achieve here, but I think you 
need to rethink the logic of how you choose which redirect to use.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



RE: [PHP] header headers_sent BUG

2003-07-23 Thread Jay Blanchard
[snip]
Hello all:
I am having a hard time with a small piece of code. I was wondering
if someone may be able to explain why the following code will not
work... I
have been scratching my head for a few hours now and I am stumped.

?php

header(Location: http://someplace.com;);

if( ! headers_sent())
header(Location: http://somplaceelse.com;);

?

So I would expect this  piece of code to direct me to somplace.com.
However it does not, and I always end up at somplaceelse.com.

I have done a tcpdump to assist with debugging here is the output below.
 From the look of it the first header is getting ignored all toghether.
Is
there some way to force changes I made to the headers, that will make
headers_sent return TRUE?
[/snip]

First of all, let's not call something a bug unless we are pretty darn
sure about it. Let's just call it a problem...

Second, from http://www.php.net/headers_sent You can't add any more
header lines using the header() function once the header block has
already been sent. Using this function you can at least prevent getting
HTTP header related error messages. Another option is to use Output
Buffering.

Also, do those spaces exist in your code? If so you may want to change;

if( ! headers_sent())

to

if(!headers_sent())

HTH!

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



RE: [PHP] header headers_sent BUG

2003-07-23 Thread Ford, Mike [LSS]
 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]
 Sent: 23 July 2003 12:31

big snip

 Also, do those spaces exist in your code? If so you may want 
 to change;
 
 if( ! headers_sent())
 
 to
 
 if(!headers_sent())

There's nowt wrong there -- both of those are functionally identical.  The
extra spaces are ignored by PHP, so the difference is purely cosmetic.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



Re: [PHP] header headers_sent BUG

2003-07-23 Thread Marek Kilimajer
Added to this, your later header replaces the earlier one of the same 
type, unless you specify false to the second parameter of header() function.
More in the manual.

Ford, Mike [LSS] wrote:

-Original Message-
From: James M. Luedke [mailto:[EMAIL PROTECTED]
Sent: 22 July 2003 07:07
   I am having a hard time with a small piece of code. I was 
wondering
if someone may be able to explain why the following code will 
not work... I
have been scratching my head for a few hours now and I am stumped.

?php

header(Location: http://someplace.com;);


At this point, you have specified that you want the header Location: http://someplace.com; to be sent when headers are sent -- but headers are not sent until you output some actual content to your page.  So...
 

if( ! headers_sent())


... headers haven't been sent yet, so this test always triggers, so...


header(Location: http://somplaceelse.com;);


... this call always executes, specifying that, actually, you want *this* Location header to be sent when headers are sent, not the one specified before.

I haven't the faintest idea what you might be trying to achieve here, but I think you need to rethink the logic of how you choose which redirect to use.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211


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


[PHP] Reminder programs

2003-07-23 Thread c b gambrell
Does anyone have experience with any of these email reminder programs or 
can someone suggest a better alternative?
	myAgenda
	E*Reminders
	Flash - Reminders
	Email Reminders

These seem to address my needs (support web-based creation of reminder, 
support single or recurring reminders, can be hour and minute specific, can 
support reminder before event and at event).

Thanks for the help

Charles

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

[PHP] Session problem when setting session variables in files that are in different directories

2003-07-23 Thread Mikael Jansson
I am running PHP 4.3.0 on a WinXPpro machine and I recently got problem with
sessions.

What I am building is a loginsystem and I need to save some parameters in
session variables. This works fine on my Win2k pro machine but when I moved
it to winXP it creates two different sessions when I set the $_SESSION
variables. here is some psedo code:

1. When going to any page first thing is to check if permission is set and
also setting a session variable with the pagename (to use as an redirct
later on)
2. after setting the session variable an file is included that performs the
actual login or permission check. In this file another session variable is
set after the login is made, and now starts the weard thing, because now a
new sessionID will be created and if I look in the sessiondata directory
there will be 2 files (with different session ids) that has all the data I
have set but in 2 files.

The first session variable is set from a PHP file in one directory and then
the include file is in another directory and that seems to be the problem
because if I move the first PHP file into the include file directory it will
all work just fine.

Please say you have some comments on what the problem is.

Thanx in advance

/ Mikael



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



Re: [PHP] Opinon please - Host refuses to install a later version than 4.2.3 - says they're too buggy.

2003-07-23 Thread Jason Wong
On Wednesday 23 July 2003 18:39, Steve Childs wrote:
 Ok, I recently upgraded to 4.2.3 or rather my hosts did. However, I'm now
 getting some mySQL crashes (we upgraded to mySQL 4 at the same time) which
 didn't happen on 4.1.6 and also phpMyAdmin is reporting a bug with strings
 in 4.2.3 and advises upgrading.

 The problem is the hosts refuse to upgrade to anything after 4.2.3 as 4.2.3
 is the only one packaged up with Debian (the OS used on the server) and
 anything over 4.2.3 is too buggy to install, in particular 4.3.2 has quote
 In particular there are severe memory and semaphore issues with
 4.3.2 that make it almost unusable in a production environment.

 If that's the case, why hasn't 4.3.2 been fixed since late May? Or is my
 hosting company just making up excuses?

 I would like to get away from 4.2.3, just wondering what people's thoughts
 on the current version of php are.

bugs.php.net to see the known bugs.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
To save a single life is better than to build a seven story pagoda.
*/


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



Re: [PHP] header headers_sent BUG

2003-07-23 Thread Curt Zirzow
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
 Added to this, your later header replaces the earlier one of the same 
 type, unless you specify false to the second parameter of header() function.
 More in the manual.

The second parameter specifies whether it will overwrite an existing
parameter. I think it is unpredictable on which Location header the
browser will actually use.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Curt Zirzow
* Thus wrote Ow Mun Heng ([EMAIL PROTECTED]):
 I'm new but.. aren't you also supposed to register the session??
 
 My code ..
 
 session_start();
 session_register('username'); 
 $_SESSION['username'] = $row['username'];
 session_register('user_id');
 $_SESSION['user_id'] = $row['user_id'];
 session_register('access_level');
 $_SESSION['access_level'] = $row['access_level'];

No that is incorrect.

snip session_register()
CAUTION:
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use
session_register(), session_is_registered(), and session_unregister(). 
/snip

What happens if you register session_register('username') is that the
$_SESSION['username'] namespace is dedicated to the global variable
$username.  

So, if in your script after your block of code, you use the variable
$username (global scoped) then your $row['username'] value you assigned
in $_SESSION['username'] is gone.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Jeff Stillwall
Curt Zirzow wrote:

 So i would also assume you have called session_start() already. and yes
 global for version = 4.1.0

Yes, I have session_start at the top of every page, and have run this
against PHP versions 4.12, 4.31 and 4.32.

 quote
 If register_globals is disabled, only members of the global associative
 array $_SESSION can be registered as session variables. The restored
 session variables will only be available in the array $_SESSION.
 /quote
 
 I can't make heads or tails what that means.

It means that you can't use session_register.  With register_globals off,
you can on directly manipulate the $_SESSION array.

 I've set up something what you describe, it works for me:
 
 http://zirzow.dyndns.org/php/session.php

Wow, thanks.  The only thing that I'm doing differently is that the function
is part of an included file (via 'require').  Would that change anything?

I've done this before also - never had a problem until now!
-- 
Jeff Stillwall


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



Re: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Jeff Stillwall
Ow Mun Heng wrote:

 I'm new but.. aren't you also supposed to register the session??

The code I posted was just a single function.  I am calling session_start()
at the head of the page.  Thanks, though.
-- 
Jeff Stillwall


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



Re: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Jeff Stillwall
Curt Zirzow wrote:

 I've set up something what you describe, it works for me:
 
 http://zirzow.dyndns.org/php/session.php

OK, here's more fuel for the fire.  When passed to this function, $userArray
is 31 elements long.  The initial function I was using (and posted) was only
grabbing 6 of those.  I changed my function to grab all of them:

function setupUserEnv ($userArray) {
$_SESSION['loggedIn'] = 1;
foreach($userArray as $key=$value) {
echo Assigning $key = $valuebr;
$_SESSION[$key] = $value;
}
}

Thanks to the echo statements, I see all 31 getting assigned.  However, when
I exit this function, and var_dump($_SESSION), only 6 are assigned!

Wrackingmybrain.
-- 
Jeff Stillwall


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



Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Hi,
 
 I have to convince one guy to not move our site from Linux box where
 it runs with Apache/PHP + MySQL to Windows box where it's going to deal
 with Windows 2k/IIS/PHP(CGI) + MySQL and I need really good arguments,
 cause it's only way I can convince him (cause his position in company
 is much stronger than mine).

 
 I know that PHP under windows is intended to be used only as test
 platform, but this is not enough to convince him.

Perhaps back when php3 was new and apache was strugling with windows,
it was considered test platform.

 
 Can you help me? I need some reasons like things that won't work under
 windows version of PHP (or at least MySQL) and that are not easy to
 fix. I've already found that IIS doesn't provide
 $_SERVER[DOCUMENT_ROOT] but it's not too much work to fix that..

Its kind of difficult to come up with reasons not to use IIS without
knowledge of:

  1. Who and what experience does he(she) have in administrating these
 Windows servers.

  2. What kind of application do you intend write in php.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] PHP CMS for high load

2003-07-23 Thread Matt Schroebel
Is anyone using a php/mysql/apache CMS (either custom or open source)
that is performing well serving on the order of 1 million page views a
month with 2600+ items of content?  If so, I'd like to know what your
using and a description of your server setup, such as if the backend
runs on a different server then the frontend, whether the DB server is
separate, memory and CPU speeds.  Thanks

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



Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread Tom Rogers
Hi,

Wednesday, July 23, 2003, 7:13:17 PM, you wrote:
PP I have concluded that Bill Gates is Satan!

PP Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on the hour 
every day for eternity to go and run a series of Java files I wrote that connect 
remotely to a remote server to
PP do remote cleanup of stray XML files, etc.; things I cannot do on the remote 
machine box itself because it's remote and I don't have permissions were I physically 
on the box anyway.

PP However, on 7/18 all 26 of my scheduled tasks stopped running; one of which 
continuously ran for 4 days straight w/o stopping (nor could I manually stop it).  I 
deleted the runaway process and
PP recreated it; now not a single one of my 26 scheduled Win2000 tasks I created 
using MS-DOS AT commands work (which were working since 7/2).

PP I am now looking into programmatic alternatives.  I really could use some ideas 
that are practical given my situation.  I'm thinking PHP since I am very comfortable 
with it, were it possible
PP within my bizarre Win2000 environment, but I need something that will clean those 
XML files remotely on a regular basis, it's important for website maintenance.  Any 
help appreciated.

PP Thanx
PP Phil

have a look for a file similar to this one and delete it, that should
get your scheduler running again while you upgrade to linux :)

C:\Documents and Settings\username_here\Application 
Data\Microsoft\Crypto\RSA\S-1-5-21-789336058-1788223648-682003330-1000

its the S-1... file
-- 
regards,
Tom


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



[PHP] PECL v. PEAR

2003-07-23 Thread Chris Boget
Could someone point me to a good website that discuss 
the above?  I can't find reference to PECL on either the 
PHP or Zend site and PHPBuilder isn't pulling much up, 
either.
I don't want to clutter the list up with something that would 
seem to have been addressed before (possibly many times)
so if someone can just point me in the right direction?

thnx,
Chris


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



Re: [PHP] direcorty listing

2003-07-23 Thread Curt Zirzow
* Thus wrote FB ([EMAIL PROTECTED]):
 Hi,
 
 I have a directory like structure below
 
 - cityname
 --townname
 ---busname
 day
 -info.zip
 
 I want to write a script and let it search the directory and find the zip
 files open them do the operation and save the out file as
 
 cityname_townname_busname_day_info.txt
 
 I am doing it for any zip files so the last part is O.K. by now but I need a
 loop to go under the direcoty structure and search for them. Cause if the
 info file is at level 2 (I mean under the townname direcotry) than it means
 a brief info of the time table so it will be save as
 cityname_townname_info.txt
 
 I am not familiar with the direcotry functions. Can anybody help me with
 that?

http://php.net/dir

There are some examples on how to scan the directory there (even
recursion ones although I'd do them differently)


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Mail functions in php

2003-07-23 Thread Justin French
Have you read the mail page in the manual?
Didn't think so :)
It discusses multipart messages/attachments/etc, links to and provides 
examples/tutorials on the topic, etc etc.  Start there, then come back 
if you get stuck.

http://au.php.net/manual/en/function.mail.php

Justin



On Wednesday, July 23, 2003, at 07:36  PM, Uma Shankari T. wrote:

Hello,

I need to send audio/video files through PHP mail() function.
What is the MIME type i need to use?
or else
Is there any other way to send attachment as a mail?

Please help me.

Thanx in advance,
Uma
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
[This E-mail scanned for viruses]



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


RE: [PHP] Apache 2.x and PHP

2003-07-23 Thread Brad Young
We have a detailed whitepaper on the subject.

Please check out: http://www.zend.com/whitepapers/PHPandApache2-ZendWhitepaper.pdf

BY

__
Brad Young
[EMAIL PROTECTED] 
www.zend.com 
Zend - The PHP Company
 

Hi All,

Can anyone aswer this simple question, that i still have not found it 
anywhere...
Is PHP capable of running on Apache 2.x and if so what version ?
And is it stable ?


Thankxs for any reply

Miguel Angelo



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



Re: [PHP] Re: Redirection Question (I spoke to soon)

2003-07-23 Thread Curt Zirzow
* Thus wrote Ow Mun Heng ([EMAIL PROTECTED]):
 Hi Curt,
 
   I'm confused..

I'll try to clear this up for you. I'm going to see if I can get the
documentation on the web site fixed also. It is rather confusing.

There appears to be two ways to do sessions:

'---
Style 1 (discuraged use):
'---
  session_start(); // start the session

  session_register('var'); // register global $var as session var

  $var = $row['var'];  // assign global $var a value
   // now the session will save the value
   // that is inside $var as long as its global
   // scoped

  // check to see if $var is registered with the session handler
  if ( session_is_registered('var') )  {

// session is registered but doesn't gaurentee 
// that a value is inside of it. 

// so check to see if there is a value
if (isset($var)) {

  // yes we have a value

} else {

  // no value assigned

}
  } else {

// session variable $var is not registered so the
// variable $var will not be saved in the session

  }

  session_unregister('var');  // Now var will not be saved in the
  // session


'---
Style 2 (prefered method):
'---
  session_start();// start the session

  $_SESSION['var'] = $row['var']; // set the session value
  // any time you need to access this 
  // value you need to reference it
  // through $_SESSION['var']

  // check to see if session 'var' is in the session
  if(isset($_SESSION['var']) ) {

// yes, so pull it out and do stuff
$var = $_SESSION['var'];

// do stuff...
  } else {

// no, there is no $_SESSION['var']
// and will not be saved in session.

  }

  unset($SESSION['var']);  // Now var will not be saved in the
   // session


HTH,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re[2]: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread sebab

Wednesday, July 23, 2003, 3:33:48 PM, you wrote:
CZ * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 Hi,
 
 I have to convince one guy to not move our site from Linux box where
 it runs with Apache/PHP + MySQL to Windows box where it's going to deal
 with Windows 2k/IIS/PHP(CGI) + MySQL and I need really good arguments,
 cause it's only way I can convince him (cause his position in company
 is much stronger than mine).

 
 I know that PHP under windows is intended to be used only as test
 platform, but this is not enough to convince him.

CZ Perhaps back when php3 was new and apache was strugling with windows,
CZ it was considered test platform.

Maybe, I just remembered that warning and actually I can't find such
one in PHP manual/installation notes.
Does the same apply to MySQL?


 
 Can you help me? I need some reasons like things that won't work under
 windows version of PHP (or at least MySQL) and that are not easy to
 fix. I've already found that IIS doesn't provide
 $_SERVER[DOCUMENT_ROOT] but it's not too much work to fix that..

CZ Its kind of difficult to come up with reasons not to use IIS without
CZ knowledge of:

CZ   1. Who and what experience does he(she) have in administrating these
CZ  Windows servers.

CZ   2. What kind of application do you intend write in php.

One of the reasons I (we) don't want to move to Windows and IIS is
that person being administrator of that box knows less than he thinks
he knows ;) and surely server is not well configured and protected..
Beside that site now works on Linux server without any problems and
moving it will cause only pointless work. But moving to IIS is
decision made by someone above me so without good reasons against I
can't stop that. And believe me - there is really no need to move to
IIS.

CZ Curt
CZ -- 
CZ I used to think I was indecisive, but now I'm not so sure.


Sebastian


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



Re: [PHP] Opinon please - Host refuses to install a later version than 4.2.3 - says they're too buggy.

2003-07-23 Thread Curt Zirzow
* Thus wrote Steve Childs ([EMAIL PROTECTED]):
 Ok, I recently upgraded to 4.2.3 or rather my hosts did. However, I'm now
 getting some mySQL crashes (we upgraded to mySQL 4 at the same time) which
 didn't happen on 4.1.6 and also phpMyAdmin is reporting a bug with strings
 in 4.2.3 and advises upgrading.

I'm not sure about the crashes but make sure you php is using the right
libmysqlclient.so, i've had problems when using the wrong one.

 
 The problem is the hosts refuse to upgrade to anything after 4.2.3 as 4.2.3
 is the only one packaged up with Debian (the OS used on the server) and
 anything over 4.2.3 is too buggy to install, in particular 4.3.2 has quote
 In particular there are severe memory and semaphore issues with
 4.3.2 that make it almost unusable in a production environment.

The php developers wont release code that is know to be buggy, the
releases actually fix more bugs than introduce them.

 
 If that's the case, why hasn't 4.3.2 been fixed since late May? Or is my
 hosting company just making up excuses?

If there was major problems with it php will put a notice out, as far as
I know there is no such notice.  

They might be making up excuses souly on the fact that they can't spend
everyday upgrading versions of software. They probably prioritize what
was important and not.  Seeing that their have been complaints with
php 4.3.2 they decided not to deal with support issues. 

At least that would be my thinking as a hosting company.

 
 I would like to get away from 4.2.3, just wondering what people's thoughts
 on the current version of php are.

I havn't upgraded yet so couldn't comment.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] PECL v. PEAR

2003-07-23 Thread Curt Zirzow
* Thus wrote Chris Boget ([EMAIL PROTECTED]):
 Could someone point me to a good website that discuss 
 the above?  I can't find reference to PECL on either the 
 PHP or Zend site and PHPBuilder isn't pulling much up, 
 either.
 I don't want to clutter the list up with something that would 
 seem to have been addressed before (possibly many times)
 so if someone can just point me in the right direction?

whats PECL?  its funny though I do a google search on PECL and PEAR
comes up... 

i'm assuming PECL is some library type thing like PEAR.

The PEAR mailing list might be able to give you some documentation
(biased as it may be)

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Opinon please - Host refuses to install a later version than 4.2.3 - says they're too buggy.

2003-07-23 Thread Justin French
This really should be asked on a MySQL list for starters, but my advice 
is to search for a host that WILL upgrade or do what you want/need.

There are 1000's of hosts out there... you shouldn't have any trouble 
finding a host to meet your requirements, and (at least for me) 
changing hosts is as simple as editing a single config file, uploading, 
and waiting for DNS to kick in :)

Justin



On Wednesday, July 23, 2003, at 08:39  PM, Steve Childs wrote:

Ok, I recently upgraded to 4.2.3 or rather my hosts did. However, I'm 
now
getting some mySQL crashes (we upgraded to mySQL 4 at the same time) 
which
didn't happen on 4.1.6 and also phpMyAdmin is reporting a bug with 
strings
in 4.2.3 and advises upgrading.

The problem is the hosts refuse to upgrade to anything after 4.2.3 as 
4.2.3
is the only one packaged up with Debian (the OS used on the server) and
anything over 4.2.3 is too buggy to install, in particular 4.3.2 has 
quote
In particular there are severe memory and semaphore issues with
4.3.2 that make it almost unusable in a production environment.

If that's the case, why hasn't 4.3.2 been fixed since late May? Or is 
my
hosting company just making up excuses?

I would like to get away from 4.2.3, just wondering what people's 
thoughts
on the current version of php are.


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


Re: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Curt Zirzow
* Thus wrote Jeff Stillwall ([EMAIL PROTECTED]):
 Curt Zirzow wrote:
 
  So i would also assume you have called session_start() already. and yes
  global for version = 4.1.0
 
 Yes, I have session_start at the top of every page, and have run this
 against PHP versions 4.12, 4.31 and 4.32.

hmm.. i'm running 4.33RC1.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



RE: [PHP] images in databases Flash via PHP

2003-07-23 Thread Luis Lebron
There a few different ways to do this. One method that we use here is to do
something like this in the embed/object tags

flash.swf?image=?php echo $image; ?

The php $image variable, of course, could be set by any method (post/get, db
query, etc...)


Luis

-Original Message-
From: Tim Baker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 22, 2003 12:01 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] images in databases  Flash via PHP



I was wondering - are there any good tutorials/examples of serving 
updating images from a mySQL database via PHP?  I assume this is possible,
but I'm almost a newbie having not used PHP/mySQL for ages with some
knowledge but would like to know more...

Also now Flash MX can dynamically take JPEGs and MPEGs in
'dynamically' at runtime now, anyone combined this with PHP/mySQL to serve
images? (I'd guess someone or many people have :-) 

I've done it from the Flash only side, loading variables and
images/music, building modular duplicated movieclips etc. and want to do the
next step which is to combine that with databases (I'm currently using text
files, files on a webserver etc.)

thanks

Tim Baker 

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


Re: [PHP] PECL v. PEAR

2003-07-23 Thread Thomas Seifert
On Wed, 23 Jul 2003 14:22:40 + [EMAIL PROTECTED] (Curt Zirzow) wrote:

 * Thus wrote Chris Boget ([EMAIL PROTECTED]):
  Could someone point me to a good website that discuss 
  the above?  I can't find reference to PECL on either the 
  PHP or Zend site and PHPBuilder isn't pulling much up, 
  either.
  I don't want to clutter the list up with something that would 
  seem to have been addressed before (possibly many times)
  so if someone can just point me in the right direction?
 
 whats PECL?  its funny though I do a google search on PECL and PEAR
 comes up... 
 
 i'm assuming PECL is some library type thing like PEAR.
 
 The PEAR mailing list might be able to give you some documentation
 (biased as it may be)


PECL is a part of PEAR, or at least they are stringed together.

as far as I understand, PECL is the thing for C/C++-extensions to PHP, 
PEAR are extensions/classes written in PHP.



Thomas

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



Re: [PHP] PECL v. PEAR

2003-07-23 Thread Chris Boget
 whats PECL?  its funny though I do a google search on PECL and PEAR
 comes up... 

From my (very limited) understanding, PECL is supposed to ultimately replace
PEAR.  Or something like that.
My lack of knowledge in this area is why I was asking for the pointer.
 
thnx,
Chris


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



[PHP] How to Determine Number of connected users to PostgreSQL

2003-07-23 Thread aka MacGuru
Hi,

Is it possible to determine number of connected users to certain 
PostgreSQL database from within PHP script?

Thanks in advance for any suggestion.

*
*   Best Regards   ---   Andrei Verovski
*
*   Personal Home Page
*   http://snow.prohosting.com/guru4mac
*   Mac, Linux, DTP, Development, IT WEB Site
*
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Opinon please - Host refuses to install a later version than 4.2.3 - says they're too buggy.

2003-07-23 Thread Steve Childs
Yeah, I'd agree there are loads of hosts around, however on the whole, these
are the best I've ever come across - and I've been through more than a few!
They are usually right about most things, but I just get the feeling they
are more in favour of Perl than PHP and I can't stand Perl! ;)

I was just wondering what people thought of the general state of 4.3.2,
thanks everyone for their answers - I didn't think there would be any
serious problems as someone said, they wouldn't release one if they knew it
was buggy.

The question has to be asked though (although this probably isn't the right
place to do so) - why is the latest Debian APT package 4.3.2? Tis rather
old.
-- 
Regards


Steve Childs,
Justin French [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This really should be asked on a MySQL list for starters, but my advice
 is to search for a host that WILL upgrade or do what you want/need.

 There are 1000's of hosts out there... you shouldn't have any trouble
 finding a host to meet your requirements, and (at least for me)
 changing hosts is as simple as editing a single config file, uploading,
 and waiting for DNS to kick in :)

 Justin



 On Wednesday, July 23, 2003, at 08:39  PM, Steve Childs wrote:

  Ok, I recently upgraded to 4.2.3 or rather my hosts did. However, I'm
  now
  getting some mySQL crashes (we upgraded to mySQL 4 at the same time)
  which
  didn't happen on 4.1.6 and also phpMyAdmin is reporting a bug with
  strings
  in 4.2.3 and advises upgrading.
 
  The problem is the hosts refuse to upgrade to anything after 4.2.3 as
  4.2.3
  is the only one packaged up with Debian (the OS used on the server) and
  anything over 4.2.3 is too buggy to install, in particular 4.3.2 has
  quote
  In particular there are severe memory and semaphore issues with
  4.3.2 that make it almost unusable in a production environment.
 
  If that's the case, why hasn't 4.3.2 been fixed since late May? Or is
  my
  hosting company just making up excuses?
 
  I would like to get away from 4.2.3, just wondering what people's
  thoughts
  on the current version of php are.




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



Re: [PHP] Some SESSION Vars not Registering

2003-07-23 Thread Curt Zirzow
* Thus wrote Jeff Stillwall ([EMAIL PROTECTED]):
 Curt Zirzow wrote:
 
  I've set up something what you describe, it works for me:
  
  http://zirzow.dyndns.org/php/session.php
 
 OK, here's more fuel for the fire.  When passed to this function, $userArray
 is 31 elements long.  The initial function I was using (and posted) was only
 grabbing 6 of those.  I changed my function to grab all of them:
 
 function setupUserEnv ($userArray) {
 $_SESSION['loggedIn'] = 1;
 foreach($userArray as $key=$value) {
 echo Assigning $key = $valuebr;
 $_SESSION[$key] = $value;
 }
 }
 

I modified this to do 31 variables:
http://zirzow.dyndns.org/php/session.php

 Thanks to the echo statements, I see all 31 getting assigned.  However, when
 I exit this function, and var_dump($_SESSION), only 6 are assigned!

The only thing i can think, mabey, is size limit?  how long are these
values your assigning?


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
 
 Wednesday, July 23, 2003, 3:33:48 PM, you wrote:
 CZ * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
  Hi,
  
  I have to convince one guy to not move our site from Linux box where
  it runs with Apache/PHP + MySQL to Windows box where it's going to deal
  with Windows 2k/IIS/PHP(CGI) + MySQL and I need really good arguments,
  cause it's only way I can convince him (cause his position in company
  is much stronger than mine).
 
  
  I know that PHP under windows is intended to be used only as test
  platform, but this is not enough to convince him.
 
 CZ Perhaps back when php3 was new and apache was strugling with windows,
 CZ it was considered test platform.
 
 Maybe, I just remembered that warning and actually I can't find such
 one in PHP manual/installation notes.
 Does the same apply to MySQL?

I have no experience with MySQL server on windows, therefore I can't
comment on that. 

 
 
  
  Can you help me? I need some reasons like things that won't work under
  windows version of PHP (or at least MySQL) and that are not easy to
  fix. I've already found that IIS doesn't provide
  $_SERVER[DOCUMENT_ROOT] but it's not too much work to fix that..
 
 CZ Its kind of difficult to come up with reasons not to use IIS without
 CZ knowledge of:
 
 CZ   1. Who and what experience does he(she) have in administrating these
 CZ  Windows servers.
 
 CZ   2. What kind of application do you intend write in php.
 
 One of the reasons I (we) don't want to move to Windows and IIS is
 that person being administrator of that box knows less than he thinks
 he knows ;) and surely server is not well configured and protected..

That always seems to be the case... expecially when this issue comes up.

 Beside that site now works on Linux server without any problems and
 moving it will cause only pointless work. But moving to IIS is
 decision made by someone above me so without good reasons against I
 can't stop that. And believe me - there is really no need to move to
 IIS.

I don't understand then why they want to move, it seems that what you
just said proves to be the strongest case... if it aint broke, leave it
alone.

I know this has been discussed plenty of times, have you searched the
archives? There might be some good points made on this already.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] PECL v. PEAR

2003-07-23 Thread Curt Zirzow
* Thus wrote Thomas Seifert ([EMAIL PROTECTED]):
 On Wed, 23 Jul 2003 14:22:40 + [EMAIL PROTECTED] (Curt Zirzow) wrote:
 
  * Thus wrote Chris Boget ([EMAIL PROTECTED]):
   Could someone point me to a good website that discuss 
   the above?  I can't find reference to PECL on either the 
   PHP or Zend site and PHPBuilder isn't pulling much up, 
   either.
   I don't want to clutter the list up with something that would 
   seem to have been addressed before (possibly many times)
   so if someone can just point me in the right direction?
  
  whats PECL?  its funny though I do a google search on PECL and PEAR
  comes up... 
  
  i'm assuming PECL is some library type thing like PEAR.
  
  The PEAR mailing list might be able to give you some documentation
  (biased as it may be)
 
 
 PECL is a part of PEAR, or at least they are stringed together.
 
 as far as I understand, PECL is the thing for C/C++-extensions to PHP, 
 PEAR are extensions/classes written in PHP.
 

Ahh.. so that explains my google results.. I was worried about google
there for a moment :)


Thanks,

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] header headers_sent BUG

2003-07-23 Thread Chris Shiflett
--- James M. Luedke [EMAIL PROTECTED] wrote:
 I was wondering if someone may be able to explain why the following
 code will not work... I have been scratching my head for a few hours
 now and I am stumped.
 
 ?php
 header(Location: http://someplace.com;);
 
 if( ! headers_sent())
 header(Location: http://somplaceelse.com;);
 ?
 
 So I would expect this  piece of code to direct me to somplace.com.

Your second call to header() uses the same header name, thus that header
(Location) is replaced with http://someplaceelse.com. The code works as
expected.

If you expected your conditional statement to fail, you are probably confusing
headers_sent() to mean something like have_i_used_the_header_function_yet().
The headers are all sent at once, regardless of how many times you use
header(). This function helps people avoid receiving the headers already sent
warning, and as long as you have no output yet in your script, you should still
be able to make changes to the headers.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread Juan Nin
First of all, security.. Windows is full of security holes

Second, a Win2k server ussually needs to be rebooted after several days of
running
A Linux box usually stays months and months running without any problem
without having to touch it
I got a Linux box running Apache + PHP + MySQL, Postfix + amavisd + uvscan,
cistron-radiusd plus some other things, and it has an uptime of 388 days.
And it works as the first day!!! I will pay the one who can achieve that
with Windows..

Third, Apache + PHP + MySQL rock, they are very well integrated

Regards,

Juan





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



[PHP] debug exhausted memory

2003-07-23 Thread Chris Hayes
dear php generalists,
I must admit that i have a pretty heave cms. But now a pretty normal query 
leads to a memory exhausted (at 8MB) crash on the server, but not at home 
with the same database content. I tried setting the memory_limit even to 
0.2 MB (and restarted apache) at home, but still no crash. What is 
happening? Server is running PHP 4.2.2 safe mode on redhat with a huge 
configure command, at home  PHP 4.3.0 with default settings on windows.

I can imagine the 8 MB goes for all PHP processes together. How can I see 
as a user whether there are more processes going on?
Can i see on PHP 4.2.3 how much memory the current process is using?

Chris 

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


Re: [PHP] arguments against moving site from Linux/Apache/PHP serverto Windows/IIS/PHP needed

2003-07-23 Thread Cesar Cordovez


[EMAIL PROTECTED] wrote:
Can you help me? I need some reasons like things that won't work under
windows version of PHP (or at least MySQL) and that are not easy to
fix. I've already found that IIS doesn't provide
$_SERVER[DOCUMENT_ROOT] but it's not too much work to fix that..


In windows, strtotime only works from 1/1/1970.  In linux can work with 
any date.

HTH

PS.  I use windows and apart from this is great.  Not cheap, but great.



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


Re: [PHP] PECL v. PEAR

2003-07-23 Thread Chris Shiflett
--- Curt Zirzow [EMAIL PROTECTED] wrote:
 whats PECL?  its funny though I do a google search on PECL and PEAR
 comes up...

PECL is a bunch of PHP extensions written in C, just like the PHP extensions
that come with the standard PHP distribution. It is an attempt to get the
non-essential features out of the core PHP, so that release cycles are more
sane and Web developers have more control over what functions they really need
to be compiled in (you can tune your PHP engine to be the stuff you need and
nothing else - lean and mean).

PEAR is a bunch of classes written in PHP, so they're no different than if you
wrote the same code yourself. It's just a nice way to share solutions to common
problems, and these solutions are well tested (many people using the same code,
so bugs are more easily discovered and resolved), adhere to PEAR coding
standards, and easy to install (much easier than writing the same code
yourself).

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] people who has done a POS system before

2003-07-23 Thread Tan Ai Leen
Hi,
I was just wondering there is a emulator for us developers to develop
programs for palm and handphone, etc. Is there a program that emulates the
output from various printers on screen?

Regards,
Tan Ai Leen



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



Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed

2003-07-23 Thread Chris Shiflett
--- Juan Nin [EMAIL PROTECTED] wrote:
 First of all, security.. Windows is full of security holes

Actually, IIS is much worse than the Windows OS. In fact, the Gartner Group
(suits typically respect their opinion) has recommended that it not be used in
production (http://www3.gartner.com/DisplayDocument?doc_cd=101034). If security
is of no concern to management, mention the fact that IIS has a much higher TCO
than Apache for similar reasons. Money is always a concern. :-)

If you receive pressure to move away from Linux (a server OS) to Windows (a
desktop OS) for use as a server, ask if you can move to Mac OS X instead. While
Mac OS X is actually a saner choice (it is based on a server OS now), Apple's
marketing has not been as effective as Microsoft's in this area, and most
people tend to think of Macs as desktop computers. So, if moving to Mac seems
like a poor choice, and you can illustrate how Mac is actually a compromise,
you might open some eyes. :-)

If all else fails, quit. That might be difficult depending on the job market,
but I would try to not sacrifice my life (work takes up a significant portion
of it) due to other people's poor decisions. There is too much useful stuff out
there you can learn and spend your time doing.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] walking through database one record at a time with forms.

2003-07-23 Thread Artoo
I'm tring to create a script for the WEBMASTER to go through a temporary
table in a MySQL database, and either accept or reject the data submitted by
users.

$sql = mysql_query(SELECT * FROM temp_table);
$result = mysql_num_rows($sql);

Then with,

while($row = mysql_fetch_array($sql))
{
...
...
}
I create variables and read the first record of the database, Then inside a
form the data of the record is displayed along with a ACCEPT and REJECT
buttons.

How do I have the script stop after displaying the first record and wait
until the ACCEPT or REJECT button has been pressed before displaying the
next record? Right now the script just continues and displays all the forms
in one long page, rather then haveing the execution pause until the
ACCEPT/REJECT button beeing pressed.



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



RE: [PHP] walking through database one record at a time with forms.

2003-07-23 Thread Luis Lebron
The trick is in using the MySQL 0limit statement.

For the first record use: 

$sql = mysql_query(SELECT * FROM temp_table limit 0, 1);

then increment the limit for the next record

$sql = mysql_query(SELECT * FROM temp_table limit 1, 1);


Luis

-Original Message-
From: Artoo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 10:38 AM
To: [EMAIL PROTECTED]
Subject: [PHP] walking through database one record at a time with forms.


I'm tring to create a script for the WEBMASTER to go through a temporary
table in a MySQL database, and either accept or reject the data submitted by
users.

$sql = mysql_query(SELECT * FROM temp_table);
$result = mysql_num_rows($sql);

Then with,

while($row = mysql_fetch_array($sql))
{
...
...
}
I create variables and read the first record of the database, Then inside a
form the data of the record is displayed along with a ACCEPT and REJECT
buttons.

How do I have the script stop after displaying the first record and wait
until the ACCEPT or REJECT button has been pressed before displaying the
next record? Right now the script just continues and displays all the forms
in one long page, rather then haveing the execution pause until the
ACCEPT/REJECT button beeing pressed.



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


Re: [PHP] walking through database one record at a time with forms.

2003-07-23 Thread Marek Kilimajer
Better would be to make combos (reject, accept) and then submit them all 
at once. Displaying a separate html page for each row is slow and pain 
to work with.

Artoo wrote:

I'm tring to create a script for the WEBMASTER to go through a temporary
table in a MySQL database, and either accept or reject the data submitted by
users.
$sql = mysql_query(SELECT * FROM temp_table);
$result = mysql_num_rows($sql);
Then with,

while($row = mysql_fetch_array($sql))
{
...
...
}
I create variables and read the first record of the database, Then inside a
form the data of the record is displayed along with a ACCEPT and REJECT
buttons.
How do I have the script stop after displaying the first record and wait
until the ACCEPT or REJECT button has been pressed before displaying the
next record? Right now the script just continues and displays all the forms
in one long page, rather then haveing the execution pause until the
ACCEPT/REJECT button beeing pressed.




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


[PHP] Problem with a dinamic variable -- array

2003-07-23 Thread Wan Do Ke
Here its the scenario:

i have a table with campo1x, campo1y, campo2x, campo3y, . campo10x,
campo10y on the table ejes

so what i need to do is to split an array that i send to this page on php ..
and include the values on this fields (but only on the fields that the $num
its writen)
(this is make by this way because the data is from flash)

?php


$propiedades= array(x,y);

// this values came from a $_POST (not now but they will)

$ejey =1,2,3,4;
$ejex = 1,3,22,4;
$num= 1,2,5,7;


$valx = split(,, $ejex);
$valy = split(,, $ejey);
$numo= split(,, $num);

for ($i = 0; $i  count($numo) ; $i++) {
 for ($e = 0; $e  2 ; $e++) {

// here its campo1x so then on the update i know wich field i have to
update...
// the problem is that i dont know how can i retrive the value of $valx
and $valy
// this is OK .. because i know the name of the field that i
have to update... my problem is to catch the value !
$a=campo .$numo[$i] . $propiedades[$e];

 /* this is WRONG ! i need $valy[0] or $valx[0] values checking
with $propiedades[$e]

 $b=\$val . $propiedades[$e]. [$e];


*/

// wrong the $b
$result2 = mysql_query(UPDATE ejes SET $a='$b', $Connect);


 }
}


?


Hope some good programmer can help me..
Wan Chan



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



[PHP] http://poker.club66.ro

2003-07-23 Thread Rausch Alexandru



[PHP] http://poker.club66.ro

2003-07-23 Thread Rausch Alexandru



[PHP] http://poker.club66.ro

2003-07-23 Thread Rausch Alexandru



[PHP] http://poker.club66.ro

2003-07-23 Thread Rausch Alexandru



[PHP] Search question ..

2003-07-23 Thread James Hatridge
Hi all..

I've got a search page written for my web site. I can find the html page I 
want by keyword. Now I need to get the title of that page in to a variable. 
In other words I have a file name, for example Summerbulletin.html. I now 
need to get the line title Summer 2003 /title in to a variable. How do 
I tell html or PHP what I want? (I hope that I am understandable, I'm still 
new at this. )

Right now I output the search results in to a chart that shows 
Summerbulletin.html. What I would like to show is Summer 2003. 

TIA!

JIM

Jim Hatridge
Linux User #88484
-- 
Our country was colonized by the religious, political, economic, and criminal
rejects of every country in the world. We have been carefully breeding insane, 
obsessive, fanatic lunatics with each other for over 400 years, resulting in 
the glorious strain of humanity known as Americans. You have to expect 
some... peculiarities. 

Read about new German stamps each quarter:
 http:/www.fecundswamp.net/~hatridge/bulletin


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



[PHP] Is this possible?

2003-07-23 Thread Tony Crockford
Hi


Thanks for the help on previous questions, I now have an in principle
type question.

I have a MySQL database - items in one table and descriptions in
another with a common key: item_ref
It is used to create a sort of categorised directory of the items.
(http://www.torbytes.co.uk)


each table has a status field the items have a default description and
the descriptions have a level classification.

up to now been working through all the items and printing out the
descriptions at each level printing the default if I don't have a
matching description, but I now need to do the following:

for a particular level print only the items (and their matching
description) where there is a matching description. (I hope you see what
I mean)

since the items are categorised and I don't want any dead ends in my
tree structure I have to know if there's a description before I start
working through the items.

I thought that this might be the way to do it:

select all the item-ref values from the description table.

step through this select array selecting the required fields from the
item table where item_ref=item_ref and adding them to another array.

then step through that array building up the tree structure

The trouble with it as I see it is:

it's a lot of select calls to the database (one for every description
found) and I'm not sure how to add the fields found in the item table to
a new array.


Am I going at this the wrong way?

Any help, clues or abuse accepted.

Thanks

Tony



--
NEO organizes my Outlook - check it out:
http://www.caelo.com/a/rl.php3?i=3NTVV


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



Re: [PHP] Selectoption....../select

2003-07-23 Thread Jason Wong
On Wednesday 23 July 2003 02:16, Etienne Mathot wrote:

 I use SELECTOPTION../SELECT for the year and the month.

 If anybody knows a way to redisplay the correct values of these fields and
 not Pick Up yours?

If I understand you correctly, this is in fact an HTML question. To make a 
drop down box default to a particular value you add SELECTED (without the 
quotes) somewhere within the OPTION tag.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
I hope something GOOD came in the mail today so I have a REASON to live!!
*/


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



Re: [PHP] Is this possible?

2003-07-23 Thread Adam Voigt
Umm, you mean like:

select i.id,d.description from items i, descriptions d where d.itemid =
i.id;

?

On Wed, 2003-07-23 at 12:32, Tony Crockford wrote:
 Hi
 
 
 Thanks for the help on previous questions, I now have an in principle
 type question.
 
 I have a MySQL database - items in one table and descriptions in
 another with a common key: item_ref
 It is used to create a sort of categorised directory of the items.
 (http://www.torbytes.co.uk)
 
 
 each table has a status field the items have a default description and
 the descriptions have a level classification.
 
 up to now been working through all the items and printing out the
 descriptions at each level printing the default if I don't have a
 matching description, but I now need to do the following:
 
 for a particular level print only the items (and their matching
 description) where there is a matching description. (I hope you see what
 I mean)
 
 since the items are categorised and I don't want any dead ends in my
 tree structure I have to know if there's a description before I start
 working through the items.
 
 I thought that this might be the way to do it:
 
 select all the item-ref values from the description table.
 
 step through this select array selecting the required fields from the
 item table where item_ref=item_ref and adding them to another array.
 
 then step through that array building up the tree structure
 
 The trouble with it as I see it is:
 
 it's a lot of select calls to the database (one for every description
 found) and I'm not sure how to add the fields found in the item table to
 a new array.
 
 
 Am I going at this the wrong way?
 
 Any help, clues or abuse accepted.
 
 Thanks
 
 Tony
 
 
 
 --
 NEO organizes my Outlook - check it out:
 http://www.caelo.com/a/rl.php3?i=3NTVV
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] Problem with a dinamic variable -- array

2003-07-23 Thread Curt Zirzow
* Thus wrote Wan Do Ke ([EMAIL PROTECTED]):
 Here its the scenario:
 
 i have a table with campo1x, campo1y, campo2x, campo3y, . campo10x,
 campo10y on the table ejes
 
 so what i need to do is to split an array that i send to this page on php ..
 and include the values on this fields (but only on the fields that the $num
 its writen)
 (this is make by this way because the data is from flash)
 
 ?php
 
 
 $propiedades= array(x,y);
 
 // this values came from a $_POST (not now but they will)
 
 $ejey =1,2,3,4;
 $ejex = 1,3,22,4;
 $num= 1,2,5,7;
 
 
 $valx = split(,, $ejex);
 $valy = split(,, $ejey);

It might make it easier if you set up your val as:
  $val['x'] = split(,, $ejex);
  $val['y'] = split(,, $ejey);

 $numo= split(,, $num);
 
 for ($i = 0; $i  count($numo) ; $i++) {

  for ($e = 0; $e  2 ; $e++) {
  // then: and the current propiedades 
 $thispropiedads = $propiedades[$e];
 
   // here its campo1x so then on the update i know wich field i have to
 update...
   // the problem is that i dont know how can i retrive the value of $valx
 and $valy
 // this is OK .. because i know the name of the field that i
 have to update... my problem is to catch the value !
   $a=campo .$numo[$i] . $propiedades[$e];
// just to use the vars i set up
$a = campo . $numo[$i] . $thispropiedads;
 
  /* this is WRONG ! i need $valy[0] or $valx[0] values checking
 with $propiedades[$e]
 
$b=\$val . $propiedades[$e]. [$e];
   // i think your mistake originally is that last $e should
   // be $i instead..

   // Using the array I setup above would be:
   $b = $val[$thispropiedads][$i];
 
 
   */
 
   // wrong the $b
   $result2 = mysql_query(UPDATE ejes SET $a='$b', $Connect);
 
 
  }
 }
 
 
 ?

That should work.

btw, next time Compose a new message when starting a new topic.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] walking through database one record at a time with form s.

2003-07-23 Thread Curt Zirzow
* Thus wrote Luis Lebron ([EMAIL PROTECTED]):
 The trick is in using the MySQL 0limit statement.
 
 For the first record use: 
 
 $sql = mysql_query(SELECT * FROM temp_table limit 0, 1);
 
 then increment the limit for the next record
 
 $sql = mysql_query(SELECT * FROM temp_table limit 1, 1);

of course if the  ACCEPT and REJECT actions actually delete it he could
just use:
  SELECT * FROM temp_table limit 1

But this is Off-Topic, so ignore what I just said...

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Search question ..

2003-07-23 Thread Curt Zirzow
* Thus wrote James Hatridge ([EMAIL PROTECTED]):
 Hi all..
 
 I've got a search page written for my web site. I can find the html page I 
 want by keyword. Now I need to get the title of that page in to a variable. 
 In other words I have a file name, for example Summerbulletin.html. I now 
 need to get the line title Summer 2003 /title in to a variable. How do 
 I tell html or PHP what I want? (I hope that I am understandable, I'm still 
 new at this. )
 
 Right now I output the search results in to a chart that shows 
 Summerbulletin.html. What I would like to show is Summer 2003. 

preg_match('#\title\(.*)\/title\#im', $text, $matches):
 

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] IE Issues

2003-07-23 Thread Jason Wong
On Wednesday 23 July 2003 00:03, Curt Zirzow wrote:

[snip]

 And it *was* a hack in the early HTML specifications, the new
 specifications discourge its use.

Didn't you say you installed a speling chekker?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Only that in you which is me can hear what I'm saying.
-- Baba Ram Dass
*/


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



[PHP] PHP5?

2003-07-23 Thread Jonathan Villa
Has anyone installed PHP 5 on Apache 2.0.47?  What version of Apache 2
works best with PHP 5? 
On both Windows and Linux?


Re: [PHP] Re: Redirection Question (I spoke to soon)

2003-07-23 Thread Jason Wong
On Thursday 24 July 2003 11:37, Beauford.2005 wrote:

 I found one of my problems and also implemented your suggestions, and
 still the same thing. It will not redirect.

 The problem I found is that $_SERVER['SERVER_NAME'] does not include the
 port number. On my Win PC I am using port 800. So I changed this line
 to:

 $_SESSION['goto'] = http://; . $_SERVER['SERVER_NAME'] .:800 .
 $_SERVER['REQUEST_URI'];

 If I take the output from that and put it into my browser is works just
 fine, but it will not work in the script.

[snip]

 header(Location:  . $_SESSION['goto']);

 If I echo $_SESSION['goto'] right after session_start() it shows exactly
 what it should be. So I am at a loss.

Have you checked your error logs? You should always, ALWAYS have error 
reporting on full, and check for errors. It could be that you're getting an 
headers already sent sent error.

Does it work if you have a single line script:

  header(Location: whatever_$_SESSION['goto']_is_supposed_to_be);


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
But Officer, I stopped for the last one, and it was green!
*/


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



Re: [PHP] PHP5?

2003-07-23 Thread Tyler Longren
the latest stable version of PHP works just fine with Apache 2.0.47.

tyler

- Original Message - 
From: Jonathan Villa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 11:47 AM
Subject: [PHP] PHP5?


 Has anyone installed PHP 5 on Apache 2.0.47?  What version of Apache 2
 works best with PHP 5? 
 On both Windows and Linux?
 


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



[PHP] USB Hard Drive

2003-07-23 Thread Digital Directory USA, Inc
I need to get a USB Hard Drive to Auto Run a flash movie when plugged into a USB 
port on all platforms of a PC (Win98, 2000, XP, ME). Can PHP do this? If so, can 
someone help me with the code for it?


-- 
George Guebely
President-General Manager
Digital Directory USA, Inc
Affiliate of:
www.ilpostino-mail.com
1900 Ocean Blvd. #1804
Long Beach, CA 90802
Direct Line: 562-307-5743

Re: [PHP] USB Hard Drive

2003-07-23 Thread Robert Cummings
On Wed, 2003-07-23 at 12:49, Digital Directory USA, Inc wrote:
 I need to get a USB Hard Drive to Auto Run a flash movie when plugged
 into a USB port on all platforms of a PC (Win98, 2000, XP, ME). Can 
 ^^^
Off Topic but I must protest...

You forgot Linux in your list -- a gross oversight I'm sure!

Cheers,
Rob.
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] http://poker.club66.ro

2003-07-23 Thread Ryan A
SPAM!
Will someone kick this jerk off the list please?

-Ryan

- Original Message - 
From: Rausch Alexandru [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 23, 2003 6:05 AM
Subject: [PHP] http://poker.club66.ro




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



  1   2   3   >