[PHP] stripping negative number

2004-12-23 Thread Roger Thomas
I want to convert negative number to its positive equivalent.

$num = -40;
printf("Unsigned value is %u", $num);

output is: Unsigned value is 4294967256

I have checked the manpages and %u seems the right format. Pls advise.


--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] $HTTP_POST array

2004-12-23 Thread kalinga
Dear all,
Is it possible to pass the entire $HTTP_POST array to a function of a class
as a variable?

without doing ...

 $new_classAccount = new classAccount;
 $msg = 
$new_classAccount->addAccount($HTTP_POST_VARS['accountName'],$HTTP_POST_VARS['firstName'],$HTTP_POST_VARS['lastName']);

is it possible to..
 $new_classAccount = new classAccount;
 $msg = $new_classAccount->addAccount($HTTP_POST);

i googled a lot on this but did not find any good code sample.

hope somebody can gide me on this.

-- 
vk.

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



Re: [PHP] stripping negative number

2004-12-23 Thread Justin England
unsigned does not equal absolute value.
$num = -40;
print "Num: $num\n";
$num = abs($num);
print "ABS: $num\n";
will display:
Num: -40
ABS: 40
http://us2.php.net/manual/en/function.abs.php
Justin
- Original Message - 
From: "Roger Thomas" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 23, 2004 1:18 AM
Subject: [PHP] stripping negative number


I want to convert negative number to its positive equivalent.
$num = -40;
printf("Unsigned value is %u", $num);
output is: Unsigned value is 4294967256
I have checked the manpages and %u seems the right format. Pls advise.
--
roger
---
Sign Up for free Email at http://ureg.home.net.my/
---
--
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] Using encrypted passwords

2004-12-23 Thread Robinson, Matthew
And the good Lord saw that clear was bad and gave us ssh...

If you care that much build an ssh tunnel to the db server and talk over
that. 

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: 20 December 2004 17:29
To: php-general@lists.php.net
Subject: Re: [PHP] Using encrypted passwords

On Tuesday 21 December 2004 00:03, symbulos partners wrote:
> is it possible to use encrypted passwords in php files, for connecting

> to a database?
>
> We do not like too much the idea of the password being in clear text.
>
> Example
> $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
>
> 'mysql_password' should be encrypted

Why? It's not going to offer any protection. If I know your encrypted
password and am able to access your database using it there is no reason
for me to know what your cleartext password is. In other words if I am
able to read the file containing your password (whether encrypted or
cleartext) then I can access your database.


This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

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



RE: [PHP] String: Arrays of arrays.

2004-12-23 Thread Ford, Mike
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 23 December 2004 07:39, Song Ken Vern-E11804 wrote:

> Hi,
> 
> I have an array of array of strings :-
> 
> $g1 = array("453", "592");
> $g2 = array("e14", "e15", "e13");
> $groups = array($g1, $g2);
> 
> I traverse and print out the value using :-
> 
>   for ($i = 0; $i < sizeof($groups); $i++) {
>  for ($j = 0; $j < sizeof($groups[$i]); $j++) {
> print "\n"; /* line?? */ 
>   } }

   print "\n";

(Note curly braces.)

Inside strings, PHP does not parse beyond the first-level subscript by
default; enclosing the whole reference in {} gives PHP the clue it needs to
use both levels of subscripting.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, 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] stripping negative number

2004-12-23 Thread tg-php
I believe this is because taking a value and displaying it as an unsigned value 
isn't the same as displaying the absolute value of a number.

Ever take a calculator that does hex and decimal, enter a negative number then 
convert it to hex?  There's no negative in hex, so you end up with something 
odd (like zero minus one equals max value of unsigned hex.. so -40 would be 40 
below the max value or something... don't know exactly how it works but I'm 
guessing that's what you're getting here).

You might want to just use abs() to get the absolute value of the number before 
displaying it.

-TG

= = = Original message = = =

I want to convert negative number to its positive equivalent.

$num = -40;
printf("Unsigned value is %u", $num);

output is: Unsigned value is 4294967256

I have checked the manpages and %u seems the right format. Pls advise.


--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] File Locking during *other* file operations

2004-12-23 Thread Robinson, Matthew
No really good reason that I can think of. I don't see any reason as to
why it wouldn't work with just 'x'.

Must have been having a 'beer' moment.

yes, it should probably clear out stale lock files but the files I
protect with this are better left untouched if the lock fails. I think
that locks fail for a reason and you should find that reason before you
unlock and potentially break something.

M 

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: 20 December 2004 18:26
To: Robinson, Matthew
Cc: Michael Sims; php-general
Subject: RE: [PHP] File Locking during *other* file operations

