RE: [PHP] xml header

2001-12-05 Thread Matthew Loff


The proper content type is text/xml.

--Matt


-Original Message-
From: bill [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, December 05, 2001 3:11 PM
To: Tyler Longren
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] xml header


Hmmm.  I'm thinking of the http headers.

Assume you have an xml file in memory as a variable ($xmlfiledata) and 
you want to send it to the browser.

If you just echo it, you are sending it as text (which isn't necessarily

bad, it just isn't as good as it should be, I think).

So far, I've been tossing this around:

$clength=strlen($xmlfiledata);
header(Host: myhost.com);
header(Content-Type: application/xml; charset=iso-8859-1);
header (Content-length: $clength);
echo $xmlfiledata;

I thought about sending Content-Type: text/xml too.

Any thoughts.

kind regards,

bill hollett

Tyler Longren wrote:

Hi Bill,

I don't believe there are any.

Tyler

- Original Message - 
From: bill [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 05, 2001 1:42 PM
Subject: [PHP] xml header


What is the proper header to send when presenting dynamic xml pages to

the browser?


-- 
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] XML and PHP - dynamic hell

2001-12-01 Thread Matthew Loff


Did you try adding:

header(Content-Type: text/xml);

To the top?


-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 01, 2001 12:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] XML and PHP - dynamic hell


I'm having one page output XML for other sites to parse. Unfortunately
if I
give an RSS parser the site (the php file) it errors out. But if I put
the
output in a XML file, and give that to the RSS parser everything works
perfectly. Does anyone know why it can't read it straight from the php
file?
PHP Builder has it working, I have no idea why mine doesn't. Thanks

Source:

?
require division/settings.inc;
require RootPath . admin/Admin.php;  //these just define mysql logins
and
such
echo  . ?xml version=\1.0\? . \n;
echo !DOCTYPE rss PUBLIC \-//Netscape Communications//DTD RSS
0.91//EN\
\http://my.netscape.com/publish/formats/rss-0.91.dtd\;\n;
echo rss version=\0.91\\n;
echo channel\n;
  $query = mysql_query(Select * from  . PREFIX . news order by Date
Desc
Limit 40);
  while($results = mysql_fetch_array($query))
  {
   echo item\n;
   echo title . stripslashes($results[Subject]) . /title\n;
   echo linkhttp://dod.stronger.org//link\n;
   echo author$results[Name]/author\n;
   echo description .
substr(htmlspecialchars(stripslashes($results[News])),0,150) .
.../description\n;
   echo /item\n;
 }
?
  /channel
/rss


-- 
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] Speed of Images from DB

2001-11-30 Thread Matthew Loff



It would be mighty handy for MySQL to have a binary file column type,
like Oracle, where the file was stored externally, outside of the rest
of the table data...  Anyone heard of any plans to implement this?


-Original Message-
From: Julio Nobrega Trabalhando
[mailto:[EMAIL PROTECTED]] 
Sent: Friday, November 30, 2001 12:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Speed of Images from DB


 But that could be due to server capabilities of my ISP (if he has for
 example a high tech mysql-server and a relativly slow machine for
apache).

  Probaly :-)

  From this page:

http://www.mysql.com/information/presentations/presentation-oscon2000-20
0007
19/

  You can read on section 'General tips':

- Store BLOB's that you need to access as files in files. Store only the
file name in the database.

  But I guess it also depends on the image size.

--

Julio Nobrega

Don't eat the yellow snow.


Stefan Rusterholz [EMAIL PROTECTED] wrote in message
000701c179bb$33c4df30$3c01a8c0@quasimodo">news:000701c179bb$33c4df30$3c01a8c0@quasimodo...
 I did do that for a galery-script of myself. I don't have any numbers
if
 you'r looking for that but my personal impression was, that the
picture
 output from the mysql-db is actually faster than reading directly from
disk.
 But that could be due to server capabilities of my ISP (if he has for
 example a high tech mysql-server and a relativly slow machine for
apache).

 But with a quite fast mysql-server it shouldn't be a problem I think.

 And if it _would_ be a problem, I think there are still more positive
 aspects then negatives (easy handling, having stored all important
 informations together, fast searching of images with keywords and so
on)

 best regards
 Stefan Rusterholz, [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] MySQL to Excel with mutiple sheets

2001-11-29 Thread Matthew Loff


Ha ha... Thanks... I realize it's off-topic to just post links, but here
are the ones I find most useful...

Generate Basic Excel Files from PHP
http://px.sklar.com/code.html?code_id=488

Favicon Generator (for Internet Explorer - icon that accompanies a link
when you add it to your favorites list)
http://www.favicon.com/

JavaScript 1.3 Object/Laguange Reference (a bit outdated, but very
useful)
http://rts.ncst.ernet.in/resources/javascript/reference/

Zip Code Database
http://sourceforge.net/project/showfiles.php?group_id=3641release_id=30
240

ADODB for PHP
http://sourceforge.net/project/showfiles.php?group_id=3641release_id=30
240

AfterBurner Cache for PHP
http://bwcache.bware.it/

Strip MP3 ID Tags - PHP
http://px.sklar.com/code.html?code_id=429

Date Calculation Class - PHP
http://www.phpinsider.com/php/code/Date_Calc/

DBG PHP Debugger
http://dd.cron.ru/dbg/

Graphing Class for PHP
http://www.aditus.nu/jpgraph/index.php

PHP Nightly Builds
http://snaps.php.net/

PHP Accelerator (similar to Zend cache)
http://212.67.208.211/index.php

File Format Archive
http://www.wotsit.org/default.asp

Cascading Style Sheets 2 Reference
http://zvon.org/xxl/CSS2Reference/Output/index.html

PHP DOM XML Parsing Class (doesn't require DOM-XML Library)
http://sourceforge.net/projects/phpxpath/

World of Mathematics (discrete math, anyone?)
http://mathworld.wolfram.com/

PHP Bytecode Compiler
http://pbc.sourceforge.net/

NuSphere Tech Library (good articles on PEAR DB, XML, and Gemini tables)
http://www.nusphere.com/products/tech_library.htm


-Original Message-
From: jimmy elab [mailto:[EMAIL PROTECTED]] 
Sent: Friday, November 30, 2001 1:34 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL to Excel with mutiple sheets


Matthew Loff wrote:
 
 http://www.wotsit.org/search.asp?page=49s=ALLFILES
  http://homepage.tinet.ie/~jmcnamara/perl/WriteExcel.html

This guy really has loads of remarkable links, or have you?!
Got any more?

-- 
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 4.1 out?

2001-11-28 Thread Matthew Loff


http://snaps.php.net/

Again, the whole not fully tested issue comes to play...  I'd avoid
using these on a production server, obviously. :)


-Original Message-
From: Mike Eheler [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 28, 2001 4:04 PM
To: Zeev Suraski; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP 4.1 out?


Interesting.

I'll hold off, but people will still try stuff like that. I'm not trying

to tell ya what to do, but I've found it best never to put files with 
release-names in their primary download spots, regardless of how hidden 
they may seem, until your absolutely positive that will be the release
file.

I've been randomly trying various filenames with wget for the past week 
or so, and last night it worked. One of the older tricks in the books 
for getting pre-releases.

Also, beyond this.. other than grabbing from CVS, does php ever publish 
milestone development versions for download anywhere?

Mike

Zeev Suraski wrote:

 And for a good reason.  Please don't publish such URLs in the
future...

 Zeev

 At 18:56 28/11/2001, Mike Eheler wrote:

 Try it:

 http://www.php.net/distributions/php-4.1.0.tar.gz

 No word on the website, though.

 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 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] MySQL to Excel with mutiple sheets

2001-11-28 Thread Matthew Loff


Can't be done easily with PHP right now...  To get that type of
functionality, you'd need to write it in Perl using the
SpreadSheet::WriteExcel module.

http://homepage.tinet.ie/~jmcnamara/perl/WriteExcel.html


-Original Message-
From: Brian Lee [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 28, 2001 6:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL to Excel with mutiple sheets 


I have a script that searches a MySQL DB and produces an Excel file from

each table in the search.

EX. You search 4 different tables for the Seattle you would come up
with 4 
different Excel files.

Now I was wondering if it was possible to take the 4 different Excel
files I 
just created and combine into one excel file with 4 different sheets?

If anyone has a code for this or could possible help me it would be
great.

I am using:
PHP: 4.04
Linux:  7.0
MySQL: 3.22.32

Thanks

-Brian


_
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 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] MySQL to Excel with mutiple sheets

2001-11-28 Thread Matthew Loff


Actually, I looked into the possibility of doing that, but it turns out
the Excel 5.0+ file format is -very- complicated... Not just a standard
binary file...

Check it out:
http://www.wotsit.org/search.asp?page=49s=ALLFILES

Way beyond my capabilities and patience.  :)


-Original Message-
From: Jason Murray [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, November 29, 2001 1:02 AM
To: 'Matthew Loff'; 'Brian Lee'; [EMAIL PROTECTED]
Subject: RE: [PHP] MySQL to Excel with mutiple sheets 


 Can't be done easily with PHP right now...  To get that type of
 functionality, you'd need to write it in Perl using the
 SpreadSheet::WriteExcel module.
 
 http://homepage.tinet.ie/~jmcnamara/perl/WriteExcel.html

In that case, someone could probably work out how to do it based
on the source of that module... :)

Jason

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

2001-11-19 Thread Matthew Loff


I always stick with PHP for web apps, but I am in a similar situation, I
have to write a script that generates statistics and item reports from a
database... The client wanted them in Excel format... I could have done
CSV, but for the sake of aesthetics, I decided to go with a native Excel
export... The best way of doing it is writing it in Perl with the
SpreadSheet::WriteExcel module.

Take a look at it...  I was quite impressed.


-Original Message-
From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 19, 2001 5:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] exporting


hey guys..

does anyone have any ideas on how to export information from a mysql
database to microsoft word, excel, access, note pad or any other such
application?


Regards,
Kunal Jhunjhunwala


-- 
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] Transfer variable to next web-page

2001-11-17 Thread Matthew Loff


Richard already answered the variable part, but I thought I'd point out
that you need to use double quotes in your HTML tags... Single quotes
are incorrect...

?
echo(P 
FORM method=\POST\ action=\join2.php\
text for button
INPUT type=\submit\ value=\Next step\
INPUT type=\hidden\ name=\htmlVariableName\
value=\$phpVariableName\
/FORM
);
?

Or...

?
echo('P 
FORM method=POST action=join2.php
text for button
INPUT type=submit value=Next step
INPUT type=hidden name=htmlVariableName value='. $phpVariableName
.'
/FORM
);
?

Or... Better yet, why not just:

P
FORM method=POST action=join2.php
text for button
INPUT type=submit value=Next step
INPUT type=hidden name=htmlVariableName
value=?=$phpVariableName?
/FORM


See the PHP manual for escaping HTML and string literals if you're
confused by any of this..
http://www.php.net/manual/en/language.basic-syntax.php#language.basic-sy
ntax.phpmode
http://www.php.net/manual/en/language.types.string.php



-Original Message-
From: Olav Drageset [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, November 17, 2001 1:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Transfer variable to next web-page


I just started..

How do you transfer a variable from one web-page to another
I try to use a form like this:
?
echo(P 
FORM method='POST' action='join2.php'
text for button
INPUT type='submit' value='Next step'
INPUT type='hidden' name='htmlVariableName' value='$phpVariableName'
/FORM
);
?

and catch it injoin2.phpby:

$phpVariableName=htmlVariableName;

echo$phpVariableName;

This do not work.
Can anyone tel me what should be done
Neither books, php-manual nor HTML-specification does tel me.

Olav




-- 
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: alzheimers and confused

2001-11-17 Thread Matthew Loff


I was waiting for someone to meantion de Morgan!  10 points for Mr.
Elab.  Ha ha...


-Original Message-
From: jimmy elab [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, November 17, 2001 1:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: alzheimers and confused


de Morgan and Boole, not Alzheimer nor Confusius

!(A OR B) = (!A) AND (!B)

-- 
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] documentation comment

2001-11-04 Thread Matthew Loff



I would have to agree on a global scale.

However, strictly in discussion of server-side languages, I haven't seen
ASP documentation as complete/useful as PHP's...  I have never had to
use anything besides the PHP manual to solve a problem in writing
something.


-Original Message-
From: Andrew Brampton [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, November 04, 2001 5:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] documentation comment


Have you seen a MSDN subscription latly?
Its many many CDs of Help Files and such...

Php.net has comments added by coders on the end, but other than that
they
have nothing over M$ unless i'm missing something?

Andrew
- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, November 04, 2001 7:59 PM
Subject: [PHP] documentation comment


 not to start a war, but have you seen php.net's documentation compared
to
 anything microsoft or anyone else has ever put out? i'd say that
 documentation is microsoft's achilles heel


 --
 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: Re[3]: [PHP] split array in 2 halfs

2001-10-31 Thread Matthew Loff


More generally, this should work:

$smallarray1=array_slice($bigarray, 0, sizeof($bigarray) / 2);
$smallarray2=array_slice($bigarray, sizeof($bigarray) / 2);

I haven't tested it though...

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 31, 2001 4:32 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re[3]: [PHP] split array in 2 halfs


$smallarray1=array_slice($bigarray,0,3);
$smallarray2=array_slice($bigarray,3,3);

On Wed, 31 Oct 2001 23:25:55 -0800, Daniel Harik wrote:
Want to split it in half

1 Big array:

1
2
3
4
5
6

Want to make


1 Small array:

1
2
3

2 Small array:
4
5
6

Thank You




-- 
Mark, [EMAIL PROTECTED] on 10/31/2001



-- 
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] Problem with very big array !

2001-10-29 Thread Matthew Loff



What prevents you from doing this iteratively, (not loading all 150,000
rows into memory, but processing each row sequentially)?


-Original Message-
From: Nicolas Guilhot [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 29, 2001 11:44 AM
To: Php General MailingList
Subject: [PHP] Problem with very big array !


Hi guys,

I have an sql query returning a result of nearly 150 000 rows. I use the
PEAR DB::getAll method to retrieve this result as an array which is very
big
indeed (about 300Mb). I can't use the MySQL LIMIT statement because I
need
to do sorting stuff on the result array.
My concern is that even after processing the last line of the script,
the
process continue running for about 20~30 minutes (I am watching running
processes using the unix command 'top'). For information, querying the
database, sorting the array and displaying results with a pager system
only
takes 3 minutes.

I have made a short example that reproduces the problem. If you could
test
it (IT WILL USE ABOUT 120Mb OF RAM) and tell me if you've got the same
problem it would be nice. You need to create a test database with the
following table :

CREATE TABLE test (
  id mediumint(20) NOT NULL,
  text varchar(255) NOT NULL default '',
  PRIMARY KEY  (id)
)

Then populate it with 150 000 rows using the populate.php script.
Finally, execute the query.php script and use top to see if the process
stops running quickly. For me it takes a lot of time to end (more than
20
minutes).
If you empty the database table, remove one character from the string in
the
insertInto function and populate it again, it should work correctly.

Thanks for any answer !!

PS : I am using PHP 4.06, MySQL 3.23.41 and Apache on a bi-processor
linux
box with 1Gb RAM.


//--
// populate.php
//--
?php
require_once(DB.php);

function getmicrotime()
{
  list($usec, $sec) = explode( ,microtime());
  return ((float)$usec + (float)$sec);
}

function insertInto($db)
{
  for ($cpt = 0; $cpt  15; $cpt++)
  {
$result = $db-query(INSERT INTO test VALUES('$cpt', 'This is the
very
big test n° $cpt. With more text. This time it will take more memory,
and
more time to execute. This is very strange. I do not understand why
???'));
  }
}


$db = DB::connect(mysql://user:password@localhost/test);
$time_start = getmicrotime();

insertInto($db);

$time_end = getmicrotime();
$time = $time_end - $time_start;
echo Execution time : $time seconds;
?
//-
//End of populate.php
//-



//-
//query.php
//-
?php
require_once(DB.php);

function getmicrotime()
{
  list($usec, $sec) = explode( ,microtime());
  return ((float)$usec + (float)$sec);
}

$db = DB::connect(mysql://user:password@localhost/test);
$time_start = getmicrotime();

$result = $db-getAll(SELECT * from test);

$time_end = getmicrotime();
$time = $time_end - $time_start;
echo Execution time : $time seconds;
?
//--
//End of query.php
//--


-- 
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] I'm not username, log me out....

2001-10-27 Thread Matthew Loff



I found sessions to be kind of fussy to get working, perhaps that's just
because I didn't have any experience with them until the last site I
did...

A simple call to session_unset() won't erase the session, but should
clear whatever username/passkey (I say passkey, assuming/hoping it's
encrypted) is stored in the session.



-Original Message-
From: Andy Lewis [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, October 27, 2001 9:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] I'm not username, log me out


Hello All,

I'm trying to use php sessions to logout a user that may be sharing a
computer with another user.

In other words. I don't want user1 to access my site and then user2 be
able to access user1's account with an auto login because the session
was saved. 

I've seen a few sites that have a URL or button that a user can click on
such as: I'm not Joe Smith, please log me out.

This is what I am trying to accomplish. Can someone point me in the
right
direction? I have sessions implemented using username and password but,
on
my login page since those vars are saved in the session the user
automatically gets logged in.

I also would like to have a checkbox on the login page that, if checked,
doesn't cache the username and password. So if they logout they must
enter
a username and password, instead of getting automatically logged in.

Any help will be highly appreciated.

Andy



-- 
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] Advanced. Trapped in architecture.

2001-10-26 Thread Matthew Loff


Response.Clear
Response.Redirect

Doesn't that imply that ASP buffers the output?  The problem with
redirecting the browser after you output data isn't a PHP issue, it's
the HTTP spec.

I think the best solution would be to turn on output buffering, then
immediately flush the output buffer when you figure out that you aren't
going to be redirecting the user.


-Original Message-
From: Mike Eheler [mailto:[EMAIL PROTECTED]] 
Sent: Friday, October 26, 2001 3:15 PM
To: Andy
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Advanced. Trapped in architecture.


I know in ASP it's as easy as doing:

Response.Clear
Response.Redirect

But PHP doesn't seem to have that feature.

My best suggestion would be to try and re-work your code so that the 
redirect can be detected *before* any html code is written to the
browser.

Mike

Andy wrote:

Hi there,

I have a serious problem in my programming architecture.

The architecture looks like fusebox (those of you familar with CF might
now
this a.) The point is, that I am sending html code at the beginning.
Body
tag and so on. Now there is the content. And inide this content there
might
be anywhere an if statement. This if statement should be able to
redirect to
another Page. I tryed this with the header location statement. Which
workes
fine as long as output buffer is on.
Having output buffer on leads to extreme performance loss. During db
access
you see a blank screen for seconds.

Here is the question: How do I redirect to another page in this case.
JS
might be a solution. But I really would like to avoid to be dependend
on the
activation of JS in such a elementery decision. So... how do you guys
redirect to other pages? Might be a quick run for you guys, but I am
totally
stuck here.

Thanx for any help

Cheers Andy






-- 
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] = 0 and = 0

2001-10-25 Thread Matthew Loff


The only reason I could see that not working is if PHP is typecasting
test to (int) in the second example...

$qty = 0;  (string)
test = test;  (string)
0 != test  (evaluates true)

$qty = 0; (int)
test = 0;  (when cast to int)
0 != 0  (evaluates false)

e.g. By comparing an int to a string in the 2nd example, the string is
casted to int, and the int cast of test is 0.


-Original Message-
From: Robin Chen [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, October 25, 2001 4:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] = 0 and = 0


why does

? $qty = 0 ; if ($qty != test) print qty is not test; ?

work properly but not the following

? $qty = 0 ; if ($qty != test) print qty is not test; ?

Thanks,

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]


-- 
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] delete html

