[PHP] transfer tables to another database?

2001-08-22 Thread nafiseh saberi


hi.
I want to transfer tables to another database.
how??

thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] time

2001-08-22 Thread nafiseh saberi

hi.
how do I can wrk with time:

11:56:23 - 10:00:45 =

thanks.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] transfer tables to another database?

2001-08-22 Thread David Robley

On Thu, 23 Aug 2001 16:07, nafiseh saberi wrote:
 hi.
 I want to transfer tables to another database.
 how??

 thanks.

Without knowing what DB package you are using - use whatever tool you 
have (in mysql it's mysqldump) to dump the data, then use ? to reload it 
into the new database; assuming that you are staying with the same DB 
package.

Alternatively, you could use PHP (just to keep on topic) to read records 
from the tables in the 'old' database and write to the 'new' database.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Time was invented by an Irish guy named O'Clock.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mySQL Query - comparing multiple values with one field

2001-08-22 Thread Niklas Lampén

What I need to do is to compare if one field matches a value from a huge
list of values.

Do I need to query like
SELECT * FROM table WHERE field LIKE '%value1%' || field LIKE '%value2%'
or can I do it something like this
SELECT * FROM table WHERE field LIKE ('%value1%' || '%value2%')?


Niklas Lampén



[PHP] re:transfer tables to another database?

2001-08-22 Thread nafiseh saberi

hi and thanks.

I work with postgres with php.

best regards.
love your enemies that cause to work harder.
I am from IRAN.
thanks again.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time

2001-08-22 Thread speedboy

 hi.
 how do I can wrk with time:
 
 11:56:23 - 10:00:45 =

Don't ask this again.

Date: Mon, 20 Aug 2001 19:14:41 +1000 (EST)
From: speedboy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: [PHP] time in php

 hi.
 how I compare two times with php?
  12:23:50 - 13:12:00 = ???

Convert them to timestamps (unix timestamps) and subtract the two.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: time

2001-08-22 Thread Raphael Pirker

convert both to a timestamp... check
http://www.php.net/manual/en/function.mktime.php for more info



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] transfer tables to another database?

2001-08-22 Thread speedboy

 hi.
 I want to transfer tables to another database.
 how??

Have you read the documentation on backing up and restoring
databases/tables in postgresql?

http://www.ca.postgresql.org/users-lounge/docs/7.1/admin/backup.html


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] thanks

2001-08-22 Thread nafiseh saberi


thanks for 
time and pg_dump.

nafiseh.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] time

2001-08-22 Thread David Robley

On Thu, 23 Aug 2001 16:11, nafiseh saberi wrote:
 hi.
 how do I can wrk with time:

 11:56:23 - 10:00:45 =

 thanks.

Have a look at the date and time functions - convert the time to seconds 
and do the calculation (mktime) then turn it back to whatever format you 
like.

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   REALITY.SYS corrupted: Reboot universe? (Y/N/A)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problems benchmarking php Scripts

2001-08-22 Thread Jens Kisters

Hello together,

I have been trying to benchmark the backend scripting for a flash online
game, for this purpose i wrote another PHP Script that uses fopen to
make exactly the same requests the flash movie would make with the same
timing, and writes a log of the game session into a database.
I run this script from the shell of a linux box using the php CGI
binary, and start it for a couple of times,
but somehow i rarely get more than 66 of those benchmark scripts started
simultaneously, neither on one machine, nor on two machines together, so
i guessed it has sth to do with my apache confguration, i set
startservers and min and maxspare childs to a high value to prevent the
httpds from crashing when there are more than 20 to be started in very
short time and set maxrequests per child to 256, but none of these
changes seem to affect the total number of scripts i can run.
The mysql keeps spawning processes of itself and i can still connect to
the database when i get to the max of running benchmark scripts, so
there does not seem to be a limit of some kind there either.

Sometime i get to start a hundred scripts or more, but they disappear in
very short time.
i have the outputs pointed to /dev/null when putting the scripts into
the background (start with ), when i start a single one with output
there are no error messages displayed.

I also noticed when looking at the output of 'top' i see few httpd
processes crashing saying defunct, this happens more rarely when i
heve enough httpds started before i start running the benchmark, but
some still crash, i can't find any messages in log files saying what
happened there.

The benchmark scripts should log errors if there was no response from
the server but i dont get any of those errors in the logs.

thanks in advance
Jens

--
Grüße aus dem schönen Kleve
Jens Kisters

rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau

Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
[EMAIL PROTECTED]
http://www.rosomm-partner.de



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Header Nightmare...

2001-08-22 Thread David Bouw

Who can crack the following nut for me..?  Or is it uncrackable...?

I have some files stored in a MySQL database... I encoded this data using 
base64_encode..
These files can be anything from .pdf files to .jpg or even a Word document...

To make these files visible I made the following code:

include (config/database.cfg);//config file to connect to database etc etc...
$result = mysql ($databasename, select * from image_table where id = '$admin[file]');
$nrrows = mysql_numrows($result);
if ($nrrows == 1)
   {$row = mysql_fetch_array($result);
header(Content-type: $row[type]);
header(Content-Disposition: inline; filename=$row[originalname]);
 echo (base64_decode($row[data]));
 exit;
   }

O.K, heres the problem... Basically the above example works for all documents which 
Explorer 5.5 (which I am testing on) has got
built-in support for..
All documents which use an external application/plugin are giving problems!   On the 
moment I am experimenting with .PDF files...