Robinson, Matthew wrote:
>  I use this code, Not all my own, some from the php manual (probably 
> most of it in fact) I lock the file as filename.lock so that I can 
> muck about with it completely and then unlock the .lock and remove it.
>
> M
>
> function LockFile($file)
> {
>
> $LockFile = $file . ".lock";# Lock the
file
> $lf = fopen ($LockFile, "wx");
>
> while ($lf === FALSE && $i++ < 20)
> {
> clearstatcache();
> usleep(rand(5,85));
> $lf = @fopen ($LockFile, 'x');


How come you use "wx" up there, and just 'x' here?

Is there some reason for that?

One may (or may not) want to consider a mechanism for throwing out
really old lock files, since it's possible your PHP script or
application would eventually fail to remove a lock file...  Or not,
depending on how you code the rest of it.

--
Like Music?
http://l-i-e.com/artists.htm



This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information
visit
http://www.citc.it

___


This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

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



[PHP] An apache rewrite/redirect problem

2004-12-23 Thread newbin shang
Merry Christmas everyone.

I want to know that when one request the address
http://reg.mysite.com/regname , how can it be redirected to
https://www.mysite.com:70/index.php?action=registration®_id=regname
 using the apache redirect/rewrite function?

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



Re: [PHP] String: Arrays of arrays.

2004-12-23 Thread Jason Wong
On Thursday 23 December 2004 15:39, Song Ken Vern-E11804 wrote:


> print "\n"; /* line?? */
>
> to include :-
>
> $cid = $groups[$i][$j];
> print "\n"; /* line?? */
>
> I seem to get the results I want.
>
> Why is this? Is there a syntax error?

You need to change it to this:

  print "\n";

See manual > Types > Strings (Complex syntax).

-- 
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
--
/*
Money isn't everything -- but it's a long way ahead of what comes next.
  -- Sir Edmond Stockdale
*/

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



Re: [PHP] stripping negative number

2004-12-23 Thread Jason Wong
On Thursday 23 December 2004 16:18, Roger Thomas wrote:
> I want to convert negative number to its positive equivalent.
>
> $num = -40;
> printf("Unsigned value is %u", $num);
>
> output is: Unsigned value is 4294967256
>
> I have checked the manpages and %u seems the right format. Pls advise.

You've misunderstood what the unsigned representation means.

The correct function to use is abs().

-- 
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
--
/*
No matter whether th' constitution follows th' flag or not, th' supreme
court follows th' iliction returns.
ollo  -- Mr. Dooley
*/

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



Re: [PHP] $HTTP_POST array

2004-12-23 Thread Jason Wong
On Thursday 23 December 2004 16:46, kalinga wrote:

> Is it possible to pass the entire $HTTP_POST array to a function of a class
> as a variable?

It is possible to pass *any* array to a function of a class as a variable.

> without doing ...
>
>  $new_classAccount = new classAccount;
>  $msg =
> $new_classAccount->addAccount($HTTP_POST_VARS['accountName'],$HTTP_POST_VAR
>S['firstName'],$HTTP_POST_VARS['lastName']);
>
> is it possible to..
>  $new_classAccount = new classAccount;
>  $msg = $new_classAccount->addAccount($HTTP_POST);
>
> i googled a lot on this but did not find any good code sample.

Well the syntax you have looks OK, did you try it? Perhaps you meant to pass 
$HTTP_POST_VARS?

-- 
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
--
/*
Cinemuck, n.:
 The combination of popcorn, soda, and melted chocolate which
 covers the floors of movie theaters.
 m  -- Rich Hall, "Sniglets"
*/

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



[PHP] Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect SuSe 
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a 
little while Firefox/IE starts asking me whether I want to download/run 
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2 
page stating 'Object not found' (with accompanying lines in my server's 
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)

I think the biggest problem is that it is intermittent: sometimes it 
works, and sometimes it doesn't... no way for me to diagnose it.
weird.

Any ideas?
Cheers,
Rinke
--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Thomas Munz
I have the same problem.

This problem occured i PHP crashes.

Do you upgrad your PHP to a newer version or do you compile a PHP source and 
have RPMs installed?

> Hi All,
>
> I have a rather odd problem. Since a few days, my otherwise perfect SuSe
> 9.0 Apache2 server started to do some funny stuff.
> In general, php works fine, and I can do anything I want... after a
> little while Firefox/IE starts asking me whether I want to download/run
> the php file instead of rendering it in the browser.
> Sometimes even this doesn't happen, and I just get a regular Apache2
> page stating 'Object not found' (with accompanying lines in my server's
> error_log). A few minutes later, everything works fine again.
> (restarting apache also tends to help)
>
> I think the biggest problem is that it is intermittent: sometimes it
> works, and sometimes it doesn't... no way for me to diagnose it.
> weird.
>
> Any ideas?
>
> Cheers,
>
>   Rinke
>
> --
> --
> Rinke Hoekstra [EMAIL PROTECTED]
> T: +31-20-5253499F: +31-20-5253495
> Leibniz Center for Law,Law Faculty
> University of Amsterdam,   PO Box 1030
> 1000 BA  Amsterdam,The Netherlands
> --

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



[PHP] Re: çå: [PHP] header information problem

2004-12-23 Thread Angelo Zanetti
I would agree with Yangshiqi

>>> "yangshiqi" <[EMAIL PROTECTED]> 12/18/04 1:41 PM >>>
And if you have some special intent, you can use ob_start().

 
Best regards,
Yang Shiqi
 
 
 
-éäåä-
åää: yangshiqi [mailto:[EMAIL PROTECTED] 
åéé: 2004å12æ18æ 19:36
æää: 'Ahmed Abdel-Aliem'; 'php-general@lists.php.net'
ä: çå: [PHP] header information problem

I don't understand why you want to include header.html before you redirect
the users to the login_success.php?

By the way, you 'd better to add mysql_escape_string() with the username and
password to ensure the security of your code. Coz we can't believe any
users' input from web. May be the sql injection with your site.
Just be careful.

Best regards,
Yang Shiqi

-éäåä-
åää: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
åéé: 2004å12æ18æ 18:52
æää: php-general@lists.php.net 
ä: [PHP] header information problem

Dear Groups members.

i am making a user protected page, the script works excellent on my
local server, but online it gives me this error :

Warning: Cannot modify header information - headers already sent by
(output started at
/home/me2resh/public_html/apex/upload/header.html:10) in
/home/me2resh/public_html/apex/upload/upload.php on line 33

the script of the page is 

You Got To This Page By Mistake";
include 'footer.html';
}else{
session_start();  
include 'db.php'; 
include 'header.html';
$username = $_POST['username']; 
$password = $_POST['password']; 
if((!$username) || (!$password)){ 
echo "Please enter ALL of the information! "; 
include 'login_form.html'; 
include 'footer.html'; 
exit(); 
}
$sql = mysql_query("SELECT * FROM user WHERE User_Login='$username'
AND User_Password='$password'");
$login_check = mysql_num_rows($sql); 
if($login_check > 0){
session_register('ID'); 
$_SESSION['ID'] = $ID;  
while($row = mysql_fetch_array($sql)){ 
foreach( $row AS $key => $val ){ 
$$key = stripslashes( $val ); 
} 
session_register('User_First_Name'); 
$_SESSION['User_First_Name'] = $User_First_Name; 
session_register('User_Last_Name'); 
$_SESSION['User_Last_Name'] = $User_Last_Name;   
session_register('User_ID'); 
$_SESSION['User_ID'] = $User_ID; 
header("Location: login_success.php"); 
}
}else{
include 'header.html';
echo "You could not be logged in! Either the username and
password
do not match!
Please try again!"; 
include 'login_form.html'; 
include 'footer.html'; 
}
} 
?>


Can anyone help me with that problem please ?

-- 
Ahmed Abdel-Aliem
www.ApexScript.com 

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

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



Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Peninsula University of
Technology or the sender of this e-mail be liable to any party for
any direct, indirect, special or other consequential damages for any
use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



[PHP] can Header open in a new window?

2004-12-23 Thread Angelo Zanetti
Hi all, 

I have a PHP script that uses a header("Location: http://"; . $href);
statement that redirects to another page. The problem I have
is that I need this new page to open up in a new window, as the PHP is
being called from an IFrame. Is there a way the Header statement can do
it? or is the header statement the incorrect way to perform this
function?

thanks in advance
Angelo

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Peninsula University of 
Technology or the sender of this e-mail be liable to any party for
any direct, indirect, special or other consequential damages for any
use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Stephan Fiedler
Hi Rinke,
check Mime-Types..
Stephan
Rinke Hoekstra wrote:
Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect SuSe 
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a 
little while Firefox/IE starts asking me whether I want to download/run 
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2 
page stating 'Object not found' (with accompanying lines in my server's 
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)

I think the biggest problem is that it is intermittent: sometimes it 
works, and sometimes it doesn't... no way for me to diagnose it.
weird.

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


[PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
Addendum: it's php 4.3.3 I'm running...
Thomas Munz wrote:
I have the same problem.
This problem occured i PHP crashes.
Do you upgrad your PHP to a newer version or do you compile a PHP source and 
have RPMs installed?


Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect SuSe
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a
little while Firefox/IE starts asking me whether I want to download/run
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2
page stating 'Object not found' (with accompanying lines in my server's
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)
I think the biggest problem is that it is intermittent: sometimes it
works, and sometimes it doesn't... no way for me to diagnose it.
weird.
Any ideas?
Cheers,
Rinke
--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--

--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
Thanks for your answer: the word 'crash' might give me some more 
pointers in google.

When the problems started I hadn't done anything. I tried to fix it by 
using the auto-updater of SuSE to install the "latest" php4 rpm... this
didn't solve my problem.
Hmm

-Rinke
Thomas Munz wrote:
I have the same problem.
This problem occured i PHP crashes.
Do you upgrad your PHP to a newer version or do you compile a PHP source and 
have RPMs installed?


Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect SuSe
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a
little while Firefox/IE starts asking me whether I want to download/run
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2
page stating 'Object not found' (with accompanying lines in my server's
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)
I think the biggest problem is that it is intermittent: sometimes it
works, and sometimes it doesn't... no way for me to diagnose it.
weird.
Any ideas?
Cheers,
Rinke
--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--

--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How do I underline a string using php and fonts?

2004-12-23 Thread Brent Clements
I have always wondered this and maybe you guys can help.

How do I underline a bit of text using True Type Fonts?

Right now, I am creating imagelines but I don't think that's the most
efficient way of doing it.

Anybody know how to do "underlines" but using the font itself?

Thanks,
Brent

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



Re: [PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Thomas Munz
This is not an Mime-type problem.

What apache version your runnging.
What RPMs of PHP4 you have installed?

What PHP Apache module you have installed?

> If it works most of the time, just not all the time... it can't really
> be the mime-types, or can it?
>
> -Rinke
>
> Stephan Fiedler wrote:
> > Hi Rinke,
> >
> > check Mime-Types..
> >
> > Stephan
> >
> > Rinke Hoekstra wrote:
> >> Hi All,
> >>
> >> I have a rather odd problem. Since a few days, my otherwise perfect
> >> SuSe 9.0 Apache2 server started to do some funny stuff.
> >> In general, php works fine, and I can do anything I want... after a
> >> little while Firefox/IE starts asking me whether I want to
> >> download/run the php file instead of rendering it in the browser.
> >> Sometimes even this doesn't happen, and I just get a regular Apache2
> >> page stating 'Object not found' (with accompanying lines in my
> >> server's error_log). A few minutes later, everything works fine again.
> >> (restarting apache also tends to help)
> >>
> >> I think the biggest problem is that it is intermittent: sometimes it
> >> works, and sometimes it doesn't... no way for me to diagnose it.
> >> weird.
> >>
> >> Any ideas?
> >>
> >> Cheers,
> >>
> >> Rinke
>
> --
> --
> Rinke Hoekstra [EMAIL PROTECTED]
> T: +31-20-5253499F: +31-20-5253495
> Leibniz Center for Law,Law Faculty
> University of Amsterdam,   PO Box 1030
> 1000 BA  Amsterdam,The Netherlands
> --

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



[PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
If it works most of the time, just not all the time... it can't really 
be the mime-types, or can it?

-Rinke
Stephan Fiedler wrote:
Hi Rinke,
check Mime-Types..
Stephan
Rinke Hoekstra wrote:
Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect 
SuSe 9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a 
little while Firefox/IE starts asking me whether I want to 
download/run the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2 
page stating 'Object not found' (with accompanying lines in my 
server's error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)

I think the biggest problem is that it is intermittent: sometimes it 
works, and sometimes it doesn't... no way for me to diagnose it.
weird.

Any ideas?
Cheers,
Rinke

--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] converting whole or tenth prices to double decimal

2004-12-23 Thread Brian A. Anderson
Anybody know the easiest way to convert a number like 2.1 to $2.10 or 2 to
$2.00?

Silly question?

-Brian

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



[PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
Thomas Munz wrote:
This is not an Mime-type problem.
What apache version your runnging.
Apache/2.0.48
What RPMs of PHP4 you have installed?
> What PHP Apache module you have installed?
apache2-mod_php4 version 4.3.3
mod_php4-core version 4.3.3
phpdoc 4.3.0
Thanks for all the help!
-Rinke

If it works most of the time, just not all the time... it can't really
be the mime-types, or can it?
-Rinke
Stephan Fiedler wrote:
Hi Rinke,
check Mime-Types..
Stephan
Rinke Hoekstra wrote:
Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect
SuSe 9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a
little while Firefox/IE starts asking me whether I want to
download/run the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2
page stating 'Object not found' (with accompanying lines in my
server's error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)
I think the biggest problem is that it is intermittent: sometimes it
works, and sometimes it doesn't... no way for me to diagnose it.
weird.
Any ideas?
Cheers,
   Rinke
--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--

--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] converting whole or tenth prices to double decimal

2004-12-23 Thread Richard Davey
Hello Brian,

Thursday, December 23, 2004, 12:25:23 PM, you wrote:

BAA> Anybody know the easiest way to convert a number like 2.1 to $2.10 or 2 to
BAA> $2.00?

Use the money_format() function.

(Yes, PHP really does have a solution for nearly everything!)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



Re: [PHP] An apache rewrite/redirect problem

2004-12-23 Thread John Nichel
newbin shang wrote:
Merry Christmas everyone.
I want to know that when one request the address
http://reg.mysite.com/regname , how can it be redirected to
https://www.mysite.com:70/index.php?action=registration®_id=regname
 using the apache redirect/rewrite function?
I want to know why you came here instead of the Apache manual and/or 
Apache mailing list.

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


RE: [PHP] converting whole or tenth prices to double decimal

2004-12-23 Thread Robinson, Matthew
sprintf should also meet your needs although not as well as
money_format()

-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: 23 December 2004 12:31
To: php-general@lists.php.net
Subject: Re: [PHP] converting whole or tenth prices to double decimal

Hello Brian,

Thursday, December 23, 2004, 12:25:23 PM, you wrote:

BAA> Anybody know the easiest way to convert a number like 2.1 to $2.10 
BAA> or 2 to $2.00?

Use the money_format() function.

(Yes, PHP really does have a solution for nearly everything!)

Best regards,

Richard Davey


This message has been checked for all known viruses by the 
CitC Virus Scanning Service powered by SkyLabs. For further information visit
http://www.citc.it

___

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



Re: [PHP] can Header open in a new window?

2004-12-23 Thread John Nichel
Angelo Zanetti wrote:
Hi all, 

I have a PHP script that uses a header("Location: http://"; . $href);
statement that redirects to another page. The problem I have
is that I need this new page to open up in a new window, as the PHP is
being called from an IFrame. Is there a way the Header statement can do
Nope.
it? or is the header statement the incorrect way to perform this
function?
Incorrect in the way that it can't do it.
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] can Header open in a new window?

2004-12-23 Thread Richard Davey
Hello Angelo,

Thursday, December 23, 2004, 11:47:03 AM, you wrote:

AZ> I have a PHP script that uses a header("Location: http://"; . $href);
AZ> statement that redirects to another page. The problem I have
AZ> is that I need this new page to open up in a new window, as the PHP is
AZ> being called from an IFrame. Is there a way the Header statement can do
AZ> it? or is the header statement the incorrect way to perform this
AZ> function?

It's not an incorrect way, it just won't work. The headers don't
control browser behaviours like this - the opening in a new window is
a browser level function, i.e. something defined by an href target, etc
which the browser should (but will not always) adhere to.

The only way I could think of would be to write out some client side
script to make a new window open (JavaScript, etc)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



Re: [PHP] converting whole or tenth prices to double decimal

2004-12-23 Thread Brian A. Anderson
I found it

$strprice1 = number_format($strprice1, 2, '.', '');
- Original Message - 
From: "Brian A. Anderson" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 23, 2004 6:25 AM
Subject: [PHP] converting whole or tenth prices to double decimal


> Anybody know the easiest way to convert a number like 2.1 to $2.10 or 2 to
> $2.00?
>
> Silly question?
>
> -Brian
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Thomas Munz
Not more PHP modules?

like

php4-4.3.3
php4-mysql-4.3.3
php4-zlib-4.3.3

??

Do you compile PHP4?
...

> Thomas Munz wrote:
> > This is not an Mime-type problem.
> >
> > What apache version your runnging.
>
> Apache/2.0.48
>
> > What RPMs of PHP4 you have installed?
> >
>  > What PHP Apache module you have installed?
>
> apache2-mod_php4 version 4.3.3
> mod_php4-core version 4.3.3
> phpdoc 4.3.0
>
> Thanks for all the help!
>
> -Rinke
>
> >>If it works most of the time, just not all the time... it can't really
> >>be the mime-types, or can it?
> >>
> >>-Rinke
> >>
> >>Stephan Fiedler wrote:
> >>>Hi Rinke,
> >>>
> >>>check Mime-Types..
> >>>
> >>>Stephan
> >>>
> >>>Rinke Hoekstra wrote:
> Hi All,
> 
> I have a rather odd problem. Since a few days, my otherwise perfect
> SuSe 9.0 Apache2 server started to do some funny stuff.
> In general, php works fine, and I can do anything I want... after a
> little while Firefox/IE starts asking me whether I want to
> download/run the php file instead of rendering it in the browser.
> Sometimes even this doesn't happen, and I just get a regular Apache2
> page stating 'Object not found' (with accompanying lines in my
> server's error_log). A few minutes later, everything works fine again.
> (restarting apache also tends to help)
> 
> I think the biggest problem is that it is intermittent: sometimes it
> works, and sometimes it doesn't... no way for me to diagnose it.
> weird.
> 
> Any ideas?
> 
> Cheers,
> 
> Rinke
> >>
> >>--
> >>--
> >>Rinke Hoekstra [EMAIL PROTECTED]
> >>T: +31-20-5253499F: +31-20-5253495
> >>Leibniz Center for Law,Law Faculty
> >>University of Amsterdam,   PO Box 1030
> >>1000 BA  Amsterdam,The Netherlands
> >>--
>
> --
> --
> Rinke Hoekstra [EMAIL PROTECTED]
> T: +31-20-5253499F: +31-20-5253495
> Leibniz Center for Law,Law Faculty
> University of Amsterdam,   PO Box 1030
> 1000 BA  Amsterdam,The Netherlands
> --

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



RE: [PHP] An apache rewrite/redirect problem

2004-12-23 Thread Jay Blanchard
[snip]
Merry Christmas everyone.

I want to know that when one request the address
http://reg.mysite.com/regname , how can it be redirected to
https://www.mysite.com:70/index.php?action=registration®_id=regname
 using the apache redirect/rewrite function?
[/snip]

Happy holidays!

You would use the Apache list to get that answer. Here is the how-to
http://www.whoopis.com/howtos/apache-rewrite.html

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-23 Thread John Nichel
Paul Aviles wrote:
John, can you maybe post the IP addresses of where does attacks came 
from or any other related info?

Thanks
-pa

This particular one came from 201.9.192.212.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Compiling PHP Source guides

2004-12-23 Thread Donald Tyler

Greg Donald wrote:
On Wed, 22 Dec 2004 13:56:39 -0800, Donald Tyler <[EMAIL PROTECTED]> wrote:
 

I do have a rudimentary knowledge of *nix stuff
   

I don't mean to offend, but it doesn't really seem so.  Basic *nix
skills usually include knowing how to configure, compile, and install
software from source.  The PHP docs explain in very explicit detail
how to do it, and I have to say you won't find any more hand holding
than you get with PHP documentation.  The 'F' in RTFM really means
'Fine' when used in a PHP context.
 

and am very computer
literate, but most of the programming I have done is with scripting
languages such as Actionscript, Javascript, PHP etc. I realy have no
idea about compiling source code.
   

If your download is still compressed you need to uncompress it. 
Depending on the download's file extension you will need to use one of
these commands:

tar zxvf php-4.3.10.tar.gz
tar jxvf php-4.3.10.tar.bz2 

Then you change to the source directory:
cd php-4.3.10/
Then you configure the source:
./configure
You will need to add your desired compile options in the ./configure
command.  I have no idea what support you want to build into your PHP.
If you don't either you might look at:
./configure --help
Then after you're done with the configure, you compile the software:
make
Then you probably want to install the software permanently to a
system-wide location (or you might not, I don't know).  On *nix the
usual install locations are somewhere like /usr or /usr/local, which
can be defined in the configure with --prefix if you don't want the
default location.  So then to do the actual install you would do:
make install
Then your php binary will be /usr/bin/php or /usr/local/bin/php.
There's also the configure option to build your PHP as a module for
use with a web server such as Apache.  For that you might use a
configure command something like:
./configure --enable-module=so --with-apxs=/usr/sbin/apxs
 

I was just hoping for something in laymans terms I guess...
   

I would guess it's hard to talk about heart surgery without talking
about heart surgery.  Same goes for compiling software.  The commands
are pretty explicit and you have to know what your doing to get the
desired results.  It's no disgrace to not know, once upon a time I
didn't know..  but I read lots of docs, and I asked many questions and
I learned.  I got a few flames along the way but that's part of
knowing *nix I guess.  :)
Several companies I've worked for in the past have brought in outside
consultants when something would come up that we didn't have skills
for in-house.  On that note, you might consider talking with a
consultant or even getting them to do your PHP install for you if in
the end you give up and cannot figure it out.  Make them document the
process as part of the deal.
 

Thanks for your responses.
Wish me luck.
   

Good luck.
 

Thanks for the info.
I do understand that *nix usage generaly relies on a lot of compiling 
software, but I have been relying on pre-compiled RPMs so far. I am by 
no means an expert, or even intermediate *nix user, which is why I used 
the term "rudimentary".

I have been running 6 Linux servers for a small company for about a year 
now learning as I go. I knew nothing about *nix when I started and 
considering most of my other responsibilities leave very little time to 
learn and experiment on the Linux systems I dont think I've done too badly.

P.S. You didnt offend me, I just wanted to explain my situation.
Thanks again for the help.
Donald Tyler
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP Exploit via phpBB?

2004-12-23 Thread John Nichel
Ashley M. Kirchner wrote:

   # strings r0nin
   [snip]
   socket
   bind
   listen
   PsychoPhobia Backdoor is starting...
   [snip]
   Might want to run nmap (or other equivalent program) on your system.
Yeah, one of the first things I did was a netstat -a.  Didn't find 
anything running that wasn't supposed to be.  This r0nin program 
downloaded a IRC server (BrazLink), and tried to install it, but my 
compiler is not in the system path, and can't be used by non-user accounts.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] An apache rewrite/redirect problem

2004-12-23 Thread newbin shang
I am so sorry for  asking a disrelated question here because I am
urgent then, regret to disturb you.

I have solved this problem myself.

Thank you anyway.

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



Re: [PHP] Compiling PHP Source guides

2004-12-23 Thread Raditha Dissanayake
Greg Donald wrote:
On Wed, 22 Dec 2004 13:56:39 -0800, Donald Tyler <[EMAIL PROTECTED]> wrote:
 

I do have a rudimentary knowledge of *nix stuff
   

I don't mean to offend, but it doesn't really seem so.  Basic *nix
skills usually include knowing how to configure, compile, and install
software from source.  The PHP docs explain in very explicit detail
how to do it, and I have to say you won't find any more hand holding
than you get with PHP documentation.  The 'F' in RTFM really means
'Fine' when used in a PHP context.
 

poor Greg, the political correctness monitors are going to fall on him 
like a ton of bricks.

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


[PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
Hmm... no? Now that you mention it, that's actually quite weird.
These are the standard SuSE php packages, mysql works out-of-the-box.
I did not compile, but everything worked fine until now.

Thomas Munz wrote:
Not more PHP modules?
like
php4-4.3.3
php4-mysql-4.3.3
php4-zlib-4.3.3
??
Do you compile PHP4?
...

Thomas Munz wrote:
This is not an Mime-type problem.
What apache version your runnging.
Apache/2.0.48

What RPMs of PHP4 you have installed?
> What PHP Apache module you have installed?
apache2-mod_php4 version 4.3.3
mod_php4-core version 4.3.3
phpdoc 4.3.0
Thanks for all the help!
-Rinke

If it works most of the time, just not all the time... it can't really
be the mime-types, or can it?
-Rinke
Stephan Fiedler wrote:
Hi Rinke,
check Mime-Types..
Stephan
Rinke Hoekstra wrote:
Hi All,
I have a rather odd problem. Since a few days, my otherwise perfect
SuSe 9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a
little while Firefox/IE starts asking me whether I want to
download/run the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2
page stating 'Object not found' (with accompanying lines in my
server's error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)
I think the biggest problem is that it is intermittent: sometimes it
works, and sometimes it doesn't... no way for me to diagnose it.
weird.
Any ideas?
Cheers,
  Rinke
--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--

--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] MP3s

2004-12-23 Thread GH
I appologize in advanced if this is an off topic discussion...

I am working on a PHP based website and would like to offer media to
my visitors... I have the Audio in WMA and MP3 formats... I would like
to know how I could get them to "Stream"? inline... using PHP any
advice would be greatfully appreciated


Thanks in advance

Happy Holidays
Gary

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



Re: [PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Raditha Dissanayake
Rinke Hoekstra wrote:
Addendum: it's php 4.3.3 I'm running...
It's a pretty ancient version upgrade to a new version and try compiling 
from source. It's very likely that your webserver error log will contain 
a message that tells you why exactly this is happening.

I have a rather odd problem. Since a few days, my otherwise perfect 
SuSe
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a
little while Firefox/IE starts asking me whether I want to download/run
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2
page stating 'Object not found' (with accompanying lines in my server's
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)


--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


Re: [PHP] How do I underline a string using php and fonts?

2004-12-23 Thread Jason Wong
On Thursday 23 December 2004 19:52, Brent Clements wrote:
> I have always wondered this and maybe you guys can help.
>
> How do I underline a bit of text using True Type Fonts?
>
> Right now, I am creating imagelines but I don't think that's the most
> efficient way of doing it.
>
> Anybody know how to do "underlines" but using the font itself?

If you can't get any joy using the image*() functions then you could take the 
scenic route:

1) compose your prose using the pdf_*() functions
2) then use something like ImageMagick's conversion tools to change into 
png/jpg/whatever

-- 
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'm having fun HITCHHIKING to CINCINNATI or FAR ROCKAWAY!!
*/

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



Re: [PHP] MP3s

2004-12-23 Thread David Dickson
I think if you generate a .m3a file with just the full url of your mp3
and send that to download in the browser this will launch the users mp3
player which will then stream the mp3 that was contained in the file.
GH wrote:
I appologize in advanced if this is an off topic discussion...
I am working on a PHP based website and would like to offer media to
my visitors... I have the Audio in WMA and MP3 formats... I would like
to know how I could get them to "Stream"? inline... using PHP any
advice would be greatfully appreciated
Thanks in advance
Happy Holidays
Gary
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Problem of varibles between webpages

2004-12-23 Thread edwardspl
Dear All,

After disable the globals varibles function...
Then how to transfer varibles between webpages with the following ways ?

1, Table form format.
2, Hyperlink ( click and go to another webpage ) format.
3, upload file ( through php into database ).

Many thank for your help !

Edward.

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



Re: [PHP] MP3s

2004-12-23 Thread Greg Donald
On Thu, 23 Dec 2004 10:44:32 -0500, GH <[EMAIL PROTECTED]> wrote:
> I am working on a PHP based website and would like to offer media to
> my visitors... I have the Audio in WMA and MP3 formats... I would like
> to know how I could get them to "Stream"? inline... using PHP any
> advice would be greatfully appreciated

I didn't know how either but figured it out in a few minutes using
Google.  Here's what I did:

mp3.html:










//

mp3.php:



//

mp3.m3u ( one line ):

mp3.php



-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: Re[2]: [PHP] Compiling PHP Source guides

2004-12-23 Thread Greg Donald
On Thu, 23 Dec 2004 16:33:30 +, Richard Davey <[EMAIL PROTECTED]> wrote:
> and I have to say - the "F" in RTFM has NEVER stood for "Fine" in my
> books :)

You people and your double quotes..  pffftt.

:)


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re[2]: [PHP] Compiling PHP Source guides

2004-12-23 Thread Richard Davey
Hello Raditha,

Thursday, December 23, 2004, 3:26:47 PM, you wrote:

>> The 'F' in RTFM really means >>'Fine' when used in a PHP context.

RD> poor Greg, the political correctness monitors are going to fall on him
RD> like a ton of bricks.

:)

and I have to say - the "F" in RTFM has NEVER stood for "Fine" in my
books :)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



Re: [PHP] MP3s

2004-12-23 Thread Robby Russell
.m3u does this

For example:

> $ cat the_vacant_-_live_10192004_full_show.m3u
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_01_-_ladders_to_the_moon.mp3
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_02_-_rooftop_rocketship.mp3
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_03_-_perception.mp3
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_04_-_song_1.mp3
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_05_-_the_cure_got_in_her_head.mp3
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_06_-_red_light.mp3
> http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_07_-_bliss.mp3

Cheers,

Robby

On Thu, 2004-12-23 at 11:18 -0500, David Dickson wrote:
> I think if you generate a .m3a file with just the full url of your mp3
> and send that to download in the browser this will launch the users mp3
> player which will then stream the mp3 that was contained in the file.
> 
> GH wrote:
> > I appologize in advanced if this is an off topic discussion...
> > 
> > I am working on a PHP based website and would like to offer media to
> > my visitors... I have the Audio in WMA and MP3 formats... I would like
> > to know how I could get them to "Stream"? inline... using PHP any
> > advice would be greatfully appreciated
> > 
> > 
> > Thanks in advance
> > 
> > Happy Holidays
> > Gary
> > 
> 
-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread John Nichel
[EMAIL PROTECTED] wrote:
Dear All,
After disable the globals varibles function...
Then how to transfer varibles between webpages with the following ways ?
1, Table form format.
2, Hyperlink ( click and go to another webpage ) format.
3, upload file ( through php into database ).
Many thank for your help !
Edward.
http://us4.php.net/manual/en/language.variables.external.php
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread John Holmes
> From: [EMAIL PROTECTED]

> After disable the globals varibles function...
> Then how to transfer varibles between webpages with the following ways ?

register_globals has nothing to do with how you pass variables... you still use 
the URL or forms. It only changes how you access them in PHP scripts, i.e. 
using $_GET['var'] instead of $var. 
 
> 1, Table form format.

wtf is this?

> 2, Hyperlink ( click and go to another webpage ) format.

The variables passed in a URL are available in $_GET and $_REQUEST. 

> 3, upload file ( through php into database ).

$_FILES

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] Checking Original URL

2004-12-23 Thread John Holmes
> From: The Disguised Jedi <[EMAIL PROTECTED]>

> That runs all fine and dandy, but I want to check the absolute URL
> that is calling it to make sure it is an approved URL.  (For example,
> I need the URL of the HTML file that contains the  tag that is
> requesting the image from the php script)

$_SERVER['HTTP_REFERER'] should contain the script that's requesting the image, 
but it can be spoofed. 

Are you using sessions at all? You could start a session on the main page (that 
requests the images) and then check for the same session on the page that 
creates the images. If a session isn't created (a certain variable isn't set), 
then don't serve the image or serve something else. 

A fun thing to do if you have a lot of people hotlinking to your images is to 
set it up so it works for the first 10 minutes or so but then changes to 
serving some nasty gay porn image (after they've probably posted it to their 
site somewhere)... heh... but I digress...

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] Re: Firefox/IE (sometimes) wants to download .php files from my Apache2 server

2004-12-23 Thread Rinke Hoekstra
Ok, thanx. I'll do that...
-Rinke
Raditha Dissanayake wrote:
Rinke Hoekstra wrote:
Addendum: it's php 4.3.3 I'm running...
It's a pretty ancient version upgrade to a new version and try compiling 
from source. It's very likely that your webserver error log will contain 
a message that tells you why exactly this is happening.

I have a rather odd problem. Since a few days, my otherwise perfect 
SuSe
9.0 Apache2 server started to do some funny stuff.
In general, php works fine, and I can do anything I want... after a
little while Firefox/IE starts asking me whether I want to download/run
the php file instead of rendering it in the browser.
Sometimes even this doesn't happen, and I just get a regular Apache2
page stating 'Object not found' (with accompanying lines in my server's
error_log). A few minutes later, everything works fine again.
(restarting apache also tends to help)



--
--
Rinke Hoekstra [EMAIL PROTECTED]
T: +31-20-5253499F: +31-20-5253495
Leibniz Center for Law,Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,The Netherlands
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] A serious bug? "or" operator gives out diffferent results depending on order of operands