2001-10-21 Thread Matthew Loff


The main manual seems to be down right now, probably being rebuilt...
Take a look at:

http://www.php.net/manual/en/html/

strip_tags() is under String Functions, and has been around for a
while.


-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, October 21, 2001 3:33 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] delete html


A fella could get converted real quick from Perl.
Is there anything else I need to learn :)

Is it that new that I can't find it on the function menu at www.php.net?

Thanks,

John

Christopher William Wesley wrote:

 use the strip_tags() function to remove HTML tags from strings.

 http://www.zend.com/manual/function.strip-tags.php

 ~Chris   /\
  \ / September 11, 2001
   X  We Are All New
Yorkers
  / \ rm -rf /bin/laden

 On Sun, 21 Oct 2001, jtjohnston wrote:

  How can I delete html from an input type=text ?
 
  Signed Perl user converted :)
  An email post  reply would come in ral handy.
  John
 
 
  --
  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] Tar and GZIP functions

2001-10-05 Thread Matthew Loff


Last time I checked, there is a class for creating tar files in PEAR...
Check your PHP installation...

Once you create a tar file, I'm sure you can filter it through zlib to
create a .tar.gz file.


-Original Message-
From: Georgie Casey [mailto:[EMAIL PROTECTED]] 
Sent: Friday, October 05, 2001 6:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Tar and GZIP functions


I want users to be able to select files from a folder and then a php
script would wrap em up in a tar file. Can zlib funtions do this?

the files are small gifs, if that helps

tia
--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Ireland's Online Film Production Directory
***



-- 
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] associative array syntax question - got it!

2001-10-03 Thread Matthew Loff


Have you tried using curly brackets?

print td$a[B]td{$quotes[$a[B]]}td

Does that work?  Just cuious...