My problems is binary data (of the pdf) showing up in my browser.. (E.g... It looks as 
if the normal html/text tag is used for the
content...
I need explorer to start Acrobat to view this page...   The idea that I get, is that I 
named the above script: retrieve_date.htm
I have got a feeling that Explorer 5.5 is still very buggy with the headers, 
especially when the filename you retrieve hasn't got
the same extension
as the filename will original be...

Does anyone see any mistakes which I am making... ?

With kind regards
David Bouw


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Strings with Spaces in URLS

2001-08-22 Thread Christian Reiniger

On Wednesday 22 August 2001 03:05, Chris Aitken wrote:
 I have come up with a bit of a problem

 I have a little funky search form on a page, and when I send the search
 data on as a URL, anything with a space is screwed up example

  $search = This is a test;
  echo a href=http://www.blah.com/foo.php?search=$search;

 and when the link is clicked (or even when the mouse is put over the
 link), the URL in the browser is -

  http://www.blah.com/foo.php?search=This

 leaving out all words after the first space.

http://php.net/urlencode
http://php.net/rawurlencode

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

The use of COBOL cripples the mind; its teaching should, therefore,
be regarded as a criminal offence.

- Edsger W. Dijkstra

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Concept of Templates

2001-08-22 Thread Navid Yar

Hello everyone,

I have a simple question, and I hope I ask it correctly without any
confusion. I want to build my own template scheme without using any 3rd
party, ready-made freeware template codes. But I am confused about one
thing. I am building a content driven website. The templates (such as html
headers, footers, style sheets, etc) will be placed in text files and called
in as includes, but the content will be placed in a database. The thing I'm
confused about is the concept behind linking these articles together in a
main TOC (table of contents) page. When one clicks on a topic from a main
TOC page, how does the server know which article to pull from the database
and place into a particular template? Does the link itself send any
information someplace that tells the server what information is needed and
how it has to be performed or placed?

I hope this doesn't sound too confusing. If anyone needs me to clear it up a
bit more, please let me know and I'll try my best. For those of you who know
what I'm talking about, what is the concept behind templates, especially the
links to those templates? Thanks in advance...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mySQL Query - comparing multiple values with one field

2001-08-22 Thread James Holloway

Hi Niklas,

You can use || or OR.

Secondly, huge list of values you say?  Can this list be exploded by a
common denominator, like a space or comma?  If so, consider this:

$list = // Huge list of words (array), separated by a comma.
$words = explode(,, $list);
$query = SELECT * FROM table WHERE ;

for($i = 0; $i = sizeof($words); $i++) {
$query .= field LIKE '% . $words[$i] . %' OR ;
}

$query = substr($query, 0, -4); // need to take out:
[[:space:]]OR[[:space:]] from the end
$do_query = @mysql_query($query);


Cheers,
James

 What I need to do is to compare if one field matches a value from a huge
 list of values.

 Do I need to query like
 SELECT * FROM table WHERE field LIKE '%value1%' || field LIKE '%value2%'
 or can I do it something like this
 SELECT * FROM table WHERE field LIKE ('%value1%' || '%value2%')?


 Niklas Lampén




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: if statement and imageline()

2001-08-22 Thread Hugh Danaher

Richard,
No, the code was cut from the php file and displayed as is in my e-mail.  I
also tried to see if I could declare the two suspect variables in another
IF() statement before the IF() statement that's fouling the execution of the
.jpg construct, but no luck there too.  Could I just be overburdening the
program?  I've got a lot of code (about 150 lines) in the .jpg construct.
Cheers,
Hugh
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: Hugh Danaher [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 12:18 AM
Subject: Re: [PHP] Re: if statement and imageline()


 Hmm.

 Are you sure you didn't have:

 if ($year = $startyear)

 *THAT* would assign 1996 over and over to $year, after the ++, so it would
 never move forward, and the script would time out...

 Not sure what else could be wrong, if it's *JUST* the if part you are
 adding...

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Hugh Danaher [EMAIL PROTECTED]
 To: Richard Lynch [EMAIL PROTECTED]
 Cc: Php-General [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 1:05 AM
 Subject: Re: [PHP] Re: if statement and imageline()


  Richard,
 
  Without the code below, I get a good .jpg file and it displays nicely.
 But,
  with the IF statement in, I get a time out error message Execute time
  exceeds 30 seconds...  I think it is because two of the variables are
  declared after the IF statement, even though they aren't being used on
the
  first loop.  I'll try to declare them before the FOR loop and see if
that
  works.
 
  As you might tell from my code, the only software course I ever had, was
 in
  college 20 years ago, and it was in BASIC language (with line numbers!).
  However, I find php easy to work with, and have done some amazing things
  with it in the last 2 months.  With your help and the help of others,
I'll
  certainly make progress.
 
  Thanks,
  Hugh
  - Original Message -
  From: Richard Lynch [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, August 21, 2001 5:16 PM
  Subject: [PHP] Re: if statement and imageline()
 
 
   What are you getting?  An image at all?  Broken image?
  
   Try getting rid of the header(image/jpeg) or whatever, and see if
you
  have
   some error message.
  
   --
   WARNING [EMAIL PROTECTED] address is an endangered species -- Use
   [EMAIL PROTECTED]
   Wanna help me out?  Like Music?  Buy a CD:
http://l-i-e.com/artists.htm
   Volunteer a little time: http://chatmusic.com/volunteer.htm
   - Original Message -
   From: Hugh Danaher [EMAIL PROTECTED]
   Newsgroups: php.general
   To: Php-General [EMAIL PROTECTED]
   Sent: Tuesday, August 21, 2001 1:16 AM
   Subject: if statement and imageline()
  
  
   help,
  
   I am trying to set up a .jpg file to graph the earnings per year of a
   company.  I can generate a log-normal graph, can get it to display the
   earnings per year as circles on the graph, but I can't get the   if
()
 
   statement to work.  I know I am setting two of the variables in the if
   statement after the if statement executes once, but these variables
 won't
  be
   used until after the  for ()  loops once, and therefore should be
   available for use in  imageline()  on the second loop (where
   $year$startyear).  Somehow, I think my logic is correct but it
mustn't
 be
   so.
  
  
   $startyear=1996;
   $chart_start_year=1992;
   for ($year=$startyear;$year=$startyear+7;$year++)
{
$x=(($year-$chart_start_year)*20)+20;
$y=420-log(${earnings_.$year})*75;
if ($year$startyear)
 {
 imageline($image,$first_x,$first_y,$x,$y,$blue);
 }
$first_x=$x;
$first_y=$y;
  
  imagettftext($image,9,0,$x_distance-4,$y_distance+3,$blue,$font2,m);
}
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] imagemagick and file size

2001-08-22 Thread Ben-Nes Michael

Hi

I decrease image size using imagemagick with the following command:
function example() {
 $convert = cat $userfile | /usr/X11R6/bin/convert - $type:-;
 return `$convert`;
}

the returned binary value is uploaded to the DB.

My main problem is that I don't know how to measure the decreased image size
while its stored in the variable.

--
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Where do I get the DLL php_mssql70.dll?? Please help...

2001-08-22 Thread Phil

Hey everybody,

I'm trying to connect a mssql db, but cant't even load the extension for
mssql

Where do I get the file php_mssql70.dll (php4)?

Thanks everybody!

Phil


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Where do I get the DLL php_mssql70.dll?? Please help...

2001-08-22 Thread Raphael Pirker

it should be inside C:\PHP\extensions

if the file is not in there, then you should download the package again.
also remember to specify the extension in your php.ini!!

cheers

raphael



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] socket function

2001-08-22 Thread Boris

Does socket() function works on windows or not?

Thanks
Boris




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: PHP based auth -----------------

2001-08-22 Thread Alex Sofronie

Thanks a lot.
And sorry about  in my subject message but at a prior post on
this list I managed to skip some responses due to the volume of this list.
Thanks again,

Alex Sofronie
[EMAIL PROTECTED]
- Original Message -
From: Sheridan Saint-Michel [EMAIL PROTECTED]
To: Alex Sofronie [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Tuesday, August 21, 2001 4:53 PM
Subject: Re: [PHP] Re: PHP based auth -


 What you are trying to do is covered in the manual here:
 http://www.php.net/manual/en/features.http-auth.php

 I think you specifically was the section:
 Both Netscape Navigator and Internet Explorer will clear the local browser
 window's authentication cache for the realm upon receiving a server
response
 of 401. This can effectively log out a user, forcing them to re-enter
 their username and password. Some people use this to time out logins, or
 provide a log-out button.

 All the details of this are in the manual.

 Sheridan Saint-Michel
 Website Administrator
 FoxJet, an ITW Company
 www.foxjet.com


 - Original Message -
 From: Alex Sofronie [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Monday, August 20, 2001 4:12 PM
 Subject: [PHP] Re: PHP based auth -


  No, I'm just using PHP_AUTH_USER and PHP_AUTH PW and i am trying to
  logout... The session_destroy() is not working.
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] How can I insert the data into the begining of a text file

2001-08-22 Thread Zenith

I orginal have a function like the following...

  $fp = fopen ( $HTTP_SERVER_VARS['DOCUMENT_ROOT']./log/debug_message.txt,
a );
  fputs ( $fp, \nDebug message from : $PHP_SELF\n );
  fputs ( $fp, \t$message\n\n );
  fclose ( $fp );

But I found that, the result is, all message is append to the end of a file.
Can I insert the text into the begining of the file??

I think read all the text from the file first, arrang the string variable,
so that the new message can insert, would be a solution. But is it stupid to
do so??




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] parsing .php files not only under root dir

2001-08-22 Thread helmutott

I would like the server on win2K to parse .php files whereever on the computer they 
are located. 
The server should run as service.
What server allows this?

Helmut



[PHP] Regex help

2001-08-22 Thread Stefen Lars

Hello all

In the Apache config file, we have the following directive:

SetEnvIfNoCase Referer ^http://www.oursite.com/; local_ref=1

FilesMatch .(gif|jpg)
  Order Allow,Deny
  Allow from env=local_ref
/FilesMatch

We use this to prevent people from directly linking to .gif and .jpg files. 
This technique is covered here:

http://apachetoday.com/mailprint.php3?action=pvltsn=2000-06-14-002-01-PS

However, we have to add more and more file types to the FilesMatch 
directive. Currently it looks like this:

FilesMatch .(doc|zip|xls|exe|jpg|gif|png|psd|tif|tif)

However, this list continues to grow. And we can never be sure that every 
file type is included.

It occurred to me that it would be better to say do not serve any files 
except .htm, .html and .php files..

I have spent quite a long time with several regexes, but I am unable to 
create a regex that archives this seemingly simple talk.

If anyone could help, I would be really happy….

S


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cant load dynamic library.... whats up?

2001-08-22 Thread Phil

Hey everybody,

Im trying to tell php to search my extensions... I tried everything but it
doesnt work... does anybody has an idea???




c:\windows\php.ini says:

- extension=php_mssql.dll
- extension=php_oci8.dll
- extension=php_openssl.dll

and

- extension_dir = c:\windows\system\




I even placed the dlls for all the extensions in:

- c:\programs\php
- c:\programs\extensions
- c:\windows\
- c:\windows\system

But ist doesn't work.


Thanks everybody!

Phil


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: our country

2001-08-22 Thread _lallous

Why LEBANON isn't listed?

Richard Lynch [EMAIL PROTECTED] wrote in message
036b01c12aa4$51b7fce0$6401a8c0@Lynchux100">news:036b01c12aa4$51b7fce0$6401a8c0@Lynchux100...
 Check at http://www.phpusergroups.org to see if there's a User Group in
your
 area.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Nafiseh Saberi [EMAIL PROTECTED]
 Newsgroups: php.general
 To: [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 8:52 AM
 Subject: our country


 
  hi.
 
  I want to know how many of people in php group are IRANIAN??
 
  I am IRANIAN too.
  how about yours??
  thanks.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] someone please explain weird getforeignkeys

2001-08-22 Thread alvarez



I need to look up a table's foreign keys using the unified ODBC-functions.
'odbc_foreignkeys()' requires me to pass seven parameters, each of them being
mandatory, to archive this.

Because the approach is not intuitive anyhow and there is no documentation
available except of the PHP-manual's prototype, neither me nor my co-workers
have any idea of how to apply the function.

The manual states that three of the arguments are superfluous, depending on
the application; but the prototype contradicts this, declaring them mandatory.

Can anyone please point me to a working code example or provide one?

   Thanks,  D. Alvarez Arribas [EMAIL PROTECTED]


Btw, how are the inter-table relationships defined at all? I cannot think of
a way to determine foreign keys without complete knowledge of all joins and
subqueries potentially run against the database.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Web fetching script

2001-08-22 Thread Ben Quinn

Hi all

I have a web fetching script that fetches text from an external URL and I
would like to grab two lots of text at the same time - can anyone tell me
why this isn't working?

?

$GrabURL = http://grabfile.html;;
$GrabStart = start;
$GrabEnd = stop;

$file = fopen($GrabURL, r);

$rf = fread($file, 2);

$grab = eregi($GrabStart(.*)$GrabEnd, $rf, $printing);

echo $printing;

rewind($rf);

$grab2 = eregi($GrabStart(.*)$GrabEnd, $rf, $printingb);

echo $printingb;

fclose($file);

?






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: register_globals odd behaviour?

2001-08-22 Thread Sean C. McCarthy

Hi,

Internally I use variables but I use the array to update the value since
I have problems with the scope inside classes. So I update the value on
the array just at the end of the script by registering an update
function with register_shutdown_function().

What is the reason that I should not use the array? Is there any problem
doing it that way?

Thanks in advance.

Sean C. McCarthy
SCI, S.L. (www.sci-spain.com)

PS: By the way I couldn't find this bug in the bug database.

Richard Lynch wrote:
 
 I think you should still use $count++
 
 The array is just there for you to *READ* data, not to alter it.
 
 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: Sean C. McCarthy [EMAIL PROTECTED]
 Newsgroups: php.general
 To: PHP General List [EMAIL PROTECTED]
 Sent: Tuesday, August 21, 2001 1:00 AM
 Subject: register_globals odd behaviour?
 
  Hi All,
 
  I just come across and odd behaviour with the register_globals and
  session handling. The problem is that when I set the register globals to
  on I cannot access the session_variables through the associative array
  HTTP_SESSION_VARS. The manual says explicitly that with track_vars and
  register_globals both on the array and the vars will point to the same.
 
  It just doesn't happen the vars are not written at the end of the
  script. I mean with register_globals ON:
 
  ?
  session_register(count);
  $HTTP_SESSION_VARS[count]++;
  ?
 
  this does not work. My php is PHP Version 4.0.3pl1 running on Linux
  2.2.18 and Apache1.3.9 . Does this bogus behaviour happen with higher
  versions too?
 
  Thanks in advance.
 
  Sean C. McCarthy
  SCI, S.L. (www.sci-spain.com)
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Web fetching script

2001-08-22 Thread Dave

What response are you expecting, and what response are you getting?

assuming your regex is working as expected, you are running it twice to receive
the same result into 2 different variables???  why not just copy the variable
after

additionally, $printing is filled with the matches of your regex(10 of them
according to manual)  as such you have to specify which element of $printing you
are wanting to print, or you will get the lovely array output

I don't understand why the grab variables are there unless you need them later.
Without accounting for your regex...

eregi($GrabStart(.*)$GrabEnd, $rf, $printing);
echo $printing[1];
$printingb=$printing;
echo $printingb[1];

I have a web fetching script that fetches text from an external URL and I
would like to grab two lots of text at the same time - can anyone tell me
why this isn't working?

?

$GrabURL = http://grabfile.html;;
$GrabStart = start;
$GrabEnd = stop;

$file = fopen($GrabURL, r);

$rf = fread($file, 2);

$grab = eregi($GrabStart(.*)$GrabEnd, $rf, $printing);

echo $printing;

rewind($rf);

$grab2 = eregi($GrabStart(.*)$GrabEnd, $rf, $printingb);

echo $printingb;

fclose($file);

?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] convert 12:12:00 to seconds

2001-08-22 Thread Chris Lambert

$seconds = explode(:, $time);
$seconds = $seconds[0] * 3600 + $seconds[1] * 60 + $seconds[2];

Or use www.php.net/mktime

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message - 
From: nafiseh saberi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 23, 2001 9:30 AM
Subject: [PHP] convert 12:12:00 to seconds


| 
| hi.
| how do I covert convert  12:12:00  to seconds ?
| I want to get time from system and covert it to seconds to do
| arithmetic work on it.
|  thanks.
| 
| -- 
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
| 
| 
| 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] convert 12:12:00 to seconds

2001-08-22 Thread Andrey Hristov

Use gmmktime() or mktime()
example :
?php
echo gmmktime(12,12,0,1,1,1970);
// format(hour,minute,second,month,day,year)
// counting starts from 1/1/1970 so if you set this day you will receive the
secongs
// gmmktime accoring GMT or mktime() accoring you local time (mine is GMT+3)
// so 12:12:00 used with gmmktime will give me how many seconds there are in
9:12:00h
?
- Original Message -
From: nafiseh saberi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 23, 2001 4:30 PM
Subject: [PHP] convert 12:12:00 to seconds



 hi.
 how do I covert convert  12:12:00  to seconds ?
 I want to get time from system and covert it to seconds to do
 arithmetic work on it.
  thanks.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Web fetching script

2001-08-22 Thread Andrey Hristov

Try this:
http://www.php.net/manual/en/ref.curl.php
- Original Message - 
From: Ben Quinn [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 2:35 PM
Subject: [PHP] Web fetching script


 Hi all
 
 I have a web fetching script that fetches text from an external URL and I
 would like to grab two lots of text at the same time - can anyone tell me
 why this isn't working?
 
 ?
 
 $GrabURL = http://grabfile.html;;
 $GrabStart = start;
 $GrabEnd = stop;
 
 $file = fopen($GrabURL, r);
 
 $rf = fread($file, 2);
 
 $grab = eregi($GrabStart(.*)$GrabEnd, $rf, $printing);
 
 echo $printing;
 
 rewind($rf);
 
 $grab2 = eregi($GrabStart(.*)$GrabEnd, $rf, $printingb);
 
 echo $printingb;
 
 fclose($file);
 
 ?
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Regex help

2001-08-22 Thread Robin Vickery

[EMAIL PROTECTED] (Stefen Lars) writes:

 In the Apache config file, we have the following directive:
 
 SetEnvIfNoCase Referer ^http://www.oursite.com/; local_ref=1
 
 FilesMatch .(gif|jpg)
   Order Allow,Deny
   Allow from env=local_ref
 /FilesMatch
 
 We use this to prevent people from directly linking to .gif and .jpg
 files.
 
 However, we have to add more and more file types to the FilesMatch
 directive. Currently it looks like this:
 
 FilesMatch .(doc|zip|xls|exe|jpg|gif|png|psd|tif|tif)
 
 However, this list continues to grow. And we can never be sure that
 every file type is included.
 
 It occurred to me that it would be better to say do not serve any
 files except .htm, .html and .php files..
 
 
 I have spent quite a long time with several regexes, but I am unable
 to create a regex that archives this seemingly simple talk.
 

How about this approach?

   SetEnvIfNoCase Referer ^http://www.oursite.com/; local_ref=1

   Order Allow,Deny

   Allow from env=local_ref

   FilesMatch \.(php|html?)$
  Allow from all
   /FilesMatch

I'd tighten up your regex slightly too. As it was it would match pretty
much any filename with those letters in it; The '.' matches any character
and it's not anchored to the end of the string.

   -robin


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP/Apache configuration for Win NT

2001-08-22 Thread paul . eaton

Hi Julie,

I realised that I had a case sensitivity issue with my script alias and
corrected it.

So far so good.

I then retried it and got the following error message:-

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and
inform them of the time the error occurred, and anything you might have done
that may have caused the error.

More information about this error may be available in the server error log.



and then:-

Fatal error: Call to undefined function: info() in C:\Program Files\Apache
Group\Apache\htdocs/phpinfo.php on line 3

when I tried the phpinfo test.

Well I just completely confused, everything is exactly as you said it should be
(I think)

Can anyone offer any further suggestions,

Thanks,

Paul Eaton.






Julie Meloni [EMAIL PROTECTED] on 08/21/2001 05:09:56 PM

Please respond to Julie Meloni [EMAIL PROTECTED]

To:   Paul Eaton/Harlequin@Harlequin
cc:   [EMAIL PROTECTED]
Subject:  Re: [PHP] PHP/Apache configuration for Win NT



pegc ScriptAlias /php/ C:/Php/

pegc AddType application/x-httpd-php .php .phtml .html
pegc AddType application/x-httpd-php-source .phps

pegc Action application/x-httpd-php /Php/php.exe

Check for mismatched cases in httpd.conf.



   Julie Meloni
[EMAIL PROTECTED]
PHP Essentials  PHP Fast  Easy
 --- www.thickbook.com ---








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] PHP/Apache configuration for Win NT