2004-12-23 Thread Bogdan Ribic
Here's a little test script:

$x = 2;
$y = 10;
$b1 = is_null($x) or ($y > 5);
$b2 = ($y > 5) or is_null($x);
var_dump($b1);
var_dump($b2);

Obviously, it should be false for both $b1 and $b2, but the output is:
bool(false)
bool(true)
Is this a bug? I tried dumping values of two expressions, they are both
boolean and correct value. Tried assigning values to two temp vars and
then or-ing these two, and that gave correct results.
I really cannot see what am I doing wrong. Tried this with php 4.3.2 and
4.3.9, and I get these weird results both times.
Maybe I should herd cattle or something :)
Boban.

--
Please reply to the list and not to my email directly.
I use usenet server and do not check yahoo email account.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] A serious bug? "or" operator gives out diffferent results depending

2004-12-23 Thread John Holmes
> From: Bogdan Ribic <[EMAIL PROTECTED]>

> Here's a little test script:
> 
> 
> $x = 2;
> $y = 10;
> 
> $b1 = is_null($x) or ($y > 5);
> $b2 = ($y > 5) or is_null($x);
> 
> var_dump($b1);
> var_dump($b2);
> 
> 
> Obviously, it should be false for both $b1 and $b2, but the output is:
> 
> bool(false)
> bool(true)
> 
> Is this a bug? I tried dumping values of two expressions, they are both
> boolean and correct value. Tried assigning values to two temp vars and
> then or-ing these two, and that gave correct results.