-Original Message-
From: Job Miller [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 03, 2001 8:44 PM
To: Maxim Maletsky (PHPBeginner.com); [EMAIL PROTECTED]
Subject: Re: [PHP] associative array syntax question - got it!


Maxim,

I figured it out.  Thanks for your help

PHP can't interpolate within string when nested
associative array is used.  the nested aa must be
appended with dot notation, and if you try to print it
within the outer quotes it balks!

print td$a[B]td.$quotes[$a[B]].td
   ^  ^^ 
 A  B

This works, B switched with A won't work though.  
 

Thanks again,

Job
--- Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
wrote:
 
 
 -Original Message-
 From: Maxim Maletsky (PHPBeginner.com) 
 [mailto:[EMAIL PROTECTED]]
 Sent: giovedi 4 ottobre 2001 2.02
 To: 'Job Miller'
 Subject: RE: [PHP] associative array syntax question
 
 
 
 I tried on winXP/PHP4.0.6/Apache
 
 ?
   $a = Array('print me');
   $b = Array('b'=0);
   print $a[$b['b']]
 
   # prints:
   # print me
 ?
 
 
 Strange, should work though
 
 Maxim Maletsky
 www.PHPBeginner.com
 
 
 
 -Original Message-
 From: Job Miller [mailto:[EMAIL PROTECTED]]
 Sent: giovedi 4 ottobre 2001 1.57
 To: Maxim Maletsky (PHPBeginner.com)
 Subject: RE: [PHP] associative array syntax question
 
 
 no luck with that either.
 I do the same thing in Perl all the time.
 can it have anything to do with the fact that the
 inner part is a fetch from a mySQL DB which returns
 an enumerated array,
 so b is actually a constant (drop the quotes)
 referring to an index in
 the result?
 
 i tried $a[$b[b]] and $a[{$b[b]}], etc..
 
 nothing works..
 
 
 --- Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
 wrote:
  Strange, I always though it should be working.
  
  Have you tried $a[{$b['b']}] ?
  
  What version of PHP are you running?
  
  Maxim Maletsky
  www.PHPBeginner.com
  
  
  
  -Original Message-
  From: Job Miller [mailto:[EMAIL PROTECTED]]
  Sent: giovedi 4 ottobre 2001 1.41
  To: [EMAIL PROTECTED]
  Subject: [PHP] associative array syntax question
  
  
  why does: print $a[$b['b']] return:
  
  parse error, expecting `T_STRING' or `T_VARIABLE'
 or `T_NUM_STRING'
  
  but if I do it in two steps like:
  
  $c=$b['b'];
  print $a[$c];
  
  it works fine.
  
  I have tried dozens of syntax combinations using
  quotes, no quotes, on one or both and can't get
  anything to work.  any help would be greatly
  appreciated.  The two step method is annoying.
  
  Job
   
  
  __
  Do You Yahoo!?
  NEW from Yahoo! GeoCities - quick and easy web
 site
  hosting, just
  $8.95/month. http://geocities.yahoo.com/ps/info1
  
  --
  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]
  
 
 
 __
 Do You Yahoo!?
 NEW from Yahoo! GeoCities - quick and easy web site
 hosting, just
 $8.95/month. http://geocities.yahoo.com/ps/info1
 
 
 --
 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!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just
$8.95/month.
http://geocities.yahoo.com/ps/info1

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

2001-10-02 Thread Matthew Loff


The lack of fprintf() has been discussed on this list before, but I'm
not sure what the status is on the PHP development side...

http://bugs.php.net/bug.php?id=1027



-Original Message-
From: Bill Rausch [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 02, 2001 7:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] fprintf


There doesn't appear to be an fprintf function. I'm using:

fputs( $fp, sprintf( $format, ... ) );

Is this the recommended workaround?

I was wondering why fprintf was left out since so many other standard 
C library routines are present?

-- 
  Bill Rausch, Software Development, Unix, Mac, Windows
  Numerical Applications, Inc.  509-943-0861   [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] Even more text document stuff!!

2001-09-24 Thread Matthew Loff


Read the manual.  (Déjà vu?)

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

Even has an example that says -- get contents of a file into a string


-Original Message-
From: Kyle Smith [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 24, 2001 7:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Even more text document stuff!!


Is i possible to make PHP CUT all of the contents of a text document
out of it and make it into a variable?

(yes i know, i havnt got to the mySQL section of the book yet!!!)



-lk6-
http://www.StupeedStudios.f2s.com
Home of the burning lego man!
 
ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666


--
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] Disk Usage

2001-09-23 Thread Matthew Loff


Try removing the typecast to (int)...

$usage = `du -sk`;


See if that works.  If not, then either your backtick operators aren't
working (is safe mode on?) or du isn't being executed (not in the PATH
environment variable?).


-Original Message-
From: Scott Poarch [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 23, 2001 4:11 AM
To: Matthew Loff; 'Steve Werby'; [EMAIL PROTECTED]
Subject: Re: [PHP] Disk Usage


Well, it's an intriquing idea, but I'm not getting any success out of
it. thanks for the suggestion. I'll keep plugging away.
-- 
Scott Poarch
http://www.globalhost.com
 - - - - - - - - - - - -

 From: Matthew Loff [EMAIL PROTECTED]
 Organization: Willetts Systems
 Date: Sat, 22 Sep 2001 23:13:25 -0400
 To: 'Scott Poarch' [EMAIL PROTECTED], 'Steve Werby' 
 [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] Disk Usage
 
 
 Yes, that's exactly what I'm suggesting...
 
 Say output of du -sk is:
 
 1022  .
 
 The dot represents the current directory.  By typecasting it to an 
 integer, using (int), PHP will drop the dot and whitespace in 
 between...
 
 So, typecasting 1022  . to int gives you 1022 by itself.
 
 Good luck!
 -Matt
 
 
 -Original Message-
 From: Scott Poarch [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, September 22, 2001 10:37 PM
 To: Matthew Loff; 'Steve Werby'; [EMAIL PROTECTED]
 Subject: Re: [PHP] Disk Usage
 
 
 I appreciate the help.
 
 I understand the 'du -sk', but what's the (int) all about. Are you 
 suggesting using:
 
 $usage = (int)`du -sk`;
 
 in the PHP code, as in:
 
 chdir($basedir);
 $usage = (int)'du -sk';
 print($usage is usage);
 
 ?
 
 Thanks,
 --
 Scott Poarch
 http://www.globalhost.com
 - - - - - - - - - - - -
 
 From: Matthew Loff [EMAIL PROTECTED]
 Organization: Willetts Systems
 Date: Sat, 22 Sep 2001 22:07:26 -0400
 To: 'Scott Poarch' [EMAIL PROTECTED], 'Steve Werby' 
 [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] Disk Usage
 
 $usage = (int)`du -sk`;
 
 


-- 
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] Disk Usage

2001-09-22 Thread Matthew Loff


Yes, that's exactly what I'm suggesting...

Say output of du -sk is:

1022  .

The dot represents the current directory.  By typecasting it to an
integer, using (int), PHP will drop the dot and whitespace in between...

So, typecasting 1022  . to int gives you 1022 by itself.

Good luck!
-Matt


-Original Message-
From: Scott Poarch [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, September 22, 2001 10:37 PM
To: Matthew Loff; 'Steve Werby'; [EMAIL PROTECTED]
Subject: Re: [PHP] Disk Usage


I appreciate the help.

I understand the 'du -sk', but what's the (int) all about. Are you
suggesting using:

$usage = (int)`du -sk`;

in the PHP code, as in:

chdir($basedir); 
$usage = (int)'du -sk';
print($usage is usage);

?

Thanks,
-- 
Scott Poarch
http://www.globalhost.com
 - - - - - - - - - - - -

 From: Matthew Loff [EMAIL PROTECTED]
 Organization: Willetts Systems
 Date: Sat, 22 Sep 2001 22:07:26 -0400
 To: 'Scott Poarch' [EMAIL PROTECTED], 'Steve Werby' 
 [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: RE: [PHP] Disk Usage
 
 $usage = (int)`du -sk`;


-- 
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] Just for fun:

2001-09-20 Thread Matthew Loff



-Original Message-
From: Jason Bell [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 20, 2001 8:32 PM
To: PHP Users
Subject: [PHP] Just for fun:


Here is a question, just for fun:

What is the biggest function (In terms of line count) you have ever
written?

I just finished one that is 100 lines long. That is by far my
biggest It's a script initialization function that sets up database
connectivity, creates all tables necessary for my script, and creates an
administrative user.

-Jason


-- 
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] Print current page with no printer dialog box - How ?

2001-09-18 Thread Matthew Loff


FYI--  Page breaks can be designated with CSS (style sheets)...
Although that's not a completely cross-platform method.


-Original Message-
From: * RzE: [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 18, 2001 4:01 AM
To: hue micheal; [EMAIL PROTECTED]
Subject: Re: [PHP] Print current page with no printer dialog box - How ?


Original message
From: hue micheal [EMAIL PROTECTED]
Date: Mon, Sep 17, 2001 at 09:51:07PM -0400
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] Print current page with no printer dialog box -  How ?

 Do you know how to create a button to print current page without 
 bringing up the printer dialog box?  I just print to the default 
 printer.
 
 And also how do I insert a page break ?
 
 Thanks.
 Huem

/Original message

Reply

FAFAIK it's not possible to print a page client-side without showing the
printer dialog box. And it shouldn't be either. You don't want people to
just be able to do all kinds of things on your computer without being
prompted for them.

Page breaks are not part of HTML. Simply because HTML was never designed
for that kind of puposes.

/Reply

-- 

* RzE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

-- 
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] Performance: PHP vs. Visual Basic

2001-09-17 Thread Matthew Loff


Thanks for the clarification...

Anyone have any benchmarks of the MySQL ODBC driver?  Just out of
curiousity...

--Matt


-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]] 
Sent: Monday, September 17, 2001 9:47 AM
To: Matthew Loff; 'Michael Kimsal'; 'Masami Kawakami'
Cc: 'php forum'
Subject: RE: [PHP] Performance: PHP vs. Visual Basic


ODBC isn's slow, but some ODBC drivers are.
Comparison test if you have performance issues.  ODBC can be faster than
native.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software  http://www.openlinksw.com
Universal Data Access  Data Integration Technology Providers

 -Original Message-
 From: Matthew Loff [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 17, 2001 12:01 AM
 To: 'Michael Kimsal'; 'Masami Kawakami'
 Cc: 'php forum'
 Subject: RE: [PHP] Performance: PHP vs. Visual Basic



 I would agree that the DB is probably the biggest bottleneck...

 Are you connecting to the DB via ODBC?  I'm not an expert at DB stuff 
 outside of the MySQL realm, but I've heard many say ODBC is horribly 
 slow.  I don't know ASP that well, but could someone comment on ADODB?

 It uses OLEDB, not ODBC, correct?  I've read that OLEDB is much 
 faster.

 First and foremost, as Michael said, optimize your SQL...  That's the 
 first thing I'd do...  Then, check and see how you are connecting to 
 the DB...

 I think I can safely say, that if you switch to PHP/MySQL, that using 
 MySQL native libs to connect to the database are fastest... But I have

 been wrong in the past...



 -Original Message-
 From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 16, 2001 11:54 PM
 To: Masami Kawakami
 Cc: php forum
 Subject: Re: [PHP] Performance: PHP vs. Visual Basic


 Much as I don't like to defend MS, I'll take a stab here.

 By 40-50 people in an office, I presume you're talking about an 
 intranet of some type - 40-50 aren't constantly hitting it (meaning 
 40-50 requests per second all the time), but 40-50 are using it 
 throughout the day for various tasks.

 You don't give the machine specs, but I'd hazard to say, if it's 
 moderate equipment, that there's some DB optimization (or VB
 optimization) that could be done.  40 people lightly hitting a machine

 shouldn't cause much of a problem regardless of language used, unless 
 there's some extremely bad coding going on.

 Are you closing DB connections?
 Are you avoiding putting objects in session and/or application scope? 
 Are the DB queries optimized properly (proper indices on tables, etc)?

 Those are just a few things I'd look for.  Yeah it'd be great to have 
 you switch to PHP, but some optimization issues are universal, and if 
 it's written poorly in one language, chances are it'll be written 
 poorly in another.

 Regardless of this, we still recommened PHP to most clients because of

 the cost issue as well.  However, since you've already paid for this 
 software you're running (right?) it's probably worth it to take a 
 while to optimize what you've got first.



 
 Michael Kimsal
 http://www.tapinternet.com
 734-480-9961


 On Sun, 16 Sep 2001, Masami Kawakami wrote:

  Maybe this is one of FAQ, Please give me a URL of this kind of 
  comparison page, or your experience.
 
  A web server program is running in my office. It consists of Visual 
  Basic, IIS, and MS SQL Server on Windows 2000. although the 
  performance is confortable for few users, it is terribly slow for 
  40-50 users. Once all of them start to use, it takes more than 20 
  seconds to open a page in client browser.
 
  To improve the performance, we have an idea to use, instead of 
  Microsoft, PHP, Apache, and mySQL/ProgreSQL on Linux. How much will 
  be

  the improvement?
 
  We also have plan to enhance the hardware, 1PC for DataBase, 2nd and

  3rd for IIS or Apaches. Which has better scalability, VB or PHP?
 
 
 
  --
  Masami Kawakami [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 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] Getting screen resolution and color depth

2001-09-16 Thread Matthew Loff


Can't be done...

1) Browser sends request
2) PHP page is compiled and executed
3) PHP output is sent to browser
4) Browser displays page/executes javascript/etc.


-Original Message-
From: Salty Marine [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting screen resolution and color depth


Greetings to You:

How do I get the user's screen resolution and color depth?  Here's how
it is done in Javascript.  I want to do it and put the results into a
PHP varibal.

Scriptdocument.write(screen.width +  x  + screen.height)/script
Scriptdocument.write(screen.colorDepth +  bit)/script

Regards,
Salty


-- 
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] Getting screen resolution and color depth

2001-09-16 Thread Matthew Loff


As long as it doesn't interfere with any GET or POST data, you could
redirect the browser...

I haven't tried this, so I don't know if my syntax is perfectly correct,
but here's a suggestion...

BODY onLoad=document.location = 'somefile.php?screen_res=' +
screen.width + x + screen.height + 'color_depth=' +
screen.colorDepth


-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 4:13 PM
To: Matthew Loff; 'Salty Marine'; [EMAIL PROTECTED]
Subject: RE: [PHP] Getting screen resolution and color depth


But you could then re-submit the page with this data somehow, couldn't
you?

- seb

-Original Message-
From: Matthew Loff [mailto:[EMAIL PROTECTED]]
Sent: 16 September 2001 21:04
To: 'Salty Marine'; [EMAIL PROTECTED]
Subject: RE: [PHP] Getting screen resolution and color depth



Can't be done...

1) Browser sends request
2) PHP page is compiled and executed
3) PHP output is sent to browser
4) Browser displays page/executes javascript/etc.


-Original Message-
From: Salty Marine [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 3:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting screen resolution and color depth


Greetings to You:

How do I get the user's screen resolution and color depth?  Here's how
it is done in Javascript.  I want to do it and put the results into a
PHP varibal.

Scriptdocument.write(screen.width +  x  + screen.height)/script
Scriptdocument.write(screen.colorDepth +  bit)/script

Regards,
Salty


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.277 / Virus Database: 146 - Release Date: 05/09/2001


-- 
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] Performance: PHP vs. Visual Basic

2001-09-16 Thread Matthew Loff


I would agree that the DB is probably the biggest bottleneck...

Are you connecting to the DB via ODBC?  I'm not an expert at DB stuff
outside of the MySQL realm, but I've heard many say ODBC is horribly
slow.  I don't know ASP that well, but could someone comment on ADODB?
It uses OLEDB, not ODBC, correct?  I've read that OLEDB is much faster.

First and foremost, as Michael said, optimize your SQL...  That's the
first thing I'd do...  Then, check and see how you are connecting to the
DB...

I think I can safely say, that if you switch to PHP/MySQL, that using
MySQL native libs to connect to the database are fastest... But I have
been wrong in the past...



-Original Message-
From: Michael Kimsal [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 16, 2001 11:54 PM
To: Masami Kawakami
Cc: php forum
Subject: Re: [PHP] Performance: PHP vs. Visual Basic


Much as I don't like to defend MS, I'll take a stab here.

By 40-50 people in an office, I presume you're talking about an intranet
of some type - 40-50 aren't constantly hitting it (meaning 40-50
requests per second all the time), but 40-50 are using it throughout the
day for various tasks.

You don't give the machine specs, but I'd hazard to say, if it's
moderate equipment, that there's some DB optimization (or VB
optimization) that could be done.  40 people lightly hitting a machine
shouldn't cause much of a problem regardless of language used, unless
there's some extremely bad coding going on.

Are you closing DB connections?
Are you avoiding putting objects in session and/or application scope?
Are the DB queries optimized properly (proper indices on tables, etc)?

Those are just a few things I'd look for.  Yeah it'd be great to have
you switch to PHP, but some optimization issues are universal, and if
it's written poorly in one language, chances are it'll be written poorly
in another.

Regardless of this, we still recommened PHP to most clients because of
the cost issue as well.  However, since you've already paid for this
software you're running (right?) it's probably worth it to take a while
to optimize what you've got first.




Michael Kimsal
http://www.tapinternet.com
734-480-9961


On Sun, 16 Sep 2001, Masami Kawakami wrote:

 Maybe this is one of FAQ, Please give me a URL of this kind of 
 comparison page, or your experience.

 A web server program is running in my office. It consists of Visual 
 Basic, IIS, and MS SQL Server on Windows 2000. although the 
 performance is confortable for few users, it is terribly slow for 
 40-50 users. Once all of them start to use, it takes more than 20 
 seconds to open a page in client browser.

 To improve the performance, we have an idea to use, instead of 
 Microsoft, PHP, Apache, and mySQL/ProgreSQL on Linux. How much will be

 the improvement?

 We also have plan to enhance the hardware, 1PC for DataBase, 2nd and 
 3rd for IIS or Apaches. Which has better scalability, VB or PHP?



 --
 Masami Kawakami [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 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] Accessing pdf file thru php

2001-09-12 Thread Matthew Loff



Are you using Internet Explorer?  I've found that broken installations
of Acrobat will cause that... Try reinstalling acrobat on your computer,
and also try using Netscape... See if they work.

--Matt


-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 12, 2001 10:01 AM
To: Brad S. Jackson
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Accessing pdf file thru php


Brad,

Thanks for that pointer.

However, with that implemented, all I get is the PDF coding dumped onto
the screen - no pdf file downloaded!

Any further suggestions. I feel as though I'm getting there . . .
slowly.

George

- Original Message -
From: Brad S. Jackson [EMAIL PROTECTED]
To: George Pitcher [EMAIL PROTECTED]
Sent: Wednesday, September 12, 2001 2:52 PM
Subject: Re: [PHP] Accessing pdf file thru php




 You should call header() for each header line.  And you should only 
 send
one
 content type header.

 header(Content-type: application/pdf);
 header(Content-Disposition: inline;
filename=D:\\Pdf\\0226138097(57-77).pdf);
 header(Content-Length: $len);


 George Pitcher [EMAIL PROTECTED] wrote:
 Hi all,

 I'm trying to build php into an existing solution which uses Lasso.

 I have tested the passing of data from Lasso to php and that works 
 fine.

 I want Lasso to pass the filename over to a php page and for that page

 to grab the file from a folder outside of the webroot and push it out 
 to the user, at the same time as presenting them with a confirmation 
 form so that downloading can be confirmed.

 I have tried the following code without any good results:

 ?php
 $filename=D:\\Pdf\\0226138097(57-77).pdf;
 $len = filesize($filename);
 $header=
 Content-type: application/pdf
 Content-type: application/x-octet-stream
 Content-Disposition: inline; filename=D:\\Pdf\\0226138097(57-77).pdf
 Content-Length: $len;
 header=($header);
 readfile($filename);
 ?

 I get a parse error on the line that calls the header.

 Can anyone help me with this please?

 Regards

 George Pitcher

 Technical Manager
 HERON Project
 Napier University
 Edinburgh EH10 5DT

 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]

 http://www.heron.ac.uk 
 
programmer -  A device for transmuting caffeine into code. 
 



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.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]


-- 
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] Problem with Uploading Many Files (22)

2001-09-12 Thread Matthew Loff


What version of PHP are you running?

There were a few bugs in the file upload code that have been fixed in
recent relases of PHP...

--Matt

-Original Message-
From: Jani Rautiainen [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 12, 2001 3:51 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with Uploading Many Files (22)


I have been fighting with an annoying problem for couple days.. If I try
to upload more than 22 files (no matter what size), the last file
doesn't upload correctly..

I don't know PHP very well, so I don't know whether there is a way to
configure the server to get around the problem...

In the beginning I thought it was a problem with the java applet that is
used to upload the files, but then I tested with a normal html form
(below) and problem was still there, so I'm assuming it's PHP (I've
tested it with both Win/IIS and Linux/Apache configurations)..

I have the following piece of code to test the feature... The output
lists all the files, but the last file doesn't have size set (name is
correct
though) and the copy function gives an error...

form action=upload_result.php method=POST
enctype=multipart/form-data File 1: input name=file1
type=filebr File 2: input name=file2 type=filebr File 3:
input name=file3 type=filebr File 4: input name=file4
type=filebr File 5: input name=file5 type=filebr File 6:
input name=file6 type=filebr File 7: input name=file7
type=filebr File 8: input name=file8 type=filebr File 9:
input name=file9 type=filebr File 10: input name=file10
type=filebr File 11: input name=file11 type=filebr File 12:
input name=file12 type=filebr File 13: input name=file13
type=filebr File 14: input name=file14 type=filebr File 15:
input name=file15 type=filebr File 16: input name=file16
type=filebr File 17: input name=file17 type=filebr File 18:
input name=file18 type=filebr File 19: input name=file19
type=filebr File 20: input name=file20 type=filebr File 21:
input name=file21 type=filebr File 22: input name=file22
type=filebr File 23: input name=file23 type=filebr File 24:
input name=file24 type=filebr input type=submit /form

and in the receiving side there is the following code

?
 $filedir = c:\\filestorage\\;
 $count = 1;
 foreach ( $HTTP_POST_FILES as $file ) {
  $filename = $file['name'];
  $filesize = $file['size'];
 echo File name $filename? size: $filesizebr\n;
  copy($file['tmp_name'], $filedir.$count..jpg);
  $count++;
}
?




-- 
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] Dynamic Form

2001-09-12 Thread Matthew Loff


echo SELECT NAME=\whatever\\n;
while($row = mysql_fetch_assoc($yourquery)
echo OPTION . ($whatever == $row['value']? SELECTED :)
.VALUE=\{$row['value']}\{$row['name']}/OPTION\n;

echo /SELECT\n;

Just insert a ternary operator in there, and check if the submitted
value is equal to the database row's value... If so, add SELECTED to
the OPTION tag.

--Matt


-Original Message-
From: Jared Mashburn [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 12, 2001 6:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Dynamic Form


Hell0,

I have a MySql database with 3 columns.  The first column is id second
is name and third is value, I have two drop-down lists, with the
first filled with an array from the column name.  I would like for the
second drop-down list be changed according to the value of what has
been selected in the first drop-down list. I have fill that I'm going in
the right direction, but have run into a wall. Can anyone give me some
advice in doing this miraculous feat?

Thanks,

Jared


-- 
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] Dynamic Form

2001-09-12 Thread Matthew Loff


Oops...  My bad.

I misread the question... Ignore my previous reply.


-Original Message-
From: Jason Bell [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 12, 2001 6:47 PM
To: Jared Mashburn; PHP Users
Subject: Re: [PHP] Dynamic Form


PHP does not know what the user has selected in the first drop down.

You can either reload the page with the new value once the user has
selected the value for the first drop down list, and go from there, or
use Javascript.


- Original Message -
From: Jared Mashburn [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 12, 2001 3:45 PM
Subject: [PHP] Dynamic Form


 Hell0,

 I have a MySql database with 3 columns.  The first column is id 
 second is name and third is value, I have two drop-down lists, 
 with the first filled with an array from the column name.  I would 
 like for the second drop-down list be changed according to the value

 of what has been selected in the first drop-down list. I have fill 
 that I'm going in the right direction, but have run into a wall. Can 
 anyone give me some advice in doing this miraculous feat?

 Thanks,

 Jared


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

2001-09-09 Thread Matthew Loff


Subdomains are first a DNS issue...  The first place you have to go is
your DNS config, since users.body-builders.org wouldn't exist without an
A or CNAME record.

I don't know if mod_rewrite can do anything about the subdomains like
that, if it can't, you will have to add VirtualHost directives to
httpd.conf for each subdomain.

--Matt


-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 12:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mod_rewrite


I have a website URL www.body-builders.org and users have URLs 
like www.body-builders.org/user According to the virtual hosting 
rules I can do any configuration tweaks by .htaccess file.

What I want to do is to offer my users URLs like users.body-
builders.org Is it possible to do with rewrite rules in .htaccess?

I tried this in my .htaccess but it doesnt help - 

RewriteEngine   on
RewriteCond %{HTTP_HOST}^users\.body-builders\.org$
RewriteRule ^.*$http://www.body-
builders.org/users/indexr.php [L]

Youri

PS there are three lines in code.
God is our provider 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

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

2001-09-09 Thread Matthew Loff


Good point, felix...

I didn't even think of catch-all DNS domains...  I don't know how to set
them up, but I'm sure with a catch-all and mod_rewrite, you can
accomplish something useful.

Check google for catch all dns or something of the like.

--Matt


-Original Message-
From: Felix [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 1:38 PM
To: [EMAIL PROTECTED]; 'Matthew Loff'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] mod_rewrite


How about http://wasarrested.com? IO don't know how they do it, but you
can enter whatever subdomain you want and it reflecst it on the weppage.
Example http://bill.clinton.wasarrested.com or youri.wasarrested.com.

Felix

-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 2:43 PM
To: Matthew Loff
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] mod_rewrite


 
 Subdomains are first a DNS issue...  The first place you have to go is

 your DNS config, since users.body-builders.org wouldn't exist without
 an A or CNAME record.
My subdomains do not have DNSs =(( and I'm not sure if I can 
change this issue with .htaccess
 
 I don't know if mod_rewrite can do anything about the subdomains like
 that, if it can't, you will have to add VirtualHost directives to 
 httpd.conf for each subdomain.
But if I assign VirtualHost users.body-builders.org using DNS of 
www.body-builders.org (the onli one I have) all visitors will go to 
www.body-builders.org and not to users.body-builders.org?

Thank you,

Youri
God is our provider 
http://www.body-builders.org
New!!! - http://body-builders.org/index.php?links=1

-- 
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] difference between ?php and ?

2001-09-09 Thread Matthew Loff


There isn't any difference, if your php.ini settings allow it
(short_tags, I believe), you can use ? instead of ?php



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 09, 2001 2:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] difference between ?php and ?


Hi,

I am a newbie at this PHP thing and I have been working from information
on the web and from books.

I noticed that some start the PHP script with ? and some start with
?php.  Actually I have noticed that one of the first PHP script in my
book uses both methods interchangeably.

Is there a real difference between the two?

Or maybe I just haven't noticed something.

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]


-- 
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] Ordering a query

2001-09-08 Thread Matthew Loff


You could insert a ternary operation...

($order?$order:defaultfield)

Is the same as:

if($order) 
echo $order;
else
echo defaultfield;

...

$result = mysql_query(SELECT
articles.title,vote.votes,vote.total,articles.date,staff.firstname,artic
les.content,articles.id FROM staff,articles,vote WHERE articles.authorid
= staff.id AND articles.id = vote.item ORDER BY .
($order?$order:defaultfield) . DESC,$db);


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 07, 2001 10:05 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Ordering a query


I use the following code to order the results of the query by the
variable $order.

$result = mysql_query(SELECT
articles.title,vote.votes,vote.total,articles.date,staff.firstname,artic
les.content,articles.id FROM staff,articles,vote WHERE articles.authorid
= staff.id AND articles.id = vote.item ORDER BY `$order` DESC,$db);

I assign the variable a value according to my url,
http://www.mysite.com/file.php?order=something

My question is. Is there a way of assigning the $order variable a
default value? Like if they hit http://www.mysite.com/file.php without
the order=something can I tell the script to assign $order a default
value?

Thanks,
Nate


-- 
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: Mailing, which is faster

2001-09-06 Thread Matthew Loff


Doesn't PHP exec sendmail when mail() is called anyway?  (Unless you run
another MTA, of course)

I would think they'd take the same amount of time, unless there is
overhead with using popen()

--Matt


-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 06, 2001 2:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Mailing, which is faster


benchamrking is a common question with a common answer, try it
yourself, depending on your situation/hardware/software this will very
greatly from machine to machine.

--

  Chris Lee
  [EMAIL PROTECTED]


Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Which is faster (and/or smarter), using function mail() or doing it by

 popen(/blah/sendmail)?


 Niklas




-- 
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] Making gd Extensions

2001-09-04 Thread Matthew Loff


Banning PHP from your system just because GD won't compile with it seems
a bit drastic...

You have to realize that the PHP developers don't really have anything
to do with GD, pdflib, etc... they have added support for them into the
PHP language, but an issue with one of these external libraries isn't
the fault of the PHP group.

I have encountered LOTS of problems getting GD to compile into PHP, and
every single time, it turned out to be a problem with how GD was
installed.

If you find Perl more useful, then more power to you, each language has
its strong points and issues... But your slandering of PHP is really
unnecessary.


-Original Message-
From: Chris Mulcahy [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 04, 2001 4:34 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Making gd Extensions


Dennis:

Unfortunately, no, I have not had any luck or even any responses to my
email.

I have officially given up on PHP and have banned it from any system I
administer due to problems such as this.  Once you get past the mod_perl
compiling with Apache, all is well with Perl and extending it is easier.

Too bad, really, because PHP is an elegant language that is easy to
develop in.  Compiling extensions, however, is an entirely different
matter.

I wish you luck, if/when you resolve the problem, please be sure to post
the solution, there are still several unanswered requests for assistance
in the Google/Dejanews archives for this exact problem.

Good luck and happy programming!
Chris Mulcahy

 -Original Message-
 From: Dennis Moore [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 04, 2001 2:00 PM
 To: Chris Mulcahy; [EMAIL PROTECTED]
 Subject: Re: [PHP] Making gd Extensions


 The problem I had was with the compilation of the gd program.
  I installed
 an RPM version of gd from Redhat and recompiled.  It worked
 like a charm on
 RedHat v7.0.

 I am still working on the tarball version of gd.  The
 documentation says to
 play around the order of some of the settings in the makefile.
 Unfortunately, I have to work with a older version of RedHat on this
 machine. RedHat v6.2.

 Have you had any luck yet?

 /dkm
 - Original Message -
 From: Chris Mulcahy [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, August 30, 2001 11:10 AM
 Subject: RE: [PHP] Making gd Extensions


  So far, there have been no answers, so I'm guessing that
 either we're
  the only two receiving this or everyone who has received it has been
  unable to resolve the problem.
 
  My searches on Google have been unsuccessful so far.  There
 are quite a
  few reports of the problem, but no responses.
 
  If I learn anything, I'll be sure to let you know.
 
  Thanks
  Chris
 
   -Original Message-
   From: Dennis Moore [mailto:[EMAIL PROTECTED]]
   Sent: Wednesday, August 29, 2001 8:59 PM
   To: Chris Mulcahy; [EMAIL PROTECTED]
   Subject: Re: [PHP] Making gd Extensions
  
  
   I am having a similar problem using gd-2.0.1 where the
   compilation complains
   about conflicting type gdIOCtx.  I am getting a knot on my
   forehead from
   the wall in front of me.  Any ideas?
  
   /dkm
  
  
  
   - Original Message -
   From: Chris Mulcahy [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Wednesday, August 29, 2001 9:31 AM
   Subject: [PHP] Making gd Extensions
  
   
The current item I'm wrestling with is the gd extensions.
   I've rebuilt
PHP and Apache so many times to enable one feature only to
   learn that I
forgot to recompile one that I'd relied on previously.
 It's a never
ending battle to get all of the features required.
   
The .so extensions option is a great feature that I'd like
   to make use
of.
   
In trying to compile the gd .so extension (gd-1.8.4), I'm
   receiving the
following errors.  Any ideas?
   
Thanks
Chris Mulcahy
---
   
Making all in ext
make[1]: Entering directory
`/home/cmulcahy/transfer/webserver/php-4.0.6/ext'
Making all in gd
make[2]: Entering directory
`/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd'
make[3]: Entering directory
`/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd'
gcc  -I.
   -I/home/cmulcahy/transfer/webserver/php-4.0.6/ext/gd -I/home/cm
ulcahy/transfer/webserver/php-4.0.6/main
   -I/home/cmulcahy/transfer/webse
rver/php-4.0.6
   -I/home/cmulcahy/transfer/webserver/php-4.0.6/Zend -I/hom
e/cmulcahy/transfer/webserver/php-4.0.6/ext/mysql/libmysql
   -I/home/cmulc
ahy/transfer/webserver/php-4.0.6/ext/xml/expat/xmltok
   -I/home/cmulcahy/t
ransfer/webserver/php-4.0.6/ext/xml/expat/xmlparse
   -I/home/cmulcahy/tran
sfer/webserver/php-4.0.6/TSRM  -DSUPPORT_UTF8
   -DXML_BYTE_ORDER=12 -g -O2
  -c gd.c  touch gd.lo
gd.c:95: conflicting types for `gdIOCtx'
/usr/local/include/gd_io.h:18: previous declaration of `gdIOCtx'
gd.c: In function `php_if_imagecreatefromgif':
gd.c:1209: `gdImageCreateFromGif' undeclared (first use 

RE: [PHP] im puzzled

2001-08-29 Thread Matthew Loff


You need to specify which item to group the query by.

SELECT users.uid FROM users, picks WHERE users.uid  picks.user_id
GROUP BY users.uid;



-Original Message-
From: Jeremy Morano [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 29, 2001 10:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] im puzzled


Hi ,

this is my query

SELECT users.uid FROM users, picks WHERE users.uid = picks.user_id;

this works correctly. The results are what they are supposed to be:
However, when I change the = sign to a  or !=, The results are
completely incorrect.

--

picks.user_id contains: 5, 1, 7, 8, 9, 12, 13, 15

users.uid contains: 1, 8, 9, 5, 7, 10, 11, 12, 13, 14, 15


the result for SELECT users.uid FROM users, picks WHERE users.uid =
picks.user_id; is:

5, 1, 7, 8, 9, 12, 13, 15

and the result for SELECT users.uid FROM users, picks WHERE users.uid 
picks.user_id; is:

1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 7, 8, 9, 10, 11,12, 13, 14, 15,
1, 5, 8, 9, 10 ,11...etc

it goes on for 80 rows with no particular pattern..H.E.L.P.!.


-- 
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] pdflib + pdf_findfont

