[PHP] filesize math

2004-12-24 Thread Sebastian
i made this function and want to know if i am doing the math correctly..
seems to be caculating ok.. $filesize is in bytes.. if the filesize is under
1MB i want to show KBs, if its under 1GB i want to show MB, if its over
1000MB i want to show GB, makes sense? ;)

function byte_format($filesize)
{
 if ($filesize  100)
 {
  return number_format($filesize / 1024, 2, '.', '') . ' KB';
 }
 else if($filesize  10)
 {
 return number_format($filesize / 1024 / 1024 / 1024, 2, '.', '') .
' GB';
 }
 else
 {
return number_format($filesize / 1024 / 1024, 2, '.', '') . ' MB';
 }
}

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



Re: [PHP] filesize math

2004-12-24 Thread tg-php
Well, depends on your definition of a kb, mb, gb, etc..

You seem to be mixing definitions here.

One school of thought is that...

1000 bytes = 1 kb
1000 kb = 1 mb
1000 mb = 1 gb

In reality...

1024 bytes = 1 kb
1024 kb = 1 mb
1024 mb = 1 gb

You're checking filesize against the '1000' method then you're returning a 
number based on the '1024' method.

You should always be consistant across the board.

-TG

= = = Original message = = =

i made this function and want to know if i am doing the math correctly..
seems to be caculating ok.. $filesize is in bytes.. if the filesize is under
1MB i want to show KBs, if its under 1GB i want to show MB, if its over
1000MB i want to show GB, makes sense? ;)

function byte_format($filesize)

 if ($filesize  100)
 
  return number_format($filesize / 1024, 2, '.', '') . ' KB';
 
 else if($filesize  10)
 
 return number_format($filesize / 1024 / 1024 / 1024, 2, '.', '') .
' GB';
 
 else
 
return number_format($filesize / 1024 / 1024, 2, '.', '') . ' MB';


___
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



[PHP] Exec() denied read on Apache (fedora core 3)

2004-12-24 Thread Zia Syed
Hi, 
I've been trying to execute some system commands and print back the
output on the webpage. I found the following code to do so, however,
it is not working.
?php
echo exec('whoami');
? 

I get following errors in my /var/log/messages
Dec 24 12:03:34 melville kernel: audit(1103889814.948:0): avc:  denied
 { read }  for  pid=13794 exe=/usr/sbin/httpd name=sh dev=hda2
ino=670441 scontext=root:system_r:httpd_t
tcontext=system_u:object_r:bin_t tclass=lnk_file

Apache server is ran by user apache and the .php file is also owned by
user apache.

Apache is not running in Safe_Mode 
safe_mode   Off Off
safe_mode_exec_dir  /var/www/html/sh/var/www/html/sh
safe_mode_gid   Off Off
safe_mode_include_dir   /var/www/html   /var/www/html

However, i tried to switch on the Safe_Mode but that wasn't any good either.
Any idea how can i get it work? 

Thanks,

Zia

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



Re: [PHP] hackers?

2004-12-24 Thread Manuel Lemos
Hello,
on 12/24/2004 03:01 AM Chris Shiflett said the following:
--- 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.
It depends on what kind of vulnerabilities you want to audit. often some
sites are vulnerable, not because of the code of site itself, but rather
wholes in the third party software that they rely.
Many of the security breaches are perform by script kiddies that use
exploit scripts that take advantage of holes in known applications such
as Web servers, database servers and even PHP itself.
Auditing the actual site code is not a bad idea but many companies are
not confortable with the idea of an outsider to look at their code and
learn details about the site that may be part of its business secret and
so they would be worth selling to competitors.
The services of trustworth auditors are often not cheap. A cheaper
alternative is probably training the site developers to write secure
code and audit the applications regularly.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] hackers?

2004-12-24 Thread Manuel Lemos
Hello,
on 12/24/2004 03:01 AM Chris Shiflett said the following:
--- 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.
It depends on what kind of vulnerabilities you want to audit. often some
sites are vulnerable, not because of the code of site itself, but rather
wholes in the third party software that they rely.
Many of the security breaches are perform by script kiddies that use
exploit scripts that take advantage of holes in known applications such
as Web servers, database servers and even PHP itself.
Auditing the actual site code is not a bad idea but many companies are
not confortable with the idea of an outsider to look at their code and
learn details about the site that may be part of its business secret and
so they would be worth selling to competitors.
The services of trustworth auditors are often not cheap. A cheaper
alternative is probably training the site developers to write secure
code and audit the applications regularly.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] php + html (frame)

2004-12-24 Thread edwardspl
Dear All,