2001-08-22 Thread Julie Meloni


pegc I then retried it and got the following error message:-

pegc Internal Server Error
pegc The server encountered an internal error or misconfiguration and was unable to
pegc complete your request.
pegc Please contact the server administrator, [EMAIL PROTECTED] and
pegc inform them of the time the error occurred, and anything you might have done
pegc that may have caused the error.

pegc More information about this error may be available in the server error log.

What does the error log say, then?


pegc and then:-

pegc Fatal error: Call to undefined function: info() in C:\Program Files\Apache
pegc Group\Apache\htdocs/phpinfo.php on line 3

pegc when I tried the phpinfo test.

The function is phpinfo()


   Julie Meloni 
[EMAIL PROTECTED]
PHP Essentials  PHP Fast  Easy
 --- www.thickbook.com ---


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Cannot get uploaded file by PUT request vith PHP4 and Apache1.3

2001-08-22 Thread Martin

I wanted to make a script to allow publishing from Netscape Composer using 
PUT request on my Apache server with PHP4. I have tried the example from 
manual. But i can not get the uploaded file. The 
$PHP_UPLOADED_FILE_NAME is not set and the 
$PHP_PUT_FILENAME allso is not set. Vhen I send the HTTP/1.0 404 
Error header (so I could see the results)and dysplaied all the variables using 
phpinfo(INFO_VARIABLES) i found there is no variable containing any 
information about uploaded file. Now I have Apache 1.3.20 with PHP 4.0.6.
But i have tried it with the same httpd.conf and php.ini on earlier version 
(Igess 1.3.13 and 4.0.2) and it did not work as well.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: problem with $HTTP_POST_FILES

2001-08-22 Thread bill

If they're empty but phpinfo displays them you're probably inside a function and 
haven't declared HTTP_POST_FILES as global.

Jason Dulberg wrote:

 I am working on an image upload script and I've tried to use the variables
 from $HTTP_POST_FILES however it seems that no matter how I try to get the
 variables, they are always empty -- even though they are populated when
 checking phpinfo();

 HTTP_POST_FILES[binFile]
 Array
 (
 [name] = arrow-block.gif
 [type] = image/gif
 [tmp_name] = /var/tmp/phph60272
 [size] = 857
 )

 I got some info on it from php.net and attempt to echo as they have on their site 
however it displays nothing.

 echo $HTTP_POST_FILES['binFile']['name'].br;

 I am attempting to get size/extension of the file to determine if its a valid 
extension and within the valid filesize range.

 Is this a server issue or just my php newbie-ness? If anyone has any ideas on how I 
can get this working, please let me know.

 Thanks.

 __
 Jason Dulberg
 Extreme MTB
 http://extreme.nas.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] resource xh in xslt functions

2001-08-22 Thread Jean-Charles Preaux

Hello

i'm using Sablotron as a PHP module to generate XSLT transformation.
(Debian potato release, Apache-1.3.20, sablot0.60, Expat-1.95.2, libxml2,
Libc6)
Have seen in main.c that the ressource xh returned by the xsl_create()
functions is not implemented in another XSLT functions as xslt_error()...
I want to kniw how i can do to ?

Thx

Jean-Charles Preaux



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Cannot get uploaded file by PUT request vith PHP4 and Apache1.3

2001-08-22 Thread Andrey Hristov

form ENCTYPE=multipart/form-data method=post name=form action=?php
echo $PHP_SELF;?
input type=file name=new_file class=textfield
/form

-=-=-=-=-=-=-=-=-=-
?php var_dump($HTTP_POST_FILES);?



or:
?php
if (preg_match('/(http:\/\/.*)/', $HTTP_POST_FILES['new_file']['name'],
$matches)){
 echo $some_array[$HTTP_POST_VARS['f_newfilename']]['URL']=$matches[1];
}
?
- Original Message -
From: Martin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 5:26 PM
Subject: [PHP] Cannot get uploaded file by PUT request vith PHP4 and
Apache1.3


 I wanted to make a script to allow publishing from Netscape Composer using
 PUT request on my Apache server with PHP4. I have tried the example from
 manual. But i can not get the uploaded file. The
 $PHP_UPLOADED_FILE_NAME is not set and the
 $PHP_PUT_FILENAME allso is not set. Vhen I send the HTTP/1.0 404
 Error header (so I could see the results)and dysplaied all the variables
using
 phpinfo(INFO_VARIABLES) i found there is no variable containing any
 information about uploaded file. Now I have Apache 1.3.20 with PHP 4.0.6.
 But i have tried it with the same httpd.conf and php.ini on earlier
version
 (Igess 1.3.13 and 4.0.2) and it did not work as well.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Convert to int...?

2001-08-22 Thread Seb Frost

I didn't think php was this fussy, but the following code seems to not work
because the numbers are floats.  round() doesn't seem to help either:

$siz=(72/160)*GetImageWidth($fileID);
$offx=(8/160)*GetImageWidth($fileID);
$offy=(1/2)*GetImageHeight($fileID);

ImageTTFText ($im, $siz, 0, $offx, $offy, $red, cour.ttf,PROOF);

Works fine if I just put $siz=72; etc

- seb

-Original Message-
From: Tribun [mailto:[EMAIL PROTECTED]]
Sent: 16 August 2001 08:30
To: [EMAIL PROTECTED]
Subject: [PHP] .htaccess username


...hmmm, I would guess there is a way, but I dont know why...

Can I read out the active username, which has just logged in through a
.htaccess authentication???

Like the access data..
user: patrick
pass: linux

can PHP reads out the usersname patrick ??

(and if ,... how? ;)

10x 4 U'r time.

Patrick




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Fwd: BadBlue v1.02 beta for Windows 98, ME and 2000 .php Source Code Disclosure Vulnerability

2001-08-22 Thread Kurth Bemis

Thought this may be of interest to somebody.

~kurth


Delivered-To: [EMAIL PROTECTED]
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Id: vuln-dev.list-id.securityfocus.com
List-Post: mailto:[EMAIL PROTECTED]
List-Help: mailto:[EMAIL PROTECTED]
List-Unsubscribe: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Delivered-To: mailing list [EMAIL PROTECTED]
Delivered-To: moderator for [EMAIL PROTECTED]
From: acz [iSecureLabs] [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: BadBlue v1.02 beta for Windows 98, ME and 2000  .php Source Code 
Disclosure Vulnerability
Date: Wed, 22 Aug 2001 11:11:28 +0200
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal

-- [ iSecureLabs BadBlue v1.02 beta for Windows 98, ME and 2000
Advisory ] --

BadBlue v1.02 beta for Windows 98, ME and 2000 .php Source Code Disclosure
Vulnerability
Problem discovered: 22/08/2001

-- [ Overview ] --

BadBlue http://badblue.com/ is a tiny, free download that lets you share
files, search other
PCs and even run powerful web applications.
Badblue support .php extension.
It is possible to retrieve full .php source code.

-- [ Description ] --

Badblue contains an input validation vulnerability which may lead to
download the full source code of .php pages.
This is due to a lack of checks for NULL bytes.

Exemple:
http://myBadBlue.com/test.php%00

Note: It is possible too to download .dll file used by BadBlue.

Exmeple:
http://myBadBlue.com/ext.dll%00

-- [ Tested Version ] --

BadBlue v1.02 beta for Windows 98, ME and 2000

-- [ Discovered by ] --

Cabezon Aurelien | [EMAIL PROTECTED]
http://www.iSecureLabs.com | French Security portal
http://www.isecurelabs.com/advisory/badblue.html


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] column_name

2001-08-22 Thread Jeremy Morano

Hi ,

I was wondering if there was a way to retreive a column_name instead of a
value in a query?

For example if my table has the fieldfirstname,  lastname, telephone,
movie1, movie2, movie3..


And my first record is JohnDoe  555-
good   bad bad
My second record isJane  Doe  555- good
goodbad

I would like to know which movies Jane Doe rated good'...Is
this possible and if so how?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Convert to int...?

2001-08-22 Thread Michael Geier, CDM Systems Admin

(int)$siz will give you what you are looking for.  although with the math
below, you are going to end up with 0.

$siz = 72 / 160;//returns 0.45
echo round($siz);   //returns 0
echo (int)$siz; //returns 0

-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 10:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Convert to int...?


I didn't think php was this fussy, but the following code seems to not work
because the numbers are floats.  round() doesn't seem to help either:

$siz=(72/160)*GetImageWidth($fileID);
$offx=(8/160)*GetImageWidth($fileID);
$offy=(1/2)*GetImageHeight($fileID);

ImageTTFText ($im, $siz, 0, $offx, $offy, $red, cour.ttf,PROOF);

Works fine if I just put $siz=72; etc

- seb

-Original Message-
From: Tribun [mailto:[EMAIL PROTECTED]]
Sent: 16 August 2001 08:30
To: [EMAIL PROTECTED]
Subject: [PHP] .htaccess username


...hmmm, I would guess there is a way, but I dont know why...

Can I read out the active username, which has just logged in through a
.htaccess authentication???

Like the access data..
user: patrick
pass: linux

can PHP reads out the usersname patrick ??

(and if ,... how? ;)

10x 4 U'r time.

Patrick




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Mem and variables

2001-08-22 Thread scott [gts]

amen.   :-)

 -Original Message-
 From: Richard Lynch [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Re: Mem and variables
 
 At any rate -- The right way to worry about perforance is to figure out
 where your code is spending 90% of its time, and to optimize that.  I'm
 betting it ain't in variable lookups for most of us :-)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] phpMyAdmin install error

2001-08-22 Thread Tom Beidler

I'm getting the following error with phpMyAdmin;

Warning: MySQL Connection Failed: Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (2) in
/home/web/isp.com/public_html/dloc/admin/lib.inc.php on line 308
Error

Any ideas where to start looking. All I've set in the config.inc.php is
userid, password and database name. Works on every other ISP I've used but
this one is barking.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTTP headers and include()

2001-08-22 Thread Casteele/ShadowLord

I've written a separate function library for a cluster of web pages, and I
then include(slib.php) in each of the web pages, instead of copying 12k
of code to each page individually.  Some of the pages require (simple)
authentication or redirection headers, which some of the code in the
library is supposed to handle.

Problem is, when I include the library, even though there's no other output
to be processed, it still generates the linefeed that triggers sending all
the current headers, so if(!headers_sent) {...} fails.

Is it possible to include php code without sending headers?  I've tried
exit() within the library, but that fails to work.  Instead, exit causes
generation of HTML code (a content type metatag) that is neither in the
main page nor the library.  I've also tried a simple return() (per the
documentation), but that generates a parse error.

I'm using Apache 1.3.12, PHP 4.0.2 and Slackware Linux (Not sure which
kernel version).

Thanks
Cas

PS: Please CC replies to [EMAIL PROTECTED], since I'm not officially
subscribed to this list.  Thanks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] php-counter

2001-08-22 Thread Gert Mellak

hi!

do you know an easy-to-use-php-counter, which uses mysql to store the data?

gert



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php-counter

2001-08-22 Thread John Meyer

At 05:49 PM 8/22/01 +0200, you wrote:
hi!

do you know an easy-to-use-php-counter, which uses mysql to store the data?

gert


Not off hand, but I could probably program one within the day.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] phpMyAdmin install error

2001-08-22 Thread Jay Paulson