2001-08-29 Thread Matthew Loff


I got the same error message, and couldn't figure out why...

In the example for pdf_findfont(), it has:

$font = pdf_findfont($pdf, Times New Roman, winansi, 1);

Try changing your embed parameter to 0...

$font = pdf_findfont($pdf, Times New Roman, winansi, 0);

... That fixed it for me.  Give it a try.

--Matt


-Original Message-
From: Adam Oliver [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 29, 2001 9:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] pdflib + pdf_findfont


I can't get pdf_findfont to work in Linux.  I keep getting a message
that the font metrics are not found.  It works fine in windows.  Anybody
have any ides what I need to have set?

--
--
Adam Oliver
http://www.meyedev.com/people/aoliver.htm
[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] Question about PDF lib.

2001-08-27 Thread Matthew Loff


It's postscript points, I believe...  72 points per inch.

So, an 8.5x11 page is 612x792 points large.

--Matt


-Original Message-
From: Johan Holst Nielsen [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 27, 2001 3:59 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] Question about PDF lib.


Hi

Do anyone know, how i define the width, height etc. parameters in
PDFlib 
functions in PHP? Is it in cm, pixels, inch? Or?

Anyone know?

I need to generate printingfiles, so I hope I can use cm or sometime
like 
that :o)

Regards,

Johan

-- 
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] 2 NEWBIE QUESTIONS

2001-08-22 Thread Matthew Loff


1)  strftime(%T on the %D, strtotime($yourdate));

Should produce:  00:12:45 on the 08-22-2001  

You can check the manual page for strftime() to see different ways to
format the time to your liking:
http://www.php.net/manual/en/function.strftime.php


2)  The way you're trying to do that sounds a bit unnecessary, but take
a look at eval()
http://www.php.net/manual/en/function.eval.php



-Original Message-
From: Georgie [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 22, 2001 7:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] 2 NEWBIE QUESTIONS


1) Is there any PHP command that'll convert a MySQL database timestamp
into a format that humans can read?!! For example, I want to change
20010822001245 into 00:12.45 on the 22-08-2001?

2) This is the hard question. I have a script that gets values from a
database and then includes a php page which contains echo $variable
code to get the values from the database onto the page.

What I want to do is have the PHP page code in the main script instead
of being included externally. So i tried putting the code into a
variable and then including, but it didnt work. Then I tried echoing the
variable but the PHP code isnt executed.

If you dont fully understand my question, mail me. I'm really stuck and
NEEDD HELP!!!

TIA



-- 
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] debugger_on() undefined?

2001-08-17 Thread Matthew Loff


PHP docs are weak on debugger_on() because the debugger isn't a feature
in PHP 4 :)  

It was not included in the transition from PHP 3 to 4.  You'll have to
use a 3rd-party debugger for PHP code.  Search the archives for this
list, it has been discussed in the past.


-Original Message-
From: Jeffery Cann [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 17, 2001 9:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] debugger_on() undefined?


Greetings.

I am running php 4.0.6, which I built as an apache module on Linux
2.2.14.  
I am trying to get debug information, using the 'debugger_on()'
function.

My compilation line (from phpinfo()) is:

 './configure' '--prefix=/usr/local/php' '--with-config-file-path=/etc' 
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-track-vars' 
'--enable-magic-quotes' '--enable-debugger'
'--with-mysql=/usr/local/mysql' 
'--with-interbase=/opt/interbase'

However, when I execute a php script that includes the 'debugger_on()' 
function, I get:

Fatal error: Call to undefined function: debugger_on()

This would seem that although I said '--enable-debugger' in the 
configuration, my debugger is either:  a) not working in php 4.0.6 or b)

not compiled into my code.

I appreciate any hints, suggestions, etc.  The docs on php.net are
rather 
weak on using the debugger_on() function.

Thanks
Jeff

-- 
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: javascript reference (slightly ot)

2001-08-15 Thread Matthew Loff


JavaScript Reference Guide--
http://rts.ncst.ernet.in/resources/javascript/reference/

I remember having trouble finding a complete object/method reference
too, this document really helped me.


-Original Message-
From: Al [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 15, 2001 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: javascript reference (slightly ot)


Try searching for javascript and reference on Google for online
references. If you want a decent book, get something like JavaScript:
The Definitive Guide by David Flanagan, published by O'Reilly.

Regardless, pay attention to flags stating IE or Netscape only! :)

-Al (used to use your handle lemming *way* back when)

On Tue, 14 Aug 2001 22:58:44 -0300, [EMAIL PROTECTED] (Christian
Dechery) wrote:

Sorry for the OT but, but I'm struggling to get my forms to have a good
validation in JavaScript.

Does anyone know a complete reference to JavaScript, like, with all
objects, it's functions, parameters and etc...

that would help a lot..

Thanks...

 Christian Dechery (lemming)
 http://www.tanamesa.com.br
 Gaita-L Owner / Web Developer



-- 
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] MySQL connection

2001-08-09 Thread Matthew Loff


How exactly is the username/password from the mysql_connect() call shown
to the browser?

I normally just get a PHP error when the db connection can't be made.
No code is shown, just a line number.  If, in your case, PHP dumps the
source code to the browser window when the db connection won't work,
then something has to be wrong. :)

--Matt


-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 09, 2001 5:57 AM
To: Attila Strauss
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL connection


I have tested again what I said yesterday and found that if I have 
problems in PHP support in Apache then all my information 
(username and password) are seing simly on the screen, so it's not 
about dead SQL server but PHP. 

However, I went through all docs that I have on this topic and found 
that the only solution of this is to put included connect.php/inc 
outside of htdocs directory and configure your php.ini such a way 
that one outsider directory would be accepted and only by php call.

Hope I didn't mess up this time so you are able to understand what 
I mean... =))

Thank you for the help anyway,  just be aware of this PHP prob 
when you pick up provider.

Youri
On 8 Aug 2001, at 19:33, Attila Strauss wrote:

 hi,
 
 there are 2 ways.
 
 1. you hardcore the user/password in the php.ini file.
 2. u do a simply error checking like :
 
 ?php
 $connect = mysql_connect($host, $user, $pass);
 if(!$connect)
 {   
 print connection failed;
 }
 
 ?
 
 of course you could also do like kindaheader(Location:
http://host;);  instead of print connection failed.
 
 i hope i could help you.
 
 best regards
 attila strauss
 
 
 
 
  Hey Jouri,
  
  
  I don't agree with this one. I tested it out on my localhost and got

  the two error messages I told you I was going to get:
  
  Warning: Unknown MySQL Server Host...
  Warning: MySQL Connection Failed...
  
  No usernames/passwords. I have to say however that I
  always include my connect.php file. Maybe that's a
  secure way to connect without anyone seeing your
  password in case of sqlserver problems.
  
  
  Greetz,
  Bjorn Van Simaeys
  www.bvsenterprises.com
  
  
  
  
  --- BRACK [EMAIL PROTECTED] wrote:
   If you have Apache and MySQL servers make this
   experiment -
   start Apache but forget to start SQL and go to
   your site 
   http://localhost/... you will see yourself all the
   information on the 
   screen.
   
   Youri
   
   On 7 Aug 2001, at 12:53, Ryan Christensen wrote:
   
I'm curious as to how the hacker would see all
   this information (the
username.. password, etc..) just by going to a
   site where the SQL backend
was down?

Ryan

 -Original Message-
 From: BRACK [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 07, 2001 12:36 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] MySQL connection


 I just wanned to bring the issue of security of
   MySQL connection:

 Let us imagine that SQL server was down for some
   hours (of
 course without us knowing it) and at the same
   hours our SQL site
 was visited by some kind of hacker, he can s
 ee
   on his screen all
 our SQL connection info like username,
   password, and database
 name. You may hide this information in different
   file than the file
 that your users open then the hacker will see
   something like
 include(connect.inc); or
   require(connect.inc); (of course IF
 server is down). So you may only imagine the
   consequences of
 this visit of the hacker. What can we do to
   protect our sensitive
 information if SQL server is down?

 Youri

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



-- 
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] Is there a debugger ???

2001-08-08 Thread Matthew Loff


The debugger is not built into PHP 4, it was a feature in PHP 3.

--Matt


-Original Message-
From: Peter Dowie [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 08, 2001 12:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a debugger ???


Hi,

I noticed in php.ini there was a setion for debugger, I tried enabling
this and connecting to the specified port, but no joy. Anyone know how
to get this working ?

Pete



-- 
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] MySQL connection

2001-08-08 Thread Matthew Loff


Ha ha...  hardcore the user/password  

Sorry... I realize you gave a good answer, just had to laugh. :)


-Original Message-
From: Attila Strauss [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 08, 2001 1:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL connection


hi,

there are 2 ways.

1. you hardcore the user/password in the php.ini file.
2. u do a simply error checking like :

?php
$connect = mysql_connect($host, $user, $pass);
if(!$connect)
{   
print connection failed;
}

?

of course you could also do like kindaheader(Location:
http://host;);  instead of print connection failed.

i hope i could help you.

best regards
attila strauss




 Hey Jouri,
 
 
 I don't agree with this one. I tested it out on my
 localhost and got the two error messages I told you I
 was going to get:
 
 Warning: Unknown MySQL Server Host...
 Warning: MySQL Connection Failed...
 
 No usernames/passwords. I have to say however that I
 always include my connect.php file. Maybe that's a
 secure way to connect without anyone seeing your
 password in case of sqlserver problems.
 
 
 Greetz,
 Bjorn Van Simaeys
 www.bvsenterprises.com
 
 
 
 
 --- BRACK [EMAIL PROTECTED] wrote:
  If you have Apache and MySQL servers make this
  experiment -
  start Apache but forget to start SQL and go to
  your site 
  http://localhost/... you will see yourself all the
  information on the 
  screen.
  
  Youri
  
  On 7 Aug 2001, at 12:53, Ryan Christensen wrote:
  
   I'm curious as to how the hacker would see all
  this information (the
   username.. password, etc..) just by going to a
  site where the SQL backend
   was down?
   
   Ryan
   
-Original Message-
From: BRACK [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 12:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL connection
   
   
I just wanned to bring the issue of security of
  MySQL connection:
   
Let us imagine that SQL server was down for some
  hours (of
course without us knowing it) and at the same
  hours our SQL site
was visited by some kind of hacker, he can s
ee
  on his screen all
our SQL connection info like username,
  password, and database
name. You may hide this information in different
  file than the file
that your users open then the hacker will see
  something like
include(connect.inc); or
  require(connect.inc); (of course IF
server is down). So you may only imagine the
  consequences of
this visit of the hacker. What can we do to
  protect our sensitive
information if SQL server is down?
   
Youri
   
--
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]
 


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



-- 
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] form validataion?

2001-08-08 Thread Matthew Loff


Usually if-statements and regex's are used to validate data... If you
just want to make sure the form is filled out completely, you could do
this: (which is how I do it)

if(empty($name) || empty($address) || empty($phone))
{
// Form is not complete
echo 'Name: INPUT TYPE=TEXT NAME=name VALUE='$name'\n;
echo 'Name: INPUT TYPE=TEXT NAME=address
VALUE='$address'\n;
echo 'Name: INPUT TYPE=TEXT NAME=phone VALUE='$phone'\n;
} else {
// Form is complete.
[code to send form]
}


That way, as long as your error reporting isn't set too high (as to warn
about uninitialized variables), it will print the form empty the first
time, and if the user submits it without completing it, it will reprint
the form with whatever data the user has provided.

Please note-- this was a very short example (no submit button, no
stripslashes() on the variables) but you get the idea.



-Original Message-
From: Kurth Bemis [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 08, 2001 2:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] form validataion?


i want to do form validation server side...not client side..

i'm wondering what programers use to validate form data.if 
loopsarrays? what?

~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 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] 3rd include

2001-08-08 Thread Matthew Loff


For reference, in case anyone cares-- from within functions, I usually
just do:

global $HTTP_POST_VARS;
extract($HTTP_POST_VARS);

...to account for the scope of the form vars.


-Original Message-
From: Mark Roedel [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 08, 2001 4:08 PM
To: Drew P. Vogel
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] 3rd include


 -Original Message-
 From: Drew P. Vogel [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, August 08, 2001 3:14 PM
 To: Mark Roedel
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] 3rd include
 
 
 If a file is included from within a function, this would limit the 
 variable cope of this file, correct?

Yes it would.  (Specifically, it would mean that everything in that file
operates at the same scope as the function in which it's included. That,
in turn, means that $HTTP_POST_VARS is likely only available if it's
been declared as global within that function.


---
Mark Roedel ([EMAIL PROTECTED])  ||  There cannot be a crisis next week.
Systems Programmer / WebMaster  ||   My schedule is already full.
 LeTourneau University  ||-- Henry Kissinger



 On Wed, 8 Aug 2001, Mark Roedel wrote:
 
  -Original Message-
  From: Drew P. Vogel [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, August 08, 2001 2:19 PM
  To: Mark Roedel
  Cc: [EMAIL PROTECTED]
  Subject: RE: [PHP] 3rd include
 
 
  You're right. It is not discuessed there. My memory served me 
  incorrectly.
 
  In index.php (the file loaded by php),
 echo( $HTTP_POST_VARS[last_name] );
  will print the variable contents, but in save_script.php  (the 3rd 
 file included) the same function call will print  nothing.
 
 Are you quite sure there's not something else going on here?
  (An issue
 of the $HTTP_POST_VARS array being out-of-scope inside a
 function, for
 example?)  I'm sure I would have run into this behavior by now if it 
 were a system bug.
 
 For whatever it's worth, I just did a test, with includes nested ten 
 deep, and $HTTP_POST_VARS kept its value at every level.  (PHP 4.0.6,

 Apache 1.3.20, FreeBSD 4-Stable)
 
 
 ---
 Mark Roedel ([EMAIL PROTECTED])  ||  There cannot be a
 crisis next week.
 Systems Programmer / WebMaster  ||   My schedule is already full.
  LeTourneau University  ||-- 
 Henry Kissinger
 
 
 
 
 
 

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

2001-08-07 Thread Matthew Loff



Resizing a whole page of large images on the fly every time is going to
put a heavy load on your CPU...

If you insist on doing that, see the PHP image functions available
through the GD library...

http://www.php.net/manual/en/ref.image.php

I recommend you use PHP 4.0.6 with GD 2.0.x...  With those installed,
you can resample images instead of resizing... Resampling produces much
better results.



-Original Message-
From: Fernando Avila [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 07, 2001 5:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Images


Hello php-general,

  Hi, I'm having some troubles because i need to resize an image.
  I mean, i have a page that lists every notice in the page with a
  small picture, and if you click over the notice you get a full
  article with the big photograph.
  But i want to put in the server only one picture (the big one) and i
  need php to resize it to a small preview for the list.
  How can i do it?

  Thanks
  

-- 
Best regards,
 Fernando  mailto:[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] Splitting Text

2001-08-06 Thread Matthew Loff


You can do this several ways... Either use explode():
http://www.php.net/manual/en/function.explode.php

...to split the retrieved data by a space   as the delimeter, then use
a for() loop to print X number of words... E.g.:

$array = explode( , $db_string);

for($i = 0; $i  25; $i++)
echo $array[$i];

(That will print the first 25 words...)


Or, another way to do it is to use strtok() to tokenize the string...
http://www.php.net/manual/en/function.strtok.php

The manual has a good example of tokenizing a string into individual
words...


-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 06, 2001 5:20 PM
To: PHP General Mailing List
Subject: [PHP] Splitting Text


Hi, 
Can anyone give some pointers for my problem.
I want to pull articles out of a db and then show the first x number of
words 
with a read more link to the rest of the article. 

Could someone point me in the right direction. I've seen a code snippet
for 
this, but now I can't find it :-(

TIA,

Jord

-- 
Jordan Elver
http://www.jordanelver.co.uk

Oops, my brain just hit a bad sector!

-- 
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] Attitude of B van Ouwerkerk

2001-07-31 Thread Matthew Loff


I agree with the try to answer your own question first theory that you
propose...

I have used PHP for almost 2 years now, and just subscribed to this list
a month or two ago, but have yet to ask a single question...  But I
realize we're all at different skill levels, and so far, I haven't done
anything as advanced as some of the members of this list. :)

I think it's great that the members of this list are as selfless as they
are in helping people try to solve their problems and helping newbies
learn how to do some great things with PHP, but it seems to me that it
is -much- more time intensive to subscribe to this list and post a
message saying how do I send mail with PHP? than to go to www.php.net
and click on Mail functions in the manual. :)

Perhaps the Mailing Lists page on php.net could have a paragraph at
the top saying before asking for help on the PHP mailing lists, check
the linkannotated manual/link for examples and explanations ?
Anyone else agree?

As for the FAQ proposal, I think it would be great for someone to set up
a site where FAQ items could be posted (no matter -how- trivial they may
seem to an experienced PHP user) and moderated into a heirarchy by
subject...  The annotations in the PHP manual can be incredibly helpful
on occasion.

--Matt


-Original Message-
From: B. van Ouwerkerk [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 31, 2001 5:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Attitude of B van Ouwerkerk


Let me give just one reply.. I did read them all..

I don't hate Kyle Smith /me rather uses the energy needed to hate in a 
positive way.. Like to write docs for an opensource project. Did a
rewrite 
once..

Phil Driscoll.. you win. I'm Dutch. No I don't have time to go a few
times 
over my mail just to see if I can put things nicer or just in another
way. Have to develop some applications.. learn new stuff.. review old
code to 
make it better.. I keep on learning :-)

I agree with Justin Farnsworth and Scott [gts].. (And a few others..)

I don't think I've got an attitude problem. I don't know everything but
I 
do bother to find information before I start asking questions to others
who 
need to spend their VALUABLE time on MY problem.
IMHO someone who found php.net and this list to ask his/her question
should 
also have clicked on the DOCUMENTATION and downloaded the manual of
his/her 
taste.
I'd say only ask your question if it's not in the docs (perhaps not 100%

clear) or in the archive.. Searchengines can be a great source too.. If
it's in the archive it will cost less time then to wait for an answer. 
Sure you can look over something even if it's staring in your face..

I'm quite sure others will point that out to anyone who send a
question..

There's nothing wrong with being a newbie.. the only newbie-problem I 
see/have is the lazy one.. ask ask ask ask without taking the time to
read 
the manual or to do a search in the archive. Sure there are newbies who 
read the manual.. get some tutorials.. thats good. They should get all
the 
support they need..

Ask yourself.. who has an attitude problem here.. Someone who didn't
read 
the manual.. or someone (/me) who wrote to RTFM.
I find it worth mentioning that he finally downloaded the manual..

Enough bandwith and time wasted.

Bye,



B.


-- 
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] Trouble creating a list on months

2001-07-31 Thread Matthew Loff


Try this:

function month_list()
{
echo select name=\month\\n;

$month_names = array(1 = January, 2 = February, 3 =
March, 
4 = April, 5 = May, 6 = June, 7 = July, 
8 = August, 9 = September, 10 = October, 
11 = November, 12 = December);

$month = (int)strftime(%m);

for($num_months = 0; $num_months  12; $num_months++)
{
echo \toption . $month_names[$month] .
/option\n;
$month = ($month == 12? 1 : $month + 1);
}

echo /select\n;
}


-Original Message-
From: Mario A. Salinas [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 31, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble creating a list on months


Hello everyone,

This is my first posting.  I'm hoping someone can help figure this 
out.  I'm using a GNU licensed calendar but there is a bug in it's 
process for building a list of months.

The list is supposed to build a list of months starting with the 
current month and adding 11 months to the list.  In theory, If this 
is July the select should be as follows:

select
optionJuly/option
optionAugust/option
optionSeptember/option
optionOctober/option
optionNovember/option
optionDecember/option
optionJanuary/option
optionFebrurary/option
optionMarch/option
optionApril/option
optionMay/option
optionJune/option
/select

The process of building this list is done in a defined function in a 
'Required' inclusion of a file.

The problem is that the list gets built as follows:

select
optionJuly/option
optionAugust/option
optionOctober/option
optionOctober/option
optionDecember/option
optionDecember/option
optionJanuary/option
optionMarch/option
optionMarch/option
optionMay/option
optionMay/option
optionJuly/option
/select

The function gets called as follows:

? month_select($month); ?







$month is defined just before the (above) call as follows:

if(!isset($month)) $month=date(n);






The actual function is as follows:

function month_select($default=1) {

   $offset = date(n)-1;  // value used to be 'm'

   echo (select name=month 
style=\font-family:Verdana,Helvetica;font-size:8pt;\);
   for($x=1;$x=12;$x++) {
 $month = $x + $offset;
 if($month12) $month -= 12;
 echo(option value=$month);
 if($month==$default) echo( selected);
 echo(.date(F,mktime(0,0,0,$month))./option);
   }
   echo (/select);
}




Any Ideas what could be causing the problem?  I'm new to this and 
have been staring at it for a while.  Your help is greatly 
appreciated.

Thanks in advance,

Mario Salinas






-- 

===
  The Internet is a Jungle...  We can guide you through it safely!
===
  Amazon Networks
  1-818/954-0131
  mailto:[EMAIL PROTECTED]
  http://www.amazon-networks.com
===
  A firm that specializes in enabling large and small companies
  to Dominate the Internet through the development of intelligent
  Intranet/Extranet solutions and Search Engine Registrations.
===
It's because light travels faster than sound that some people seem very
bright, until you hear them speak
 
-- Anonymous
===

-- 
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] Trouble creating a list on months

2001-07-31 Thread Matthew Loff


Oops!  I forgot to include the parameter...

function month_select($month)
{
echo select name=\month\\n;

$month_names = array(1 = January, 2 = February, 3 =
March, 
4 = April, 5 = May, 6 = June, 7 = July, 
8 = August, 9 = September, 10 = October, 
11 = November, 12 = December);

if(!isset($month)) $month = (int)strftime(%m);

for($num_months = 0; $num_months  12; $num_months++)
{
echo \toption . $month_names[$month] .
/option\n;
$month = ($month == 12? 1 : $month + 1);
}

echo /select\n;
}

I didn't get a chance to test this, but you get the idea...

Good luck.


-Original Message-
From: Mario A. Salinas [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 31, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble creating a list on months


Hello everyone,

This is my first posting.  I'm hoping someone can help figure this 
out.  I'm using a GNU licensed calendar but there is a bug in it's 
process for building a list of months.

The list is supposed to build a list of months starting with the 
current month and adding 11 months to the list.  In theory, If this 
is July the select should be as follows:

select
optionJuly/option
optionAugust/option
optionSeptember/option
optionOctober/option
optionNovember/option
optionDecember/option
optionJanuary/option
optionFebrurary/option
optionMarch/option
optionApril/option
optionMay/option
optionJune/option
/select

The process of building this list is done in a defined function in a 
'Required' inclusion of a file.

The problem is that the list gets built as follows:

select
optionJuly/option
optionAugust/option
optionOctober/option
optionOctober/option
optionDecember/option
optionDecember/option
optionJanuary/option
optionMarch/option
optionMarch/option
optionMay/option
optionMay/option
optionJuly/option
/select

The function gets called as follows:

? month_select($month); ?







$month is defined just before the (above) call as follows:

if(!isset($month)) $month=date(n);






The actual function is as follows:

function month_select($default=1) {

   $offset = date(n)-1;  // value used to be 'm'

   echo (select name=month 
style=\font-family:Verdana,Helvetica;font-size:8pt;\);
   for($x=1;$x=12;$x++) {
 $month = $x + $offset;
 if($month12) $month -= 12;
 echo(option value=$month);
 if($month==$default) echo( selected);
 echo(.date(F,mktime(0,0,0,$month))./option);
   }
   echo (/select);
}




Any Ideas what could be causing the problem?  I'm new to this and 
have been staring at it for a while.  Your help is greatly 
appreciated.

Thanks in advance,

Mario Salinas






-- 

===
  The Internet is a Jungle...  We can guide you through it safely!
===
  Amazon Networks
  1-818/954-0131
  mailto:[EMAIL PROTECTED]
  http://www.amazon-networks.com
===
  A firm that specializes in enabling large and small companies
  to Dominate the Internet through the development of intelligent
  Intranet/Extranet solutions and Search Engine Registrations.
===
It's because light travels faster than sound that some people seem very
bright, until you hear them speak
 
-- Anonymous
===

-- 
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] dynamic variable names?

2001-07-31 Thread Matthew Loff


RTFM...  Read the Fabulous Manual.  :)  ha ha...  

It's possible, and downright easy.

http://www.php.net/manual/en/language.variables.variable.php


-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 31, 2001 10:58 PM
To: PHP Mailing List
Subject: [PHP] dynamic variable names?


Is it possible to dynamically assign a variable name?

For example:
variable name is $var_.name
or $var_.$name

Regards,

Matthew Delmarter

-- 
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] Find and Replace

2001-07-30 Thread Matthew Loff


Instead of using numbers, I use this system:

chmod a+rwx
(all users read/write/execute)

chmod u+rwx
(owner of file read/write/execute)

chmod g+rwx
(group read/write/execute)

chmod o+rwx
(all users read/write/execute)

The plus + can be substituted with a minus - to remove specific
permissions, and any combination of r, w, and x can exist in there.


- Original Message -
From: Shrout, Ryan [EMAIL PROTECTED]
To: 'Matt Kaufman' [EMAIL PROTECTED]
Sent: Monday, July 30, 2001 12:14 PM
Subject: RE: [PHP] Find and Replace


 Thanks!  Do you know what ownership properties only allow viewing by
owner?

 chmod 600?  711? 555?

 Thanks!

 Ryan

 -Original Message-
 From: Matt Kaufman [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 30, 2001 6:00 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Find and Replace


 There are a lot of text editors that allow you to find and replace - 
 vi
even
 does.

 You can also CHMOD the *.inc files to allow only the owner to access
them -
 I don't even use the *.inc or *.inc.php function, you can do without 
 it
(eg
 include.php, settings.php instead of include.inc or settings.inc.php)

 Matt Kaufman
 - Original Message -
 From: Shrout, Ryan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, July 30, 2001 12:06 PM
 Subject: [PHP] Find and Replace


  This isn't exactly PHP I need help with, but it relates to what I
learned
  about security.  Up until now, I have been using *.inc extensions 
  for my include files.  Well, I didn't realize until recently that 
  anyone can
view
  these files.  So, I want to rename them to *.inc.php.  BUT, in 
  almost
all
 of
  my PHP pages, there are links to : include ('mydir/myfile.inc');
 
  Can someone tell me how to do a recursive find and replace to look 
  for /myfile.inc and replace it with myfile.inc.php?  I am running 
  Red Hat
7.1
 
  Thanks!
 
  Ryan
 
  --
  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 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] my php script is very slow. help?

2001-07-27 Thread Matthew Loff


If you're only doing one DB query per page, then the query is probably
what's taking the longest.

Log into mysql, and execute EXPLAIN SELECT ...rest of query  ... It'll
tell you how MySQL plans on performing the query across the rows of the
table(s).  You can use the information it provides to optimize your
tables and/or indicies.

See this section of the MySQL manual for more info:

http://www.mysql.com/doc/E/X/EXPLAIN.html


-Original Message-
From: Tom Carter [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 27, 2001 6:48 AM
To: hassan xaaji; [EMAIL PROTECTED]
Subject: Re: [PHP] my php script is very slow. help?



Do you have many DB queries? What is the average size of the result
returned?

have you tried running timing functions on it to get a measure of how
long the page is taking? theres many examples on the web..

You can also use these to calculate the time for different sections..
that should help you work out what is taking the time.

HTH,Tom



 Hi all

 I have Linux/PHP/MySQL. Some of my script really run
 very slowly. painfully slow. All data are fetched from
 the database. The tables in database are indexed.
 Still  some scripts are very slow. I am using nested
 while and for loops. Any idea how to make them faster?

 What should I avoid in my scripting?

 thanks all

 
 Do You Yahoo!?
 Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your 
 free @yahoo.ie address at http://mail.yahoo.ie

 --
 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: download a pdf file

2001-07-26 Thread Matthew Loff


If the PDF file is publicly accessible via a web server, you should be
able to simply do:

header(Location: http://www.server.com/file.pdf;);


-Original Message-
From: kaab kaoutar [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 26, 2001 7:47 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: download a pdf file




Maybe ?!
I tried it
it gives me an error in that line
header(Content-Disposition: filename=\$file\);
But how when i click on  a button, the dialog box for downloading
appear? Thanks

From: Fredrik Arild Takle [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP] Re: download a pdf file
Date: Thu, 26 Jul 2001 13:35:38 +0200

Like this?

?php

header(Content-Type: application/download\n);
header(Content-Disposition: filename=\$file\);
$fn = fopen($file , r);
fpassthru($fn);

?

Best Regards
Fredrik A. Takle
Bergen, Norway

Kaab Kaoutar [EMAIL PROTECTED] wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi
  I looked in the php manual for how to download a file
  bbut in vain.
  Thanks
 
 
  _
  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]



_
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 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] Learning PHP

2001-07-25 Thread Matthew Loff


O'Reilly book and PHP manual?  That's the best you're going to get.
(Others will recommend other books, but the O'Reilly one is great to
start with)

Good luck!


-Original Message-
From: Kyle Smith [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 25, 2001 9:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Learning PHP


Can someone please make a list of the best places to learn PHP as I have
6 weeks of school holidays and I want to put the m to good use (i have
the PHP reference guide from www.oreilly.com and i have the big ass
document files from www.php.net)


-legokiller666-
http://www.StupeedStudios.f2s.com
New address new site

ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666




-- 
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] The BIG Question

2001-07-25 Thread Matthew Loff


That's like saying What's C++ good for?  

Well, not quite... Ha ha... I get a bit carried away... But it's close
enough.  

PHP does what you want it to do... Database-driven sites are covered
frequently on this list because PHP's database support is extensive and
very easy to use.

You shouldn't be thinking What can I do with PHP on my web site? you
should be thinking I want my website to do __, how will I
accomplish this with PHP?  :)


-Original Message-
From: Kyle Smith [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 26, 2001 12:23 AM
To: [EMAIL PROTECTED]
Subject: [PHP] The BIG Question


Ok this is the big question, in-depth could someone tell me what PHP
could be used for other than aking databases (which i canT do)

Thanks
-legokiller666-
http://www.StupeedStudios.f2s.com
New address new site

ICQ: 115852509
MSN: [EMAIL PROTECTED]
AIM: legokiller666




-- 
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] Regular Expression Question

2001-07-25 Thread Matthew Loff


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

string substr (string string, int start [, int length])

Substr returns the portion of string specified by the start and length
parameters. 

If start is positive, the returned string will start at the start'th
position in string, counting from zero. For instance, in the string
'abcdef', the character at position 0 is 'a', the character at position
2 is 'c', and so forth. 

Examples: 
$rest = substr (abcdef, 1);// returns bcdef
$rest = substr (abcdef, 1, 3); // returns bcd


-Original Message-
From: Seb Frost [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 25, 2001 5:09 PM
To: [EMAIL PROTECTED]; PHP
Subject: RE: [PHP] Regular Expression Question


I hope my later message clarifys what I mean.

- seb

-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: 25 July 2001 22:05
To: PHP
Subject: RE: [PHP] Regular Expression Question


Aren't the trims just for white space?
Jeff Oien

 since you know exactly which 4 characters you want to keep you can use

 a simple string trimming routine.  I forget the name of the function 
 in php but it's there and it'll be something like

 trimstring($string,1,5);

 or something like that.  No need for complicated regular expressions
either
 way.

 - seb

 -Original Message-
 From: Jeff Oien [mailto:[EMAIL PROTECTED]]
 Sent: 25 July 2001 21:47
 To: PHP
 Subject: [PHP] Regular Expression Question


 I want to replace a string like this 1B335-2G with this B335. So for 
 all
the
 strings I want to remove the first character and the last three
characters.
 I'm not sure which replace function to use or how to go about it. 
 Thanks. Jeff Oien

 --
 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 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] Zip Code Locator?

2001-07-24 Thread Matthew Loff


Ben--

Thanks for pointing that out... I've been looking for info like that for
a long time! 

Much appreciated.

--Matt


-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 24, 2001 1:23 PM
To: Vincent P. Cocciolone
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Zip Code Locator?


You could write your own. . .

Just kidding... well, technically you could... but... that's not the
point.

http://sourceforge.net/projects/zipcodedb has a Raw ZIP code dump...
It has a little more data than just zip, city, state... I don't know
what it means, but maybe you would...

Sorry, it's the best I could do =

Ben

On Mon, 23 Jul 2001, Vincent P. Cocciolone wrote:

 Hi,

 Does anyone know where can I find documentation or example scripts for

 a zip code locator. I'm looking for something that will list other zip

 codes within a number of miles radius of the zip specified.

 Thanks!

 Vince


 --
 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] Syntax Eyes

2001-07-24 Thread Matthew Loff


Output control functions will let you buffer the output, and you can
decide to send a header instead of flushing the buffer to the client:

http://www.php.net/manual/en/ref.outcontrol.php

ob_start()  flush()  should accomplish this all for you.


-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 24, 2001 11:14 PM
To: Php-General
Subject: Re: [PHP] Syntax Eyes


Nevermind, I got it...

Now, how do you reset header information if you need to redclare the
header(); 

ie:
Warning: Cannot add header information - headers already sent by (output
started at ...


-Clayton


- Original Message -
From: Clayton Dukes [EMAIL PROTECTED]
To: Php-General [EMAIL PROTECTED]
Sent: Tuesday, July 24, 2001 10:54 PM
Subject: [PHP] Syntax Eyes


Hey, I need a set of extra eyes:

$res_id = mysql_query (update contacts_data set (
description='$description',
data='$data',
filename='$input_file_name',
filesize='$input_file_size',
filetype='$input_file_type'
where uid='$uid'
));

Can someone tell me why this is yeilding:

MySQL Error: (1064) You have an error in your SQL syntax near '(
'Clayton Dukes', 'ÿØÿà\0JFIF\0\0H\0H\0\0ÿÛ\0C\0' at line 1


???
TIA!
--
Clayton Dukes
CCNA, CCDA, CCDP, CCNP
(c) 904.477.7825
(h) 904.292.1881
Download Free Essays, Term Papers and Cisco Training from
http://www.gdd.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 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] Networking

2001-07-23 Thread Matthew Loff


I don't see why you wouldn't be able to access that share... Did you try
escaping the path?

e.g. chdir(computer\\dir);


-Original Message-
From: ReDucTor [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 23, 2001 6:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Networking


Hey does any one know if it is possible to do something like

read stuff thro file and printer sharing on a remote pc, i tried

\\computer\dir for the dirs but that didn't work any suggestions(btw i
did addslashes :D )

so ne ideas...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]




RE: [PHP] Capitalize Function ??

2001-07-23 Thread Matthew Loff


I think ucfirst() only does the first character of the string...

ucwords() will do all the parts of the name.

The only shortcoming I've found is if people put in a middle initial and
add a period to it, or put a nickname in quotes... ucwords() skips
those.


-Original Message-
From: Opec Kemp [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 23, 2001 9:53 PM
To: PHP Junkie
Cc: PHP List
Subject: RE: [PHP] Capitalize Function ??


The function that you want is called: ucfirst()

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

To make sure that string are consistant you might want to convert all
characters in the string to Lower case first then call this function.
This will ensure that stuff like JoHn sMITH gets converted to John
Smith consistantly.

 -Original Message-
 From: PHP Junkie [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 24, 2001 11:39 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Capitalize Function ??


 I know this one will be an easy one ...

 I'm taking in first name and last name data into a MySQL db through a 
 form. Users sometimes don't capitalize their first and last names when

 entering the data.  Is there a function to clean this up for 
 consistency?  If so, what is the name of the function that performs 
 this?

 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 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] 33 Need A Vacation? Let Us Take You On One for FREE...

2001-07-22 Thread Matthew Loff


Whew!  They're giving away a lot of vacations if we -all- qualify...

:)


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]

Sent: Sunday, July 22, 2001 4:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] 33 Need A Vacation? Let Us Take You On One for FREE...


You have been specially selected to qualify for the following:

Premium Vacation Package and Pentium PC Giveaway
To review the details of the please click on the link 
with the confirmation number below:

http://www.1chn.com/wintrip





























































































RE: [PHP] formatting host output

2001-07-22 Thread Matthew Loff


If $lookup is passed from the client, then you should be careful with
that exec() call...

http://www.php.net/manual/en/ref.exec.php

Use one of the escape...() functions, perhaps?


-Original Message-
From: David Robley [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 23, 2001 12:47 AM
To: Tyler Longren; php-general
Subject: Re: [PHP] formatting host output


On Sat, 21 Jul 2001 06:32, Tyler Longren wrote:
 $data = exec(host $lookup);
 printf(pre%s/pre, $data);

 How can I format the output of that properly?
 Sometimes, it's all on one line, and it's fine.
 Other times, there's more than one line...like if there was an alias.

 Any way to format it like it is on the command line?

 Thanks,
 Tyler

$data = exec(host $lookup, $ary);
while(list(,$val) = each($ary)) {
echo $val . 'BR';
}

You need to assign the output of exec to an array if you want to capture

multiple lines of output. Check the manual for more detail.

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

   Try our NEW *SOLAR POWERED* tanning salon!

-- 
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] passing variables from forms to the same page repetatively

2001-07-17 Thread Matthew Loff


INPUT TYPE=HIDDEN NAME=name_of_variable VALUE=value_of_variable


-Original Message-
From: Tim Olsen [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 2:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] passing variables from forms to the same page
repetatively


People,
I have 4 forms in four seperate html pages included directly (no links
to 
includes) in the same .php file, i have it so all the form actions is
php.self, so when each form is submitted it goes on to display the next
form 
in line, using if and else statements, of course. I want to be able to
use 
variables created by the first form in the html part of the last form.
What 
is the best way to do this?

So far, I can only use variables on the next page (form) that is written
out. After that those variables have no value.  Is there some way to
submit 
all variables present and assigned with the submission of each form?  If
I 
make the forms a seperate include file, instead of having them in-line,
how 
does this change the ways variables are passed or submitted by each
form? 
Thanks, - Tim
_
Get your FREE download of MSN Explorer at http://explorer.msn.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] How to add a new color to JPEG

2001-07-17 Thread Matthew Loff


I don't know a way around the problem you're describing with your
version of PHP, but PHP 4.0.6 with GD 2.0.1 allows you to call
ImageCreateTrueColor(), which eliminates the 256-color limitation with
JPEG files-- solved my problem right away.

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 5:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to add a new color to JPEG


   -Original Message-
   From: SED [mailto:[EMAIL PROTECTED]]
   According to the manual, you can only get closest value of your 
   desired color by letting the ImageColorClosest() find it. 
   Therefore, if the image is totally black, you can not get the 
   yellow color. I have not found a way to do this though I believe I

   have tried everything. And yet, I have not found any documents 
   covering this other than PHP-manual.

I didn't get this from reading the manual, but I struggled with this
problem for days and finally gave up.  I posted to some other forums
when this one was done and found no answers.

Now, I know it isn't just me and I know what the problem is, but I still
don't know a solution.

I am creating an image on the fly and I have no problem if I am just
using a background color and adding text to it or if I use
ImageCreateFromPNG, but if I use ImageCreateFromJPEG and try to add text
on top of that or even a rectangle or anything on top, it seems to
ignore the color that I specify and always came out grey. (Of course now
if I use ImageColorClosest(), some colors work because they are in my
image.)

It doesn't matter what I output it as, only what I read it in as.

And if I read it in as a png, the image quality is horrible which I also
don't understand. It seems to have drastically reduced the number of
colors used.

My phphinfo says GD version 1.6.2 or higher I'm using PHP Version
4.0.1pl2

Here is my test page.
http://216.122.251.174/test/test.php

Here is the source for the graphic
http://216.122.251.174/test/button.phps

Any idea on how solutions?

Jennifer

-- 
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] GEt Command

2001-07-17 Thread Matthew Loff

 
$site = fopen( http://www.whatever.com/ http://www.whatever.com/,
r);
$contents = fread($site, 102400);
fclose($site);
 

-Original Message-
From: Clayton Dukes [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 2:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] GEt Command


Does anyone have a simple script that will GET a web page and return the
reply?
 
Something like this:
 
function getpage($host, $path, getstr) {
$getstr=whatever\r\n;
$host=www.whatever.com;
 
$hdr=sprintf(GET $getstr, $path);
$hdr .=Content-type: application/x-www-form-urlencoded\r\n;
$hdr .=Accept: text/html\r\nAccept: text/plain\r\n;
$hdr .=User-Agent: Mozilla/1.0\r\n\r\n;
 
$fp = fsockopen($host , 80, $errno, $errstr, 45);
if (!$fp) {
echo $host open error: $errstr $errno .\n;
return(0);
} else {
fputs($fp,$hdr.$poststr);
return($fp);
}
}
 
while (!feof($fp)) {
$buff=fgets($fp, 1024);
//dofoo($buff);
echo $buff;
}
fclose($fp);
 
 
TIA!
 
Clayton Dukes
CCNA, CCDA, CCDP, CCNP
(c) 904.477.7825
(h) 904.292.1881
Download Free Essays, Term Papers and Cisco Training from
http://www.gdd.net
 
 




RE: [PHP] REPOST: converting multiple URL values for the same variable into an array

2001-07-16 Thread Matthew Loff



If PHP won't overload them to an array, you could parse $QUERY_STRING
manually.


-Original Message-
From: Jason Murray [mailto:[EMAIL PROTECTED]] 
Sent: Monday, July 16, 2001 11:06 PM
To: 'Kurt Lieber'; 'PHP General List (E-mail)'
Subject: RE: [PHP] REPOST: converting multiple URL values for the same
variable into an array


Hi Kurt,

 So, am I correct in assuming that $song will never be considered an 
 array? (basically, given the above code and URL, $song will always 
 equal 102)

If .pls is a PHP file, then in my experience yes you're right.

However, I've never seen a PHP file called .pls, it may be something
else. Java Servlets for example will allow you to overload variables
like that on a URL line and will indeed produce an array.

I could be wrong, though.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

-- 
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] learning PHP from scratch

2001-07-16 Thread Matthew Loff


I am not sure how easy it would be to learn PHP from scratch without any
prior programming experience...

In my case, knowing C and HTML very well made learning PHP easy as
pie...  I think both are great starting points for someone who wants to
do PHP well.


-Original Message-
From: Jason Murray [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 17, 2001 12:28 AM
To: 'Raphael Steenbergen'; [EMAIL PROTECTED]
Subject: RE: [PHP] learning PHP from scratch


 This approach worked pretty well with previous people i teached
 PHP, but they already had some sort of programming background. 
 This guy hasn't. I find that he has some difficulties picking 
 it up. And I have some difficulties to further help him. 

Is he having problems with PHP, or database interaction with PHP?

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
Work now, freak later!

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

2001-07-14 Thread Matthew Loff


Just for reference, I originally meantioned a comparison of PostgreSQL
beta vs. MySQL latest--  here's the article:

http://www.phpbuilder.com/columns/tim2705.php3?page=1

I'm curious to hear comments on stability of Postgres, since the author
of that article meantions it as a concern of his.


-Original Message-
From: Chris Lambert - WhiteCrown Networks [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, July 14, 2001 11:30 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Web application?


And the article was written by Joshua Drake, not Zeev. It seems to have
been published early January, judging by some Google research. Not sure
why it isn't in Zend's article DB anymore...

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

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Martín Marqués [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 14, 2001 11:24 AM
Subject: Re: [PHP] Web application?


|  On Sáb 14 Jul 2001 12:09, Rasmus Lerdorf wrote:
|Thats not the worst thing I find in it. MySQL has referential
integrity?
|How about locking for update of rows? You have to lock the whole
table!
|  
|   Actually both the innodb and gemini backends for MySQL have 
|   row-level locking.
| 
|  That must be really new, cause the biggest blame I find over MySQL 
|  is
the
|  table locking feature (Zeev Suraski articule also talks about it).
|
| Has been there for months.  Since version 3.23.30
|
| -Rasmus
|
|
| --
| 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] Alternative to phpMyAdmin

2001-07-14 Thread Matthew Loff


You probably mean SSH tunnel, which is quite feasable--  Hank Marquardt
posted this earlier to the list:

--- BEGIN QUOTE ---

Works just fine ... as does postgres --

ssh -N -2 -f -C -c blowfish -L3306:yourdatabase.server.here:3306
[EMAIL PROTECTED]

or the other usual tricks work too ... like going through a firewall
(fyi ... clear text on the *other* side of the firewall):

ssh -N -2 -f -C -c blowfish -L3306:db_behind_thefirewall:3306
[EMAIL PROTECTED]

The only oddity is that you will have to use the local host *address*
127.0.0.1 to connect from the mysql client as it normally looks for a
local socket if you use 'localhost', so your connection will be:

mysql -h 127.0.0.1

for postgres examples, change the port numbers (3306) to 5432

--- END QUOTE ---

-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, July 14, 2001 6:02 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Alternative to phpMyAdmin


What if you were to open an SSL tunnel to the DB host, then connect
through 
that???

 like you said... as long as the database provider accepts connections 
 from outside, you can administer it from anywhere.

 if the provider doesn't accept incoming connections, no amount of 
 tools and software will work for you.

  -Original Message-
  From: Alexander Skwar [mailto:[EMAIL PROTECTED]]On Behalf Of
  Subject: RE: [PHP] Alternative to phpMyAdmin
 
   if you install mysql on a windoze machine then you can administer 
   ANY 
 
  mysql database going through the socket.
 
  Okay, for a development this may be fine, but I still fail to see 
  how a tool that runs on your own computer (no matter if it's a 
  Windows tool, or a Linux tool) can help you administer databases 
  which are not on the same computer (unless the mysql database on the

  providers server can be contacted from any machine and not just from

  localhost).
 


-- 
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] Algorithm for repeating calendar events

2001-07-13 Thread Matthew Loff


That's a good question, Michael-- I don't really know if libmcal can be
used on Win32...  Is it made to be compiled under VC++?

If it can't, you should be able to achieve similar results by storing
events in a DB, and using the Date_Calc class:
http://www.phpinsider.com/php/code/Date_Calc/

Good luck!

-Original Message-
From: Michael Hall [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 9:13 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Algorithm for repeating calendar events


This libmcal sounds like something I've been needing for another
project.

Unfortunately, I'm on a Windows platform.  Is there any way to get this
functionality on Win32?

I downloaded the tar.gz file with teh libmcal library in it, but I have
no idea what I would do next.



 -Original Message-
 From: Matthew Loff [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 1:43 PM
 To: 'Rasmus Lerdorf'; 'Reuben D Budiardja'
 Cc: 'php php'
 Subject: RE: [PHP] Algorithm for repeating calendar events



 libmcal is a pain in the butt to set up, but once it's set up, it has 
 some great features...  I had to write a PHP page that handled 
 scheduling of appointments, and mcal saved me a lot of time, after I 
 spent the initial 2 hours pulling my hair to set it up. :)


 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 2:28 PM
 To: Reuben D Budiardja
 Cc: php php
 Subject: Re: [PHP] Algorithm for repeating calendar events


 Not quite live yet.  You'll see it when it goes live.

 By the way, there is a very complete date class in PEAR that has 
 pretty much everything you would need to build a calendar app.  See 
 pear/Date/Calc.php

 -Rasmus

 On Thu, 12 Jul 2001, Reuben D Budiardja wrote:

  Great, I'd like to steal it too then :). I just check php.net, but 
  couldn't find it. In what section would you put it?
 
  Thanks.
  Reuben D. Budiardja
 
  On Tuesday 10 July 2001 05:34 pm, Rasmus Lerdorf wrote:
Have any of you seen those calendar applications that let you 
program events that repeat periodically? You can set it to 
repeat every thursday, every week, every third week, every six 
months, and so on?
   
I am developing such an application in PHP and I know that the 
client will ask for this feature. So in thinking ahead of time, 
I would like to know if any of you has had any experience 
developing

such an application so that you can point me in the right 
direction.
  
   I just wrote one on the plane back from LinuxTag.  I'll get it up 
   on

   php.net soon and you can steal it from there.
  
   -Rasmus
 


 --
 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] Alternative to phpMyAdmin

2001-07-13 Thread Matthew Loff


Unfortunately, it doesn't -- you bring up a good point. 

It does support the compressed client/server protocol, which would make
it harder to intercept-- but encryption is not an option yet on the
client.

I don't suppose there's any way on Win32 to use an SSH tunnel, is there?


-Original Message-
From: Egan [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 10:06 AM
To: Steve Brett
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Alternative to phpMyAdmin


On Fri, 13 Jul 2001 11:15:52 +0100, Steve Brett
[EMAIL PROTECTED] wrote:

one of the guys i work for has an account with a service provider that 
gives mysql databases as part of his package. he has an account and 
password that is supplied when using mysql-front to connect to his 
database.

Does mysql-front encrypt the password before it travels the 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 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] Passwords and SSH port forwarding (was: Alternative to phpMyAdmin)

2001-07-13 Thread Matthew Loff



Excellent tip, Hank!  I didn't know SSH tunneling was that easy, I
haven't had the necessity to use SSH at all yet.


-Original Message-
From: Hank Marquardt [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 6:42 PM
To: Egan
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Passwords and SSH port forwarding (was: Alternative
to phpMyAdmin)


Works just fine ... as does postgres --

ssh -N -2 -f -C -c blowfish -L3306:yourdatabase.server.here:3306
[EMAIL PROTECTED]

or the other usual tricks work too ... like going through a firewall
(fyi ... clear text on the *other* side of the firewall):

ssh -N -2 -f -C -c blowfish -L3306:db_behind_thefirewall:3306
[EMAIL PROTECTED]

The only oddity is that you will have to use the local host *address*
127.0.0.1 to connect from the mysql client as it normally looks for a
local socket if you use 'localhost', so your connection will be:

mysql -h 127.0.0.1

for postgres examples, change the port numbers (3306) to 5432



On Fri, Jul 13, 2001 at 06:39:51PM -0400, Egan wrote:
 On Fri, 13 Jul 2001 12:28:37 -0400, Matthew Loff [EMAIL PROTECTED]
 wrote:
 
  Does mysql-front encrypt the password before it travels the net?
 
 It does support the compressed client/server protocol, which would 
 make it harder to intercept-- but encryption is not an option yet on 
 the client.
 
 I don't suppose there's any way on Win32 to use an SSH tunnel, is 
 there?
 
 
 I use SSH port forwarding to protect FTP passwords into my server. 
 Getting FTP to work with SSH port forwarding was more tricky than POP 
 or SMTP, but it can be done.  Also, the FTP server itself can be an 
 obstacle to making it work, depending on how it's configured.
 
 Funny that, after figuring it out the first time, now it doesn't seem 
 so tricky after all.
 
 It might work with MySQL, but I have not tried it.
 
 Egan
 
 
 
 
 
 --
 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]

-- 
Hank Marquardt [EMAIL PROTECTED]
http://web.yerpso.net

Web  Database Development in PHP, MySQL/PostgreSQL
Small Office Networking Solutions - Debian GNU/Linux  FreeBSD PHP
Instructor - HTML Writers Guild http://www.hwg.org
*** PHP II The Cool Stuff starts July 16, 2001
*** http://www.hwg.org/services/classes/p181.1.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] Alternative to phpMyAdmin

2001-07-12 Thread Matthew Loff


I second that recommendation-- MySQL-Front is downright excellent!

http://www.mysqlfront.de/


-Original Message-
From: Steve Brett [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 12, 2001 6:47 AM
To: Steph; [EMAIL PROTECTED]
Subject: RE: [PHP] Alternative to phpMyAdmin


mysql front is by far my favourite

available from mysql download section.

Steve

 -Original Message-
 From: Steph [mailto:[EMAIL PROTECTED]]
 Sent: 12 July 2001 05:01
 To: [EMAIL PROTECTED]
 Subject: [PHP] Alternative to phpMyAdmin
 
 
 Hi all! I love phpMyAdmin, just makes life so easy :) But I
 just moved my site, and phpMyAdmin isnt working on my server 
 yet, so does any one have any solid alternatives that I can install??
 
 Thanks, Steph
 

-- 
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] Alternative to phpMyAdmin

2001-07-12 Thread Matthew Loff


Same here... I run MySQL on Win2k as well as Linux machines, and use
Mysql-Front for things like table creation, user management, etc.  

It's also a great tool for EXPLAINing massive queries to find the most
efficient.



-Original Message-
From: scott [gts] [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 12, 2001 2:17 PM
To: php
Subject: RE: [PHP] Alternative to phpMyAdmin


i manage the production mysql database on a linux server
from my windows desktop at work

it's an extremely nice program.  :)

many compliments to the authour, if he reads this list.

 -Original Message-
 From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 12, 2001 2:15 PM
 To: Matthew Loff
 Cc: 'Steve Brett'; 'Steph'; [EMAIL PROTECTED]
 Subject: Re: [PHP] Alternative to phpMyAdmin


 So sprach »Matthew Loff« am 2001-07-12 um 14:07:16 -0400 :
 
  I second that recommendation-- MySQL-Front is downright excellent!
 
  http://www.mysqlfront.de/

 Well, but how is that going to work, if Steph wants to manage his 
 databases on his providers server?

 Besides, mysqlfront is a Windows program...

 Alexander Skwar
 --
 How to quote: http://learn.to/quote (german) http://quote.6x.to
(english)
 Homepage: http://www.digitalprojects.com   |
http://www.iso-top.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 23 hours 13 minutes

 --
 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] Algorithm for repeating calendar events

2001-07-12 Thread Matthew Loff


libmcal is a pain in the butt to set up, but once it's set up, it has
some great features...  I had to write a PHP page that handled
scheduling of appointments, and mcal saved me a lot of time, after I
spent the initial 2 hours pulling my hair to set it up. :)


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 12, 2001 2:28 PM
To: Reuben D Budiardja
Cc: php php
Subject: Re: [PHP] Algorithm for repeating calendar events


Not quite live yet.  You'll see it when it goes live.

By the way, there is a very complete date class in PEAR that has pretty
much everything you would need to build a calendar app.  See
pear/Date/Calc.php

-Rasmus

On Thu, 12 Jul 2001, Reuben D Budiardja wrote:

 Great, I'd like to steal it too then :). I just check php.net, but 
 couldn't find it. In what section would you put it?

 Thanks.
 Reuben D. Budiardja

 On Tuesday 10 July 2001 05:34 pm, Rasmus Lerdorf wrote:
   Have any of you seen those calendar applications that let you 
   program events that repeat periodically? You can set it to repeat 
   every thursday, every week, every third week, every six months, 
   and so on?
  
   I am developing such an application in PHP and I know that the 
   client will ask for this feature. So in thinking ahead of time, I 
   would like to know if any of you has had any experience developing

   such an application so that you can point me in the right 
   direction.
 
  I just wrote one on the plane back from LinuxTag.  I'll get it up on

  php.net soon and you can steal it from there.
 
  -Rasmus



-- 
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] Thumbnail Generation from DB Stored Images.

2001-07-12 Thread Matthew Loff


Jason--

There are many reasons I don't quite recommend creating the thumbnails
on the fly with ImageMagick:

1) I've heard many say that storing/retrieving images from MySQL
databases isn't the greatest idea, because you end up with -huge-
tables, which leads to long query times.
2) Resizing a JPEG on the fly is a very CPU intensive task
3) Calling the shell, then calling the ImageMagick program is more and
more overhead.

If you insist on storing the images in the database, then you're best
off storing the thumbnails in there too.  If you insist on creating
thumbnails on the fly, then I suggest you install PHP 4.0.6 with GD
2.0.1 and use ImageCopyResampled() or ImageCopyResized() to do it--
it'll save you from spawning a shell and running an external program.

I had to create a Real Estate site, where house listings could be posted
with photos to accompany them... When a photo was uploaded (HTTP
upload), the script would use ImageCreateTrueColor() to create two new
images, then I called ImageCopyResampled() to resize the image to two
different sizes-- one thumbnail for search results, then a larger one
for listing details.

I stored these images in a directory in the format:

/images/1_thumb.jpg
/images/1_full.jpg

And so on... The number (1 in this case) corresponded with the
auto_increment ID of the MySQL record for the item.

When the listing is deleted, PHP deletes the associated images
automatically (if they exist).

Good luck!


-Original Message-
From: Jason Bell [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 12, 2001 7:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Thumbnail Generation from DB Stored Images.


Hello! I have images stored in a MySQL Database. I can retrieve the
images and display them without a problem, but I'd really like to be
able to create thumbnails. The code that I've written just doesn't seem
to work. Preferably, I'd like to pull the image from the database, and
create the thumbnail for display, without ever writing an image to the
disk. If this is not possible, I'd like to know alternate methods. I'm
using imagemagick's convert utility to create the thumbs. Here is my
code:

getpic.php:

?php
if($id) {
@MYSQL_CONNECT(localhost,username,mypassword);
@mysql_select_db(daelic);
$query = select image,type from images where id=$id;
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0,image);
$type = @MYSQL_RESULT($result,0,type);
Header( Content-type: $type);
echo $data;
};
?

tgen.php:

?php
if ($id) {
  $src = getpic.php?id=$id;
  $thumb = passthru(convert -geometry 40% $src jpeg:-);
  print $thumb;
 };
?


I know that getpic.php works.  I can use it in like this:   echo IMG
SRC='getpic.php?id=$id'; and it will output the fullsize graphic in
place. I'm trying to get to a point where I can use tgen.php in the same
mannor. I can use the same convert command if I use an actual file, like
pics/mypic.jpg and it works, so the command is good.

any help at all would be very appreciated,

Jason Bell


-- 
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] Protecting a directory

2001-07-12 Thread Matthew Loff


With PHP, not without creating an index file.

If the server is apache, you can simply create a .htaccess file in the
directory, containing:

order deny,allow
deny from all 


I'm pretty sure that should do it.