= has a higher precedence than OR and OR is not the same as ||

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

So you should use

$b1 = is_null($x) || ($y > 5);

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] What is happening to the news server?

2004-12-23 Thread symbulos partners
Dear friends,

What is happening to the news server? we cannot connect anymore!

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



Re: [PHP] A serious bug? "or" operator gives out diffferent results depending on order of operands

2004-12-23 Thread Rasmus Lerdorf
Bogdan Ribic wrote:
Here's a little test script:

$x = 2;
$y = 10;
$b1 = is_null($x) or ($y > 5);
$b2 = ($y > 5) or is_null($x);
var_dump($b1);
var_dump($b2);

Obviously, it should be false for both $b1 and $b2, but the output is:
bool(false)
bool(true)
Is this a bug? I tried dumping values of two expressions, they are both
boolean and correct value. Tried assigning values to two temp vars and
then or-ing these two, and that gave correct results.
I really cannot see what am I doing wrong. Tried this with php 4.3.2 and
4.3.9, and I get these weird results both times.
Maybe I should herd cattle or something :)
The whole point of OR is that it is a very low precedence operator. 
Think of it as being at the bottom of the precedence table (it isn't 
quite, ',' is lower) so you can do:

$a = b() + $c / $d OR echo "false";
That is, do everything before the OR first, then see what that evaluates 
to before applying the OR.  This wouldn't work if it took precedence 
over anything in the rest of the expression.

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