I had the EXACT same problem... what you need to do is find where the
'mysql.sock' file is on your computer (sometimes it's at /var/lib/mysql.sock
or some place like that).. then what you need to do is create the mysql.sock
file in the /tmp directory (for some reason it wouldn't let me copy over the
file to the /tmp directory once i found it).. then you can create a symbolic
link using the ln command.. and if you need help with the ln (i believe
that's it if not let me know) you can just type man ln in the command
prompt if you are running on a linux box

hope that helps..
jay

- Original Message -
From: Tom Beidler [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 10:39 AM
Subject: [PHP] phpMyAdmin install error


 I'm getting the following error with phpMyAdmin;

 Warning: MySQL Connection Failed: Can't connect to local MySQL server
 through socket '/tmp/mysql.sock' (2) in
 /home/web/isp.com/public_html/dloc/admin/lib.inc.php on line 308
 Error

 Any ideas where to start looking. All I've set in the config.inc.php is
 userid, password and database name. Works on every other ISP I've used but
 this one is barking.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Script timeout

2001-08-22 Thread Julian Wood


I have a script which has to do a *lot* of work. In fact, it times out 
after 300 seconds, but is only about half done at that point. So I  
tried using set_time_limit(0) to no avail (php is *not* running in safe 
mode). So next I tried this directive in the apache config file: 
php_value max_execution_time 12000 (and various other values too). Now 
this changed the value of the constant correctly as reported by 
phpinfo(), but not as reported by get_cfg_var(max_execution_time), which 
still reported the default 30s. Empirically, the script would still time 
out at exactly 300 seconds, as before. So, any idea what is going on? 
Why timeout at 300s instead of the 30s or the 12000s which are the only 
two values reported? Any other workarounds? This is php 4.0

Thanks, J

--
Julian Wood

Programmer/Analyst
University of Calgary

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] HTTP headers and include()

2001-08-22 Thread Andy





 See if is there some kind of echo before header()s, or HTML sent to
browser.
 You cannot do this
 html
 head
  Bla bla
 ?php header(Location : any_script.php\n\n);?
 /head
 body
 
/body
 /html
 Why? Because there is already content sent to the browser. If some code
uses
 header() place it before any output. As I said sometimes a simple echo()
 breaks all.

 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 99%

 - Original Message -
 From: Casteele/ShadowLord [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 6:52 PM
 Subject: [PHP] HTTP headers and include()


  I've written a separate function library for a cluster of web pages, and
I
  then include(slib.php) in each of the web pages, instead of copying
12k
  of code to each page individually.  Some of the pages require (simple)
  authentication or redirection headers, which some of the code in the
  library is supposed to handle.
 
  Problem is, when I include the library, even though there's no other
 output
  to be processed, it still generates the linefeed that triggers sending
all
  the current headers, so if(!headers_sent) {...} fails.
 
  Is it possible to include php code without sending headers?  I've tried
  exit() within the library, but that fails to work.  Instead, exit causes
  generation of HTML code (a content type metatag) that is neither in the
  main page nor the library.  I've also tried a simple return() (per the
  documentation), but that generates a parse error.
 
  I'm using Apache 1.3.12, PHP 4.0.2 and Slackware Linux (Not sure which
  kernel version).
 
  Thanks
  Cas
 
  PS: Please CC replies to [EMAIL PROTECTED], since I'm not officially
  subscribed to this list.  Thanks.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] phpMyAdmin install error

2001-08-22 Thread Kurth Bemis

At 11:58 AM 8/22/2001, Jay Paulson wrote:

the socket has to be made by the mysql deamon.  Read the mysql docs on 
mysql.org search for mysql.sock.  mysql will not work if that files is 
deletedif you run redhat or other distros make sure that /tmp and 
/var/tmp aren't cleaned at each reboot or you'll have a bitch of a time 
because you'll have to create a new socket each time.

~kurth