I just created a webpage with frame structure:
top.php ( name of frame is t ) + buttom.php ( name of frame is b ) +
right.php ( name of frame is r )

Now, I want to make a hypher link with top.php, and when user mouse
click the link under top.php, then there will load a php ( base target
is b ) and load another php ( base target is r )...

So, is there a sample for reference mouse click a hypher link then auto
load two php pages into different target area ?

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



Re: [PHP] php + html (frame)

2004-12-24 Thread John Nichel
[EMAIL PROTECTED] wrote:
Dear All,
I just created a webpage with frame structure:
top.php ( name of frame is t ) + buttom.php ( name of frame is b ) +
right.php ( name of frame is r )
Now, I want to make a hypher link with top.php, and when user mouse
click the link under top.php, then there will load a php ( base target
is b ) and load another php ( base target is r )...
So, is there a sample for reference mouse click a hypher link then auto
load two php pages into different target area ?
Edward.
This has nothing to do with PHP.  Use a HTML/JavaScript mailing list, 
and/or read some howto's for HTML/JavaScript.

--
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] Parse Flash File for URLs

2004-12-24 Thread Greg Donald
On Thu, 23 Dec 2004 23:17:09 -0500, Jason Paschal [EMAIL PROTECTED] wrote:
 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 -r 'system( strings *.swf | grep http );'


-- 
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] php + html (frame)

2004-12-24 Thread Greg Donald
On Fri, 24 Dec 2004 21:35:01 +0800, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 I just created a webpage with frame structure:
 top.php ( name of frame is t ) + buttom.php ( name of frame is b ) +
 right.php ( name of frame is r )
 
 Now, I want to make a hypher link with top.php, and when user mouse
 click the link under top.php, then there will load a php ( base target
 is b ) and load another php ( base target is r )...
 
 So, is there a sample for reference mouse click a hypher link then auto
 load two php pages into different target area ?

 ./google.pl javascript load multiple frames 10
Result: 
http://www.programmersheaven.com/2/FAQ-JavaScript-Load-Multiple-Frames-And-Replace-Same-Frame
http://www.programmersheaven.com/2/FAQ-JavaScript-Load-Multiple-Frames
http://www.programmersheaven.com/phwiki/printer.aspx?w=2p=FAQ-JavaScript-Load-Multiple-Frames
http://html.megalink.com/programmer/tips/multilink.html
http://polymer.bu.edu/~ccruz/javascript/reference.html
http://www.javascriptkit.com/javatutors/twoframes3.shtml
http://www.javascriptkit.com/javatutors/twoframes2.shtml
http://www.chalcedony.com/javascript3e/scripts/
http://www.webreference.com/js/column36/navigating.html
http://tech.irt.org/articles/js126/


-- 
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] Exec() denied read on Apache (fedora core 3)

2004-12-24 Thread Greg Donald
On Fri, 24 Dec 2004 12:09:51 +, Zia Syed [EMAIL PROTECTED] wrote:
 I've been trying to execute some system commands and print back the
 output on the webpage. I found the following code to do so, however,
 it is not working.
 ?php
 echo exec('whoami');
 ?
 
 However, i tried to switch on the Safe_Mode but that wasn't any good either.
 Any idea how can i get it work?

I assume you're hosting with someone and they have dsiabled that
function via the php.ini, I dunno..  Anyway, you might get lucky and
they are using a different php.ini for the php binary.  Try this from
command line:

php -r 'system( whoami );'



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

2004-12-24 Thread GH
Thank you will look at these after the holidays when I get back to
the project


On Thu, 23 Dec 2004 08:44:20 -0800, Robby Russell [EMAIL PROTECTED] wrote:
 .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
 


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



Re: [PHP] filesize math

2004-12-24 Thread Greg Donald
On Fri, 24 Dec 2004 04:15:10 -0500, Sebastian
[EMAIL PROTECTED] wrote:
 i made this function and want to know if i am doing the math correctly..
 seems to be caculating ok.. $filesize is in bytes.. if the filesize is under
 1MB i want to show KBs, if its under 1GB i want to show MB, if its over
 1000MB i want to show GB, makes sense? ;)
 
 function byte_format($filesize)
 {
 if ($filesize  100)
 {
  return number_format($filesize / 1024, 2, '.', '') . ' KB';
 }
 else if($filesize  10)
 {
 return number_format($filesize / 1024 / 1024 / 1024, 2, '.', '') .
 ' GB';
 }
 else
 {
return number_format($filesize / 1024 / 1024, 2, '.', '') . ' MB';
 }
 }

Seems overly complex.  Why not something like:

$file_name = /path/to/file;
$file_type = array( 'K', 'M', 'G' );
$size = filesize ( $file_name );
for ( $t = 0; $size  1024; $t++ )
{
$size /= 1024;
$file_size = round ( $size, 1 ) . ' ' . $file_type[ $t ] . 'B';
}
echo \$file_size = $file_size;


-- 
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] Exec() denied read on Apache (fedora core 3)

2004-12-24 Thread Zia Syed
Thanks for ur reply. I'm running httpd with php on my linux box. I
dont know how to enable the exec in php.ini. Tried safe mode but no
use.  I get the following output from the command

[EMAIL PROTECTED] html]# php -r 'system(whoami);'
Error in argument 1, char 2: option not found r

however, with who.php, it works 

[EMAIL PROTECTED] html]# php who.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

root

:( I'm still stuck with it.

Z.
On Fri, 24 Dec 2004 08:13:37 -0600, Greg Donald [EMAIL PROTECTED] wrote:
 On Fri, 24 Dec 2004 12:09:51 +, Zia Syed [EMAIL PROTECTED] wrote:
  I've been trying to execute some system commands and print back the
  output on the webpage. I found the following code to do so, however,
  it is not working.
  ?php
  echo exec('whoami');
  ?
 
  However, i tried to switch on the Safe_Mode but that wasn't any good either.
  Any idea how can i get it work?
 
 I assume you're hosting with someone and they have dsiabled that
 function via the php.ini, I dunno..  Anyway, you might get lucky and
 they are using a different php.ini for the php binary.  Try this from
 command line:
 
 php -r 'system( whoami );'
 
 --
 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
 


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



Re: [PHP] hackers?

2004-12-24 Thread Manuel Lemos
Hello,
on 12/24/2004 03:01 AM Chris Shiflett said the following:
--- 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.
It depends on what kind of vulnerabilities you want to audit. often some
sites are vulnerable, not because of the code of site itself, but rather
wholes in the third party software that they rely.
Many of the security breaches are perform by script kiddies that use
exploit scripts that take advantage of holes in known applications such
as Web servers, database servers and even PHP itself.
Auditing the actual site code is not a bad idea but many companies are
not confortable with the idea of an outsider to look at their code and
learn details about the site that may be part of its business secret and
so they would be worth selling to competitors.
The services of trustworth auditors are often not cheap. A cheaper
alternative is probably training the site developers to write secure
code and audit the applications regularly.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Question about dates

2004-12-24 Thread Brent Clements
How does one over come the issue of unix time not going beyond a certain date?


ie, when I do echo strtotime(2099-10-08); it outputs -1

This has to do with the limitations of unix time, so how does one get around it?

Thanks,
Brent

-- 
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-24 Thread Greg Wardawy
Thanks a lot Sagar,
The logic looks perfect. Having no web programming experience at all I 
didn't even know what I was looking for.
And I didn't know I needed a java script for the PHP page.

Greg.
- Original Message - 
From: Sagar C Nannapaneni [EMAIL PROTECTED]
To: Greg Wardawy [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Thursday, December 23, 2004 1:25 PM
Subject: Re: [PHP] Next page every second


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: php-general@lists.php.net
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__
table width=420 height=12 border=3 cellpadding=6 cellspacing=4
bordercolor=#9900CC
  tr
th width=60 scope=colVariable/th
th width=360 scope=colValue/th
  /tr
  ?php do { ?
  tr
th width=601/th
td width=360 nowrap=nowrap bordercolor=#660066
bgcolor=#FFdiv align=right class=style8?php echo
$row_gail_data['var1']; ?/div/td
  tr
th width=602/th
td width=360 nowrap=nowrap bordercolor=#660066
bgcolor=#FFdiv align=right class=style9?php echo
$row_gail_data['var2']; ?/div/td
  /tr
  tr
th width=603/th
td width=360 nowrap=nowrap bordercolor=#660066
bgcolor=#FFdiv align=right class=style10?php echo
$row_gail_data['var3']; ?/div/td
  /tr
  tr
th width=604/th
td width=360 nowrap=nowrap bordercolor=#660066
bgcolor=#FFdiv align=right class=style7?php echo
$row_gail_data['var4']; ?/div/td
  /tr
  ?php } while ($row_gail_data = mysql_fetch_assoc($gail_data)); ?
/table
/p
pa href=?php printf(%s?pageNum_gail_data=%d%s, $currentPage,
min($totalPages_gail_data, $pageNum_gail_data + 1),
$queryString_gail_data);
?Next/a
/p
__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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php + html (frame)

2004-12-24 Thread edwardspl
John Nichel wrote:

 [EMAIL PROTECTED] wrote:
  Dear All,
 
  I just created a webpage with frame structure:
  top.php ( name of frame is t ) + buttom.php ( name of frame is b ) +
  right.php ( name of frame is r )
 
  Now, I want to make a hypher link with top.php, and when user mouse
  click the link under top.php, then there will load a php ( base target
  is b ) and load another php ( base target is r )...
 
  So, is there a sample for reference mouse click a hypher link then auto
  load two php pages into different target area ?
 
  Edward.

 This has nothing to do with PHP.?Use a HTML/JavaScript mailing list,
 and/or read some howto's for HTML/JavaScript.

But I want to use php instead of HTML/JavaScript...
So, is there any sample for reference ?

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



Re: [PHP] php + html (frame)

2004-12-24 Thread John Nichel
[EMAIL PROTECTED] wrote:
John Nichel wrote:

[EMAIL PROTECTED] wrote:
Dear All,
I just created a webpage with frame structure:
top.php ( name of frame is t ) + buttom.php ( name of frame is b ) +
right.php ( name of frame is r )
Now, I want to make a hypher link with top.php, and when user mouse
click the link under top.php, then there will load a php ( base target
is b ) and load another php ( base target is r )...
So, is there a sample for reference mouse click a hypher link then auto
load two php pages into different target area ?
Edward.
This has nothing to do with PHP.  Use a HTML/JavaScript mailing list,
and/or read some howto's for HTML/JavaScript.

But I want to use php instead of HTML/JavaScript...
So, is there any sample for reference ?
PHP is server side.  It cannot target frames.  That is done on the 
client side.  You will *have too* use JavaScript to target multiple 
frames with just one link.

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


[PHP] Re: [PHP-DB] Table Info

2004-12-24 Thread Greg Wardawy
Hi Brad,
That's what I'm trying to achieve (my post Next page every second). Maybe 
Sagar's response will help you a bit.

Greg
Brad Ciszewski [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am having problems coming up with a way to do this. I highly appreciate
any help what so ever.
Problem: I  need to extract data from the database, and display it on a
table with 2 columns. It has to alternate columns automaticly, for each 
row.

Like I said earlier, any help is highly appreciated!!
Thanks in advance,
Brad Ciszewski
www.BradTechnologies.com Web Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php + html (frame)

2004-12-24 Thread Matthew Sims
 John Nichel wrote:

 [EMAIL PROTECTED] wrote:
  Dear All,
 
  I just created a webpage with frame structure:
  top.php ( name of frame is t ) + buttom.php ( name of frame is b )
 +
  right.php ( name of frame is r )
 
  Now, I want to make a hypher link with top.php, and when user mouse
  click the link under top.php, then there will load a php ( base
 target
  is b ) and load another php ( base target is r )...
 
  So, is there a sample for reference mouse click a hypher link then
 auto
  load two php pages into different target area ?
 
  Edward.

 This has nothing to do with PHP.  Use a HTML/JavaScript mailing list,
 and/or read some howto's for HTML/JavaScript.

 But I want to use php instead of HTML/JavaScript...
 So, is there any sample for reference ?


PHP and Javascript are apples and oranges. They are nothing alike and are
completely different in everyway. If you want something done with the
browser, use Javascript.


-- 
--Matthew Sims
--http://killermookie.org

-- 
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-24 Thread Jose M.Herrera
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
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);
Yes, of course.
Your code or example, is just like:
( $b1 = is_null($x) )  or ( $y  5  ) ;
( $b2 =  ($y  5)   )  or  is_null($x) ;
The  has more precedence than =, or it has a very low precedence.
Then, $b1 = false and $b2 = True... that's ok! :P
You example, must have been:
$b1 = (   ( is_null($x) )  or ( $y  5  ) );
$b2 = (   ( $y  5  )  or ( is_null($x) ) );
I this example the value of $b1 is all between the parenthesis (explicitly).
Bye!
- --
Jose Miguel Herrera M.  -  User #246070 counter.li.org
Est.Ing.Civil Informatica - UTFSM
Valparaiso, Chile -  http://www.inf.utfsm.cl/~jherrera
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBzHJdl/j2VHFHn8wRArZdAKCJbv8W54vlpeinK1hMF3xEttjuiACeIIUs
63OX2bn+h9zLUDHhSvSTr/M=
=3vfi
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Merry Christmas ;o]

2004-12-24 Thread Alaor Barroso
Merry Christmas and happy new year for all that is
part of php community, god bless us. Peace!





___ 
Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. 
http://br.acesso.yahoo.com/ - Internet rápida e grátis

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



[PHP] Simple code to replace one line?

2004-12-24 Thread Aaron Paulley
Can someone help me out with a little bit of simple code please?

I know that the line in a file that I want to replace completely is
line number 9.

Is there a simple function I can use to replace that line?

Thanks,
Aaron

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



Re: [PHP] Simple code to replace one line?

2004-12-24 Thread Greg Donald
On Fri, 24 Dec 2004 19:08:03 -0500, Aaron Paulley [EMAIL PROTECTED] wrote:
 I know that the line in a file that I want to replace completely is
 line number 9.
 
 Is there a simple function I can use to replace that line?

php -r 'system( sed 9s/.*/replacement/g old  new );'


-- 
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] Merry Christmas ;o]