Re: [PHP] Destroying session data

2004-12-23 Thread John Holmes
> From: Philip Thompson <[EMAIL PROTECTED]>

> My question is: when the session is "logged out" or ended (via closing 
> the browser or however), should these data files (which look like 
> sess_fd983aedf93ceeioa8332890bcd, etc) not be destroyed? If not, is 
> there a way to automatically destroy them because I don't want to have 
> to go in each day/week/month and delete these session data files 
> manually? Are these data files considered to be cookies?

They are not cookies and they should be deleted automatically by the garbage 
collection process. However, by default, there is only a 1% chance that the 
garbage collection process is triggered when a session is started. So, if this 
is a low traffic server, you may not have triggered garbage collection at all. 
They are not deleted automatically when the session is ended. 

You can up the probability, if you want, but I wouldn't worry too much about 
it. Or you can write your own session handler to handle deleting the files. 

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] Destroying session data

2004-12-23 Thread Philip Thompson
On Dec 23, 2004, at 3:40 PM, John Holmes wrote:
From: Philip Thompson <[EMAIL PROTECTED]>
On Dec 23, 2004, at 2:59 PM, Matt M. wrote:

this might be coming into play:
http://us4.php.net/session
session.gc_maxlifetime  integer
session.gc_maxlifetime specifies the number of seconds after 
which
data will be seen as 'garbage' and cleaned up.
Okay, lemme see if I understand how it works. Even if it "sees" it as
garbage, it will not destroy it until the session has ended? or will
destroy when that time is reached? So can I set session.gc_maxlifetime
to be a low number (e.g., 10 seconds) and it will still behave
appropriately? Currently, it's set to the default - 1440.
The gc_maxlifetime setting controls how "old" files can be before the 
garbage collection process deletes them, when it's actually started. 
This is why your file system must support atime as mentioned before. 
If the file has not been accessed in over 1440 seconds (by default) 
then if the garbage collection process is started, it'll be deleted.

Like I said in my other post, though, there's only a 1% chance of the 
garbage collection process being started (by default). These old files 
you see are probably there because you don't have enough traffic to 
trigger garbage collection or your using a file system that doesn't 
support atime.

---John Holmes...
Thanks to all for your assistance. I'm pretty sure I understand it at 
least 1% better! =P

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


Re: [PHP] Destroying session data

2004-12-23 Thread Matt M.
> I have multiple pages on a website that uses sessions ($_SESSION) to
> store the data. However, I noticed that in the C:\Windows\Temp
> directory, all the session variables/data files are stored there from
> previous (and current) sessions.

what version of php are you using?

this might be coming into play:
http://us4.php.net/session

session.gc_maxlifetime  integer

session.gc_maxlifetime specifies the number of seconds after which
data will be seen as 'garbage' and cleaned up.

Note: If you are using the default file-based session handler,
your filesystem must keep track of access times (atime). Windows FAT
does not so you will have to come up with another way to handle
garbage collecting your session if you are stuck with a FAT filesystem
or any other fs where atime tracking is not available. Since PHP 4.2.3
it has used mtime (modified date) instead of atime. So, you won't have
problems with filesystems where atime tracking is not available.

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



Re: Re: [PHP] A serious bug? "or" operator gives out diffferent results dependin

2004-12-23 Thread John Holmes
> From: Comex <[EMAIL PROTECTED]>
> 
> Uh.. $y is > 5.