I had the EXACT same problem... what you need to do is find where the
'mysql.sock' file is on your computer (sometimes it's at /var/lib/mysql.sock
or some place like that).. then what you need to do is create the mysql.sock
file in the /tmp directory (for some reason it wouldn't let me copy over the
file to the /tmp directory once i found it).. then you can create a symbolic
link using the ln command.. and if you need help with the ln (i believe
that's it if not let me know) you can just type man ln in the command
prompt if you are running on a linux box

hope that helps..
jay

- Original Message -
From: Tom Beidler [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 10:39 AM
Subject: [PHP] phpMyAdmin install error


  I'm getting the following error with phpMyAdmin;
 
  Warning: MySQL Connection Failed: Can't connect to local MySQL server
  through socket '/tmp/mysql.sock' (2) in
  /home/web/isp.com/public_html/dloc/admin/lib.inc.php on line 308
  Error
 
  Any ideas where to start looking. All I've set in the config.inc.php is
  userid, password and database name. Works on every other ISP I've used but
  this one is barking.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php-counter

2001-08-22 Thread Sheridan Saint-Michel

No, but I could throw one together in 10 minutes.

Here is some 5 minute untested code to get you started
where int count is in table counter.

?php
$dblink = mysql_pconnect(localhost,username,password);
mysql_select_db(DB);
?

!-- HTML PAGE --

?php
  $query = Select count from counter;
  if( !($dbq = mysql_query($query,$dblink)))
  {
echo Error reading database.  Please Contact A
HREF=\mailto:[EMAIL PROTECTED]\;Administrator/A;
exit;
  }

$count = mysql_result($dbq,0)
echo This page has been visited $count times!;

  $query = Update counter set count = count + 1;
  if( !($dbq = mysql_query($query,$dblink)))
  {
echo Error updating database.  Please Contact A
HREF=\mailto:[EMAIL PROTECTED]\;Administrator/A;
exit;
  }
?

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


- Original Message -
From: Gert Mellak [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 10:49 AM
Subject: [PHP] php-counter


 hi!

 do you know an easy-to-use-php-counter, which uses mysql to store the
data?

 gert



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php-counter

2001-08-22 Thread Andrey Hristov

Here goes a sample code.
The db interaction is throurh db abstraction layer but easily can be
translated to used directly mysql_* functions.
?php
include 'db.lib.php';
include 'webstats.lib.php';
class ClientBrowser{//-=-=-=-=-=--==-=-=-=--==-=-=-=-=-=-=-=-=-=-=-=-class
ClientBrowser-=-=-==-=-
  var $browser='unknown';
  var $mozilla='';
  var $major='0.0';
  var $minor='0.0';
  var $build='';
  var $platform='';
  var $windowses=array(
   'win95'='windows 95',
   'windows 95'='windows 95',
   'win98'='windows 98',
   'windows 98'='windows 98',
   'winnt'='windows nt 4.0',
   'windows nt'='windows nt 4.0',
   'windows'='windows 95',
   'windows 3.1'='windows 3.1',
   'win16' = 'windows 3.1',
   'win32' = 'windows 95',
   'windows'= 'win-unknown',
   'windows nt 4.0'='windows nt 4.0',
   'windows nt 5.0'='windows 2000',
   'windows 2000' = 'windows 2000',
   'win2k' = 'windows 2000',
   'windows millennium'='windows me',
   'windows ce' = 'windows ce',
   'windows ce 2.0' = 'windows ce 2.0',
   'windows ce 3.0' = 'windows ce 3.0'
  );

  function ClientBrowser($http_agent='none'){
if ($http_agent=='none') $http_agent=$GLOBALS['HTTP_USER_AGENT'];
if($cap = $this- _client_is_MSIE($http_agent)){
  $this-browser='MSIE';
 }elseif($cap = $this-_client_is_MSPIE($http_agent)){
  $this-browser='MSPIE';
 }elseif($cap = $this-_client_is_Opera($http_agent)){
  $this-browser='OPERA';
 }elseif($cap = $this-_client_is_NS($http_agent)){
  $this-browser='NAVIGATOR';
 }
if ($this-browser!='unknown'){
  $this-mozilla=$cap['mozilla'];
  $this-major=$cap['major'];
  $this-minor=$cap['minor'];
  $this-build=$cap['build'];
  $this-platform=$cap['platform'];
}
  }

  function _client_is_MSIE($s){
   $to_return = FALSE;
   if(preg_match('~^Microsoft Internet Explorer/([^ ]+) \\(([^)]+)\\)~i',
$s, $a)){
$to_return = array('mozilla' = '', 'major' = '1', 'minor' = '0',
'build' = $a[1]);
if (strpos(' '.strtolower($a[2]),'win')){
 $to_return['platform'] = isset($this-windowses[strtolower($a[2])]) ?
$this-windowses[strtolower($a[2])]:'win-unknown';
}else{
   $to_return['platform'] = strtolower($a[2]);
}
return $to_return;
   }
   if(preg_match('~^Mozilla/([^ ]+) \\(compatible;.* MSIE
([^.]+)\\.([\d.]+)([^; )]*).*?
((Win|Windows|Mac_PowerPC|Mac_68000|Mac_68K|Mac_PPC|OS/2|SUNOS|sunos 4|sunos
5|i86|irix|irix 6|irix
5|hp-ux|aix|aix1|aix2|aix3|aix4|linux|unix_system_v|ncr|reliantunix|bsd)[^);
]*)~i', $s, $a)){
$to_return = array('mozilla' = $a[1], 'major' = $a[2], 'minor' =
$a[3], 'build' = $a[4]);
if (strpos(' '.strtolower($a[5]),'win')){
 $to_return['platform'] = isset($this-windowses[strtolower($a[5])]) ?
$this-windowses[strtolower($a[5])]:'win-unknown';
}else{
   $to_return['platform'] = strtolower($a[5]);
}
return $to_return;
   }
   if(preg_match('~^Mozilla/([^ ]+) \\(compatible;.* MSIE
([^.]+)\\.([\d.]+)([^; )]*)~i', $s, $a)){
$to_return = array('mozilla' = $a[1], 'major' = $a[2], 'minor' =
$a[3], 'build' = $a[4], 'platform' = '');
return $to_return;
   }
   return $to_return;
  }

  function _client_is_MSPIE($s){
   $to_return = FALSE;
   if(preg_match('~^Microsoft Pocket Internet
Explorer/([^.]+)\\.([\d.]+)(.*)~i', $s, $a)){
$to_return = array('mozilla' = '', 'major' = $a[1], 'minor' = $a[2],
'build' = $a[3], 'platform' = 'windows ce');
return $to_return;
   }
   if(preg_match('~^Mozilla/([^ ]+) \\(compatible;.* MSPIE
([^.]+)\\.([\d.]+)([^; )]*).*?
((Win|Windows|Mac_PowerPC|Mac_68000|Mac_68K|Mac_PPC|OS/2|SUNOS|sunos 4|sunos
5|i86|irix|irix 6|irix
5|hp-ux|aix|aix1|aix2|aix3|aix4|linux|unix_system_v|ncr|reliantunix|bsd)[^);
]*)~i', $s, $a)){
$to_return = array('mozilla' = $a[1], 'major' = $a[2], 'minor' =
$a[3], 'build' = $a[4]);
if (strpos(' '.strtolower($a[5]),'win')){
 $to_return['platform'] = isset($this-windowses[strtolower($a[5])]) ?
$this-windowses[strtolower($a[5])]:'wince-unknown';
}else{
   $to_return['platform'] = strtolower($a[5]);
}
return $to_return;
   }
   return $to_return;
  }

  function _client_is_NS($s){
   $to_return = FALSE;
   if(preg_match('~^Mozilla/([^.]+)\\.([\d.]+)([^ ]*).*?\\(([^;)]+)~i', $s,
$a)){
if(strtolower($a[4]) == 'compatible') return FALSE;
if(strtolower($a[4]) == 'macintosh'){
 if(strpos($s, '68K')) $a[4] = 'Mac_68K';
 elseif(strpos($s, 'PPC')) $a[4] = 'Mac_PPC';
}
$to_return = array('mozilla' = $a[1] . . . $a[2] . $a[3], 'major' =
$a[1], 'minor' = $a[2], 'build' = $a[3]);
if (strpos(' '.strtolower($a[4]),'win')){  // heading space added
because specific return value of strpos()
 $to_return['platform'] = isset($this-windowses[strtolower($a[4])]) ?
$this-windowses[strtolower($a[4])]:'win-unknown';
}else{
   $to_return['platform'] = strtolower($a[4]);
}
return $to_return;
   }
   return $to_return;
  }

  function _client_is_Opera($s){
   $to_return 

[PHP] help with php mysql and images...

2001-08-22 Thread Mike

Don't know if this is the place to ask this, but I'll find out soon.
I'm trying to create a database in mysql that will hold information
About users, it will hold the path to a picture, and it will resize
Images on a page... sorry that's a really blunt description.

A user will goto this certain page...
they bring up the page and the page it self, coded in php, will
pull out of the database, the names of everyone that is registered
to this certain page.  It will list it all in alphabetical order.

For anyone interested... the page I'm working on is here...
http://www.hypoparathyroidism.com/gallery.asp
I am having trouble figuring out how to do it, I'm new to mysql
And php actually... I just started learning it about a month ago
But I've done some pretty impressive stuff for php.  I guess
I just need some ideas on how to go about doing this project.

Going to that page will help you figure out what I have to do.
You see the guy that programmed that page before, did it all
In asp.  And I don't know anything about asp, and I was told
Not to learn anything about asp because it is dumb (no offense
To anyone intended)

Any help appreciated...
mike




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Fwd: BadBlue v1.02 beta for Windows 98, ME and 2000 .php Source Code Disclosure Vulnerability

2001-08-22 Thread Tom Malone

This is not an issue if you're site is using Apache, correct?

Tom Malone
Web Designer
http://www.tom-malone.com 

-Original Message-
From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Fwd: BadBlue v1.02 beta for Windows 98, ME and 2000 .php
Source Code Disclosure Vulnerability


Thought this may be of interest to somebody.

~kurth


Delivered-To: [EMAIL PROTECTED]
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
List-Id: vuln-dev.list-id.securityfocus.com
List-Post: mailto:[EMAIL PROTECTED]
List-Help: mailto:[EMAIL PROTECTED]
List-Unsubscribe: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Delivered-To: mailing list [EMAIL PROTECTED]
Delivered-To: moderator for [EMAIL PROTECTED]
From: acz [iSecureLabs] [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: BadBlue v1.02 beta for Windows 98, ME and 2000  .php Source Code 
Disclosure Vulnerability
Date: Wed, 22 Aug 2001 11:11:28 +0200
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal

-- [ iSecureLabs BadBlue v1.02 beta for Windows 98, ME and 2000
Advisory ] --

BadBlue v1.02 beta for Windows 98, ME and 2000 .php Source Code Disclosure
Vulnerability
Problem discovered: 22/08/2001

-- [ Overview ] --

BadBlue http://badblue.com/ is a tiny, free download that lets you share
files, search other
PCs and even run powerful web applications.
Badblue support .php extension.
It is possible to retrieve full .php source code.

-- [ Description ] --

Badblue contains an input validation vulnerability which may lead to
download the full source code of .php pages.
This is due to a lack of checks for NULL bytes.

Exemple:
http://myBadBlue.com/test.php%00

Note: It is possible too to download .dll file used by BadBlue.

Exmeple:
http://myBadBlue.com/ext.dll%00

-- [ Tested Version ] --

BadBlue v1.02 beta for Windows 98, ME and 2000

-- [ Discovered by ] --

Cabezon Aurelien | [EMAIL PROTECTED]
http://www.iSecureLabs.com | French Security portal
http://www.isecurelabs.com/advisory/badblue.html


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can I insert the data into the begining of a text file

2001-08-22 Thread Zenith

I have try this but, PHP just overwrite the prevoius content, and write the
new message into the file.
But I want to INSERT the new message into the head of a file.
Or , I did a wrong thing again??
My code is like now.
$fp = fopen ( $HTTP_SERVER_VARS['DOCUMENT_ROOT']./log/debug_message.txt,
r+ );
 fputs ( $fp, \nDebug message from : $PHP_SELF at .strftime(%T on
%D).\n );
 fputs ( $fp, $message\n\n );
 fclose ( $fp );

Niklas lampén [EMAIL PROTECTED] ?
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Use $fp = fopen($file, r+);

 PHP Manual would have told you this.


 Niklas

 -Original Message-
 From: Zenith [mailto:[EMAIL PROTECTED]]
 Sent: 22. elokuuta 2001 12:39
 To: [EMAIL PROTECTED]
 Subject: [PHP] How can I insert the data into the begining of a text
 file


 I orginal have a function like the following...

   $fp = fopen
 $HTTP_SERVER_VARS['DOCUMENT_ROOT']./log/debug_message.txt,
 a );
   fputs ( $fp, \nDebug message from : $PHP_SELF\n );
   fputs ( $fp, \t$message\n\n );
   fclose ( $fp );

 But I found that, the result is, all message is append to the end of a
file.
 Can I insert the text into the begining of the file??

 I think read all the text from the file first, arrang the string variable,
 so that the new message can insert, would be a solution. But is it stupid
to
 do so??




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] convert 12:12:00 to seconds

2001-08-22 Thread rm

maybe

$time=12:12:00

$x=explode(:,$time);

$sec=($x[0]*3600)+($x[1]*60)=$x[2];

rm


--- nafiseh saberi [EMAIL PROTECTED] wrote:
 
 hi.
 how do I covert convert  12:12:00  to seconds ?
 I want to get time from system and covert it to
 seconds to do
 arithmetic work on it.
  thanks.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


RE: [PHP] Fwd: BadBlue v1.02 beta for Windows 98, ME and 2000 .php Source Code Disclosure Vulnerability

2001-08-22 Thread Kurth Bemis

At 12:10 PM 8/22/2001, Tom Malone wrote:

read the advisory - everything is explained.

~kurth

This is not an issue if you're site is using Apache, correct?

Tom Malone
Web Designer
http://www.tom-malone.com

-Original Message-
From: Kurth Bemis [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 22, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Fwd: BadBlue v1.02 beta for Windows 98, ME and 2000 .php
Source Code Disclosure Vulnerability


Thought this may be of interest to somebody.

~kurth


 Delivered-To: [EMAIL PROTECTED]
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 List-Id: vuln-dev.list-id.securityfocus.com
 List-Post: mailto:[EMAIL PROTECTED]
 List-Help: mailto:[EMAIL PROTECTED]
 List-Unsubscribe: mailto:[EMAIL PROTECTED]
 List-Subscribe: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Delivered-To: moderator for [EMAIL PROTECTED]
 From: acz [iSecureLabs] [EMAIL PROTECTED]
 To: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: BadBlue v1.02 beta for Windows 98, ME and 2000  .php Source Code
 Disclosure Vulnerability
 Date: Wed, 22 Aug 2001 11:11:28 +0200
 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
 Importance: Normal
 
 -- [ iSecureLabs BadBlue v1.02 beta for Windows 98, ME and 2000
 Advisory ] --
 
 BadBlue v1.02 beta for Windows 98, ME and 2000 .php Source Code Disclosure
 Vulnerability
 Problem discovered: 22/08/2001
 
 -- [ Overview ] --
 
 BadBlue http://badblue.com/ is a tiny, free download that lets you share
 files, search other
 PCs and even run powerful web applications.
 Badblue support .php extension.
 It is possible to retrieve full .php source code.
 
 -- [ Description ] --
 
 Badblue contains an input validation vulnerability which may lead to
 download the full source code of .php pages.
 This is due to a lack of checks for NULL bytes.
 
 Exemple:
 http://myBadBlue.com/test.php%00
 
 Note: It is possible too to download .dll file used by BadBlue.
 
 Exmeple:
 http://myBadBlue.com/ext.dll%00
 
 -- [ Tested Version ] --
 
 BadBlue v1.02 beta for Windows 98, ME and 2000
 
 -- [ Discovered by ] --
 
 Cabezon Aurelien | [EMAIL PROTECTED]
 http://www.iSecureLabs.com | French Security portal
 http://www.isecurelabs.com/advisory/badblue.html


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] how to disable the automated userID/password in Internet Explorer

2001-08-22 Thread Zhu George-CZZ010

Hi, all.

   Sorry, I know there is out of the topic, but you are highly possible to help on 
this.
My browser --Internet Exporer will remember my userID and password, and the next time, 
after I type the first char of my user ID, it will automatically fill in the userID 
and password. Is there a way to disablt it?

Thanks.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Training Course Update - October 1-5

2001-08-22 Thread Michael Kimsal

Hello all:

Just a quick reminder about our upcoming PHP training course.

We'll be holding a 5 day, hands-on, instructor-led PHP training course
October 1-5 in Ann Arbor, Michigan.  We're gearing this more to
newbies and medium-level PHPers than high-end advanced PHPers,
because our previous class (and phone conversations with
prospective students) has shown that they'd rather spend more time covering
some 'basics' in depth than skimming over a lot of stuff (5 days ends up 
being
not that long when trying to cover PDFs, graphics, DB abstraction and more).

More info is at http://www.tapinternet.com/php/ and we're also available to
take any questions by email ([EMAIL PROTECTED] to get me directly)
or 734-480-9961 (1-866-745-3660 tollfree) or even AIM
(screen name phptraining).

October may be a ways off, but many of you may need to plan that far in
advance to schedule time off, get the boss to expense the trip, etc.  :)

Thanks!

-
Michael Kimsal
http://www.tapinternet.com/php
PHP Training Courses
734-480-9961





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] help with php mysql and images...

2001-08-22 Thread John Meyer

A couple of things:

1.  ASP is not dumb.  It was just written by Microsoft.  Seriously, though 
I'd learn both, it would make you much more marketable.
2.  First off, create the database.  Then ask yourself what are the steps 
that you have to go through.  What your probably looking at right now is 
selecting the information off of the database and reporting it.

I'd _definitely_ think about sitting down with the MySQL manual and the PHP 
manual, both of which are availible free.  Also, look for a good MySQL/PHP 
book (my favorite is MySQL/PHP Database Applications, by Jay Greenspan 
and Brad Bulger).  You have some work ahead of you, but not a lot.

At 10:09 AM 8/22/01 -0700, you wrote:
Don't know if this is the place to ask this, but I'll find out soon.
I'm trying to create a database in mysql that will hold information
About users, it will hold the path to a picture, and it will resize
Images on a page... sorry that's a really blunt description.

A user will goto this certain page...
they bring up the page and the page it self, coded in php, will
pull out of the database, the names of everyone that is registered
to this certain page.  It will list it all in alphabetical order.

For anyone interested... the page I'm working on is here...
http://www.hypoparathyroidism.com/gallery.asp
I am having trouble figuring out how to do it, I'm new to mysql
And php actually... I just started learning it about a month ago
But I've done some pretty impressive stuff for php.  I guess
I just need some ideas on how to go about doing this project.

Going to that page will help you figure out what I have to do.
You see the guy that programmed that page before, did it all
In asp.  And I don't know anything about asp, and I was told
Not to learn anything about asp because it is dumb (no offense
To anyone intended)

Any help appreciated...
mike




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Newsgroup?

2001-08-22 Thread Christopher Raymond




Is this PHP listserve available as a newsgroup? I'm getting tired of
managing this much mail everyday. I'd like it a bit simpler.

If this list is not available, are there other equally busy newsgroups for
PHP?


Thanks,

Christopher Raymond


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] functions and quotes

2001-08-22 Thread Kurth Bemis

i'm working on a site that is going to require some fancy image switching 
based on URL called...thats part isn't a problem...the problem comes in the 
way that i'm passing the HTML from the function.

My main concern here is speed with the second being workload on the server.

right now the function looks like this.

function tab($section){

$hmenav = a href=\/index.php\ onMouseOut=\MM_swapImgRestore()\ 
onMouseOver=\MM_swapImage('document.Nav2','document.Nav2','/images/nav/home_hi.gif','#931914015883')\img
 
src=\/images/nav/home_off.gif\ width=\62\ height=\16\ border=\0\ 
name=\Nav2\ alt=\\/a;

$comnav = a href=\/company/index.php\ 
onMouseOut=\MM_swapImgRestore()\ 
onMouseOver=\MM_swapImage('document.Nav3','document.Nav3','/images/nav/com_hi.gif','#931914051666')\img
 
src=\/images/nav/com_off.gif\ width=\79\ height=\16\ border=\0\ 
name=\Nav3\ alt=\\/a;

$curnav = a href=\/listings.php\ onMouseOut=\MM_swapImgRestore()\ 
onMouseOver=\MM_swapImage('document.Nav4','document.Nav4','/images/nav/cur_hi.gif','#931914075550')\img
 
src=\/images/nav/cur_off.gif\ width=\113\ height=\16\ border=\0\ 
name=\Nav4\ alt=\\/a;

$llsnav = a href=\/lls\  onMouseOut=\MM_swapImgRestore()\ 
onMouseOver=\MM_swapImage('document.Nav5','document.Nav5','/images/nav/lls_hi.gif','#931914098883')\img
 
src=\/images/nav/lls_off.gif\ width=\168\ height=\16\ border=\0\ 
name=\Nav5\ alt=\land mark land services\/a;

$navspc = img src=\/images/spacer_blank.gif\ width=\125\ 
height=\10\ border=\0\ alt=\\;

if ($section == root){
$hmenav = a href=\/index.php\img src=\/images/nav/home_on.gif\ 
width=\62\ height=\16\ border=\0\ name=\Nav2\ alt=\\/a;
}elseif ($section == company){
$comnav = a href=\/company/index.php\img 
src=\/images/nav/com_on.gif\ width=\79\ height=\16\ border=\0\ 
name=\Nav3\ alt=\\/a;
}
print $navspc$hmenav$comnav$curnav$llsnav;
}

