RE: [PHP] RE: html in my form? bad things! help help help!

2001-07-16 Thread Ray Dow

Once you open up ANY HTML tag to the public you open a huge can of worms and
trouble, like the following for example

a href=http://php.net; onmousemove=javascript:alert('Blar Blar
Blar');Click me!/a

My javascript is not great (I could not think of anything more damaging) but
its pretty clear what the possibilities are.

Strip all tags and use a custom system is my advice




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, 16 July 1979 3:59 PM
 To: Ray Dow; [EMAIL PROTECTED]
 Subject: Re: [PHP] RE: html in my form? bad things! help help help!
 
 
 on 7/16/01 2:03 AM, Ray Dow at [EMAIL PROTECTED] wrote:
 
  Everything removed by strip_tags(), including a 
 href=somelinkclick 
  me/a (you original example)
  
  See the problem?
 
 Everything isn't removed if you set it up like this:
 
 
 strip_tags($string,a,i,b)
 
 
 that part is working fine, it's tags with missing quotes that 
 have me worried, like this:
 
 a href=http://www.someplace.comMy site!/a
 
 
 
 -- 
 [EMAIL PROTECTED]
 http://futurebird.diaryland.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] Re: Question about strlen I think

2001-07-16 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Dennis Kaandorp) wrote:

Ah.  I see why you're having trouble: documentation of the 'F' modifier has 
apparently be excised from the manual since the preg_replace_callback() has 
replaced it in PHP 4.0.5.  If you've got 4.0.5, use the new function 
instead.  If you've got an earlier version, here's the info on 'F':

If this modifier is set, preg_replace() treats the replacement parameter 
as a function name that should be called to provide the replacement string. 
The function is passed an array of matched elements in the subject string. 
NOTE: this modifier cannot be used along with /e modifier; and only 
preg_replace() recognizes this modifier.

For example:
$ftpdata['path'] = preg_replace(/(matchtext)/F, 
replace_func,$ftpdata['path']);