What an insightful post, but it depends on the value of $y, no? Maybe next time 
you'd like to post some of the original message so we know wtf you're talking 
about? I know what thread you're talking about... but what point are you trying 
to make that hasn't already been made obvious?

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] Destroying session data

2004-12-23 Thread Philip Thompson
Hi all.
I have multiple pages on a website that uses sessions ($_SESSION) to 
store the data. However, I noticed that in the C:\Windows\Temp 
directory, all the session variables/data files are stored there from 
previous (and current) sessions.

My question is: when the session is "logged out" or ended (via closing 
the browser or however), should these data files (which look like 
sess_fd983aedf93ceeioa8332890bcd, etc) not be destroyed? If not, is 
there a way to automatically destroy them because I don't want to have 
to go in each day/week/month and delete these session data files 
manually? Are these data files considered to be cookies?

Just to clarify, I know how to destroy session variables... I want to 
know how to destroy the files that contain those variables after 
they're no longer being used. I have RTFM and I can't seem to find the 
answer.

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


Re: [PHP] PHP4: Using create_function to create an object method

2004-12-23 Thread Greg Donald
On Thu, 23 Dec 2004 15:57:08 -0600, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> but I did not see anything in the manual that explicitly states that this will
> not work.

create_function -- Create an anonymous (lambda-style) function

The keyword here is anonymous, as in 'not named'.  The anonymous
function you create will have a name but it's not a name you can use,
it's just a randomly generated string for preventing naming
collisions.  That's why you must access anonymous functions with a
variable.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] A serious bug? "or" operator gives out diffferent results depending on order of operands

2004-12-23 Thread Comex
Uh.. $y is > 5.

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



RE: [PHP] Destroying session data

2004-12-23 Thread Vail, Warren
Closing the browser sends nothing to the webserver and with most webservers,
the server has forgotten that you were ever there.

When using sessions, you connect your browser and request a page, and that
request is accompanied with a session key that is stored in a cookie on the
browser machine by domain.  PHP takes it on faith that IF this cookie comes
with the request, it should match a session datastore, and it looks, and if
it finds one, it uses that session when the session_start() function is
called (now it remembers you, so to speak).

As the script wraps up the session datastore is updated with any new session
data, using a probability factor set in php.ini, it may do some extra
processing to cleanup old "expired" sessions.  Since the page has already
been transmitted in it's entirety to the browser, and the browser should now
be working to render the page, this extra process should have no noticeable
impact on the user experience.  This "Garbage Cleanup" routine will scan the
entire datastore looking for session records that are older than allowed by
another php.ini parameter (gc_maxlifetime), and removes them (gc stands for
Garbage Cleanup).  Keep in mind that this garbage collection will probably
not remove the session that pertain to the browser that triggers the
cleanup, but rather it will remove session records for other sessions that
have not been referenced for a while.

In php you can write your own session management handler routines and attach
them to your php process.  Check out some of the following;

http://us4.php.net/manual/en/ref.session.php
http://us4.php.net/manual/en/function.session-set-save-handler.php

Studying these routines can teach you a lot about how sessions work.

If you can get your users to log out instead of closing their browser, you
have a chance to execute a script that will then kill a session and that
usually removes an individual session data record.

HTH,

Warren Vail


> -Original Message-
> From: Philip Thompson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 23, 2004 12:45 PM
> To: php-general@lists.php.net
> Subject: [PHP] Destroying session data
> 
> 
> Hi all.
> 
> I have multiple pages on a website that uses sessions ($_SESSION) to 
> store the data. However, I noticed that in the C:\Windows\Temp 
> directory, all the session variables/data files are stored there from 
> previous (and current) sessions.
> 
> My question is: when the session is "logged out" or ended 
> (via closing 
> the browser or however), should these data files (which look like 
> sess_fd983aedf93ceeioa8332890bcd, etc) not be destroyed? If not, is 
> there a way to automatically destroy them because I don't 
> want to have 
> to go in each day/week/month and delete these session data files 
> manually? Are these data files considered to be cookies?
> 
> Just to clarify, I know how to destroy session variables... I want to 
> know how to destroy the files that contain those variables after 
> they're no longer being used. I have RTFM and I can't seem to 
> find the 
> answer.
> 
> Thanks in advance,
> ~Philip
> 
> -- 
> 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] Destroying session data

2004-12-23 Thread Vail, Warren
> 
> Okay, lemme see if I understand how it works. Even if it "sees" it as 
> garbage, it will not destroy it until the session has ended? or will 
> destroy when that time is reached? So can I set 
> session.gc_maxlifetime 
> to be a low number (e.g., 10 seconds) and it will still behave 
> appropriately? Currently, it's set to the default - 1440.
> 
Actually the way most garbage cleanup routines work, the session datastore
will be removed regardless of whether it is "in use" or not.  

Here comes the tricky stuff, if php has sent a page to the browser and has
satisfied your browsers request, and your user is reviewing the contents of
the page to decide his next action, as far as apache and php are concerned,
that users session is no longer "in use".  But, if in the process of
preparing that page, it was using sessions, it would have stamped the
session datastore with a new timestamp, so the garbage cleanup routine would
not consider it an old datastore and remove it.  If the user waits a long
time (longer than gc_maxlifetime in seconds) before doing something, when
someone else requests a page, their session could trigger a cleanup process
and your session could be deleted.

If your script is running, fetches the session datastore, and has not
reached the end of it's processing where it rewrites the datastore with
updated data and a new timestamp, if during that time the file is deleted,
no harm done since the save session routine of your script will make sure
the datastore is created and write stuff back into if from it's memory
image.  I guess that is what PHP would consider "in use", whereas your user
will consider the time he is mulling over his response as "in use", even if
he gets up to get a cup of coffee before responding.

Warren Vail

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



[PHP] PHP4: Using create_function to create an object method

2004-12-23 Thread kermodebear
Hello all,

I was playing with create_function the other day and found that it is not
possible to use create_function to create a method for an object. Code example:

test = create_function( '', 'echo "Testing";' );
$o->test(); // Will break:
// Fatal error: Call to undefined function:  test()
// in /www/devel/jmiller/include/test.php on line 10
?>

I saw several work arounds for this in the comments section of the PHP manual,
but I did not see anything in the manual that explicitly states that this will
not work. On an intuitive level, it would seem to me that it would and should. 
Using call_user_func( $o->test ) does work.

I did some google searching but I didn't come up with anything that seemed
relevant. Could someone point me to some documentation that explains why
$o->test() does not work? It would seem to me that this would be a useful
feature for dynamically building objects for use in SOAP, for example, without
having to eval() a big block of code.

>From what I understand, in PHP5 there is a magical __call() method for all
classes/objects, but in PHP4 this capability does not exist.