section is passed to the function and the function returns the correct 
tab.  IS there a better and faster way?

~kurth


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: functions and quotes

2001-08-22 Thread Gabe da Silveira

Well, just off the top of my head, you seem to be mostly storing data.  
None of the strings you are storing contain any variable values, so they 
don't need to be double quoted.  I would even take it a step further, 
and move all your HTML data into raw text files, then use the readfile() 
function to insert them where needed.  This would make your program 
logic clearer and allow easier editing of the data since they would no 
longer need to have quotes escaped.  It would also be faster because it 
doesn't need to parse through all the data, it simply echoes what you 
need to the screen.  The overhead for printing multiple files is 
negligible in comparison... especially if you are calling this function 
from multiple pages... 

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Kurth Bemis) wrote:

 i'm working on a site that is going to require some fancy image switching 
 based on URL called...thats part isn't a problem...the problem comes in the 
 way that i'm passing the HTML from the function.
 
 My main concern here is speed with the second being workload on the server.
 
 right now the function looks like this.
 
 function tab($section){
 
 $hmenav = a href=\/index.php\ onMouseOut=\MM_swapImgRestore()\ 
 onMouseOver=\MM_swapImage('document.Nav2','document.Nav2','/images/nav/home_h
 i.gif','#931914015883')\img 
 src=\/images/nav/home_off.gif\ width=\62\ height=\16\ border=\0\ 
 name=\Nav2\ alt=\\/a;
 
 $comnav = a href=\/company/index.php\ 
 onMouseOut=\MM_swapImgRestore()\ 
 onMouseOver=\MM_swapImage('document.Nav3','document.Nav3','/images/nav/com_hi
 .gif','#931914051666')\img 
 src=\/images/nav/com_off.gif\ width=\79\ height=\16\ border=\0\ 
 name=\Nav3\ alt=\\/a;
 
 $curnav = a href=\/listings.php\ onMouseOut=\MM_swapImgRestore()\ 
 onMouseOver=\MM_swapImage('document.Nav4','document.Nav4','/images/nav/cur_hi
 .gif','#931914075550')\img 
 src=\/images/nav/cur_off.gif\ width=\113\ height=\16\ border=\0\ 
 name=\Nav4\ alt=\\/a;
 
 $llsnav = a href=\/lls\  onMouseOut=\MM_swapImgRestore()\ 
 onMouseOver=\MM_swapImage('document.Nav5','document.Nav5','/images/nav/lls_hi
 .gif','#931914098883')\img 
 src=\/images/nav/lls_off.gif\ width=\168\ height=\16\ border=\0\ 
 name=\Nav5\ alt=\land mark land services\/a;
 
 $navspc = img src=\/images/spacer_blank.gif\ width=\125\ 
 height=\10\ border=\0\ alt=\\;
 
 if ($section == root){
   $hmenav = a href=\/index.php\img src=\/images/nav/home_on.gif\ 
 width=\62\ height=\16\ border=\0\ name=\Nav2\ alt=\\/a;
   }elseif ($section == company){
   $comnav = a href=\/company/index.php\img 
 src=\/images/nav/com_on.gif\ width=\79\ height=\16\ border=\0\ 
 name=\Nav3\ alt=\\/a;
   }
   print $navspc$hmenav$comnav$curnav$llsnav;
 }
 
 section is passed to the function and the function returns the correct 
 tab.  IS there a better and faster way?
 
 ~kurth


-- 
__
Gabe da Silveira, Web Designer
Twin Cities Student Unions
University of Minnesota
http://www.coffman.umn.edu

wFone: (612)624-7270
eMail: [EMAIL PROTECTED]
hPage: http://www.visi.com/~jiblet

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Newsgroup?

2001-08-22 Thread Gabe da Silveira

Yup, connect your news client to news.php.net.

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Christopher Raymond) wrote:

 Is this PHP listserve available as a newsgroup? I'm getting tired of
 managing this much mail everyday. I'd like it a bit simpler.
 
 If this list is not available, are there other equally busy newsgroups for
 PHP?
 
 
 Thanks,
 
 Christopher Raymond


-- 
__
Gabe da Silveira, Web Designer
Twin Cities Student Unions
University of Minnesota
http://www.coffman.umn.edu

wFone: (612)624-7270
eMail: [EMAIL PROTECTED]
hPage: http://www.visi.com/~jiblet

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: how to disable the automated userID/password in Internet Explor er

2001-08-22 Thread Gabe da Silveira

Just look through the preferences, disable forms auto-complete.  That 
should take care of it for forms, I don't know about dialog boxes.

In article 
[EMAIL PROTECTED],
 [EMAIL PROTECTED] (Zhu George-Czz010) wrote:

 Hi, all.
 
Sorry, I know there is out of the topic, but you are highly possible to 
help on this.
 My browser --Internet Exporer will remember my userID and password, and the 
 next time, after I type the first char of my user ID, it will automatically 
 fill in the userID and password. Is there a way to disablt it?
 
 Thanks.

-- 
__
Gabe da Silveira, Web Designer
Twin Cities Student Unions
University of Minnesota
http://www.coffman.umn.edu

wFone: (612)624-7270
eMail: [EMAIL PROTECTED]
hPage: http://www.visi.com/~jiblet

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Mem and variables

2001-08-22 Thread rm

point taken...thanks


 At any rate -- The right way to worry about
 perforance is to figure out
 where your code is spending 90% of its time, and to
 optimize that.  I'm
 betting it ain't in variable lookups for most of us


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] Need Working... pop up dialog (repost)

2001-08-22 Thread Ray Clouse

That's exactly what I needed!  Thanks!

Richard Lynch wrote:

You may just need a flush() call after the Starting UNZIP.

http://php.net/flush

PHP (Apache, actually) sends data to the browser when there's enough to
send, not right away.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Ray Clouse [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Cc: php [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, August 21, 2001 10:10 AM
Subject: Re: [PHP] Need Working... pop up dialog (repost)


It's due to space restrictions on the server.  We have 300GB available
on the server, but the compressed data takes up 200GB, and we're adding
new data (several GB) every month or so.

So we need to keep as much compressed as possible, but we have to
uncompress the data for the webpages to use it.  The PHP webpages on the
server use the uncompressed data to generate plots.  The data is never
sent to the user, just the plots.

The main problem I'm having is with page resolution.  If I say:

  print(SCRIPTjsPopupWindow('Starting UNZIP');/SCRIPT\n);

  $gunzipcmdline = gunzip /PATHTO/MYDATA;
  $result = exec($gunzipcmdline, $execout, $execretval);

  print(SCRIPTjsPopupWindow('Finished UNZIP');/SCRIPT\n);

the 'Starting UNZIP' popup appears at the same time as the 'Finished
UNZIP' one.  The page hasn't resolved until after the gunzip is done, so
it doesn't execute the Javascript the way I want it to.  I've tried
popping up a window, getting the handle, passing the handle to the
gunzip code, then closing the handle when the gunzip is done, but that
hasn't worked either.

-- 
-
Ray Clouse | Don't fear the penguins.
Engineer Scientist/Specialist  |  
Boeing Expendable Launch Vehicles  |  Ray.Clouse AT boeing.com
Huntington Beach, CA   |  clouse AT rayclouse.org





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Please Help - getting a hightlight depending on selected page

2001-08-22 Thread Martin Hughes

Hi can anyone help me please!?

I have a page that has a navigation table on the left with various links:

Information
Software
Cars
Dishwashers
Paper
Contact
etc...

(not the real links ;))

and I want the cell of the section I am in to be highlighted (ie if I am in
Cars I want the Cars link to have a red background). I have set it up so
that in CSS the id sel is a red b/g.

How do I set the id of a certain cell to sel taking it from the url
(index.php?menu=cars as a very bad example of php coding :)).

Cheers

Martin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: problem with $HTTP_POST_FILES

2001-08-22 Thread Jason Dulberg

Now I just feel like an idiot... that was the answer! I had all the other
globals registered but that one.

Thanks for your time!

Jason.



 If they're empty but phpinfo displays them you're probably inside
 a function and haven't declared HTTP_POST_FILES as global.

 Jason Dulberg wrote:

  I am working on an image upload script and I've tried to use
 the variables
  from $HTTP_POST_FILES however it seems that no matter how I try
 to get the
  variables, they are always empty -- even though they are populated when
  checking phpinfo();
 
  HTTP_POST_FILES[binFile]
  Array
  (
  [name] = arrow-block.gif
  [type] = image/gif
  [tmp_name] = /var/tmp/phph60272
  [size] = 857
  )
 
  I got some info on it from php.net and attempt to echo as they
 have on their site however it displays nothing.
 
  echo $HTTP_POST_FILES['binFile']['name'].br;
 
  I am attempting to get size/extension of the file to determine
 if its a valid extension and within the valid filesize range.
 
  Is this a server issue or just my php newbie-ness? If anyone
 has any ideas on how I can get this working, please let me know.
 
  Thanks.
 
  __
  Jason Dulberg
  Extreme MTB
  http://extreme.nas.net




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Urgent!!! Forum code

2001-08-22 Thread Emiliano Marmonti

Anybody knows a good  free PHP with Mysql code for implementing a forum?

-
Emiliano H.Marmonti
Informático Módulo de Bibliotecas
Programa SIU
Ministerio de Educación de la Nación



RE: [PHP] Urgent!!! Forum code

2001-08-22 Thread Erik H. Mathy

There are many. Get thee to Freshmeat and search for:

PHP mysql forum

http://www.freshmeat.net

Have fun,
- Erik

 -Original Message-
 From: Emiliano Marmonti [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 22, 2001 3:26 AM
 To: Lista PHP
 Subject: [PHP] Urgent!!! Forum code


 Anybody knows a good  free PHP with Mysql code for implementing a
 forum?

 -
 Emiliano H.Marmonti
 Informático Módulo de Bibliotecas
 Programa SIU
 Ministerio de Educación de la Nación



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Upgrading to Windows XP Whistler

2001-08-22 Thread Thomas Edison Jr.

I'm gonna be using windows XP whistler home edition.
Can someone tell me if i'll be needing a different
version of PHP4 to download  install and the
installation instructions to go along. So far that
i've heard is that it's the same as Windows 2000, but
i'm muchly new at this thing so it'd be really good if
someone can tell me what is gonna to happen. 
Also, i've been using Apache as the server, will i
have to download a newer version of Apache for my
windows XP?

Thanks.
Thomas Edison jr.

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

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


Re: [PHP] Urgent!!! Forum code

2001-08-22 Thread Jeff Lewis

Try the following:

phpBB: http://www.phpbb.com/
Phorum: http://phorum.org/

Jeff Lewis
- Original Message -
From: Emiliano Marmonti [EMAIL PROTECTED]
To: Lista PHP [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 4:26 AM
Subject: [PHP] Urgent!!! Forum code


Anybody knows a good  free PHP with Mysql code for implementing a forum?

-
Emiliano H.Marmonti
Informático Módulo de Bibliotecas
Programa SIU
Ministerio de Educación de la Nación



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Please Help - getting a hightlight depending on selected page

2001-08-22 Thread Gabe da Silveira

Is the menu part of each page?  Or is it a separate file/script that 
gets included in each page? Or is the navigation in a separate frame?

If the menu is hard-coded into each page, then there's no reason to use 
PHP, because you have to modify each page ANYWAY, so you might as well 
just set each page to what it needs to be.

The only way you are going to be able to accomplish this with 
significantly less work than that is if you store your image URLs and 
menu links in a database.  In that case as you printed out the links, 
you would check each one to see if $PHP_SELF was equal to the link.

Ultimately there are so many ways that you could be doing this that 
there is no simple answer.  Post your menu code, and tell us how it gets 
included in your page and then we can help... 

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Martin Hughes) wrote:

 Hi can anyone help me please!?
 
 I have a page that has a navigation table on the left with various links:
 
 Information
 Software
 Cars
 Dishwashers
 Paper
 Contact
 etc...
 
 (not the real links ;))
 
 and I want the cell of the section I am in to be highlighted (ie if I am in
 Cars I want the Cars link to have a red background). I have set it up so
 that in CSS the id sel is a red b/g.
 
 How do I set the id of a certain cell to sel taking it from the url
 (index.php?menu=cars as a very bad example of php coding :)).
 
 Cheers
 
 Martin
 


-- 
__
Gabe da Silveira, Web Designer
Twin Cities Student Unions
University of Minnesota
http://www.coffman.umn.edu

wFone: (612)624-7270
eMail: [EMAIL PROTECTED]
hPage: http://www.visi.com/~jiblet

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] session_write_close()