2004-12-24 Thread Greg Donald
On Fri, 24 Dec 2004 20:45:28 -0300 (ART), Alaor Barroso
[EMAIL PROTECTED] wrote:
 Merry Christmas and happy new year for all that is
 part of php community, god bless us. Peace!

Same.  :)


-- 
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] hackers?

2004-12-24 Thread Greg Donald
On Thu, 23 Dec 2004 21:01:57 -0800 (PST), Chris Shiflett
[EMAIL PROTECTED] wrote:
 This is the least effective means of auditing an application. Letting an
 experienced person review your code is much, much better.

I agree.

But feeding ';drop table blah' sql into the GET query is much, much more fun.

:)


-- 
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] Question about dates

2004-12-24 Thread Greg Donald
On Fri, 24 Dec 2004 08:46:28 -0600, Brent Clements
[EMAIL PROTECTED] wrote:
 How does one over come the issue of unix time not going beyond a certain date?

Overcome the issue in what way?  A 32bit integer is what it is.

 ie, when I do echo strtotime(2099-10-08); it outputs -1

So don't use strtotime().  You're never going to fit an integer with
more than 32bits into a memory space of 32bits or less without losing
bits.  The PHP manual seems pretty clear in what to do as far as
checking for failure:

$str = 'Not Good';
if (($timestamp = strtotime($str)) === -1) {
   echo The string ($str) is bogus;
} else {
   echo $str ==  . date('l dS of F Y h:i:s A', $timestamp);
}

 This has to do with the limitations of unix time, so how does one get around 
 it?

If it's stored in a db, you can use the date/time fields which usually
provide more storage space than 32bits.  MySQL has timestamp for
example.


-- 
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] Merry Christmas ;o]

2004-12-24 Thread Matthew Sims
 Merry Christmas and happy new year for all that is
 part of php community, god bless us. Peace!


How is this PHP? Please consult the Christmas mailing list.

JUST KIDDING! Happy holidays. :)

-- 
--Matthew Sims
--http://killermookie.org

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



Re: [PHP] Shifting banner on re-display [SOLVED]

2004-12-24 Thread Andre Dubuc
Hi List,

This is an 'oldie' thread, but since I found out what caused the odd behavior, 
I thought it would be nice to pass on the solution.

Toying around with it last week, I suddenly remembered that often when I 
manipulated an image in The Gimp, sometimes the image would move slightly 
off-center or down a shade. If that image was then saved, those changes, 
minute as they were, would magnify if the image was displayed at increased 
width. Result = image might shift an inch shift up or down. A rather 
embarrassing but obvious error, if one knew where to look. . .

Re-centering and saving the images solved the problem. Thanks again to all who 
offered suggestions.

A Blessed Christmas to all.
Andre

Hi Mark,

Tried your idea - no go. 

Somehow I think the problem may be related to the banner's gif width (set at 
101%). I recall when I first made the banner, which has a horizontal rule (a 
png) above it set at 100%, that the HR caused some problems. Perhaps I should 
toy more with the combo.

Thanks for the suggestion.
Regards,
Andre


On Saturday 13 November 2004 07:42 pm, Marek Kilimajer wrote:
 What if you try:

 ?php include(banner.php); ?
 form action=bad.php method=post

 Andre Dubuc wrote:
  Hi,
 
  I have a very annoying problem with pages that re-display using the form
  action tag. On re-display the banner, which is set absolute position at
  0px, shifts down by about an inch. I've isolated the cause to the form
  action tag.
 
  Simplified code for bad.php page:
 
  ?php session_start(); ob_start(); ?
  /* html head style body tags */
 
  form action=bad.php method=post
  ?php include(banner.php); ?
 
  input type=submit name=submit value=Add Names
 
  /* closing form body html tags */

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



[PHP] Mandrake 10.1

2004-12-24 Thread GH
This may be off topic.. but does anyone know what versions of PHP and
MySql Mandrake is shipping with 10.1 Offical?

Thanks

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