No, I'm not actually trying to play with this in any serious manner, nor do I
intend to write 'real' code that uses this... Just a curiousity and something
to play around with. (o:

Thank you, all.

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



Re: [PHP] Destroying session data

2004-12-23 Thread Philip Thompson
On Dec 23, 2004, at 2:59 PM, Matt M. wrote:
I have multiple pages on a website that uses sessions ($_SESSION) to
store the data. However, I noticed that in the C:\Windows\Temp
directory, all the session variables/data files are stored there from
previous (and current) sessions.
what version of php are you using?
I'm using 4.3.8
this might be coming into play:
http://us4.php.net/session
session.gc_maxlifetime  integer
session.gc_maxlifetime specifies the number of seconds after which
data will be seen as 'garbage' and cleaned up.
Okay, lemme see if I understand how it works. Even if it "sees" it as 
garbage, it will not destroy it until the session has ended? or will 
destroy when that time is reached? So can I set session.gc_maxlifetime 
to be a low number (e.g., 10 seconds) and it will still behave 
appropriately? Currently, it's set to the default - 1440.

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


Re: Re: [PHP] Destroying session data

2004-12-23 Thread John Holmes
From: Philip Thompson <[EMAIL PROTECTED]> 
> On Dec 23, 2004, at 2:59 PM, Matt M. wrote:

> > this might be coming into play:
> > http://us4.php.net/session
> >
> > session.gc_maxlifetime  integer
> >
> > session.gc_maxlifetime specifies the number of seconds after which
> > data will be seen as 'garbage' and cleaned up.
> 
> Okay, lemme see if I understand how it works. Even if it "sees" it as 
> garbage, it will not destroy it until the session has ended? or will 
> destroy when that time is reached? So can I set session.gc_maxlifetime 
> to be a low number (e.g., 10 seconds) and it will still behave 
> appropriately? Currently, it's set to the default - 1440.

The gc_maxlifetime setting controls how "old" files can be before the garbage 
collection process deletes them, when it's actually started. This is why your 
file system must support atime as mentioned before. If the file has not been 
accessed in over 1440 seconds (by default) then if the garbage collection 
process is started, it'll be deleted. 

Like I said in my other post, though, there's only a 1% chance of the garbage 
collection process being started (by default). These old files you see are 
probably there because you don't have enough traffic to trigger garbage 
collection or your using a file system that doesn't support atime. 

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread edwardspl
Hello,

For table form format ( sample ),



Your Name : 
Address:



"name" and "address" is varible, so how can we pass these two varible without 
register_globals function ( actually it is disable ) to another webpage ?

Many thank for your help !

Edward.

John Holmes wrote:

> > From: [EMAIL PROTECTED]
>
> > After disable the globals varibles function...
> > Then how to transfer varibles between webpages with the following ways ?
>
> register_globals has nothing to do with how you pass variables... you still 
> use the URL or forms. It only changes how you access them in PHP scripts, 
> i.e. using $_GET['var'] instead of $var.
>
> > 1, Table form format.
>
> wtf is this?
>
> > 2, Hyperlink ( click and go to another webpage ) format.
>
> The variables passed in a URL are available in $_GET and $_REQUEST.

I have ever try to use $_GET and $_REQUEST, but fail...
I will send my samples in here.

> > 3, upload file ( through php into database ).
>
> $_FILES
>
> ---John Holmes...
>
> UCCASS - PHP Survey System
> http://www.bigredspark.com/survey.html

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread Matthew Sims
> Hello,
>
> For table form format ( sample ),
>
> 
> 
> Your Name :  maxlength="60">
> Address¡G maxlength="60">
> 
> 
>
> "name" and "address" is varible, so how can we pass these two varible
> without register_globals function ( actually it is disable ) to another
> webpage ?
>
> Many thank for your help !
>
> Edward.

Your method and action are blank.



You need a submit button.



Submit will pass the vars to whichever page action is set to. The vars
will be in the $_POST array, basically $_POST['name'] and
$_POST['address'].

Whatever page action calls, you can have php check that the submit button
was executed like:



-- 
--Matthew Sims
--

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread John Nichel
[EMAIL PROTECTED] wrote:
Hello,
For table form format ( sample ),


Your Name : 
Addressï


"name" and "address" is varible, so how can we pass these two varible without 
register_globals function ( actually it is disable ) to another webpage ?
Many thank for your help !
Edward.
I guess you ignored the link I posted earlier.
RTFM
http://us4.php.net/manual/en/language.variables.external.php
PS  'Table form format'?  No such animal.  It's either a form or a 
table.  In your example, a form inside of a table.

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


Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread edwardspl
Matthew Sims wrote:

> > Hello,
> >
> > For table form format ( sample ),
> >
> > 
> > 
> > Your Name :  > maxlength="60">
> > Address: > maxlength="60">
> > 
> > 
> >
> > "name" and "address" is varible, so how can we pass these two varible
> > without register_globals function ( actually it is disable ) to another
> > webpage ?
> >
> > Many thank for your help !
> >
> > Edward.
>
> Your method and action are blank.
>
> 
>
> You need a submit button.
>
> 
>
> Submit will pass the vars to whichever page action is set to. The vars
> will be in the $_POST array, basically $_POST['name'] and
> $_POST['address'].
>
> Whatever page action calls, you can have php check that the submit button
> was executed like:
>
>  if (isset($_POST['add')):
> ?// whatever you want to do with $_POST['name'] and $_POST['address']
> endif;
> ?>

Hello Matthew,

I have ever try to use $_POST functon, but fail...
May be I need to check the config of php (?ini file ) again , and I want to
know which setting must be enable and which setting must be disable ?

Many thank for your help !

Edward.

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread edwardspl
John Nichel wrote:

> [EMAIL PROTECTED] wrote:
> > Hello,
> >
> > For table form format ( sample ),
> >
> > 
> > 
> > Your Name :  > maxlength="60">
> > Address嚗?/td> > maxlength="60">
> > 
> > 
> >
> > "name" and "address" is varible, so how can we pass these two varible 
> > without register_globals function ( actually it is disable ) to another 
> > webpage ?
> >
> > Many thank for your help !
> >
> > Edward.
>
> I guess you ignored the link I posted earlier.
>
> RTFM
>
> http://us4.php.net/manual/en/language.variables.external.php
>
> PS?'Table form format'??No such animal.?It's either a form or a
> table.?In your example, a form inside of a table.

Dear John,

I have just test a sample through the link, but fail...
So, I'm check my php config ( ini file ), and would you mind to tell me which 
setting must be disabled / enabled ?

Thank for you help so much !

Edward.

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



Re: Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread John Holmes
> From: [EMAIL PROTECTED]

> For table form format ( sample ),
> 
> 
> 
> Your Name :  maxlength="60">
> Address? maxlength="60">
> 
> 
> 
> "name" and "address" is varible, so how can we pass these two varible without 
> register_globals function ( actually it is disable ) to another webpage ?

Did you read what I wrote? register_globals has nothing to do with how you pass 
variables. You create a form the same way with it ON or OFF... The difference 
is in how you access the variables in the PHP script. In this instance, since 
you haven't specified a method for your form, GET is assumed. So you can access 
the form variables in $_GET['name'] and $_GET['address']. If you used POST in 
your form method, then $_POST['name'] and $_POST['address'] can be used. 
Regardless of the method, you can use $_REQUEST['name'] and 
$_REQUEST['address']... catching on? ;)

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread John Holmes
> From: [EMAIL PROTECTED]
> Dear John,
> 
> I have just test a sample through the link, but fail...
> So, I'm check my php config ( ini file ), and would you mind to tell me which 
> setting must be disabled / enabled ?

John is very helpful and loves to dedicate his time to helping new users. If 
you don't get a response within the next 10 minutes (he's always available), 
just continue to write him and ask him for help. It's the Christmas season, 
right???

Merry Christmas John,

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread Jason Wong
On Friday 24 December 2004 11:27, [EMAIL PROTECTED] wrote:

> I have ever try to use $_POST functon, but fail...

HOW did it fail? Please be specific.

> May be I need to check the config of php (ï ini file ) again , and I want
> to know which setting must be enable and which setting must be disable ?

$_POST is only available from version 4.1.0 of PHP onwards, and is enabled by 
default. If you're using any version older than that you *really* ought to 
upgrade. All this and more are in the link that you had been given, read it.

-- 
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'd like to meet the guy who invented beer and see what he's working on now.
*/

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread edwardspl
John Holmes wrote:

> > From: [EMAIL PROTECTED]
> > Dear John,
> >
> > I have just test a sample through the link, but fail...
> > So, I'm check my php config ( ini file ), and would you mind to tell me 
> > which setting must be disabled / enabled ?
>
> John is very helpful and loves to dedicate his time to helping new users. If 
> you don't get a response within the next 10 minutes (he's always available), 
> just continue to write him and ask him for help. It's the Christmas season, 
> right???
>
> Merry Christmas John,

Dear John,

Merry Christmas too first,
I have tried to do the test about the varible ( transfer ) this morning ( China 
Time ), but I don't know what happen about the result...

So, I hope you can help me to test and finish the result !

Thanks !

Edward.

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread John Nichel
John Holmes wrote:
From: [EMAIL PROTECTED]
Dear John,
I have just test a sample through the link, but fail...
So, I'm check my php config ( ini file ), and would you mind to tell me which 
setting must be disabled / enabled ?

John is very helpful and loves to dedicate his time to helping new users. If 
you don't get a response within the next 10 minutes (he's always available), 
just continue to write him and ask him for help. It's the Christmas season, 
right???
Merry Christmas John,
---John Holmes...
I will save you a spot next to me...in the firey pits of hell. ;)
Merry Xmas to you too.
--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread edwardspl
Jason Wong wrote:

> On Friday 24 December 2004 11:27, [EMAIL PROTECTED] wrote:
>
> > I have ever try to use $_POST functon, but fail...
>
> HOW did it fail? Please be specific.

The result of $_POST['vars'] is blank !

> > May be I need to check the config of php (嚙?ini file ) again , and I want
> > to know which setting must be enable and which setting must be disable ?
>
> $_POST is only available from version 4.1.0 of PHP onwards, and is enabled by
> default. If you're using any version older than that you *really* ought to
> upgrade. All this and more are in the link that you had been given, read it.

There is two servers for the test, one is using Fedora Core 2 Linux ( come with
php 4.x.x ), another is using W2k + php 5.xx !

So, I think may be the problem of php config...
But I don't know how to fix the problem ( setting of php config ) !

Edward.

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



[Fwd: [PHP] Problem of varibles between webpages]

2004-12-23 Thread edwardspl
?--- Begin Message ---
Jason Wong wrote:

> On Friday 24 December 2004 11:27, [EMAIL PROTECTED] wrote:
>
> > I have ever try to use $_POST functon, but fail...
>
> HOW did it fail? Please be specific.

The result of $_POST['vars'] is blank !

> > May be I need to check the config of php (嚙?ini file ) again , and I want
> > to know which setting must be enable and which setting must be disable ?
>
> $_POST is only available from version 4.1.0 of PHP onwards, and is enabled by
> default. If you're using any version older than that you *really* ought to
> upgrade. All this and more are in the link that you had been given, read it.

There is two servers for the test, one is using Fedora Core 2 Linux ( come with
php 4.x.x ), another is using W2k + php 5.xx !

So, I think may be the problem of php config...
But I don't know how to fix the problem ( setting of php config ) !

Edward.


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

[PHP] Parse Flash File for URLs

2004-12-23 Thread Jason Paschal
how might i accomplish this?  phpAds does this when a flash banner is
uploaded, and asks if you want to change the URLs it finds.  instead
of being diligent and scouring the phpAds code for what I'm looking
for, was hoping someone out there could offer some tips, suggestions,
pseudo-code, etc for how this could be done.

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



[PHP] Next page every second

2004-12-23 Thread Greg Wardawy
Ladies and gentlemen of PHP,
I'm quite new to PHP (coming from Perl) so please don't laugh too hard if 
I'm missing something obvious.
My scenario is as follows:
Connect to the MySQL server->grab the data from the table->display the data 
of the first row on the web page->sleep 1 second->display the data from the 
next row->sleep 1 second... and so forth up to the last row of the table.
I'm able to get the next page displayed by using a link to it (a snippet 
below) but I'm out of ideas how to have the next page displayed every 
second. So far I'm getting tons of tables displayed on the page or tons of 
the variables displayed in a single cell of the table. I could really use 
your help here.
Happy Holidays to all of you and many thanks for any suggestions given.

Greg.
#
__SNIP__

 
   Variable
   Value
 
 
 
   1
   
 
   2
   
 
 
   3
   
 
 
   4
   
 
 


">Next

__SNIP__
# 

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


Re: [Fwd: [PHP] Problem of varibles between webpages]

2004-12-23 Thread Jason Wong
On Friday 24 December 2004 12:02, [EMAIL PROTECTED] wrote:
> The result of $_POST['vars'] is blank !

And this was the result of using the form that you originally had or the 
corrected form that Matthew suggested? If you want the form values to be 
available in $_POST then you need to specify method="POST" in your form. May 
I suggest that you get a better understanding of HTML before attempting to 
use PHP?

> There is two servers for the test, one is using Fedora Core 2 Linux ( come
> with php 4.x.x ), another is using W2k + php 5.xx !

And just what version is 4.x.x? If you want help you have to be *specific*. 
Although in this case one can presume that Fedora Core 2 is recent enough to 
be shipping with a version of PHP newer than 4.1.0.

> So, I think may be the problem of php config...
> But I don't know how to fix the problem ( setting of php config ) !

You don't need to change any of the default settings in php.ini to make this 
work.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
"An open mind has but one disadvantage: it collects dirt."
-- a saying at RPI
*/

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



Re: [PHP] Next page every second

2004-12-23 Thread Jason Wong
On Friday 24 December 2004 13:09, Greg Wardawy wrote:

> I'm quite new to PHP (coming from Perl) so please don't laugh too hard if
> I'm missing something obvious.
> My scenario is as follows:
> Connect to the MySQL server->grab the data from the table->display the data
> of the first row on the web page->sleep 1 second->display the data from the
> next row->sleep 1 second... and so forth up to the last row of the table.
> I'm able to get the next page displayed by using a link to it (a snippet
> below) but I'm out of ideas how to have the next page displayed every
> second. 

Presumably you want the "next page displayed every second" bit to happen 
automatically? And this "next page" is actually a whole new page? (ie you 
want to display each record on a new page). The only way this can be done is 
to use meta-refresh and construct the refresh URL appropriately (similar to 
how you are currently doing the "next" link).

-- 
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
--
/*
Williams and Holland's Law:
 If enough data is collected, anything may be proven by statistical
 methods.
*/

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



Re: [PHP] PHP Exploit via phpBB?

2004-12-23 Thread Chris Shiflett
--- "Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote:
> I'd be interested to know what other applications you suggest
> that compares to phpBB. Just for my own curiosity.

As far as I can tell, FUDforum seems to be better in every way except
design. It is substantially better in terms of performance and security.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

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



Re: [PHP] hackers?

2004-12-23 Thread Chris Shiflett
--- Sebastian <[EMAIL PROTECTED]> wrote:
> im looking for a person or a place that will check or try
> to "break" a site.

This is the least effective means of auditing an application. Letting an
experienced person review your code is much, much better.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

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



Re: [PHP] Problem of varibles between webpages

2004-12-23 Thread Matthew Sims
> Jason Wong wrote:
>
>> On Friday 24 December 2004 11:27, [EMAIL PROTECTED] wrote:
>>
>> > I have ever try to use $_POST functon, but fail...
>>
>> HOW did it fail? Please be specific.
>
> The result of $_POST['vars'] is blank !
>
>> > May be I need to check the config of php (� ini file ) again , and I
>> want
>> > to know which setting must be enable and which setting must be disable
>> ?
>>
>> $_POST is only available from version 4.1.0 of PHP onwards, and is
>> enabled by
>> default. If you're using any version older than that you *really* ought
>> to
>> upgrade. All this and more are in the link that you had been given, read
>> it.
>
> There is two servers for the test, one is using Fedora Core 2 Linux ( come
> with
> php 4.x.x ), another is using W2k + php 5.xx !
>
> So, I think may be the problem of php config...
> But I don't know how to fix the problem ( setting of php config ) !
>
> Edward.

There's nothing in the php.ini file that would cause $_POST to not work
unless you did something yourself. $_POST is a superglobal var. It's
always available to all pages.

Is php even working for you?

If you just create a test.php with simply:



does anything show up in the web browser?

-- 
--Matthew Sims
--

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



Re: [Fwd: [PHP] Problem of varibles between webpages]

2004-12-23 Thread edwardspl
Jason Wong wrote:

> On Friday 24 December 2004 12:02, [EMAIL PROTECTED] wrote:
> > The result of $_POST['vars'] is blank !
>
> And this was the result of using the form that you originally had or the
> corrected form that Matthew suggested? If you want the form values to be
> available in $_POST then you need to specify method="POST" in your form. May
> I suggest that you get a better understanding of HTML before attempting to
> use PHP?

$_POST['var'] or $_GET['var'] which I also ever tried...
But at this time, I'm vary hard to found out what happen !

Edward.

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



Re: [PHP] Next page every second

2004-12-23 Thread Sagar C Nannapaneni
If all you want to display each record one by one at a particular interval
of time
you could do this at one page itself...here is the procedure

1. connect to mysql
2. grab the row you want
3. store the row number in a session variable
4. Add an autorefresh code to ur html..(lot of java scritps are there for
setting the time interval for the page refresh)
5.  when the page again loads grab the row number from session and increment
it by one

hope that the logic will work out...

/sagar
- Original Message -
From: "Greg Wardawy" <[EMAIL PROTECTED]>
To: 
Sent: Friday, December 24, 2004 10:39 AM
Subject: [PHP] Next page every second


> Ladies and gentlemen of PHP,
>
> I'm quite new to PHP (coming from Perl) so please don't laugh too hard if
> I'm missing something obvious.
> My scenario is as follows:
> Connect to the MySQL server->grab the data from the table->display the
data
> of the first row on the web page->sleep 1 second->display the data from
the
> next row->sleep 1 second... and so forth up to the last row of the table.
> I'm able to get the next page displayed by using a link to it (a snippet
> below) but I'm out of ideas how to have the next page displayed every
> second. So far I'm getting tons of tables displayed on the page or tons of
> the variables displayed in a single cell of the table. I could really use
> your help here.
> Happy Holidays to all of you and many thanks for any suggestions given.
>
> Greg.
>

#
> __SNIP__
>  bordercolor="#9900CC">
>   
> Variable
> Value
>   
>   
>   
> 1
>  bgcolor="#FF"> $row_gail_data['var1']; ?>
>   
> 2
>  bgcolor="#FF"> $row_gail_data['var2']; ?>
>   
>   
> 3
>  bgcolor="#FF"> $row_gail_data['var3']; ?>
>   
>   
> 4
>  bgcolor="#FF"> $row_gail_data['var4']; ?>
>   
>   
> 
> 
>  min($totalPages_gail_data, $pageNum_gail_data + 1),
$queryString_gail_data);
> ?>">Next
> 
> __SNIP__
>

#
>
> --
> 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: [Fwd: [PHP] Problem of varibles between webpages]

2004-12-23 Thread Matthew Sims
> Jason Wong wrote:
>
>> On Friday 24 December 2004 12:02, [EMAIL PROTECTED] wrote:
>> > The result of $_POST['vars'] is blank !
>>
>> And this was the result of using the form that you originally had or the
>> corrected form that Matthew suggested? If you want the form values to be
>> available in $_POST then you need to specify method="POST" in your form.
>> May
>> I suggest that you get a better understanding of HTML before attempting
>> to
>> use PHP?
>
> $_POST['var'] or $_GET['var'] which I also ever tried...
> But at this time, I'm vary hard to found out what happen !
>
> Edward.

That doesn't even answer his questions.

First, HTML forms:

http://www.w3.org/TR/REC-html40/interact/forms.html

particually

http://www.w3.org/TR/REC-html40/interact/forms.html#adef-action

-- 
--Matthew Sims
--

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