2001-08-22 Thread Gabor Gludovatz

Hello,

I'm having problems with sessions. Since I use MySQL to store sessions, I
always have to call session_write_close() at the end of every page,
otherwise session variables don't get saved.

If I use PHP's built-in 'files' method to store session vars, then
everything works fine, I don't need to call session_write_close() and even
so the variables get saved and are restored correctly.

Is it a bug? Or is there something I don't know about?

-- 
 Gabor Gludovatz [EMAIL PROTECTED] http://www.sopron.hu/~ggabor/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] strange error

2001-08-22 Thread Jeremy Morano

Hi,

I get an error message which I can't figure out.

Its a Parse error: on line 142 which is the last line of the page containing
absolutly no code. The last line of code is simply /HTML..Did
anyone have a similar experience? Can anyone help me out please?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: strange error

2001-08-22 Thread Gijsbert te Riet

Hi Jeremy,

 I get an error message which I can't figure out.

 Its a Parse error: on line 142 which is the last line of the page containing
 absolutly no code. The last line of code is simply /HTML..Did
 anyone have a similar experience? Can anyone help me out please?

I guess you haven't closed the ?php tag with ?, before your /HTML
code.
Otherwise, the php parser will think that it's still parsing php code,
which results in an parse error.

Regards,
Gijs.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strange error

2001-08-22 Thread Gabor Gludovatz

On Wed, 22 Aug 2001, Jeremy Morano wrote:

 I get an error message which I can't figure out.

 Its a Parse error: on line 142 which is the last line of the page containing
 absolutly no code. The last line of code is simply /HTML..Did
 anyone have a similar experience? Can anyone help me out please?

You may have not put an enclosing '?' at the end of your code, or you may
have missed a closing bracket or quotation mark somewhere.

-- 
 Gabor Gludovatz [EMAIL PROTECTED] http://www.sopron.hu/~ggabor/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] strange error

2001-08-22 Thread John Meyer

At 03:12 PM 8/22/01 -0400, you wrote:
Hi,

I get an error message which I can't figure out.

Its a Parse error: on line 142 which is the last line of the page containing
absolutly no code. The last line of code is simply /HTML..Did
anyone have a similar experience? Can anyone help me out please?


Try to post some code, particularity the lines that come just before line 
142.  A parse error usually means that something on the previous line is 
wrong, at least, that's been my experience.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] strange error

2001-08-22 Thread Erik H. Mathy

Heya!

All adive given so far is good. You might also want to check for a
non-closed if { } statement.

If you've got something like:
-
html
? if(isset($foo)) {?
html 1
? } else { ?
html2

/html
-

You'll get an error in the last line, where the /html resides.

Hope this is a helpin'
- Erik


 -Original Message-
 From: Jeremy Morano [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 22, 2001 2:12 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] strange error


 Hi,

 I get an error message which I can't figure out.

 Its a Parse error: on line 142 which is the last line of the page
 containing
 absolutly no code. The last line of code is simply /HTML..Did
 anyone have a similar experience? Can anyone help me out please?


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] sessions and sessionfiles

2001-08-22 Thread Danny

Hi there,

well...I'm tired of searching so I'll drop a note here.
I've been busy working with php (4.0.6) sessions lately for an online
shopping cart, which works really great.
Only problem is, the temporary session-files are not removed after a certain
timeout occurs.
The session.gc_maxlifetime-variable is set to 1440 seconds, which means
the temporary session-files should be deleted after 24 minutes of inactivity
from the client side. Unfortunately, nothing of a kind happens.
A way around this problem is adding a cronjob which deletes session-files
older than say 3 or 4 hours or so.
I'd rather see a better solution...anyone?
And is there any information available on wether or not the error of not
deleting session-files has any consequences for newly created sessions?

Anyone out there, if you have a serious and professional solution, please
mail to [EMAIL PROTECTED]
Thanks!

Happy php-ing! Danny.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] sessions and sessionfiles

2001-08-22 Thread Jay Paulson

in the php.ini you can set the garbbage collection higher than 1 but that
puts a bigger load on your computer... what garbage collection does is that
it goes through and deletes all the session files that have expired due to
the setting of the session.gc_maxlifetime.. so right now with the way you
have things set up is that 1 out of every 100 session requests php will go
though the session files and find the ones that are older than 1440 seconds
and delete them... if you set 1 to 100 then every time a session request is
made php will go and find all the files that are over 1440 seconds and
delete them.. as you can see that would be a huge load on your computer...
:) hope that helps!

jay

Danny [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 well...I'm tired of searching so I'll drop a note here.
 I've been busy working with php (4.0.6) sessions lately for an online
 shopping cart, which works really great.
 Only problem is, the temporary session-files are not removed after a
certain
 timeout occurs.
 The session.gc_maxlifetime-variable is set to 1440 seconds, which means
 the temporary session-files should be deleted after 24 minutes of
inactivity
 from the client side. Unfortunately, nothing of a kind happens.
 A way around this problem is adding a cronjob which deletes session-files
 older than say 3 or 4 hours or so.
 I'd rather see a better solution...anyone?
 And is there any information available on wether or not the error of not
 deleting session-files has any consequences for newly created sessions?

 Anyone out there, if you have a serious and professional solution, please
 mail to [EMAIL PROTECTED]
 Thanks!

 Happy php-ing! Danny.




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] pointers in php

2001-08-22 Thread Christian Zonsius

Hi,

I have a problem with pointers in php.
In the following code the parent object should be a pointer to class Main
($this), but it's a copy ...

Any ideas ?
Thx Chris

?php
class Sub_A {

// constructor

function Sub_A($parent) {

$this-parent = $parent;

}

function Modify($text) {

$this-parent-B-text = $text;

}

}

class Sub_B {

var $text = untouched;

// constructor

function Sub_B($parent) {

$this-parent = $parent;

}

}

class Main {

// constructor

function Main() {

$this-A = new Sub_A($this);

$this-B = new Sub_B($this);

}


}

$test = new Main();

$test-A-Modify('test');

// this method should work, but doesnt (should return test instead of
untouched)

echo $test-B-text.br;

// parent isnt a pointer but a copy so absolute addressing works

echo $test-A-parent-B-text.br;

?




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: force download in IE -- conclusion

2001-08-22 Thread David Minor

I ran some tests of different header configurations of 6 browser/platform
combinations to find out what worked and what didn't.  I didn't cover all of
the platforms available, just those that my user-base uses, so this isn't
complete.  

combinations tested was IE5.5, NN4, NN6 for Windows 98 and IE5.5, NN4.7 for
Mac 9.1.  I tested all of these browsers using/not using 'attachment' in the
Content-Disposition header.  and also changed out the Content-Type header
with 'application/octet-stream', 'application/download', and '*/*'.

Here's the summary and what I did to make things work as well as possible.
My goal is to prompt the user with a save-as dialog for an mp3 file.

IE5.5 for Mac always uses the quicktime plugin to play the file no matter
what the disposition or type is.  (also no matter what the file extension
is.  Couldn't figure out how to trick it to download the file.)

IE5.5 for Win98 would attempt to download the file if (content-disposition:
attachment; filename=) attachment was there.

All 3 of the Win98 browsers would do prompt with as few clicks as possible
when content-type was application/octet-stream.  Therefore,  I test in my
script for the Mac users and give them Content-type: application/downlaod
while I give other users Content-Type: application/octet-stream.  Of
course, this doesn't help the IE5.5 Mac users who still have to use
Downlaod Link to Disk routine to get a save-as prompt.

Anyone who sees different ways this could be done, please respond.

Here's my code:

if (eregi(mac,$HTTP_USER_AGENT))
   $type = application/download;
else
   $type = application/octet-stream;

// stream file to user
header(Content-Type: $type);
header(Content-Disposition: attachment; filename=$filename);
header(Content-Length: .filesize($tmp_file));
header(Content-Transfer-Encoding: binary);
readfile($tmp_file);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Question

2001-08-22 Thread Gustavo Luis Pereira Verly

Hello, I have the next problem and I don't know how can I have the solution:

I wan to read a socket output, and format the lines, but

first: Can I make some kind o sizeof in the buffer that I'm receiving?
That's because the read of the socket it's very slow; and if I read for
example 256 for the length of the packet, and the server send me just 117
characters (include spaces) what happened with the others 139 characters?? I
got another problem, because the second packet, must to have 117 character
as length, and the PHP, read part of the first packet (this 139) and part of
the second. and its very slow, and finish by timeout.

second: can I cut the lines when I found the \n between each one?

Thanks everybody

Gustavo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help alleviate the U.S. Nursing Shortage and Profit in the process

2001-08-22 Thread Jess Ragaza


My e-mail to cousin Bobby will be most informative. The details are in the indicated 
web site.

 

---

To: Bobby Lazam

Subject: Thank you for the second set of newspaper clippings.

Cc: ...

Bcc: ...

Your contributions will certainly help us level a bit the playing field with our 
competitors.

Please send your future mailing to 

P.O. Box 2766 
Washington, D.C. 20013 

which is also now the postal address of

 http://www.internetarchitecture.com/

By the way, we have quietly announced our nursing recruitment plan in the web site.

It would seem like the nursing shortage here would be for years to come.

I was just thinking if we should have a strategy that goes beyond mere tactical 
recruitment but more toward seeding for the future ... e.g., scholarships for 
deserving nursing students? Can you imagine how many good, but possibly impoverished 
people we can help this way? Maybe we should ask Auntie Andy and Auntie Chata to come 
out of retirement and help through their school in Bulacan. What do you think?

Jess

--

If you do not want to receive further mails please reply with remove and you will be 
taken off the mailing list. 

--





Jess Ragaza, President, Internet Architecture Inc.; P.O. Box 2766, Washington, D.C. 
20013 [EMAIL PROTECTED] http://www.internetarchitecture.com/ With shopping and 
entertainment an experience in great deals, ease and comfort: Disney, amazon.com, 
eBay, AOL, CarsDirect, Sony, Franklin Mint, Playboy and others; Where everybody is 
given a chance to work profitably at home with Multilevel Marketing and Residual 
Income Galore; Watch for the next IPO that will reap rewards beyond your imagination!


-
Do You Yahoo!?
Make international calls for as low as $0.04/minute with Yahoo! Messenger.


[PHP] More about forums

2001-08-22 Thread Emiliano Marmonti

Dear people:

I have tested the address you have send me. I like one or two but thay are too 
complex, I don´t need registration, sessions, etc. Only I need a mail input line, a 
person line input and the text. Pretty simple but I can´t find anything like this.

Could anybody help me? Thanks a lot

-
Emiliano H.Marmonti
Informático Módulo de Bibliotecas
Programa SIU
Ministerio de Educación de la Nación



[PHP] Re: Please Help - getting a hightlight depending on selected page

2001-08-22 Thread Martin Hughes

OK here's the code in the page:

!-- Start Navigation --
div id=navbar
table class=navtable width=160 cellpadding=4
!-- Navigation Bar Heading --
tr
 td class=navheadWelcome/td
/tr
trtd class=navtext id=sela href=Home/a/td/tr
trtd class=navtexta href=Introduction/a/td/tr
trtd class=navtexta href=Changes amp; Cuts/a/td/tr
trtd class=navtexta href=Scores/a/td/tr
trtd class=navtexta href=Orchestra/a/td/tr
trtd class=navtexta href=Synthesizers/a/td/tr
trtd class=navtexta href=Sound System/a/td/tr
trtd class=navtexta href=Articles/a/td/tr
trtd class=navtexta href=21st Century Les
Miseacute;rables/a/td/tr
trtd class=navtexta href=Information/a/td/tr
trtd class=navtexta href=Discussion Forums/a/td/tr

/table
/div
!-- End Navigation --


I am using this 1 page as the php 'template' with content added depending on
the url. For example, to go to the synthesizers page the url is:
index.php?sect=5id=0page=31

where sect=5 is the part that sets the menu highlight (the menu is alway the
same, hard-coded into the page - all I want to do is change the css id=sel
from Home to Synthesizers.

Cheers

Martin



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: register_globals odd behaviour?

2001-08-22 Thread Richard Lynch

 What is the reason that I should not use the array? Is there any problem
 doing it that way?

They array is simply not designed for you to use as if it were your
variable.

What you want to do is this:

?php
# Beginning of script:
session_start();
session_register('count');
$count = $HTTP_SESSION_VARS['count'];
.
.
.
# In your class methods:
class ...
function ...
global $count;
}
}
.
.
.
# At the end of your script.
# Nothing.  $count is your variable, it's registered, coo coo ka choo
?