function replace_func($arr)
   {
   ...
   }

 argh.. it was to complicated for me :(
 Can you help me with this?
 $ftpdata['path'] = preg_replace($ftpdata['path']);
 Thnx
 
 Cc Zona [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  In article [EMAIL PROTECTED],
   [EMAIL PROTECTED] (Dennis Kaandorp) wrote:
 
   Is there a way to replace the spaces between the paths?
   This is what I mean:
   /uploads//by/   /dennis/
   must become
   /uploads/4sp/by/3spdennis/
 
  See http://php.net/preg-replace. You can use the e or f modifier to
  count the number of captured spaces and write that number into your
 4sp
  replacement pattern.

-- 
CC

-- 
PHP General Mailing List (http://www.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] option value

2001-07-16 Thread teo

Hi Michael!
On Sun, 15 Jul 2001, Michael Thomas wrote:

 
 how can i populate an dropdown box useing php  postgresql.
 Thanks in advance
 
if you tell me how you tried by yourself first, I'll help you
further ;)

it's trivial with Javascript, but if you don't want to use that it's still
doable.

-- teodor

-- 
PHP General Mailing List (http://www.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] output plain HTML for CD Rom

2001-07-16 Thread David Robley

On Sun, 15 Jul 2001 16:10, Justin French wrote:
 Hi,

 I have a client who wishes to publish some catalogues to CD Rom.  Of
 course they can't be placed onto a CD using PHP code (because it would
 require the CD user to have PHP installed!!), but PHP/MySQL is
 definately the best way to build the content, since the same data is
 being used for online content as well.

 So I guess my question is, what;s the best way to creat a static site
 from dynamic content.  If it was a small site, i'd just access every
 page, view the source, copy it, and save to file, but the catalogues
 may get up over 1000 pages!!

 It also occurs to me that this would be helpfull in building dynamic
 sites monthly, but publishing a static site to the web, which would
 have better luck with search engines, and maybe even with server load /
 caching.


 I could make a script which builds / wrote HTML files to disc, no
 problem, but if the pages already exist dynamically, I thought there
 might be a way to write the HTML source (same as sent to the browser)
 to a HTML file


 Thanks

 Justin French

Scratching around in my multiple mailbox folders, I found these mesages 
on the topic. Hopefully there is some still useful info there.

##

Re: [PHP] PHP site to CDRom
Date: Wed, 18 Oct 2000 10:57:53 -0700
From: Robert V. Zwink [EMAIL PROTECTED]
To: [EMAIL PROTECTED], Andrea Resmini [EMAIL PROTECTED]


There was a message posted today for a script viewer that is probably what
you guys are looking for.  It can be found here:
http://www.angorasoftware.com/scriptviewer.html

This windows application is designed to show a parsed script file without
the need of a web server. This may be useful for CD-ROM distribution,
Stand-Alone materials, and other uses. The application starts the php
executable with a file parameter, showing the result in a HTML format.

Hope this helps.

Robert V. Zwink


##

Re: [PHP] PHP site to CDRom
Date: Wed, 18 Oct 2000 16:53:06 +0200
From: Andrea Resmini [EMAIL PROTECTED]
To: [EMAIL PROTECTED]


Phil Driscoll wrote:
 
 I do this kind of job (on windows) with some software called WinHTTrack
 http://httrack.free.fr/
 It sorts everything out for you.

Yowza!

Thanks Phil.
I went to the site above and found out that they also have a new site at
www.httrack.com, and that the thing is  also available for Linux and
Solaris.
I downloaded and simply launched it (as usual, you have your
three-screens-load of switches) and it correctly parsed and saved the
files in a safe format (index.html and then index.html, where 
is an alphanumberic combo).
Works great: anybody looking out for a quick way to move some PHP site
to a CDRom should go take a look.

Thanks again
##


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

   On a radiator repair shop: Best place to take a leak.

-- 
PHP General Mailing List (http://www.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] Free Hosting Sites

2001-07-16 Thread Bernie Kruger

I need some free PHP hosting sites.  Any url's that you can spare?

Tx
Bernie



-- 
PHP General Mailing List (http://www.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] Problem with cookie

2001-07-16 Thread Mihailo Dzigurski

Hello,

I need cookie that will expire in 15 mins. My server is in different time
zone than most of my clients. When I set cookie, the cookie is already
expired when it reach clients. I use setcookie(Test, 1, time()+600).

This problem only happens with IE, Netscape is working fine?!

Is there any solution for my problem?

Regards,
Mihailo.


_
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] Free Hosting Sites

2001-07-16 Thread Aniceto Lopez

some free host servers PHP + mySQL

http://www.jumpworld.net/
http://hosting.datablocks.net/
http://www.coolfreehost.com/
http://www.nexen.net
http://free.any.za.net

Ani López
http://www.lamundial.net
Visit us, download our music




-- 
PHP General Mailing List (http://www.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] Problem with passthru

2001-07-16 Thread Manuel Forget

I use passthru to launch an Unix command but after it's done (I verufy the
execution of the unix prog) , it seems that php does not work anymore. The
loading of a php page is infinite.
First, I think that the unix shell does not send to php the end of the
command, so I use  at the end of the command in passthru but it doesn't
do anything better.

Manuel Forget.



-- 
PHP General Mailing List (http://www.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] lack of error

2001-07-16 Thread Christian Reiniger

On Sunday 15 July 2001 17:11, Jon Yaggie wrote:
 i am generating an image.  Everything is going fine except this one
 image.  it shows only as a broken image.  even if you go directly too
 the file all you get is a broken image.  with out an error of some sort
 i am baffled where to start.  any one got an idea what may cause such? 
 here is the url you can try it.

 http://www.hvacsites.com/SiteBuilder/logo.php?tmpcolor=_dredlogo_text=
sdfdsdfasfdlogo_style=1

Works fine for me

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

These are the people who proudly call themselves hackers --
not as the term is now abused by journalists to mean a computer
criminal, but in its true and original sense of an enthusiast,
an artist, a tinkerer, a problem solver, an expert.

- ESR

--
PHP General Mailing List (http://www.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] session problem using headers

2001-07-16 Thread David Allen

Thanks for your email. I did the changes you suggested, and the page  is now
going
to input.php?= ie no record of the SID.

I added the following lines to the code.

echo SID: $SID;
and
echo SID: $PHPSESSID;

and $SID was not displayed i.e just SID: was displayed. I guess this is the
problem.
For some reason,  SID is not assigned a value. However, PHP is creating a file
in /tmp
on the server called sess_09591b3e465294959ecde0ee41f6c188 and as I said in
the last e-mail, sessions with cookies is working fine.

Thanks again for any ideas. I am using php 4.0.5 running on Sun Solaris

David


scott [gts] wrote:

 you're passing the PHPSESSID incorrectly, it seems

 you must do something like this:
   A HREF=nextpage.php??=SID?
 or
   header(Location: nextpage.php?$SID);

 what you're doing now will go to page input.php?=SID
 instead of input.php?938sa9fa98f7daf987a9s (or similar)

  -Original Message-
  From: David Allen [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 13, 2001 6:45 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] session problem using headers
 
 
  Hi,
 
  I am having problems with sessions. With cookies turned on it works
  fine. Turn off cookies it fails.
 
  I have tried both
 
  header(Location: input.php?=SID);
  header(Location: input.php?PHPSESSID=.PHPSESSID);
 
  to pass the session id to the programme input.php but neither works.
 
  The first lines of input.php are
 
  ?
  session_register(userid);
  ?
 
  userid is the variable  I wish to pass. However, I have no other code
  related to sessions in this script. Do I need in some way tell the
  script to use this session id?
 
  As a have said before, it works fine if cookies are turned on.
 
  Thanks in advance for any help.
 
  David
 
 
  --
  PHP General Mailing List (http://www.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] Re: Problem with cookie

2001-07-16 Thread Yasuo Ohgaki

IE does not accept cookie expires less than 7200 sec.
Someone mentioned it before. (I don't verified this)

Is this true?

--
Yasuo Ohgaki


Mihailo Dzigurski [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I need cookie that will expire in 15 mins. My server is in different time
 zone than most of my clients. When I set cookie, the cookie is already
 expired when it reach clients. I use setcookie(Test, 1, time()+600).

 This problem only happens with IE, Netscape is working fine?!

 Is there any solution for my problem?

 Regards,
 Mihailo.


 _
 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] the triple equal sign?

2001-07-16 Thread elias

What is the '===' ?

Please give me an example.



-- 
PHP General Mailing List (http://www.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 triple equal sign?

2001-07-16 Thread Thies C. Arntzen

On Mon, Jul 16, 2001 at 04:36:54AM -0700, elias wrote:
 What is the '===' ?
 
 Please give me an example.

( == false) is true
( === false) is false

re,
tc

-- 
PHP General Mailing List (http://www.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] report generation with PHP

2001-07-16 Thread Matthew Garman


Hello:

I wrote an small web application that interfaces a Microsoft Access
database.  The database is fairly small and simple: it is a listing of
employees, their phone number(s) and their department.  My interface
allows folks to view the phone list, search for a name, list by
department, etc., and allows certain users to update the phone book (add
employees, change phone numbers, etc).  It's a fairly typical phonebook
application.

The Access database has a macro in it that allows for the generation of a
report.  The report is a nicely formatted listing of all the employees and
their phone numbers, grouped by department.  Everybody fits on one page.
The whole purpose of this report is to be printable, and so that the one
page phone list can be distributed throughout the factory.

Now I want to be able to generate this report from the web.  It doesn't
have to use Access (and I would prefer that it didn't, so I can convert to
MySQL).  But I don't know of a nice (and easy!) way to generate such a
report.  Using HTML tables isn't acceptable---when you print, you still
get the header and footer that the browser adds (and it's unacceptable to
have everyone modify their browser's setup).  Furthermore, the printable
list has to look as close as possible to the original, because if I start
changing formats, people will get upset.

So I'm not really too sure where to start on this one.  If anyone could
offer some suggestions, and point me in the right direction, it would be
sincerely appreciated!

Thanks,
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray...
-- Pete Townshend/The Who, Won't Get Fooled Again




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




[PHP] php file extensions with IIS

2001-07-16 Thread Matthew Garman


I installed PHP 4.0 on an MS Windows 2000 server (running IIS 5.0).  It
processes files whose extension is .php but displays files with .php3
and .php4 extensions as text.

I might have specified such behavior in the original installation.  But
now I can't find out where to associate other extensions with the PHP
engine.  Mainly I want to install the phpMyAdmin package to get started
with MySQL (and get rid of MS Access :), but all the PHP files in that
package are named with .php3 or .php4 extensions.

By the way, I've been using Linux exclusively for the last few years, so
I'm not too Windows savvy.  But I'm working at an internship where
everything is Windows-based, so I'm a bit lost (but feeling more at home
by using great open source packages like PHP and MySQL :)

Thanks!
Matt

-- 
Matt Garman, [EMAIL PROTECTED]
I'll tip my hat to the new constitution, Take a bow for the new revolution
 Smile and grin at the change all around, Pick up my guitar and play
 Just like yesterday, Then I'll get on my knees and pray...
-- Pete Townshend/The Who, Won't Get Fooled Again




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




RE: [PHP] the triple equal sign?

2001-07-16 Thread Jochen Kaechelin

 What is the '===' ?
 

You can not only compare if the content of two variables
is the same ($a == $b) - you can also compare the type (integer, float...)

$a = 1;
$b = 1;

$a == $b - TRUE

$a = 1;
$b = 1;

$a === $b - FALSE  because $a is a STRING and $b is a INTEGER!

-- 
phpArbeitsgruppe in Gruendung - Jochen Kaechelin
Stuttgarter Str.3, D-73033 Goeppingen
Tel. 07161-92 95 94, Fax 07161-92 95 98
http://www.php-arbeitsgruppe.de, mailto:[EMAIL PROTECTED]





Re: [PHP] report generation with PHP

2001-07-16 Thread Morten Winkler Jørgensen

Hi Matthew,


MG Now I want to be able to generate this report from the web.  It doesn't
MG have to use Access (and I would prefer that it didn't, so I can convert to
MG MySQL).  But I don't know of a nice (and easy!) way to generate such a
MG report.  Using HTML tables isn't acceptable---when you print, you still
MG get the header and footer that the browser adds (and it's unacceptable to
MG have everyone modify their browser's setup).  Furthermore, the printable
MG list has to look as close as possible to the original, because if I start
MG changing formats, people will get upset.

Try PHP's PDF extension. That way you can create neat documents.

-- 
Kind regards,
 Mortenmailto:[EMAIL PROTECTED]



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




[PHP] how to strip just the img tag from html file?

2001-07-16 Thread sgibbs

I've created a printer-friendly version of a page (PHP/MySQL) and want to
have just the img tags automatically removed.  I thought about using
strip_tags() but I'm not able to predict what html tags to include as the
exceptions so that they would not be removed too.  How can I do this?  Thank
you!

- Shawna



-- 
PHP General Mailing List (http://www.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: Problem with cookie

2001-07-16 Thread Justin Farnsworth

You may have different behaviour between browsers, but you
are never going to be able to use this method reliably because
of the vagaries of times encountered on the client side.
Just look at the postings to this list, supposedly more
sophisticated computer users, as some postings are dated
1972, last month, 2010 et cetera.

_jef
-

Yasuo Ohgaki wrote:
 
 IE does not accept cookie expires less than 7200 sec.
 Someone mentioned it before. (I don't verified this)
 
 Is this true?
 
 --
 Yasuo Ohgaki
 
 Mihailo Dzigurski [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  I need cookie that will expire in 15 mins. My server is in different time
  zone than most of my clients. When I set cookie, the cookie is already
  expired when it reach clients. I use setcookie(Test, 1, time()+600).
 
  This problem only happens with IE, Netscape is working fine?!
 
  Is there any solution for my problem?
 
  Regards,
  Mihailo.
 
 
  _
  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]

-- 
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722

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




[PHP] Re: how to strip just the img tag from html file?

2001-07-16 Thread James Holloway

Hi Shawna

Look up preg_replace();

Assuming $file is the contents of your file -

$file = preg_replace(/img.*?/i, , $file);

James.

[EMAIL PROTECTED] wrote in message
BB6D932A42D6D211B4AC0090274EBB1D2EEF63@GLOBAL1">news:BB6D932A42D6D211B4AC0090274EBB1D2EEF63@GLOBAL1...
 I've created a printer-friendly version of a page (PHP/MySQL) and want
to
 have just the img tags automatically removed.  I thought about using
 strip_tags() but I'm not able to predict what html tags to include as the
 exceptions so that they would not be removed too.  How can I do this?
Thank
 you!

 - Shawna





-- 
PHP General Mailing List (http://www.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] sending to large mailing list

2001-07-16 Thread Adrian Teasdale

Hi

I have some mailing list programming which we've used for quite some time.
However, one of my clients now has 660 people on the list and we are getting
a timeout error on the script and class.

I'm using the Mime type class from Manuel Lemos

I'd like to know how other people handle large mailing lists?

Ade


-- 
PHP General Mailing List (http://www.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] Exec, system, passthru didn't work

2001-07-16 Thread Reuben D Budiardja


Hi,
I tried to execute the following command from the web interface using a 
system call
/usr/bin/play a_wave_file.wav

I tried exec, system, passthru, and shell_exec. None of them worked, that is 
I didn't hear any sound played. Note that I'm sitting here on the server 
itself, and tried it with a web browser in the server. The command is 
executed fine when I just copy it and run it in terminal. I also made sure 
that nothing blocked the sound card, that is, the sound card was not in use.

However, if I tried to run the same file using php as command line, it works 
find.

exec, system, passthru returns the value 2, which I don't know what it means. 

Any help on this will be appreciated. Thanks in advance.

Reuben D. Budiardja


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




[PHP] Cannot add SNMP support

2001-07-16 Thread Robert Covell

I have been trying to add snmp support into PHP 4.0.4pl1 and 4.0.6 without
success.  The box currently has ucd-snmp-4.2.1 on it and is working fine
with our mod_perl installation.  When we configure it with --with-snmp
and --enable-ucd-snmp-hack it configures fine and lists the it has found
SNMP.  The compile goes smoothly but when I try to run it returns:

Fatal error:  Call to undefined function:  snmpget() in ./snmpmonitor.
php on line 2

It is like snmp is not even compiled in.  Our configure options are:
./configure  --with-gd=/usr/local/gd1.3 --with-mysql=/usr/local/mysql
--enable-debug=no --enable-track-vars=yes --with-msql=/usr/local/Hughes
--enable-ftp --enable-snmp --with-snmp=shared --enable-ucd-snmp-hack

We did notice that configure stated that in order to use the shared libs
elsewhere we should use libtool or 1 or 3 other options.  Not sure how to do
this part.

When we do it without the shared option for --with-snmp or replace it with
/usr/local it returns:

++
|   *** ATTENTION ***|
||
| Something is likely to be messed up here, because the configure|
| script was not able to detect a simple feature on your platform.   |
| This is often caused by incorrect configuration parameters. Please |
| see the file debug.log for error messages. |
||
| If you are unable to fix this, send the file debug.log to the  |
| [EMAIL PROTECTED] mailing list and include appropiate  |
| information about your setup.  |
++


Debug.log has:
/usr/local/lib/libsnmp.so: undefined reference to `EVP_DigestInit'
/usr/local/lib/libsnmp.so: undefined reference to `EVP_DigestFinal'
/usr/local/lib/libsnmp.so: undefined reference to `EVP_md5'
/usr/local/lib/libsnmp.so: undefined reference to `HMAC'
/usr/local/lib/libsnmp.so: undefined reference to `EVP_sha1'
/usr/local/lib/libsnmp.so: undefined reference to `des_cbc_encrypt'
/usr/local/lib/libsnmp.so: undefined reference to `des_key_sched'
/usr/local/lib/libsnmp.so: undefined reference to `EVP_DigestUpdate'
/usr/local/lib/libsnmp.so: undefined reference to `RAND_bytes'
/usr/local/lib/libsnmp.so: undefined reference to `des_ncbc_encrypt'


Any suggestions would be great...

-Bob


-- 
PHP General Mailing List (http://www.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] sending to large mailing list

2001-07-16 Thread Richard Heyes

 I have some mailing list programming which we've used for 
 quite some time.
 However, one of my clients now has 660 people on the list and 
 we are getting
 a timeout error on the script and class.

set_time_limit(0);

-- 
Richard Heyes
Passwords are like underwear: don't share them, hide them under your
keyboard, or hang them from your monitor. Above all, change them
frequently

--
PHP General Mailing List (http://www.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] sending to large mailing list

2001-07-16 Thread Adrian Teasdale

Richard

Thanks for this email.  I have done that and used flush(); on the next page.
It does seem to be taking a long time and I was wondering if people use
other methods.  For example, one of the scripts I have seen can use either
mail, sendmail, or smtp as options.  I was wondering if going direct
to sendmail would be a better approach?  The idea is that this database will
expand to quite a few thousand in the near future and I want to know that
we'll be able to handle it :)  The problem is that I cleverly added the
feature that each email has a salutation which personalized to the persons
name!

Thanks for the help

Ade


  I have some mailing list programming which we've used for
  quite some time.
  However, one of my clients now has 660 people on the list and
  we are getting
  a timeout error on the script and class.

 set_time_limit(0);



-- 
PHP General Mailing List (http://www.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 strip just the img tag from html file?

2001-07-16 Thread Adrian Ciutureanu

$printerFriendlyContent = eregi_replace('img[^]*', '', $htmlContent);

You can also use
$printerFriendlyContent = eregi_replace('src=[^]*',
'src=images/spacer.gif', $htmlContent);
to preserve formatting (spacer.gif = 1x1 px transparent)

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 16 iulie 2001 14:53
 To: [EMAIL PROTECTED]
 Subject: [PHP] how to strip just the img tag from html file?
 
 
 I've created a printer-friendly version of a page 
 (PHP/MySQL) and want to
 have just the img tags automatically removed.  I thought about using
 strip_tags() but I'm not able to predict what html tags to 
 include as the
 exceptions so that they would not be removed too.  How can I 
 do this?  Thank
 you!
 
 - Shawna
 
 
 
 -- 
 PHP General Mailing List (http://www.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] submitting free-form text to a database

2001-07-16 Thread garman

Hello.  I'm creating a simple Classifieds PHP application.  It allows users 
to view classifieds by category, and add new items to the database.  For now, 
I'm using MS Access 97 as my database (although eventually I would like to 
switch to MySQL).

Anyway, one element of a classified is the description.  I have a textarea 
box where the user enters a description of the item he is selling.  If the 
user's input contains an apostrophe (aka a single quote ') or even a double 
quote, the code gets confused.

A single quote is used around values in an SQL update command.  So if the 
value itself contains a single quote (or multiple single quotes) I get an SQL 
error when trying to update the database (understandably so).

When the user input contains double quotes, PHP gets confused and thinks other 
form variables aren't set, which then confuses the SQL update command.

What kind of form processing do I need to do to fix these things?

Thanks,
Matt


-- 
PHP General Mailing List (http://www.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] report generation with PHP

2001-07-16 Thread garman

= Original Message From Morten Winkler Jørgensen [EMAIL PROTECTED]
=
Hi Matthew,

MG Now I want to be able to generate this report from the web.  It doesn't
MG have to use Access (and I would prefer that it didn't, so I can convert
to
MG MySQL).  But I don't know of a nice (and easy!) way to generate such a
MG report.  Using HTML tables isn't acceptable---when you print, you still
MG get the header and footer that the browser adds (and it's unacceptable to
MG have everyone modify their browser's setup).  Furthermore, the printable
MG list has to look as close as possible to the original, because if I start
MG changing formats, people will get upset.

Try PHP's PDF extension. That way you can create neat documents.

I forgot to mention that I already looked into the PDF extensions.  Although
it looks like it would do exactly what I want, the PDFLib isn't free for
commercial use.  As an intern, I'm not in a position to make purchase
decisions (and I'm pretty sure my supervisor won't pay for it either!).

Thanks anyway,
Matt


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




[PHP] sessions . . . .

2001-07-16 Thread Jon Yaggie

i have  three pages all begin with session_start()  one fo the variables i register on 
the first page si $directory which is used to create a unique and temp directory for 
user files.  in the first this is some stuff saved tot his directory.  in the second 
page there is information pulled fromt this directory.  in the third when i try to 
save to it i get the following erros


Warning: fopen(/body.html,a+) - Permission denied in 
/home/www/hvacsites.com/SiteBuilder/control.php on line 35

Warning: Supplied argument is not a valid File-Handle resource in 
/home/www/hvacsites.com/SiteBuilder/control.php on line 36

Warning: Supplied argument is not a valid File-Handle resource in 
/home/www/hvacsites.com/SiteBuilder/control.php on line 37

from the code

 $pg_info .= /table;
 $file = $directory/body.html;
 $handle = fopen($file, a+);
 fputs($handle, $pg_info);
 fclose($handle);

as you can see in the error $directory appears not to be there.  i didnt unregister 
it.  i didnt change it.  where did it go?  and what might have cause this??



Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0





Re: [PHP] sending to large mailing list

2001-07-16 Thread Mark Charette

From: Adrian Teasdale [EMAIL PROTECTED]
The idea is that this database will
 expand to quite a few thousand in the near future and I want to know that
 we'll be able to handle it :)  The problem is that I cleverly added the
 feature that each email has a salutation which personalized to the persons
 name!

Honestly speaking, when mailing lists grow to (somewhere past trivial)
numbers that are large it's best to use software that is designed to be
efficient at handling those numbers of people. I use ezmlm to handle a few
lists that total about 2000 people, others use majordomo or another such
list. ezmlm has options to interface w/ mysql should you want to.

The administration, handling of bounces, etc. can overwhelm!

Mark C.



-- 
PHP General Mailing List (http://www.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] submitting free-form text to a database

2001-07-16 Thread garman

= Original Message From Duncan Hill [EMAIL PROTECTED] =
On Mon, 16 Jul 2001, garman wrote:

 box where the user enters a description of the item he is selling.
 If the user's input contains an apostrophe (aka a single quote ')
 or even a double quote, the code gets confused.

addslashes()

RTM :)

I was originally using regular expressions to achieve the same effect as 
addslashes().  But I switched to addslashes() anyway, and the problem 
persists.

My guess is that MS Access uses a method other than slashes to escape quotes.

Matt


-- 
PHP General Mailing List (http://www.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] report generation with PHP

2001-07-16 Thread Marius Andreiana

În 16 Jul 2001 09:07:17 -0500 garman a scris:
 I forgot to mention that I already looked into the PDF extensions.  Although 
 it looks like it would do exactly what I want, the PDFLib isn't free for 
You can generate xml in php, write xsl to convert xml in xml-fo
and then use fop to generate pdf, it really works :)
http://xml.apache.org/fop/index.html

Marius Andreiana
--
You don't have to go to jail for helping your neighbour
http://www.gnu.org/philosophy/


-- 
PHP General Mailing List (http://www.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] submitting free-form text to a database

2001-07-16 Thread Rasmus Lerdorf

 = Original Message From Duncan Hill [EMAIL PROTECTED] =
 On Mon, 16 Jul 2001, garman wrote:
 
  box where the user enters a description of the item he is selling.
  If the user's input contains an apostrophe (aka a single quote ')
  or even a double quote, the code gets confused.
 
 addslashes()
 
 RTM :)

 I was originally using regular expressions to achieve the same effect as
 addslashes().  But I switched to addslashes() anyway, and the problem
 persists.

 My guess is that MS Access uses a method other than slashes to escape quotes.

Probably ''

Turn on magic_quotes_sybase in your php.ini file and it should work.

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




Re: [PHP] output plain HTML for CD Rom

2001-07-16 Thread Justin French

Many thanks to David and Lars.

Justin French

-- 
PHP General Mailing List (http://www.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] Exec, system, passthru didn't work

2001-07-16 Thread Rasmus Lerdorf

 I tried to execute the following command from the web interface using a
 system call
 /usr/bin/play a_wave_file.wav

 I tried exec, system, passthru, and shell_exec. None of them worked, that is
 I didn't hear any sound played. Note that I'm sitting here on the server
 itself, and tried it with a web browser in the server. The command is
 executed fine when I just copy it and run it in terminal. I also made sure
 that nothing blocked the sound card, that is, the sound card was not in use.

Does it work from the shell if you su to the web server user id and try to
run it?  99% of shell exec issues are permission-related.

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




Re: [PHP] sending to large mailing list

2001-07-16 Thread Adrian Teasdale

OK Mark

Thanks for your reply.  I'll have a look at this and see if I can use PHP
for managing the list of people, but use another app to send

Thanks again

ade

 Honestly speaking, when mailing lists grow to (somewhere past trivial)
 numbers that are large it's best to use software that is designed to be
 efficient at handling those numbers of people. I use ezmlm to handle a few
 lists that total about 2000 people, others use majordomo or another such
 list. ezmlm has options to interface w/ mysql should you want to.

 The administration, handling of bounces, etc. can overwhelm!

 Mark C.



-- 
PHP General Mailing List (http://www.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: REGEXP

2001-07-16 Thread Don Read


On 16-Jul-01 Adrian D'Costa wrote:
 Hi James,
 
 Thanks for your mail.  But I think the problem like somewhere else.
 
 I have the following:
 echo $buffer;
 There result :
 Content-Type: multipart/mixed; 
 
 This is wrong.  It should be 
 Content-Type: multipart/mixed;
  boundary=B42DA66C4EC07C9B572A58FC
 
 I don't know why it is not reading the whole string.  It seems to treat
 the *boundary* part as another line. 

It _is_ another line; it just happens to starts with whitespace. 
check RFC822.

If you have the whole message in a string (psuedo-code):

list ($h,$msg) =split(\n\n, $mailmsg);

$h=str_replace(\t,  , $h);  // tab - space
$h=str_replace(\n ,  , $h); //  nlspace - space 
// i.e. continuation of prior line 

$hdrs=split(\n, $h);

 ...

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.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] submitting free-form text to a database

2001-07-16 Thread Francis Fillion

If I remember the best things with M$ oriented database, is to to double
it so ' should be '' and it should be ok. Anyway, that's what I do
when I have to do stuff with those software.

garman wrote:
 
 = Original Message From Duncan Hill [EMAIL PROTECTED] =
 On Mon, 16 Jul 2001, garman wrote:
 
  box where the user enters a description of the item he is selling.
  If the user's input contains an apostrophe (aka a single quote ')
  or even a double quote, the code gets confused.
 
 addslashes()
 
 RTM :)
 
 I was originally using regular expressions to achieve the same effect as
 addslashes().  But I switched to addslashes() anyway, and the problem
 persists.
 
 My guess is that MS Access uses a method other than slashes to escape quotes.
 
 Matt
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Francis Fillion, BAA SI
Broadcasting live from his linux box.
And the maintainer of http://www.windplanet.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] string search

2001-07-16 Thread Joseph Bannon

I need a search function (if statement) that performs a search on a string
and if the string contains something like aol.com, performs another
function. Can anyone help me? Thanks.

Joseph

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




RE: [PHP] sessions . . . .

2001-07-16 Thread scott [gts]

any number of things could happen to the $directory variable...
it could be out of scope, gotten overwritten or unset by another
function, or it might just never have been saved to the database...

but the real problem with that code is that there are no 
error checks on the file functions.  that is a bad thing.

you should *always* check file operations for errors.
$fp = fopen( ... ) or die(Cannot open);


 -Original Message-
 From: Jon Yaggie [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 10:13 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] sessions . . . .
 
 
 i have  three pages all begin with session_start()  one fo the variables i 
 register on the first page si $directory which is used to create a unique 
 and temp directory for user files.  in the first this is some stuff saved 
 tot his directory.  in the second page there is information pulled fromt 
 this directory.  in the third when i try to save to it i get the following erros
 
 
 Warning: fopen(/body.html,a+) - Permission denied in 
 /home/www/hvacsites.com/SiteBuilder/control.php on line 35
 
 Warning: Supplied argument is not a valid File-Handle resource in 
 /home/www/hvacsites.com/SiteBuilder/control.php on line 36
 
 Warning: Supplied argument is not a valid File-Handle resource in 
 /home/www/hvacsites.com/SiteBuilder/control.php on line 37
 
 from the code
 
  $pg_info .= /table;
  $file = $directory/body.html;
  $handle = fopen($file, a+);
  fputs($handle, $pg_info);
  fclose($handle);
 
 as you can see in the error $directory appears not to be there.  i didnt 
 unregister it.  i didnt change it.  where did it go?  and what might have 
 cause this??
 
 
 
 Thank You,
  
 Jon Yaggie
 www.design-monster.com
  
 And they were singing . . . 
  
 '100 little bugs in the code
 100 bugs in the code
 fix one bug, compile it again
 101 little bugs in the code
  
 101 little bugs in the code . . .'
  
 And it continued until they reached 0
 
 
 

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




Re: [PHP] sessions . . . .

2001-07-16 Thread Jon Yaggie

Luiz

I can see from the error message the variable is empty in control.php.
however there are two pages of script before it where it does exist.   So
the problem is why isnt it also available in this part of the script?  i
have started the session on this page also which should make it avaiable.  i
do register more variables on this page but i never reregister $directory




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


- Original Message -
From: Luiz Vitor [EMAIL PROTECTED]
To: Jon Yaggie [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 9:22 PM
Subject: Re: [PHP] sessions . . . .


 Probably the $directory variable is empty or incorrect.
 Why don't you print $directory variable and see what is the value.


 Regards,
 Luiz Vitor

 - Original Message -
 From: Jon Yaggie [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, July 16, 2001 11:12 AM
 Subject: [PHP] sessions . . . .


 i have  three pages all begin with session_start()  one fo the variables i
 register on the first page si $directory which is used to create a unique
 and temp directory for user files.  in the first this is some stuff saved
 tot his directory.  in the second page there is information pulled fromt
 this directory.  in the third when i try to save to it i get the following
 erros


 Warning: fopen(/body.html,a+) - Permission denied in
 /home/www/hvacsites.com/SiteBuilder/control.php on line 35

 Warning: Supplied argument is not a valid File-Handle resource in
 /home/www/hvacsites.com/SiteBuilder/control.php on line 36

 Warning: Supplied argument is not a valid File-Handle resource in
 /home/www/hvacsites.com/SiteBuilder/control.php on line 37

 from the code

  $pg_info .= /table;
  $file = $directory/body.html;
  $handle = fopen($file, a+);
  fputs($handle, $pg_info);
  fclose($handle);

 as you can see in the error $directory appears not to be there.  i didnt
 unregister it.  i didnt change it.  where did it go?  and what might have
 cause this??



 Thank You,

 Jon Yaggie
 www.design-monster.com

 And they were singing . . .

 '100 little bugs in the code
 100 bugs in the code
 fix one bug, compile it again
 101 little bugs in the code

 101 little bugs in the code . . .'

 And it continued until they reached 0





-- 
PHP General Mailing List (http://www.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] echo vs printf

2001-07-16 Thread brother

Why should I use printf instead of echo and vice versa? 

As for today I use printf mostly but I don't know why.

brother
Mail: [EMAIL PROTECTED]
UIN: 4722160
Web: http://motd.st


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




[PHP] Re: echo vs printf

2001-07-16 Thread Steve Brett

don't echo and printf do different jobs ?

as i understand it echo will dump anything to screen, fprint will accept
formatted text args like you owe me %d dollars,$owed_amount) or something
like that.

i kind of use print by itself (harking back to the old days of basic etc)
but use echo quite a lot. only use printf when i have to put cash amounts in
and stuff like that.

Steve

Brother [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Why should I use printf instead of echo and vice versa?

 As for today I use printf mostly but I don't know why.

 brother
 Mail: [EMAIL PROTECTED]
 UIN: 4722160
 Web: http://motd.st




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




[PHP] Re: string search

2001-07-16 Thread J Smith

Joseph Bannon wrote:

 I need a search function (if statement) that performs a search on a string
 and if the string contains something like aol.com, performs another
 function. Can anyone help me? Thanks.
 
 Joseph
 

Try researching regular expressions. In PHP, look at the preg and ereg 
groups of functions.

J

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




[PHP] Re: string search

2001-07-16 Thread Steve Brett

have a look at ereg() (regular expression match)  functions in manual.
they'll do exactly what you want.

Steve

Joseph Bannon [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need a search function (if statement) that performs a search on a string
 and if the string contains something like aol.com, performs another
 function. Can anyone help me? Thanks.

 Joseph



-- 
PHP General Mailing List (http://www.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] echo vs printf

2001-07-16 Thread Don Read


On 16-Jul-01 brother wrote:
 Why should I use printf instead of echo and vice versa? 
 

printf print-formated

$a=12.3456;

echo $a, 'BR';
printf('%1.2fBR', $a);

12.3456BR
12.34BR

 As for today I use printf mostly but I don't know why.

You prolly mean print; There may be some minor differences from echo,
but i've never seen 'em. 
(i think they threw print in PHP to keep JAPHs happy).

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.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] escape char hell

2001-07-16 Thread Steve Brett

hi,

i've got myself into a bit of a mess. i have a database with approx 4000
records (mysql) and when  i populated the database i was given 4000 text
files with the product name as the file name and the description of the
product as the contents.

so i set up a text field in the table to hold the descriptions and wrote a
script in php to handle the import. all went well, client impressed etc, but
now i'm running into problems with allsorts of escape chars in the
description field and am looking for a script that will strip the escape
chars from the database ...

anyone had similar problems ? new records added to the db now have all html
chars translated on input and translated on query.

many thanks,

Steve



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




[PHP] Re: escape char hell

2001-07-16 Thread Steve Brett

sorry  posted to wrong group

Steve

Steve Brett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi,

 i've got myself into a bit of a mess. i have a database with approx 4000
 records (mysql) and when  i populated the database i was given 4000 text
 files with the product name as the file name and the description of the
 product as the contents.

 so i set up a text field in the table to hold the descriptions and wrote a
 script in php to handle the import. all went well, client impressed etc,
but
 now i'm running into problems with allsorts of escape chars in the
 description field and am looking for a script that will strip the escape
 chars from the database ...

 anyone had similar problems ? new records added to the db now have all
html
 chars translated on input and translated on query.

 many thanks,

 Steve





-- 
PHP General Mailing List (http://www.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] echo vs printf

2001-07-16 Thread Steve Brett

i seem to remember reading somewhere that print acts like (is) a function,
presumably returning false if  it cannot print to screen, whereas echo just
dumps it.

also you can drop vars in print like

print you have $points points;

whereas to echo it you'd have to concatenate the string.

Steve


Don Read [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On 16-Jul-01 brother wrote:
  Why should I use printf instead of echo and vice versa?
 

 printf print-formated

 $a=12.3456;

 echo $a, 'BR';
 printf('%1.2fBR', $a);

 12.3456BR
 12.34BR

  As for today I use printf mostly but I don't know why.

 You prolly mean print; There may be some minor differences from echo,
 but i've never seen 'em.
 (i think they threw print in PHP to keep JAPHs happy).

 Regards,
 --
 Don Read   [EMAIL PROTECTED]
 -- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.



-- 
PHP General Mailing List (http://www.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] infinite loop problem

2001-07-16 Thread Florin Covaciu

HI,
my bigest problem in the last two weeks is that I can't figure this out:
- I ' m running a script which contains an infinite loop, and displays
something from time to time, with flush() method.
- this script seems to be working with one IE window openned.
- I open a new window (CTRL + N)
and the script still works
- on the third window nothing happens (the new window doesn't display the
output from the script).
This is until I stop (by pushing the stop button) one of the others
windows(as if the new window waits for the ones before to finish something).

The same thing works perfectly in Netscape, or Opera. No mather what
version.
And also if I start another IEXPLORE proces for every window in which I want
to have this script running all of them will work.


How can I solve this problem,
Please, if You have any Idea of how to solve this problem send me an email
to:  [EMAIL PROTECTED]
Here is the script code:
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
html
head
 titleUntitled/title
/head
script language=JavaScript
!--
function moves() {
if (scrolling) window.scroll(1,50);
window.setTimeout(moves(), 100);
}
scrolling = true;
moves();
file://--
/SCRIPT
BODY onBlur = scrolling = true onFocus = scrolling = false
?
flush();
$i=0;
echo $s=0;
echo br;
while(0!=5)
{
  $i=$i+1;
  $s=$s+1;
  if($s==1000)
  {
echo $i.br;
$s=0;
 sleep(3);
  }
  echo  ;
  flush();
}
?
/body
/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] echo vs print (was echo vs printf)

2001-07-16 Thread Sheridan Saint-Michel

Ummm.  I am not sure about either having a return value... but

print you have $points points;

and

echo you have $points points;

have identical output.  You can drop a variable into an echo statement with
no problem

Sheridan

- Original Message -
From: Steve Brett [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 10:48 AM
Subject: Re: [PHP] echo vs printf


 i seem to remember reading somewhere that print acts like (is) a function,
 presumably returning false if  it cannot print to screen, whereas echo
just
 dumps it.

 also you can drop vars in print like

 print you have $points points;

 whereas to echo it you'd have to concatenate the string.

 Steve


 Don Read [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  On 16-Jul-01 brother wrote:
   Why should I use printf instead of echo and vice versa?
  
 
  printf print-formated
 
  $a=12.3456;
 
  echo $a, 'BR';
  printf('%1.2fBR', $a);
 
  12.3456BR
  12.34BR
 
   As for today I use printf mostly but I don't know why.
 
  You prolly mean print; There may be some minor differences from echo,
  but i've never seen 'em.
  (i think they threw print in PHP to keep JAPHs happy).
 
  Regards,
  --
  Don Read   [EMAIL PROTECTED]
  -- It's always darkest before the dawn. So if you are going to
 steal the neighbor's newspaper, that's the time to do it.



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


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




[PHP] RE: string search

2001-07-16 Thread Joseph Bannon

Will this work?

$string = http://www.aol.com/;;

if (ereg (^aol.com^, $string) {
}
else {
}



 I need a search function (if statement) that performs a search on a string
 and if the string contains something like aol.com, performs another
 function. Can anyone help me? Thanks.
















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




[PHP] How can I see if variable is a odd or an even number?

2001-07-16 Thread SED

Do you know if there is a function to find out if a variable contains a
odd or an even number? I checked the manual but didn't see it.

Thanks!

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]




Re: [PHP] echo vs printf

2001-07-16 Thread rm

Actually, you can do the same thing with echo.

echo you have $points points;

As I understand it, echo is not a function it's a
language something or other, supposedly it runs
slightly faster than print given the same output.

however, given it's Monday, I could be wrong.

rm

 
 also you can drop vars in print like
 
 print you have $points points;
 
 whereas to echo it you'd have to concatenate the
 string.
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.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] string replace using ereg

2001-07-16 Thread Jeroen Olthof

hi,

I want to replace strings in string using a key / value array as the
replacemant contract
basicly,
I want to find a open en close tag, pick out the word in the middle and
replace it by the value of the key that match the picked out word.
example

test test

should result in

this is a test this is a test

well, The below code works for only one replacement cause when I add another
on the same line. it will pick out
test test
als the key wordt and therefor isn't able to find this key in the array.

how can I get the reg expression so it will not only get the first occurence
of the open tag and the last of the close tag ??

please help,

kind regards
Jeroen Olthof

$ASSIGN = array(test = this is a test )

$OPENTAG = ;
$CLOSETAG = ;

while ($line[$i]) {
ereg($OPENTAG.([^*]*).$CLOSETAG, $line[$i], $regs);
$newString .= str_replace($this-OPENTAG.$regs[1].$this-CLOSETAG,
$ASSIGN[$regs[1]], $line[$i]);
}



-- 
PHP General Mailing List (http://www.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] echo vs printf

2001-07-16 Thread scott [gts]

from the manual:
[print is a language construct [EMAIL PROTECTED]]
The print() function returns a boolean indicating the status of the call. If the
write was successful, print() returns 1. If not, it returns 0. This can be used to
detect when the client has closed the connection, and appropriate measures taken. The
builtin echo does not provide this same service.


can anyone else think of any other difference between
print and echo ?

i use print, becuase that's what i'm used to...
but i'd be curious to find out if there really
is any significant differences between the way
echo and print both work.


 -Original Message-
 From: Steve Brett [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 11:49 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] echo vs printf


 i seem to remember reading somewhere that print acts like (is) a function,
 presumably returning false if  it cannot print to screen, whereas echo just
 dumps it.

 also you can drop vars in print like

 print you have $points points;

 whereas to echo it you'd have to concatenate the string.

 Steve


 Don Read [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  On 16-Jul-01 brother wrote:
   Why should I use printf instead of echo and vice versa?
  
 
  printf print-formated
 
  $a=12.3456;
 
  echo $a, 'BR';
  printf('%1.2fBR', $a);
 
  12.3456BR
  12.34BR
 
   As for today I use printf mostly but I don't know why.
 
  You prolly mean print; There may be some minor differences from echo,
  but i've never seen 'em.
  (i think they threw print in PHP to keep JAPHs happy).
 
  Regards,
  --
  Don Read   [EMAIL PROTECTED]
  -- It's always darkest before the dawn. So if you are going to
 steal the neighbor's newspaper, that's the time to do it.



 --
 PHP General Mailing List (http://www.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: string search

2001-07-16 Thread scott [gts]

read the docs for ereg... i hardly use it, so i dont know
for certain if it will match. (althouth the use of ^ at
beginning *and* end suggests that it wont do what you expect)

preg will match aol.com with this regexp:

preg_match('/aol.com/', $string )


 -Original Message-
 From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 11:49 AM
 To: PHP (E-mail)
 Subject: [PHP] RE: string search
 
 
 Will this work?
 
 $string = http://www.aol.com/;;
 
 if (ereg (^aol.com^, $string) {
 }
 else {
 }


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




RE: [PHP] How can I see if variable is a odd or an even number?

2001-07-16 Thread scott [gts]

even numbers are even becuase they're divisible by 2
w/o a remainder... use this property to your advantage:

if ( $num % 2 ) {
print $num is odd;
}
else {
print $num is even;
}

 -Original Message-
 From: SED [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 12:07 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] How can I see if variable is a odd or an even number?
 
 
 Do you know if there is a function to find out if a variable contains a
 odd or an even number? I checked the manual but didn't see it.
 
 Thanks!
 
 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] Can i use PHP to do Voice Chat?

2001-07-16 Thread Timthothy

If you have any other idea, also tell me...thanks a lot

timchan



-- 
PHP General Mailing List (http://www.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] string replace using ereg

2001-07-16 Thread scott [gts]

$text = Hello there, test.
My name is name;

$ASSIGN   = array(test = this is a test, 'name'= 'BOB', );
$OPENTAG  = ;
$CLOSETAG = ;

print preg_replace( /$OPENTAG(.*?)$CLOSETAG/e, '$ASSIGN[$1]', $text );


prints:
Hello there, this is a test.
My name is BOB


To do what you want, throw a loop statement around the preg_replace
to loop thru each line of a file... etc...  :)

 -Original Message-
 From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 12:01 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] string replace using ereg
 
 
 hi,
 
 I want to replace strings in string using a key / value array as the
 replacemant contract
 basicly,
 I want to find a open en close tag, pick out the word in the middle and
 replace it by the value of the key that match the picked out word.
 example
 
 test test
 
 should result in
 
 this is a test this is a test
 
 well, The below code works for only one replacement cause when I add another
 on the same line. it will pick out
 test test
 als the key wordt and therefor isn't able to find this key in the array.
 
 how can I get the reg expression so it will not only get the first occurence
 of the open tag and the last of the close tag ??
 
 please help,
 
 kind regards
 Jeroen Olthof
 
 $ASSIGN = array(test = this is a test )
 
 $OPENTAG = ;
 $CLOSETAG = ;
 
 while ($line[$i]) {
 ereg($OPENTAG.([^*]*).$CLOSETAG, $line[$i], $regs);
 $newString .= str_replace($this-OPENTAG.$regs[1].$this-CLOSETAG,
 $ASSIGN[$regs[1]], $line[$i]);
 }
 
 
 
 -- 
 PHP General Mailing List (http://www.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] session problem using headers

2001-07-16 Thread David Allen


Further to the last e-mail the plot thickens...

If cookies is turned on, the line

echo SID: $PHPSESSID;

displays the session id. I thought the whole idea of using $PHPSESSID was so that
sessions
would work with cookies turned off! Am I missing something here?

I disabled cookies via the preferences advanced tab in Netscape.

David


David Allen wrote:

 Thanks for your email. I did the changes you suggested, and the page  is now
 going
 to input.php?= ie no record of the SID.

 I added the following lines to the code.

 echo SID: $SID;
 and
 echo SID: $PHPSESSID;

 and $SID was not displayed i.e just SID: was displayed. I guess this is the
 problem.
 For some reason,  SID is not assigned a value. However, PHP is creating a file
 in /tmp
 on the server called sess_09591b3e465294959ecde0ee41f6c188 and as I said in
 the last e-mail, sessions with cookies is working fine.

 Thanks again for any ideas. I am using php 4.0.5 running on Sun Solaris

 David

 scott [gts] wrote:

  you're passing the PHPSESSID incorrectly, it seems
 
  you must do something like this:
A HREF=nextpage.php??=SID?
  or
header(Location: nextpage.php?$SID);
 
  what you're doing now will go to page input.php?=SID
  instead of input.php?938sa9fa98f7daf987a9s (or similar)
 
   -Original Message-
   From: David Allen [mailto:[EMAIL PROTECTED]]
   Sent: Friday, July 13, 2001 6:45 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] session problem using headers
  
  
   Hi,
  
   I am having problems with sessions. With cookies turned on it works
   fine. Turn off cookies it fails.
  
   I have tried both
  
   header(Location: input.php?=SID);
   header(Location: input.php?PHPSESSID=.PHPSESSID);
  
   to pass the session id to the programme input.php but neither works.
  
   The first lines of input.php are
  
   ?
   session_register(userid);
   ?
  
   userid is the variable  I wish to pass. However, I have no other code
   related to sessions in this script. Do I need in some way tell the
   script to use this session id?
  
   As a have said before, it works fine if cookies are turned on.
  
   Thanks in advance for any help.
  
   David
  
  
   --
   PHP General Mailing List (http://www.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] Re: echo vs printf

2001-07-16 Thread Gonyou, Austin

print, echo, and printf are all available to help different coders code in
their own style. So if you're used to just using echo in shell, or print
in perl/basic or perhaps printf, in c/c++/java/asp, there you go. Make a
language easy to get stuff out of, and you can have a really quick user
base. 

-- 
Austin Gonyou
Systems Architect, CCNA
Coremetrics, Inc.
Phone: 512-796-9023
email: [EMAIL PROTECTED] 

 -Original Message-
 From: Steve Brett [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 10:38 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: echo vs printf
 
 
 don't echo and printf do different jobs ?
 
 as i understand it echo will dump anything to screen, fprint 
 will accept
 formatted text args like you owe me %d 
 dollars,$owed_amount) or something
 like that.
 
 i kind of use print by itself (harking back to the old days 
 of basic etc)
 but use echo quite a lot. only use printf when i have to put 
 cash amounts in
 and stuff like that.
 
 Steve
 
 Brother [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Why should I use printf instead of echo and vice versa?
 
  As for today I use printf mostly but I don't know why.
 
  brother
  Mail: [EMAIL PROTECTED]
  UIN: 4722160
  Web: http://motd.st
 
 
 
 
 -- 
 PHP General Mailing List (http://www.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: string search

2001-07-16 Thread Sheridan Saint-Michel

Couldn't he just do something like

if (strstr($text, aol.com)) {
   MyFunction();
} else {
   echo Not Found;
}

It just seems like using ereg for this is like killing a fly with a
sledgehammer

Sheridan

- Original Message -
From: scott [gts] [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 10:59 AM
Subject: RE: [PHP] RE: string search


 read the docs for ereg... i hardly use it, so i dont know
 for certain if it will match. (althouth the use of ^ at
 beginning *and* end suggests that it wont do what you expect)

 preg will match aol.com with this regexp:

 preg_match('/aol.com/', $string )


  -Original Message-
  From: Joseph Bannon [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 16, 2001 11:49 AM
  To: PHP (E-mail)
  Subject: [PHP] RE: string search
 
 
  Will this work?
 
  $string = http://www.aol.com/;;
 
  if (ereg (^aol.com^, $string) {
  }
  else {
  }


 --
 PHP General Mailing List (http://www.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] Global Database

2001-07-16 Thread Erich Kolb

Does anynone know where I can find a database of general information like
country abbreviations - country, zip codes, state names?  I am also looking
for a database that has generic topic lists, sort of like how you see on
Yahoo.com or DMOZ?  If there is no database, would anyone be interested in
creating such a thing?


-- 
PHP General Mailing List (http://www.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 ERROR: Update Query Failed problem with 4.0.6

2001-07-16 Thread David Wartell

I know a lot of people are having this problem too because there is a bug report with 
the same/similar description for many
different platforms.

Here is how I got things to work.  I did this with the latest php4 dev CVS snapshot 
(which also has the same error) but it should
work on 4.0.6 also.  I believe this problem is a problem with different version of the 
MySQL API that PHP is using.  MySQL just made
some changes to their API with the last couple of versions the latest 3.23.39 is what 
I am running and what I experienced the
problem with.

Build PHP with --with-mysql but DO NOT specify the path to mysql.  By not specifying 
the path mysql will use its built-in static
version of the mysql client lib.  There is a warning that doing this this way will not 
work when using mysql-auth apache module but
I use the latest version of mysql-auth and found no problems.

good luck

-David


- Original Message -
From: David Wartell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 1:55 PM
Subject: [PHP] mysql ERROR: Update Query Failed problem with 4.0.6


Im using PHP 4.0.6 install on Solaris x86 with mysql 3.23.39.  The following code 
causes mysql_query to return false, but the
database update works!

$query .= WHERE User_Name = '$User_Name[$i]' ;
$sth = mysql_query($query) or die (pERROR: Update Query Failedp$queryBR) ;
if ($verbose) {
print ($queryBR);
}

Here is the error message generated by the code:
ERROR: Update Query Failed
UPDATE Padmin SET Full_Name = 'Corin Cody', Admin = 1 WHERE User_Name = 'ccody'

I was recieving the following warning from the code above until I changed 
error_reporting = E_ERROR
Warning: MySQL: Unable to save result set in
/usr/www/netsite-docs/parda.actionwebservices.com/public-html/includes/admin_user_write.php
 on line 26

Here are my PHP build options:
CC=gcc OPTIM=-O2 EXTRA_LIBS=/usr/local/lib LIBS=-lz
./configure  --with-apxs=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql/ 
--with-png-dir=/usr/local/lib/libpng.so.2 --with-i
map=/usr/local/lib --with-lz=/usr/local/lib

Any ideas?

Thanks,
David


--
PHP General Mailing List (http://www.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] free email providers

2001-07-16 Thread Egan

Hi,

I need to prohibit free email address domains when verifying account
information via email, and I found this list of free email providers:

  http://www.fepg.net/


Does anyone know of other lists, or better yet, have a text file of
free email domains?


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]




Re: [PHP] Global Database

2001-07-16 Thread rm

FWIW re: dmoz.or,  provides an index of topics and
catagories as well as their own current database of
subjects and content for download...big downloads, I
think the content material is over 500megs, but it's
free. It's in some sort of text format, I can't seem
to recall the exact format.

rm

--- Erich Kolb [EMAIL PROTECTED] wrote:
 Does anynone know where I can find a database of
 general information like
 country abbreviations - country, zip codes, state
 names?  I am also looking
 for a database that has generic topic lists, sort of
 like how you see on
 Yahoo.com or DMOZ?  If there is no database, would
 anyone be interested in
 creating such a thing?
 
 
 -- 
 PHP General Mailing List (http://www.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!?
Get personalized email addresses from Yahoo! Mail
http://personal.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]




RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]

what code are you trying to use?

i have exactly the following code, and it prints out:
Hello there, this is a test.
My name is BOB


$text = Hello there, test.
My name is name;

$ASSIGN   = array(test = this is a test,
'name'= 'BOB', );
$OPENTAG  = ;
$CLOSETAG = ;

print preg_replace( /$OPENTAG(.*?)$CLOSETAG/e, '$ASSIGN[$1]', $text );




 -Original Message-
 From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 12:45 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] string replace using ereg
 
 
 Mmmm, thx , but I can't get it to work when I run your code,
 
 Parse error: parse error, expecting `T_VARIABLE' or `'$'' in Eval code on
 line 1
 
 Fatal error: Failed evaluating code: $ASSIGN[$1] in test2.php on line 9
 
 ?
 can u please take another small look
 
 thanks anyway
 
 Scott [EMAIL PROTECTED] schreef in bericht
 news:[EMAIL PROTECTED]...
  $text = Hello there, test.
  My name is name;
 
  $ASSIGN   = array(test = this is a test, 'name'= 'BOB', );
  $OPENTAG  = ;
  $CLOSETAG = ;
 
  print preg_replace( /$OPENTAG(.*?)$CLOSETAG/e, '$ASSIGN[$1]', $text );
 
 
  prints:
  Hello there, this is a test.
  My name is BOB
 
 
  To do what you want, throw a loop statement around the preg_replace
  to loop thru each line of a file... etc...  :)
 
   -Original Message-
   From: Jeroen Olthof [mailto:[EMAIL PROTECTED]]
   Sent: Monday, July 16, 2001 12:01 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] string replace using ereg
  
  
   hi,
  
   I want to replace strings in string using a key / value array as the
   replacemant contract
   basicly,
   I want to find a open en close tag, pick out the word in the middle and
   replace it by the value of the key that match the picked out word.
   example
  
   test test
  
   should result in
  
   this is a test this is a test
  
   well, The below code works for only one replacement cause when I add
 another
   on the same line. it will pick out
   test test
   als the key wordt and therefor isn't able to find this key in the array.
  
   how can I get the reg expression so it will not only get the first
 occurence
   of the open tag and the last of the close tag ??
  
   please help,
  
   kind regards
   Jeroen Olthof
  
   $ASSIGN = array(test = this is a test )
  
   $OPENTAG = ;
   $CLOSETAG = ;
  
   while ($line[$i]) {
   ereg($OPENTAG.([^*]*).$CLOSETAG, $line[$i], $regs);
   $newString .= str_replace($this-OPENTAG.$regs[1].$this-CLOSETAG,
   $ASSIGN[$regs[1]], $line[$i]);
   }
  
  
  
   --
   PHP General Mailing List (http://www.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: string search

2001-07-16 Thread scott [gts]

hehe... that's what regular expressions are for.
they're extrememly powerful... but that doesnt mean that
you should only use them for extremely complicated situations.
they work great everywhere... 

if you dont like overdoing it, you might as well loop
thru the string character by character, C-style.  :-)

 -Original Message-
 From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
 Subject: Re: [PHP] RE: string search
 
 Couldn't he just do something like
 
 if (strstr($text, aol.com)) {
MyFunction();
 } else {
echo Not Found;
 }
 
 It just seems like using ereg for this is like killing a fly with a
 sledgehammer
 
 Sheridan


-- 
PHP General Mailing List (http://www.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] Do not get any PHP-binary in install?

2001-07-16 Thread scott [gts]

i know it's silly to ask -- 
but did you look for php in /usr/local/bin/

 -Original Message-
 From: Lasse Andersson [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 2:49 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: [PHP] Do not get any PHP-binary in install?
 
 
 
 Hi,
 
 I'm trying to install GD(1.8.4) with PHP (4.04p1).
 The end of 'make install' script looks lik this:
 
 for prog in phpize php-config pear; do \
 /opt/src/src/php-4.0.4pl1/build/shtool install -c -m 755 $prog
 /usr/local/bin/$prog; \
 done
 make[2]: Leaving directory `/opt/src/src/php-4.0.4pl1/pear'
 make[1]: Leaving directory `/opt/src/src/php-4.0.4pl1/pear'
 
 As you can see I get binaries for phpize, php-config and pear but not
 any PHP binary?
 
 Configure used :
 
 sh configure --enable-discard-path
 --with-apache=/opt/src/src/apache_1.3.19/ \
  --with-mysql=/opt --with-gd=/opt --with-jpeg-dir=/opt
 
 Help appreciated
 
 
 
 Lasse
 Netcraft Scandinavia
 
 
 
 -- 
 PHP General Mailing List (http://www.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] submitting free-form text to a database

2001-07-16 Thread scott [gts]

for the quotes thing.  you must have single quotes around the
values that will go to the database, and you must escape single
quotes inside the value with either '' or \' (at least in 
MySQL, both work)

and as for the database... IMO, you should download MySQL now and
save yourself a ton of trouble porting/updating code later on.

MySQL is free, fast, good, stable, etc.  Everything i hear about
Microsoft databases leads me to believe that they're buggy, slow,
and incompatible with most other databases.  

if you write the entire thing for MS-access, you'll probably have
to re-write half the database access code when you decide to
switch to MySQL... so better to do it sooner than later and save
yourself the work down the road.  :-)

 -Original Message-
 From: garman [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] submitting free-form text to a database
 
 
 Hello.  I'm creating a simple Classifieds PHP application.  It allows users 
 to view classifieds by category, and add new items to the database.  For now, 
 I'm using MS Access 97 as my database (although eventually I would like to 
 switch to MySQL).
 
 Anyway, one element of a classified is the description.  I have a textarea 
 box where the user enters a description of the item he is selling.  If the 
 user's input contains an apostrophe (aka a single quote ') or even a double 
 quote, the code gets confused.
 
 A single quote is used around values in an SQL update command.  So if the 
 value itself contains a single quote (or multiple single quotes) I get an SQL 
 error when trying to update the database (understandably so).
 
 When the user input contains double quotes, PHP gets confused and thinks other 
 form variables aren't set, which then confuses the SQL update command.
 
 What kind of form processing do I need to do to fix these things?
 
 Thanks,
 Matt

-- 
PHP General Mailing List (http://www.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] Exec, system, passthru didn't work

2001-07-16 Thread scott [gts]

did you try and capture error messages from the system calls?

webserver probably doesnt have permission to do what you want it to do.

 -Original Message-
 From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]]
 Subject: [PHP] Exec, system, passthru didn't work
 
 Hi,
 I tried to execute the following command from the web interface using a 
 system call
 /usr/bin/play a_wave_file.wav
 
 I tried exec, system, passthru, and shell_exec. None of them worked, that is 
 I didn't hear any sound played. Note that I'm sitting here on the server 
 itself, and tried it with a web browser in the server. The command is 
 executed fine when I just copy it and run it in terminal. I also made sure 
 that nothing blocked the sound card, that is, the sound card was not in use.
 
 However, if I tried to run the same file using php as command line, it works 
 find.
 
 exec, system, passthru returns the value 2, which I don't know what it means. 
 
 Any help on this will be appreciated. Thanks in advance.
 
 Reuben D. Budiardja

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




[PHP] Re: free email providers

2001-07-16 Thread Inércia Sensorial

  Hi,

  I am not trying to discredit your decision to don't accept free emails,
but look for example my situation. The only email accounts I have are on
free email providers. I also connect to the internet using a free ISP, so
there's no pratical reason to use a paid email. So it would be impossible to
confirm my account on your service. If it is a public service, where anyone
can sign up, I think yo should reconsider your decision, unless there is a
strong reason behind to not do it...

--

  Julio Nobrega.

Because happiness is a warm gun
Bang-bang shoot-shoot

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

 I need to prohibit free email address domains when verifying account
 information via email, and I found this list of free email providers:

   http://www.fepg.net/


 Does anyone know of other lists, or better yet, have a text file of
 free email domains?


 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]




RE: [PHP] echo vs printf

2001-07-16 Thread Kent Sandvik

As I understand it, echo is not a function it's a
language something or other, supposedly it runs
slightly faster than print given the same output.
 
?php
class xTimer{
var $time_start;
var $time_delta; 

function Start(){
$this-time_start = $this-GetMicroTime();
}

function Stop(){
$time_end = $this-GetMicroTime();
$this-time_delta = $time_end - $this-time_start;
return $this-time_delta;
}

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

print echo vs print testbr\n;
$string = foo ;
$iter = 100;
$t = new xTimer;
$t-Start();
for($i = 0; $i  $iter; $i++){
print $string;
}
$print_time = $t-Stop();

$t-Start();
for($i=0; $i  $iter; $i++){
echo $string;
}
$echo_time = $t-Stop();

print \nbrprint printing $iter times: $print_timebr\n;
print \nbrecho printing $iter times: $echo_timebr\n;
?

Results:
Test1:
print printing 100 times: 2.829174041748
echo printing 100 times: 3.683454990387

Test2:
print printing 100 times: 3.131462931633
echo printing 100 times: 2.8942189216614

Test3:
print printing 100 times: 5.127711057663
echo printing 100 times: 5.5264019966125

HW, Dell rackmount Server, dual CPU running Linux 2.2.16.

--Kent


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




[PHP] Time Taken to Process

2001-07-16 Thread Phil Spitler

Does anyone know an easy way to tell how long a page takes to run in ms.
Maybe some variable that can be called at the bottom of the page or
something.

THANKS!

-
Phil Spitler [Applications Developer]
American City Business Journals
p: 704.973.1049
f: 704.973.8049
e: 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]




Re: [PHP] Re: free email providers

2001-07-16 Thread Egan

On Mon, 16 Jul 2001 14:41:35 -0300, Inércia Sensorial
[EMAIL PROTECTED] wrote:

I am not trying to discredit your decision to don't accept free emails,
but look for example my situation. The only email accounts I have are on
free email providers. I also connect to the internet using a free ISP, so
there's no pratical reason to use a paid email.

I encounter many sites that now refuse free email addresses.  That
alone is a practical reason to use a paid email or paid ISP.

I don't expect the free ISP concept to live much longer.  Look at
NetZero's share price.  They are in danger of delisting by nasdaq
soon.


So it would be impossible to confirm my account on your service.

Yes, that is our intention.


If it is a public service, where anyone can sign up, I think yo should
reconsider your decision, unless there is a strong reason behind to not
do it...

Free email addresses are virtually untraceable.  You can provide
totally fraudulent information when signing up with most of them.

That is unacceptable for our purposes.


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]




Re: [PHP] how can i creat a file and write a string to it!

2001-07-16 Thread Jason Bell

You need to open the file before you can actually write to it

try this:

$fp = fopen($file, w);
fwrite($fp, $articletext);
fclose($fp);


- Original Message - 
From: sunny AT wde [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Sunday, July 15, 2001 10:27 AM
Subject: [PHP] how can i creat a file and write a string to it!


 i've been looking for an adequate answer all morning in the archives,
 but can't find one, neithr can i understand the manual.
 
 all i want to do is for php to take the strong sent to it through a
 form, and create a new file with a name 2.html for example, and
 write the string to it.
 
 how can i quickly do this please?
 
 i got this so far but that gives me some filehandler problem. i'm
 running off a unix system btw.
 
   $lastid = mysql_insert_id() ; 
   $root = /home/articles/;
   $file = $root . $lastid . .html;
 
   fwrite($file, $articletext);
 
 tia!!
 
 /sunny
 
 
 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] Re: Time Taken to Process

2001-07-16 Thread Philip Hallstrom

Look at the recent subject entitled echo vs printf.  There's code to do
exactly what you want.  I don't think there's anything built in, but I
could be wrong.

On Mon, 16 Jul 2001, Phil Spitler wrote:

 Does anyone know an easy way to tell how long a page takes to run in ms.
 Maybe some variable that can be called at the bottom of the page or
 something.

 THANKS!

 -
 Phil Spitler [Applications Developer]
 American City Business Journals
 p: 704.973.1049
 f: 704.973.8049
 e: 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]




[PHP] true type fonts

2001-07-16 Thread Jon Yaggie

i am creating images using true type fonts.  i have uploaded all my fonts into one 
directory on the server(/fonts)  

some fonts like arial.ttf work.  however other show up as boxes.  they are beautiful 
but not quit the desired effect.  what is the problem any idea?  it cant be a 
scriptproblem can it? it has to be the files or maybe server set up?   i have done 
this before with no problem so i am stumped at what the difference here is and why 
some work.


idea?




Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0





[PHP] RE: Time Taken to Process

2001-07-16 Thread Phil Spitler

yeah, I just saw that, thanks! :)

Phil

 -Original Message-
 From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 2:12 PM
 To: Phil Spitler
 Cc: [EMAIL PROTECTED]
 Subject: Re: Time Taken to Process


 Look at the recent subject entitled echo vs printf.  There's code to do
 exactly what you want.  I don't think there's anything built in, but I
 could be wrong.

 On Mon, 16 Jul 2001, Phil Spitler wrote:

  Does anyone know an easy way to tell how long a page takes to run in ms.
  Maybe some variable that can be called at the bottom of the page or
  something.
 
  THANKS!
 
  -
  Phil Spitler [Applications Developer]
  American City Business Journals
  p: 704.973.1049
  f: 704.973.8049
  e: 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] Exec, system, passthru didn't work

2001-07-16 Thread Reuben D Budiardja

On Monday 16 July 2001 10:37 am, you wrote:
  On Monday 16 July 2001 09:42 am, you wrote:
I tried to execute the following command from the web interface using
a system call
/usr/bin/play a_wave_file.wav
   
I tried exec, system, passthru, and shell_exec. None of them worked,
that is I didn't hear any sound played. ...
  
   Does it work from the shell if you su to the web server user id and try
   to run it?  99% of shell exec issues are permission-related.
  
   -Rasmus
 
  Yes, I su as root and then su as the web server user id, it worked. I
  also check the permission is already 755.

 Ok, and does this play program actually work without a controlling tty?

I can only guess what you mean here, but I think that's a good point. Maybe 
the play program wouldn't work withough a controlling tty. Do you know how 
to check, or any work around?

Thanks.
Reuben D. Budiardja



--
PHP General Mailing List (http://www.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] Do not get any PHP-binary in install?

2001-07-16 Thread Lasse Andersson



No it isn't there either.

My configure, make and make install do not seem to create a 'php' binary.

Lasse


Scott wrote:

 i know it's silly to ask --
 but did you look for php in /usr/local/bin/

  -Original Message-
  From: Lasse Andersson [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 16, 2001 2:49 PM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: [PHP] Do not get any PHP-binary in install?
 
 
 
  Hi,
 
  I'm trying to install GD(1.8.4) with PHP (4.04p1).
  The end of 'make install' script looks lik this:
 
  for prog in phpize php-config pear; do \
  /opt/src/src/php-4.0.4pl1/build/shtool install -c -m 755 $prog
  /usr/local/bin/$prog; \
  done
  make[2]: Leaving directory `/opt/src/src/php-4.0.4pl1/pear'
  make[1]: Leaving directory `/opt/src/src/php-4.0.4pl1/pear'
 
  As you can see I get binaries for phpize, php-config and pear but not
  any PHP binary?
 
  Configure used :
 
  sh configure --enable-discard-path
  --with-apache=/opt/src/src/apache_1.3.19/ \
   --with-mysql=/opt --with-gd=/opt --with-jpeg-dir=/opt
 
  Help appreciated
 
 
 
  Lasse
  Netcraft Scandinavia
 
 
 
  --
  PHP General Mailing List (http://www.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: Time Taken to Process

2001-07-16 Thread Michael Geier, CDM Systems Admin

try the attached class.

$t = new timer;
$t-start();
// some code;
$t-stop();

$diff = $t-gettime();
echo $diff;

-Original Message-
From: Phil Spitler [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 2001 1:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: Time Taken to Process


yeah, I just saw that, thanks! :)

Phil

 -Original Message-
 From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 2:12 PM
 To: Phil Spitler
 Cc: [EMAIL PROTECTED]
 Subject: Re: Time Taken to Process


 Look at the recent subject entitled echo vs printf.  There's code to do
 exactly what you want.  I don't think there's anything built in, but I
 could be wrong.

 On Mon, 16 Jul 2001, Phil Spitler wrote:

  Does anyone know an easy way to tell how long a page takes to run in ms.
  Maybe some variable that can be called at the bottom of the page or
  something.
 
  THANKS!
 
  -
  Phil Spitler [Applications Developer]
  American City Business Journals
  p: 704.973.1049
  f: 704.973.8049
  e: 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]



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


Re: [PHP] Time Taken to Process

2001-07-16 Thread py

Mostly Taken from phpbuilder I beleive...

// =
// Function to start the timer.
// =
function start_timer(){
 $timeparts = explode(  ,microtime() );
 $starttime = $timeparts[1].substr( $timeparts[0], 1 );
 return $starttime;
}

// =
// Function to stop the timer.
// =
function stop_timer(){
 $timeparts = explode(  ,microtime() );
 $endtime = $timeparts[1].substr( $timeparts[0], 1 );
 return $endtime;
}

// =
// Print script execution time
// =
function script_time( $starttime, $endtime ){
 $t_time = ( $endtime - $starttime );
return $t_time;
}

$starttime = start_timer();

// Script here ..

$endtime = stop_timer();
echo brExec: b. number_format( script_time( $starttime, $endtime ),
6 ) ./b secbr;

py

- Original Message -
From: Phil Spitler [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 6:57 PM
Subject: [PHP] Time Taken to Process


 Does anyone know an easy way to tell how long a page takes to run in ms.
 Maybe some variable that can be called at the bottom of the page or
 something.

 THANKS!

 -
 Phil Spitler [Applications Developer]
 American City Business Journals
 p: 704.973.1049
 f: 704.973.8049
 e: 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] true type fonts

2001-07-16 Thread Chris Anderson

Many special fonts don't have all the characters besides letters and
numbers. Perhaps thats the problem?
- Original Message -
From: Jon Yaggie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 2:11 PM
Subject: [PHP] true type fonts


i am creating images using true type fonts.  i have uploaded all my fonts
into one directory on the server(/fonts)

some fonts like arial.ttf work.  however other show up as boxes.  they are
beautiful but not quit the desired effect.  what is the problem any idea?
it cant be a scriptproblem can it? it has to be the files or maybe server
set up?   i have done this before with no problem so i am stumped at what
the difference here is and why some work.


idea?




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0





-- 
PHP General Mailing List (http://www.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] true type fonts

2001-07-16 Thread Jon Yaggie

nope.  the fonts are normalenough when i i open them.  and in fact i guess i
get slight different boxes for different fonts.   but all of them are
alpha-numeric fonts




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


- Original Message -
From: Chris Anderson [EMAIL PROTECTED]
To: Jon Yaggie [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 2:02 AM
Subject: Re: [PHP] true type fonts


 Many special fonts don't have all the characters besides letters and
 numbers. Perhaps thats the problem?
 - Original Message -
 From: Jon Yaggie [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, July 16, 2001 2:11 PM
 Subject: [PHP] true type fonts


 i am creating images using true type fonts.  i have uploaded all my fonts
 into one directory on the server(/fonts)

 some fonts like arial.ttf work.  however other show up as boxes.  they are
 beautiful but not quit the desired effect.  what is the problem any idea?
 it cant be a scriptproblem can it? it has to be the files or maybe server
 set up?   i have done this before with no problem so i am stumped at what
 the difference here is and why some work.


 idea?




 Thank You,

 Jon Yaggie
 www.design-monster.com

 And they were singing . . .

 '100 little bugs in the code
 100 bugs in the code
 fix one bug, compile it again
 101 little bugs in the code

 101 little bugs in the code . . .'

 And it continued until they reached 0





-- 
PHP General Mailing List (http://www.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] Quoted-Printable Encoding

2001-07-16 Thread Sheridan Saint-Michel

I am trying to put together a script that e-mails web pages (similar to the send page 
functionality in IE).

Is there a function that will convert HTML from plaintext into Quoted-Printable 
Encoding (ie = becomes =3D) so I can 
e-mail it?

Or will one of the encodings available (ie rawurlencode) work in it's place?

Any help or ideas would be greatly appreciated.

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



RE: [PHP] echo vs printf

2001-07-16 Thread rm


I don't know what to say, my comment was based on

http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40

note the author.

I ran your code in both windows and linux and got
faster speeds, on a regular basis, for echo. That
said, the speed differences were not great(minor is a
good description), I think the greatest was half a sec
for 1 million loops.

rm

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.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] auto link?

2001-07-16 Thread [EMAIL PROTECTED]

On Ray's advice I've given up on letting the users put html into my form.
But I would like any http:// type addresses they include to be turned into
hyper links:



a href=http://www.mysite.comwww.mysite.com/a

is there a script or function some place I can use to do this? Or must I try
to write something of my own?


Susan


-- 
[EMAIL PROTECTED]
http://futurebird.diaryland.com



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




Re: [PHP] Quoted-Printable Encoding

2001-07-16 Thread jeremy brand

I think you will want to use the imap_8bit() function:
http://php.net/imap_8bit

But, I'm not sure if there is a version available in PHP without compiling
in c-client IMAP.

Jeremy

Jeremy Brand :: Sr. Software Engineer :: +393485323988 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LINUX is obsolete  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  Get your own Free, Private email at http://www.smackdown.com/

On Mon, 16 Jul 2001, the following spilled from the mind of Sheridan...:

 Date: Mon, 16 Jul 2001 14:23:00 -0500
 From: Sheridan Saint-Michel [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Quoted-Printable Encoding

 I am trying to put together a script that e-mails web pages (similar to the send 
page functionality in IE).

 Is there a function that will convert HTML from plaintext into Quoted-Printable 
Encoding (ie = becomes =3D) so I can
 e-mail it?

 Or will one of the encodings available (ie rawurlencode) work in it's place?

 Any help or ideas would be greatly appreciated.

 Sheridan Saint-Michel
 Website Administrator
 FoxJet, an ITW Company
 www.foxjet.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] return

2001-07-16 Thread Tyler Longren

Here's my code:
?
function expDate($date) {
$month = substr($date, 0, 2);
$len = strlen($date);
$year = substr($date, $len-2, $len);
return $month;
return $year;
}
expDate(11/2002);
print $month $year;
?

I know this isn't the correct usage of return, but how to I get the $month
and $year variables so I can print them after I've called the expDate()
function?  Currently, nothing is printed to the browser.

Thanks,
Tyler


-- 
PHP General Mailing List (http://www.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] return

2001-07-16 Thread Boget, Chris

 Here's my code:
 ?
 function expDate($date) {
 $month = substr($date, 0, 2);
 $len = strlen($date);
 $year = substr($date, $len-2, $len);
 return $month;
 return $year;
 }
 expDate(11/2002);
 print $month $year;
 ?
 I know this isn't the correct usage of return, but how to I 
 get the $month and $year variables so I can print them 
 after I've called the expDate() function?  Currently, nothing 
 is printed to the browser.

You cannot use return twice like that.  The function will
exit immediately after the first valid return call it hits.
To do what you want, you can do this:



function expDate($date, $returnMonth, $returnYear ) {
$month = substr($date, 0, 2);
$len = strlen($date);
$year = substr($date, $len-2, $len);
$returnMonth = $month;
$returnYear = $year;
}

$month = 0;
$year = 0;

expDate( 11/2002, $month, $year );
print $month $year;

--

The  operator passes a variable by reference.

Alternately, you can do:



function expDate($date, $returnMonth, $returnYear ) {
global $month;
global $year;

$month = substr($date, 0, 2);
$len = strlen($date);
$year = substr($date, $len-2, $len);

}

$month = 0;
$year = 0;

expDate( 11/2002 );
print $month $year;

--

Though, I try to use global as little as possible.

Chris



Re: [PHP] Quoted-Printable Encoding

2001-07-16 Thread Sheridan Saint-Michel

I tried the imap_8bit function, but got:

Fatal error: Call to undefined function: imap_8bit() in
/home/www/foxjet/admin/mailer.php on line 44

I do not have control over what is compiled on my hosts machine.  They are
running PHP 4.0.4pl1

I am not sure how to tell what has and has not been compiled, but I threw up
an info page here

http://www.foxjet.com/info.php

Are there any other functions I could use, instead if imap_8bit?

Sheridan

- Original Message -
From: jeremy brand [EMAIL PROTECTED]
To: Sheridan Saint-Michel [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 3:18 PM
Subject: Re: [PHP] Quoted-Printable Encoding


 I think you will want to use the imap_8bit() function:
 http://php.net/imap_8bit

 But, I'm not sure if there is a version available in PHP without compiling
 in c-client IMAP.

 Jeremy

 Jeremy Brand :: Sr. Software Engineer :: +393485323988 ::
[EMAIL PROTECTED]
 http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 LINUX is obsolete  -- Andy Tanenbaum, January 29th, 1992
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Get your own Free, Private email at http://www.smackdown.com/

 On Mon, 16 Jul 2001, the following spilled from the mind of Sheridan...:

  Date: Mon, 16 Jul 2001 14:23:00 -0500
  From: Sheridan Saint-Michel [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: [PHP] Quoted-Printable Encoding
 
  I am trying to put together a script that e-mails web pages (similar to
the send page functionality in IE).
 
  Is there a function that will convert HTML from plaintext into
Quoted-Printable Encoding (ie = becomes =3D) so I can
  e-mail it?
 
  Or will one of the encodings available (ie rawurlencode) work in it's
place?
 
  Any help or ideas would be greatly appreciated.
 
  Sheridan Saint-Michel
  Website Administrator
  FoxJet, an ITW Company
  www.foxjet.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] return

2001-07-16 Thread Don Read


On 16-Jul-01 Tyler Longren wrote:
 Here's my code:
 ?
 function expDate($date) {
 $month = substr($date, 0, 2);
 $len = strlen($date);
 $year = substr($date, $len-2, $len);
 return $month;
 return $year;
 }
 expDate(11/2002);
 print $month $year;
 ?
 
 I know this isn't the correct usage of return, but how to I get the $month
 and $year variables so I can print them after I've called the expDate()
 function?  Currently, nothing is printed to the browser.
 

return array($month, $year);

 -- or --

function expDate($date,$month,$year) {
  ...
}

expDate(11/2002,$month,$year);
print ...

 -- or --

list($month, $year)=explode(/, 11/2002);


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.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] return

2001-07-16 Thread Alexander Skwar

So sprach »Tyler Longren« am 2001-07-16 um 15:25:08 -0500 :
 function?  Currently, nothing is printed to the browser.

No wonder, because you don't assign the returned value of expDate to
anything..

well, if you want to return two values, I'd suggest to use an array,
like so:

function expDate($date){
  $month = 08; // whatever
  $year = 15; // whatever

  $return_value = array(
month = $month,
year  = $year
  );

  return $return_value;
}

$date = expDate(4711);
print $date[month] .   . $date[year];

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: 5 hours 23 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]




Re: [PHP] return

2001-07-16 Thread Alexander Skwar

So sprach »Alexander 'Digital Projects' Skwar« am 2001-07-16 um 22:38:44 +0200 :
 anything..

correction: Whoops - there's a . missing

anything...

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: 5 hours 31 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]




RE: [PHP] auto link?

2001-07-16 Thread Chad Day

Here's a function I use on a text field..


function activateUrls( $s ) {
  $o = '';
  while ($s != '') {
$url = '';
$temp = split('://', $s, 2);
if (count($temp)1) {   # '://' found; now extract schema
  $s = $temp[1];
  $temp2 = split('[^[:alpha:]]', strrev($temp[0]), 2);
  $schema = strrev($temp2[0]); # this gets schema
  $o .= substr($temp[0], 0, strlen($temp[0])-strlen($schema));
  if ($schema != '') { # this ensures a non-null schema
$temp3 = split([[:space:],'\:], $s, 2);
$url = $schema . '://' . $temp3[0];
$ns = substr($s, strlen($temp3[0]),1) . $temp3[1];
if ($temp3[0] != '') {
  $o .= a href=$url target=_new$url/a;
} else {
  $o .= $url;
}
$s = $ns;
  }
  else {
$o .= '://';
  }
}
else {
  $o .= $s;
  $s = '';
}
  } // while
  return $o;
}


Hope this helps,
Chad

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 16, 1979 4:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] auto link?


On Ray's advice I've given up on letting the users put html into my form.
But I would like any http:// type addresses they include to be turned into
hyper links:



a href=http://www.mysite.comwww.mysite.com/a

is there a script or function some place I can use to do this? Or must I try
to write something of my own?


Susan


--
[EMAIL PROTECTED]
http://futurebird.diaryland.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] auto link?

2001-07-16 Thread Bob Scott

Take a look at

 http://www.php.net/manual/en/function.ereg-replace.php

There's a bit of sample code up there that may help...

-bob

--
Bob Scott   Web / DB Developer
http://www.covalent.netCovalent Technologies, Inc.

On Mon, 16 Jul 1979, [EMAIL PROTECTED] wrote:

 On Ray's advice I've given up on letting the users put html into my form.
 But I would like any http:// type addresses they include to be turned into
 hyper links:



 a href=http://www.mysite.comwww.mysite.com/a

 is there a script or function some place I can use to do this? Or must I try
 to write something of my own?


 Susan


 --
 [EMAIL PROTECTED]
 http://futurebird.diaryland.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] Re: string search

2001-07-16 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (J Smith) wrote:

  I need a search function (if statement) that performs a search on a string
  and if the string contains something like aol.com, performs another
  function. Can anyone help me? Thanks.
  
  Joseph
  
 
 Try researching regular expressions. In PHP, look at the preg and ereg 
 groups of functions.

This doesn't sound like it requires the overhead of a regex function.  
Check out http://php.net/strstr instead.

-- 
CC

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




[PHP] RE: report generation with PHP

2001-07-16 Thread Andrew Chase

There's more than one way to skin a cat - if not directly from PHP to PDF,
why not PHP to a .TeX LaTeX file, then use exec() to run latex and dvi2pdf
on it.  No license restrictions there that I know of, and you can get some
very nice results with LaTeX.

-Andy

 -Original Message-
 From: Matthew Garman [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 4:00 AM
 To: [EMAIL PROTECTED]
 Subject: report generation with PHP



 Hello:

 I wrote an small web application that interfaces a Microsoft Access
 database.  The database is fairly small and simple: it is a listing of
 employees, their phone number(s) and their department.  My interface
 allows folks to view the phone list, search for a name, list by
 department, etc., and allows certain users to update the phone book (add
 employees, change phone numbers, etc).  It's a fairly typical phonebook
 application.

 The Access database has a macro in it that allows for the generation of a
 report.  The report is a nicely formatted listing of all the employees and
 their phone numbers, grouped by department.  Everybody fits on one page.
 The whole purpose of this report is to be printable, and so that the one
 page phone list can be distributed throughout the factory.

 Now I want to be able to generate this report from the web.  It doesn't
 have to use Access (and I would prefer that it didn't, so I can convert to
 MySQL).  But I don't know of a nice (and easy!) way to generate such a
 report.  Using HTML tables isn't acceptable---when you print, you still
 get the header and footer that the browser adds (and it's unacceptable to
 have everyone modify their browser's setup).  Furthermore, the printable
 list has to look as close as possible to the original, because if I start
 changing formats, people will get upset.

 So I'm not really too sure where to start on this one.  If anyone could
 offer some suggestions, and point me in the right direction, it would be
 sincerely appreciated!

 Thanks,
 Matt

 --
 Matt Garman, [EMAIL PROTECTED]
 I'll tip my hat to the new constitution, Take a bow for the new
 revolution
  Smile and grin at the change all around, Pick up my guitar and play
  Just like yesterday, Then I'll get on my knees and pray...
 -- Pete Townshend/The Who, Won't Get Fooled Again






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




  1   2   >