-Original Message-
From: Tom Malone [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 12, 2001 11:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Protecting a directory


I hope this is the appropriate place for this post - I apologize in
advance if I'm stepping on any toes... I have created a database to
manage my contacts in a sub-directory of my site. I used php user
authentication to protect the directory, but you can still see the
directory index by entering http://www.somefakeurl.com/admin/.
Since i do not want to use an index page in that directory, is there any
way to keep people from seeing that index using PHP?

Thank you

Tom


-- 
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 installed - MySql Server can't connect

2001-07-12 Thread Matthew Loff


Maybe his mysql.sock file isn't in /var/lib/mysql/mysql.sock?

Mine is /tmp/mysql.sock


-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 1:31 AM
To: Gaylen Fraley
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP installed - MySql Server can't connect


This happens when the mysql server you are running is different from the
version of the mysql library php was linked against.  If you compiled
php using --with-mysql you get the mysql client library that comes
bundled with PHP which may not match your mysql server and thus may look
for the mysql.sock file in the wrong place.

To fix this, either figure out where your mysql.sock file is and specify
it directly in your mysql_connect() call (see
http://php.net/mysql_connect) or recompile PHP against your system's
mysql client library by using --with-mysql=/usr assuming your mysql
client library is in /usr/lib/mysqlclient.*

-Rasmus

 PHP install went perfectly.  phpinfo shows MySql installed.  But, when

 I try to start Mysql, I get:

 ERROR 2002: Can't connect to local MySQL server through socket 
 '/var/lib/mysql/mysql.sock' (111)

 What and why?

 Please reply to my e-mail address if you can help.  Thanks!

 --
 Gaylen
 [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] Mail Bcc to a $variable?

2001-07-11 Thread Matthew Loff


Ahh!  I forgot to meantion the \n at the end of the headers in my
original post...


-Original Message-
From: Marcus James Christian [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 1:37 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Mail Bcc to a $variable?


Like  this...

$headers = From: Me [EMAIL PROTECTED]\nBCC:$recipients\n;

Or somewhere else?

Thanks,
Marcus

Russell Chadwick wrote:

 Try a newline at the end of $headers

 -Original Message-
 From: Marcus James Christian [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 11, 2001 10:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Mail Bcc to a $variable?

 Hello,

 Ok I've got a script going to  a Bcc but can't seem to get it to work 
 when it's like this?

 ?php
 include(mailinglist.inc);
 $recipients = mailinglist.inc;
 $headers = From: Me [EMAIL PROTECTED]\nBCC:$recipients;

 include(password.inc);
 if($mailusername == $username  $mailpassword == $password); {
 mail($to, $subject, $bodytext, $headers);
 };

 ?

 So how do I get mail to Bcc a variable like $recipients?   Recipients
 being a huge text file of hundreds of email addy's.

 -Marcus

 --
 Marcus James Christian - UNLIMITED -
 Multimedia Internet Design
 http://mjchristianunlimited.com

 Proudly presents the music of CHROMATICUS
 at http://chromaticus.com
 and http://artists.mp3s.com/artists/275/chromaticus.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]

--
Marcus James Christian - UNLIMITED -
Multimedia Internet Design
http://mjchristianunlimited.com

Proudly presents the music of CHROMATICUS
at http://chromaticus.com
and http://artists.mp3s.com/artists/275/chromaticus.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] Back/Forward

2001-07-11 Thread Matthew Loff



Since IDs can disappear when records are delted, I think it's best to do
a COUNT() first, then retrieve your listings with

SELECT * FROM table WHERE blah LIMIT offset,number_to_retrieve;


-Original Message-
From: scott [gts] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 2:55 PM
To: php
Subject: RE: [PHP] Back/Forward


how do you have the data stored?
by ID number?

if you have it stored by ID number, just
put next/back links something like this:

?
// here, find out the max number of rocks
$prev = (($id0)? $id-1 : 0 );
$next = (($id$max)? $id+1 : $max );
?

A HREF=rock.php?id=?= $prev ?previous/A
A HREF=rock.php?id=?= $next ?next/A



 -Original Message-
 From: Devin Atencio [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 11, 2001 2:53 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Back/Forward
 
 
 
 I have a page that brings up the info on a rock, I wanted to add the 
 functionality of doing like a next and previous option to go thru 
 all the rocks in my database. I can't figure out how to exactly do 
 this, could someone give me some help?
 
 
 --
 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] Fatal error: Call to undefined function: mysql_pconnect() in ...

2001-07-11 Thread Matthew Loff


Have you tried a non-persistant connection?  Does that work?

mysql_connect()?


-Original Message-
From: Tom Beidler [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 3:12 PM
To: php list
Subject: [PHP] Fatal error: Call to undefined function: mysql_pconnect()
in ...


I'm working with an new ISP and I'm having trouble connecting to MySQL
through PHP 4.

Here's some server specifics;
PHP Version 4.0.4pl1
Apache/1.3.14

DBA supportenabled
Supported handlersgdbm db2 db3

I'm getting the following error;

Fatal error: Call to undefined function: mysql_pconnect() in /home/...
on line 5

Line 5 is;

$connection = mysql_pconnect(localhost,myuserid,mypass)

It's a new box so I'm assuming it's something in the configuration. I
don't have access to the server so I'm trying to troubleshoot for the
ISP. Any help would be greatly appreciated.

Thanks,
Tom


-- 
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] Back/Forward

2001-07-11 Thread Matthew Loff


Oh!  My mistake... I thought he was retrieving several listings at a
time...

If he's doing a single record each page, your method is definitely the
best that I can think of. :)


-Original Message-
From: scott [gts] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 3:58 PM
To: php
Subject: RE: [PHP] Back/Forward


ah yes... that was my quick-n-dirty way ;)

you could also do it this way:

file.php?id=1act=next

if ($act eq 'next') {
  $sql = SELECT id FROM table WHERE id  '$id' LIMIT 1;
}
elsif ($act eq 'prev') {
  $sql = SELECT id FROM table WHERE id  '$id' LIMIT 1;
}


but that's also a quick-n-dirty way, becuase it
doesnt know when the first/last record is...

however, that's less quick and less dirty than
the original code i posted 

TIMTOWTDI - there's more than one way to do it. :)

 -Original Message-
 From: Matthew Loff [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 11, 2001 3:59 PM
 To: 'scott [gts]'; 'php'
 Subject: RE: [PHP] Back/Forward
 
 
 
 
 Since IDs can disappear when records are delted, I think it's best to 
 do a COUNT() first, then retrieve your listings with
 
 SELECT * FROM table WHERE blah LIMIT offset,number_to_retrieve;
 
 
 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 11, 2001 2:55 PM
 To: php
 Subject: RE: [PHP] Back/Forward
 
 
 how do you have the data stored?
 by ID number?
 
 if you have it stored by ID number, just
 put next/back links something like this:
 
 ?
 // here, find out the max number of rocks
 $prev = (($id0)? $id-1 : 0 );
 $next = (($id$max)? $id+1 : $max );
 ?
 
 A HREF=rock.php?id=?= $prev ?previous/A
 A HREF=rock.php?id=?= $next ?next/A
 
 
 
  -Original Message-
  From: Devin Atencio [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 11, 2001 2:53 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Back/Forward
  
  
  
  I have a page that brings up the info on a rock, I wanted to add the
  functionality of doing like a next and previous option to go
thru 
  all the rocks in my database. I can't figure out how to exactly do 
  this, could someone give me some help?
  
  
  --
  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 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] using GetImageSize in a directory of images

2001-07-11 Thread Matthew Loff


(This is assuming you'll have all images in the directory, and no other
file types...)

$directory = opendir(./);

$dirEntry = readdir($directory);  // Skip .
$dirEntry = readdir($directory);  // Skip ..

while($dirEntry = readdir($directory))
{
// GetImageSize Code for Each $dirEntry Goes Here
}

closedir($directory);


If you may have other types of files besides images, you could easily
check each filename with strstr() or a regex.


-Original Message-
From: Rory O'Connor [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 3:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] using GetImageSize in a directory of images


recent posts introduced me to the handy GetImageSize, and it's just what
I need!  What I want to do is write a script that will go through a
directory of images and write [image name];[image dimensions] to a file
so I can query that into my products database for dynamic use on my
site.

BUT, i'm a super-duper PHP newbie and i'm unfamiliar with the syntax for
looping thru all fils in a given directory.  Can anyone point me in the
right direction?  

Thanks so much!



providing the finest in midget technology

-- 
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] mail() function 30minute delay??

2001-07-11 Thread Matthew Loff


Sendmail should (by default) attempt to send the mail immediately...  If
it can't deliver it on that attempt, then it should be queued to send
again later (30 mins?)...  

Unless you've configured sendmail differently, it should attempt to
deliver as soon as the mail is sent from PHP.

You can reduce the queue time of sendmail when you run it... For
example, on my system, it's:

# /usr/sbin/sendmail -bd -q15m

-bd---Tells sendmail to enter daemon mode
-q15m---Tells sendmail to processes the queue every 15 minutes.

If you can't fix sendmail, your alternatives are:

1) Connect to an SMTP server directly using fsockopen() and send the
mail that way (I don't recommend it)
2) Reconfigure php.ini to use a different MTA (mail transport agent)

Anyone else have additional suggestions?


-Original Message-
From: Ben Rigby [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 7:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mail() function 30minute delay??


hi.
i'm using the mail() function to send email from a PHP script on a UNIX
system. sample code is:

$result=mail ($mail_to, $mail_subject, $mail_body, $mail_headers);

and it seems to be placing the mail in the sendmail queue which gets
sent every 30 mintues. is there a PHP mail() option or another mailing
command that can speed up this time?

or, does this sound like a sendmail setting?

thanks for any help!
ben




-- 
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: Warning: mail() is not supported in this PHP build

2001-07-11 Thread Matthew Loff


The build date in phpinfo() is the date that configure was run from
scratch on the build...

Try deleting config.cache in the PHP directory, then rerun configure.


-Original Message-
From: Kyle [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 11, 2001 10:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Warning: mail() is not supported in this PHP build


Somebody mentioned that PHP checks to see if sendmail was installed when
it was installing.

Just I have another question, does anyone know where PHP puts everything
when it installs? I keep recompiling PHP and Apache, and every time I
run
phpinfo() it still has the original build date. I tried deleting:

/usr/local/lib/php

/usr/local/include/php

apache src/src/modules/php4/

- Kyle

Kyle [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Warning: mail() is not supported in this PHP build in testmail.php on 
 line
1

 I don't remember disabling it when I compiled, and I can't find 
 anything
to
 specifically enable it when compiling.  I'm running PHP 4.0.6.  My 
 sendmail_path is correct in my php.ini.

 I tried recompiling php4 and apache but it seems that it isn't 
 overwriting the php modules.  What files are used? I tried deleting 
 the apache 1.3.20
 src/src/modules/php4 folder.

 Any help would be greatly appreciated.





-- 
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 to add a new color to JPEG

2001-07-10 Thread Matthew Loff


Is this only a problem with PHP/GD versions previous to 4.0.6/2.0.1?

Does the new ImageCreateTrueColor() function fix this issue?

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



-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 7:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black
box, select the yellow you want, and then click ok. Then, click the
button above the yellow - that will select the eyedropper. Then, go to
the color palette opposite. click on the 3rd icon underneath it, which
allows you to add eyedropper color to the palette.

That should work. mail me if you get stuck, with your image
dimensions/copy of image.

James

 -Original Message-
 From: SED [mailto:[EMAIL PROTECTED]]
 Sent: 11 July 2001 00:21
 To: 'James Cox'; [EMAIL PROTECTED]
 Subject: RE: [PHP] How to add a new color to JPEG


 How can I add colors to JPEG-palette? I never new It had a special 
 palette (until now :).

 -Original Message-
 From: James Cox [mailto:[EMAIL PROTECTED]]
 Sent: 10. júlí 2001 22:38
 To: Jeff@Hyrum. Net
 Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
 Subject: RE: [PHP] How to add a new color to JPEG



 hmm.

 If what I understand from your ImageColorClosest(); function, why 
 don't you just add yellow to the palette? that way it can be found by 
 the function, but isn't used in the image?

 HTH,

 James Cox

 apologies jeff for sending it twice to you :)

  -Original Message-
  From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
  Sent: 10 July 2001 23:00
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: RE: [PHP] How to add a new color to JPEG
 
 
  Hmm, I create my image from scratch and haven't tried drawing on an 
  existing pallette.  If your start image is always a blank black box 
  you could always create it on the fly...
 
   -Original Message-
   From: SED [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, July 10, 2001 1:52 PM
   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: RE: [PHP] How to add a new color to JPEG
  
  
   That’s the problem, if I do that and the color is not used before 
   in

   the image, I get only the closest match. Note, if I add a yellow 
   pixle into the JPEG-image with Photoshop, save it and try it 
   again, then I can use the yellow for my text. However, I don’t 
   want to have

   the yellow dot in my picture, only a yellow text.
  
   SED
  
   -Original Message-
   From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
   Sent: 10. júlí 2001 17:26
   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: RE: [PHP] How to add a new color to JPEG
  
  
   Could try this:
  
   $blue = ImageColorAllocate($image, 0, 0, 255);
  
   Substitue blue for yellow and you'll be the appropriate RGB values

   for the numbers.
  
   Jeff
  
-Original Message-
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 1:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to add a new color to JPEG
   
   
Lets say I have a black JPEG-image and I want to add yellow text

to it, how can I define the yellow color?
   
According to the manual, you can only get closest value of your 
desired color by letting the ImageColorClosest() find it. 
Therefore, if the image is totally black, you can not get the 
yellow color. I have not found a way to do this though I believe

I

have tried everything. And yet, I have not found any documents 
covering this other than PHP-manual.
   
Do you know of a way to do this? Or do you know of other 
manuals/tutorials covering this issue?
   
Regards,
Sumarlidi Einar Dadason
   
SED - Graphic Design
   
--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is
--
   
   
   
   
   
--
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 General Mailing List (http://www.php.net/)
 To 

RE: [PHP] Blind Carbon Copies? with mail ()???

2001-07-10 Thread Matthew Loff


(Have the To: address be yourself, or a mail account that simply dumps
to /dev/null)

$to = [EMAIL PROTECTED];
$subject = Subject of Message;
$message = blah blah blah...
$headers = From: Optional Name of List [EMAIL PROTECTED]\nBCC:
[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED];

mail($to, $subject, $message, $headers);

That's how I do it...


-Original Message-
From: Marcus James Christian [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 9:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Blind Carbon Copies? with mail ()???


Hello,

I want to send Blind Carbon Copies or Bcc:  to a huge 100-200 person
mailing list.

But the PHP mail() has a  to, subject, body     format.

How can I get a Bcc: in there?

Thanks,
Marcus

--
Marcus James Christian - UNLIMITED -
Multimedia Internet Design
http://mjchristianunlimited.com

Proudly presents the music of CHROMATICUS
at http://chromaticus.com
and http://artists.mp3s.com/artists/275/chromaticus.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 to add a new color to JPEG

2001-07-10 Thread Matthew Loff


I believe the problem is GD previous to version 2.0.1... They could only
create images with indexed (256?) colors...

I had a PHP script that used GD to resize JPEGs to smaller thumbnails
automatically... And it would always reduce them to 256 colors, until I
upgraded to PHP 4.0.6, GD 2.0.1, and used ImageCreateTrueColor()

--Matt


-Original Message-
From: SED [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 9:17 PM
To: 'James Cox'; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


I'm not sure I follow. I know this is how I would do it if I had a
GIF-image, but this does not include JPEG. That’s the main issue. The
JPEG is saved as an RGB-image, not index colored like GIF, therefore I'm
asking about how to add a RGB color to a non-index-color-image (JPEG).
Are you sure you are talking about JPEG, not GIF?

SED

-Original Message-
From: James Cox [mailto:[EMAIL PROTECTED]] 
Sent: 10. júlí 2001 23:28
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] How to add a new color to JPEG


That's something you would need to do in photoshop.

open your image, select save for web, look to the left of the image, you
should see some buttons and a black box. you need to click on the black
box, select the yellow you want, and then click ok. Then, click the
button above the yellow - that will select the eyedropper. Then, go to
the color palette opposite. click on the 3rd icon underneath it, which
allows you to add eyedropper color to the palette.

That should work. mail me if you get stuck, with your image
dimensions/copy of image.

James

 -Original Message-
 From: SED [mailto:[EMAIL PROTECTED]]
 Sent: 11 July 2001 00:21
 To: 'James Cox'; [EMAIL PROTECTED]
 Subject: RE: [PHP] How to add a new color to JPEG


 How can I add colors to JPEG-palette? I never new It had a special
 palette (until now :).

 -Original Message-
 From: James Cox [mailto:[EMAIL PROTECTED]]
 Sent: 10. júlí 2001 22:38
 To: Jeff@Hyrum. Net
 Cc: [EMAIL PROTECTED]; Php-General@Lists. Php. Net
 Subject: RE: [PHP] How to add a new color to JPEG



 hmm.

 If what I understand from your ImageColorClosest(); function, why
 don't you just add yellow to the palette? that way it can be found by 
 the function, but isn't used in the image?

 HTH,

 James Cox

 apologies jeff for sending it twice to you :)

  -Original Message-
  From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
  Sent: 10 July 2001 23:00
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: RE: [PHP] How to add a new color to JPEG
 
 
  Hmm, I create my image from scratch and haven't tried drawing on an
  existing pallette.  If your start image is always a blank black box 
  you could always create it on the fly...
 
   -Original Message-
   From: SED [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, July 10, 2001 1:52 PM
   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: RE: [PHP] How to add a new color to JPEG
  
  
   That’s the problem, if I do that and the color is not used before
   in

   the image, I get only the closest match. Note, if I add a yellow
   pixle into the JPEG-image with Photoshop, save it and try it 
   again, then I can use the yellow for my text. However, I don’t 
   want to have

   the yellow dot in my picture, only a yellow text.
  
   SED
  
   -Original Message-
   From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
   Sent: 10. júlí 2001 17:26
   To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: RE: [PHP] How to add a new color to JPEG
  
  
   Could try this:
  
   $blue = ImageColorAllocate($image, 0, 0, 255);
  
   Substitue blue for yellow and you'll be the appropriate RGB values

   for the numbers.
  
   Jeff
  
-Original Message-
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 1:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to add a new color to JPEG
   
   
Lets say I have a black JPEG-image and I want to add yellow text

to it, how can I define the yellow color?
   
According to the manual, you can only get closest value of your
desired color by letting the ImageColorClosest() find it. 
Therefore, if the image is totally black, you can not get the 
yellow color. I have not found a way to do this though I believe

I

have tried everything. And yet, I have not found any documents
covering this other than PHP-manual.
   
Do you know of a way to do this? Or do you know of other
manuals/tutorials covering this issue?
   
Regards,
Sumarlidi Einar Dadason
   
SED - Graphic Design
   
--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is
--
   
   
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional 

RE: [PHP] Blind Carbon Copies? with mail ()???

2001-07-10 Thread Matthew Loff


I'm not sure what you mean by that...

You could easily do:
$headers = From: Optional Name of List [EMAIL PROTECTED]\nBCC: .
$bcc_addresses;

(The dot . will concatenate the strings together)

If you didn't want the From:  Header in there, you could always just:
$headers = BCC:  . $bcc_addresses;

...or if you had the BCC e-mail addresses in one-dimensional array...
$headers = BCC:  . implode(,, $bcc_emails_array);

Best of luck!

-Original Message-
From: Marcus James Christian [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 9:48 PM
To: Matthew Loff
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Blind Carbon Copies? with mail ()???


Man that is awesome!

Can the Bcc in the headers somehow be a $variable  ?

Thanks,
Marcus

Matthew Loff wrote:

 (Have the To: address be yourself, or a mail account that simply dumps

 to /dev/null)

 $to = [EMAIL PROTECTED];
 $subject = Subject of Message;
 $message = blah blah blah...
 $headers = From: Optional Name of List [EMAIL PROTECTED]\nBCC: 
 [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED];

 mail($to, $subject, $message, $headers);

 That's how I do it...

 -Original Message-
 From: Marcus James Christian [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 10, 2001 9:17 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Blind Carbon Copies? with mail ()???

 Hello,

 I want to send Blind Carbon Copies or Bcc:  to a huge 100-200 person 
 mailing list.

 But the PHP mail() has a  to, subject, body     format.

 How can I get a Bcc: in there?

 Thanks,
 Marcus

 --
 Marcus James Christian - UNLIMITED -
 Multimedia Internet Design
 http://mjchristianunlimited.com

 Proudly presents the music of CHROMATICUS
 at http://chromaticus.com
 and http://artists.mp3s.com/artists/275/chromaticus.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]

--
Marcus James Christian - UNLIMITED -
Multimedia Internet Design
http://mjchristianunlimited.com

Proudly presents the music of CHROMATICUS
at http://chromaticus.com
and http://artists.mp3s.com/artists/275/chromaticus.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]




RE: [PHP] Variables

2001-07-10 Thread Matthew Loff


You could always do...

If(!strcmp($text1, $text2))
{
equal;
} else {
not equal;
}


-Original Message-
From: James Bartlett [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 10, 2001 10:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Variables


No it doesn't seem to like that either...

The weird thing is that if I used  instead of = it's fine...although
that is not the result I want...
  - Original Message - 
  From: Tyler Longren 
  To: James Bartlett 
  Cc: [EMAIL PROTECTED] 
  Sent: Wednesday, July 11, 2001 3:21 AM
  Subject: Re: [PHP] Variables


  Try
  if($text1 == $text2)
  {
  echo The variables are equal;
  }
  else
  {
  echo The variables are not equal;
  }

  notice the change in the if()

  Tyler


  On Wed, 11 Jul 2001 03:12:56 +0100
  James Bartlett [EMAIL PROTECTED] wrote:

   Hi,
   
   This might sound really simple but plz humour me :)
   
   How can I tell if two text variables are equal to one another?
   
   If I use..
   
   if($text1 = $text2)
   {
   echo The variables are equal;
   }
   else
   {
   echo The variables are not equal;
   }
   
   then the code in the else state is always printed even if I know for
a fact that the variables are equal...
   
   Any suggestions?
   
   James
   


  -- 
  Tyler Longren
  [EMAIL PROTECTED]
  Currently Unemployed
  www.noworkfortyler.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] ok!

2001-07-08 Thread Matthew Loff


A quick plug for Mysql-front at http://www.mysqlfront.de/ that Hennik
meantions here...

If you use Win98/ME/2k/NT, and are looking for a utility to admin a
MySQL database, this is hands-down the best front end I've ever used...



-Original Message-
From: Henrik Hansen [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 05, 2001 5:42 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] ok!


Johan Vikerskog (ECS) [EMAIL PROTECTED] wrote:

  Simple question and i know that i shouldent post it here.
  Hope you bare with me.
  
  I have a mysql database that is called supportdb
  How do i create an account for my user so he can connect to this
database?

http://www.mysql.com/doc/P/r/Privilege_system.html

  
  Do i use mysqlacccess?

i only know of mysqlfront.de

-- 
Henrik Hansen


-- 
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] Running PHP as a cron job....

2001-07-08 Thread Matthew Loff


Make sure the code is like:

#!/usr/local/bin/php -q
?php

...code...

?

(obviously the location of php may be different, but the above works for
me, I'm running a daily e-mail batch from a PHP script via cron)

Make sure you chmod ug+x it.


-Original Message-
From: James, Yz [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 6:57 PM
To: Ben Bleything; [EMAIL PROTECTED]
Subject: Re: [PHP] Running PHP as a cron job


Hi Ben,

When running it as a normal PHP file, I get the cron daemon emailing me
stuff like:

automation/mail.php: ?: No such file or directory
automation/mail.php: =: command not found
automation/mail.php: =: command not found
automation/mail.php: line 7: syntax error near unexpected token
`mail(emailaddress@takenout,'
automation/mail.php: line 7: `mail(emailaddress@takenout, mail test,
$mailcontent, $sender);'


When running it with the Perl style line at the top (as you suggested) I
get, no such file or directory.

The script is Chmodded to 755 in both cases.  And I saved it as a .php
and .cgi file (with the root to bin/php in it).  God knows what I'm
doing wrong
;)

James.

 How are you executing the script?  Does it come by and run 'php 
 yourscript.php' or does the script have a shebang ('#!/usr/bin/php') 
 in it?  I've found that works well... just put that as the first line,

 and it behaves as a shell script (after you make it executable, of 
 course)

 Ben

 -Original Message-
 From: James, Yz [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, July 08, 2001 3:39 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Running PHP as a cron job

 Hi all,

 This is probably going to sound incoherant, but

 Do I have to do anything (other than change the permissions of a php
 file)
 to get it to run as part of a cron job?  I created an extremely simple

 file that should just send a blank email to me (using mail()).  I got 
 an email
 from the cron daemon saying, bad token, or something like that, yet
 when
 executed through a browser, the script behaves as it should.

 Do I have to write the php scripts differently to how I would if they 
 were to be displayed in a browser?

 Neeed...Slp ;)

 Cheers,
 James.



 --
 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] Mosinskis's autoreply

2001-07-08 Thread Matthew Loff


Yep... Getting them here too.


-Original Message-
From: Ben Bleything [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 8:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mosinskis's autoreply


Just out of curiosity, is everyone else receiving auto-replies from
Peter Mosinskis when they post to the list?  I know I am.
 
=  Ben


-- 
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: poor HTML syntax crashing (!) netscape

2001-07-08 Thread Matthew Loff


I completely agree, Dave...  

I use IE 6 for browsing, but when I develop sites, I always test them
for backwards compatibility all the way down to Netscape 3.0.  If your
site renders properly in NS 3.0, then you can rest assured it will
render correctly for the majority of web users out there.


-Original Message-
From: DAve Goodrich [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 9:00 PM
To: Christian Calloway; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: poor HTML syntax crashing (!) netscape


Yes Netscape will be a problem for poor code and MSIE will not. HTML is
very straightforward like any other language, learn to write it properly
and it will do nothing that surprises you. A requirement for proper
syntax is a good thing in your delivery method (the browser).

PHP will roll over and die if you leave a ';' off the end of a line, but
no one claims it sucks. Don't shoot the messenger

View the offending page in MSIE, save to file, send to me directly, and
I'll be happy to take a look at it for you. We are a cross platform shop
and test everything on MSIE/Netscape 4+ on Mac, Windows, and Unix/Linux
every day.

DAve

on 7/8/01 2:52 PM, Christian Calloway at [EMAIL PROTECTED] wrote:

 I've had the same problem with Netscape, where it would crash/choke on

 any platform. I never figured it out, but it has something to do with 
 Netscape choking on your HTML, it has nothing to do with CSS or 
 Javascript or PHP for that matter. I'm not an IE fan, but lets face 
 it, Netscape sucks.
 
 
 Tom Carter [EMAIL PROTECTED] wrote in message 
 02bb01c103fe$c51d1ac0$0a00a8c0@bjorn">news:02bb01c103fe$c51d1ac0$0a00a8c0@bjorn...
 Hi guys,
 
 I have an interesting situation at the moment... my (slightly sloppy)

 HTML is obviously missing a closing tag here or there but displays 
 fine in
 opera,
 ie etc however when I try and view it netscape (4.x, windows, linux, 
 any
 platform) netscape just nice and cleanly crashes!! If anyone knows of
a
 bug
 which would cause netscape to do this then please let me know. The 
 code in question is very dynamic (what I mean is that it can vary by 
 quite a lot depending upon many many different things). Its qutie 
 hard to debug, especially seeing as the page returned is browser 
 specific.. the one thing
 I
 have ruled out is that it is JavaScript.. I removed all of that and 
 no change.
 
 Any tips will be helpful... in the meanwhile I'm going to go thru all

 my functions to attempt to work out what is doing it  *yawn*
 
 TIA
 Tom.
 
 
 

--
Dave Goodrich
Director of Interface Development
Reality Based Learning Company
9521 NE Willows Road, Suite 100
Redmond, WA 98052 
Toll Free 1-877-869-6603 ext. 237
Fax (425) 558-5655 
[EMAIL PROTECTED] 
http://www.rblc.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]




  1   2   >