You are changing $HTTP_SESSION_VARS['count'], but I'm betting the *GLOBAL*
variable $count is not changing, and *THAT* is what was registered, and
*THAT* is what gets save.  $count in the global name-space.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Random PowerBall Generator

2001-08-22 Thread Montz, James C. (James Tower)

More as an exercise to get back into the swing of PHP, I have created the
PowerBall number generator. (for those of you un-aware, the powerball is at
$200 mil).

Took me a while to figure out using arrays, and the array_unique function.
It also incorporate the imagepng function.

Thanks to CC Zona for pointing me to the function I needed to get the job
done!

The page is at http://www.usrlinux.com/pball.php

Source code is available for viewing.  Suggestions on cleaning up code
welcome.

Enjoy!

James

___
James C. Montz
James Tower
http://www.jamestower.com 
[EMAIL PROTECTED] 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: force download in IE -- conclusion

2001-08-22 Thread pierre-yves

I worked on a script like yours for a looong time now!

I need to force the download of various type of file, doc, pdf, zip, even
html!

Your script works fine on Opera 5.02 and netscape 4.76 on my win NT 4.0 box,
but
not on IE 5.5 On this one, it offers me to download the script file but
instead of being
a php file it has now an html extension !!

Anyhow, I do have a download by email attachment button also, because I gave
up on trying
to find a script to force download

py


- Original Message -
From: David Minor [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 22, 2001 4:10 PM
Subject: [PHP] Re: force download in IE -- conclusion


 I ran some tests of different header configurations of 6 browser/platform
 combinations to find out what worked and what didn't.  I didn't cover all
of
 the platforms available, just those that my user-base uses, so this isn't
 complete.

 combinations tested was IE5.5, NN4, NN6 for Windows 98 and IE5.5, NN4.7
for
 Mac 9.1.  I tested all of these browsers using/not using 'attachment' in
the
 Content-Disposition header.  and also changed out the Content-Type header
 with 'application/octet-stream', 'application/download', and '*/*'.

 Here's the summary and what I did to make things work as well as possible.
 My goal is to prompt the user with a save-as dialog for an mp3 file.

 IE5.5 for Mac always uses the quicktime plugin to play the file no matter
 what the disposition or type is.  (also no matter what the file extension
 is.  Couldn't figure out how to trick it to download the file.)

 IE5.5 for Win98 would attempt to download the file if
(content-disposition:
 attachment; filename=) attachment was there.

 All 3 of the Win98 browsers would do prompt with as few clicks as possible
 when content-type was application/octet-stream.  Therefore,  I test in
my
 script for the Mac users and give them Content-type:
application/downlaod
 while I give other users Content-Type: application/octet-stream.  Of
 course, this doesn't help the IE5.5 Mac users who still have to use
 Downlaod Link to Disk routine to get a save-as prompt.

 Anyone who sees different ways this could be done, please respond.

 Here's my code:

 if (eregi(mac,$HTTP_USER_AGENT))
$type = application/download;
 else
$type = application/octet-stream;

 // stream file to user
 header(Content-Type: $type);
 header(Content-Disposition: attachment; filename=$filename);
 header(Content-Length: .filesize($tmp_file));
 header(Content-Transfer-Encoding: binary);
 readfile($tmp_file);



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Please Help - getting a hightlight depending on selected page

2001-08-22 Thread Gabe da Silveira

Okay, well you could either put code like this into each td cell like 
this:

td class=navtext ?php if (sect == 5) print id=\sel\; ?

That is kind of ugly, however.  A more elegant solution would be to make 
an array containing the links then do a loop kind of like this (I'm just 
typing the code off the top of my head, so there is likely to be some 
errors):

$menuItems = array('Home', 'Introduction', 'Changes amp; Cuts', 
'Scores', 'Orchestra', 'Synthesizers', 'Sound System', 'Articles');
$i = 0;
foreach ($menuItems as $item) {
   if($sect == $i) {
  print trtd class=\navtext\ id=\sel\a 
href=\\$item/a/td/tr\n;
   } else {
  print trtd class=\navtext\a 
href=\\$item/a/td/tr\n;
   }
   $i++;
}

The obvious problem with my solution is the links will also presumably 
have to be entered into an array, and I don't think the foreach 
construct can work on two arrays simultaneously, but you can use the $i 
variable as the index to your second array.

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Martin Hughes) wrote:

 OK here's the code in the page:
 
 !-- Start Navigation --
 div id=navbar
 table class=navtable width=160 cellpadding=4
 !-- Navigation Bar Heading --
 tr
  td class=navheadWelcome/td
 /tr
 trtd class=navtext id=sela href=Home/a/td/tr
 trtd class=navtexta href=Introduction/a/td/tr
 trtd class=navtexta href=Changes amp; Cuts/a/td/tr
 trtd class=navtexta href=Scores/a/td/tr
 trtd class=navtexta href=Orchestra/a/td/tr
 trtd class=navtexta href=Synthesizers/a/td/tr
 trtd class=navtexta href=Sound System/a/td/tr
 trtd class=navtexta href=Articles/a/td/tr
 trtd class=navtexta href=21st Century Les
 Miseacute;rables/a/td/tr
 trtd class=navtexta href=Information/a/td/tr
 trtd class=navtexta href=Discussion Forums/a/td/tr
 
 /table
 /div
 !-- End Navigation --
 
 
 I am using this 1 page as the php 'template' with content added depending on
 the url. For example, to go to the synthesizers page the url is:
 index.php?sect=5id=0page=31
 
 where sect=5 is the part that sets the menu highlight (the menu is alway the
 same, hard-coded into the page - all I want to do is change the css id=sel
 from Home to Synthesizers.
 
 Cheers
 
 Martin
 


-- 
__
Gabe da Silveira, Web Designer
Twin Cities Student Unions
University of Minnesota
http://www.coffman.umn.edu

wFone: (612)624-7270
eMail: [EMAIL PROTECTED]
hPage: http://www.visi.com/~jiblet

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Please Help - getting a hightlight depending on selected page

2001-08-22 Thread Hugh Bothwell


Martin Hughes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 OK here's the code in the page:

 !-- Start Navigation --
 div id=navbar
 table class=navtable width=160 cellpadding=4
 !-- Navigation Bar Heading --
 tr
  td class=navheadWelcome/td
 /tr
 trtd class=navtext id=sela href=Home/a/td/tr
 trtd class=navtexta href=Introduction/a/td/tr
 trtd class=navtexta href=Changes amp; Cuts/a/td/tr
 trtd class=navtexta href=Scores/a/td/tr
 trtd class=navtexta href=Orchestra/a/td/tr
 trtd class=navtexta href=Synthesizers/a/td/tr
 trtd class=navtexta href=Sound System/a/td/tr
 trtd class=navtexta href=Articles/a/td/tr
 trtd class=navtexta href=21st Century Les
 Miseacute;rables/a/td/tr
 trtd class=navtexta href=Information/a/td/tr
 trtd class=navtexta href=Discussion Forums/a/td/tr

 /table
 /div
 !-- End Navigation --


 I am using this 1 page as the php 'template' with content added depending
on
 the url. For example, to go to the synthesizers page the url is:
 index.php?sect=5id=0page=31

 where sect=5 is the part that sets the menu highlight (the menu is alway
the
 same, hard-coded into the page - all I want to do is change the css
id=sel
 from Home to Synthesizers.

div id=navbar
table class=navtable width=160 cellpadding=4
trtd class=navheadWelcome/td/tr

?php

$index = array(
Home,
Introduction,
Changes amp; Cuts,
Scores,
Orchestra,
Synthesizers,
Sound System,
Articles,
21st Century Les Miseacute;rables,
Information,
Discussion Forums
);

$items = count($index);
for($i = 0; $i  $items; $i++) {
echo \ntrtd class='navtext';

if ($sect == $i)
echo  id='sel';

echo a href='index.php?sect=$i'.$index[$i]./a;

echo /td/tr;
}
?

/table
/div




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] MySQL trubs

2001-08-22 Thread Michael O'Neal

Hi. I've recently set up phpMyAdmin on an OS X 10.1 server.  Everything was
fine, and it set up great.  I then restarted the Apache server and am
getting this message:



Warning: Access denied for user: 'root@localhost' (Using password: YES) in
/Library/WebServer/Documents/Mangotest/phpMyAdmin/lib.inc.php on line 351

Warning: MySQL Connection Failed: Access denied for user: 'root@localhost'
(Using password: YES) in
/Library/WebServer/Documents/Mangotest/phpMyAdmin/lib.inc.php on line 351
Error 

MySQL said:  Access denied for user: 'root@localhost' (Using password: YES)


I've been mucking around the command line for a while, but can't figure out
how to reset my root password.  It *was* setup with a root password, but it
won't let me in now.  Anyone have any suggestions?

Please respond to [EMAIL PROTECTED], as I am on the digest.  Thanks.


mto

-- 

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
-
 M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mysql_db_name not working (solved)

2001-08-22 Thread Peter Ostry

For those who might run into the same problem in the future:

If functions like mysql_db_name are not working and you get no 
mysqlerr, then most likely your PHP installation is messed up. Maybe you 
see the same behavior than we: phpinfo shows old and wrong stuff in the 
first section, i.e. an old servername or the wrong PHP version even if 
you installed a different one. phpinfo must never show wrong information!
In our case PHP is static compiled with Apache, I guess the Apache 
installation was not clean either.

This kind of error is easy to see if you install phpMyAdmin: you do not 
even get the index page. We finally connected to a running MySQL 
database on a production server, got the same result and could therefore 
isolate the problem - PHP or the combination Apache/PHP.

We run Solaris 2.8 on a Netra T1 AC200 and we are not familiar to this 
system yet. And we did more than one installation on this machine, maybe 
one or more were not correct. Since a complete new install of 
Apache/PHP/MySQL on a other Sun (X1) worked, we knew what to do:
Delete all previous installations of Apache and PHP. Make a fresh and 
empty /usr/local/ directory. delete all config files you might have in 
different locations. Unpack the downloads - all latest stable - only 
with gtar (important!) and compile only with gcc (important!). Now we 
are up and running, just the PHP library for dynamic image generation 
could not been installed - we are working on it.

Richard Lynch, thank you for your help. Your guess that there are 
accidently different libraries involved, pointed us in the right 
direction.


Peter Ostry

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mac PHP'ers - New PHP editor!

2001-08-22 Thread Michael O'Neal

Hi all.  I just stumbled across this earlier this week.  It's an app called
JaneBUILDER that helps with some of the PHP tedium of connecting,
selecting, and grabbing data from your MySQL db.  I was amazed at how fast I
put together an admin section for a client...3 minutes generated 10 pages!!!
Here's a little blurb from their website:

What is JaneBUILDER?


JaneBUILDER is a visual editor for PHP. JaneBUILDER allows you build complex
PHP pages with mouse clicks and menu items. The files created are native PHP
(text) files (that can be opened by any html tool or text editor) and
uploaded to your web server for deployment.

JaneBUILDER Philosophy:

JaneBUILDER is simple tool that lets you build PHP pages extremely quickly.
JaneBUILDER is not a replacement for your current HTML editor. Nor, is it a
replacement for your current text editor. JaneBUILDER is a tool that lives
in and lets you work in between these two worlds. We call it middleware for
your middleware. We think you'll love it so much you will add it to your
current arsenal of web tools.


I certainly don't work for them, but I think it's a cool app.  Windows
version on the way, apparently.

http://www.seejanecode.com


mto

-- 

Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
-
 M   A   N   G   O
B  O  U  L  D  E  R
-
http://www.thinkmango.com
e- [EMAIL PROTECTED]
p- 303.442.1821
f- 303.938.8507


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Creditcard checksum and identification

2001-08-22 Thread Peter Ostry

Has anyone a PHP Script for the checksum of Creditcards?
And a Script which can identify card types based on their first numbers?
(VISA, AMEX, MASTER, DINERS, JBC, DISCOVERY)

There where a lot of JavaScript pages on the web some years ago, but I 
have lost my local copies and the pages are vanished...


TIA,
Peter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >