[PHP] any package for lost and found

2003-04-06 Thread SayOrange.com
I am working on a project that shall have a section for 'Lost and Found' 
people lists with photographs. Does anyone knows of any package or code 
that could be reused here.
Thanks in advance.
--
--
SayOrange.com
http://www.sayorange.com

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


[PHP] alignment

2003-04-06 Thread Diksha Neel
dear all,

hi!
an html file is being created by my php script.
i have used tables for the alignment of html file's text
and images.
i have an image and the value of variable $cname to be
displayed in a cell.
i want both of these items to appear on the same line.
but what happens is the $cname value appears under the
image in the center of the page.
my question is is there any way without nesting tables to
ensure that my text will appear in the horizontal line
same as that of the image?
the code is as under.
thanks,
diksha.
table border=1 width=100% height=430
  tr
td width=100% colspan=2 height=61img 
src=C:\DocumentsandSettings\mangesh\My Documents\My 
pictures\crows_eating_md_wht.gif
  div align=centerh1u';
  $string.=$wname;
  $string.='/u/h1/div/td
  /tr

___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 6 Apr 2003 11:10:18 -0000 Issue 1982

2003-04-06 Thread php-general-digest-help

php-general Digest 6 Apr 2003 11:10:18 - Issue 1982

Topics (messages 142538 through 142580):

Re: HTTP or HTTPS
142538 by: Rasmus Lerdorf
142541 by: Alexander Weber

Re: error while quering from MSSQL server from a Linux box
142539 by: Alexander Weber

Re: newbie alternate row colours in dynamic table
142540 by: Daevid Vincent
142544 by: Chris Hayes
142545 by: Don Read

Re: Right Click
142542 by: Leif K-Brooks
142550 by: daniel
142551 by: Leif K-Brooks

Prefix question
142543 by: Sparky Kopetzky
142546 by: Chris Hayes

Re: newbie alternate row colours in dynamic table -- timed tests
142547 by: Daevid Vincent
142553 by: Philip Olson
142555 by: John W. Holmes

Roadblock When One Page Calls ANother to Log In Users
142548 by: Stephen Tiano

Timing test of the parser... Makes no difference
142549 by: Daevid Vincent
142578 by: daniel

Design - Database, Hard File, Combination?
142552 by: Mike
142557 by: Burhan Khalid

combining text with $_POST
142554 by: David McGlone
142556 by: John W. Holmes
142558 by: Don Read
142560 by: David McGlone
142561 by: Sebastian
142562 by: John W. Holmes

Re: Query
142559 by: Burhan Khalid

Problem with mysql versions. help
142563 by: NeXaS

Another problem with mysql version coding
142564 by: NeXaS
142565 by: John W. Holmes

When to use a text file rather then a database
142566 by: Charles Kline
142567 by: John W. Holmes

array_unique wierdness
142568 by: Greg Robillard
142570 by: John W. Holmes

array_unique wierdness -addendum
142569 by: Greg Robillard

Re: Finding the height of a JPG in pixels using PHP
142571 by: De deco
142572 by: Tom Rogers

Great Opportunity for all group members!!!
142573 by: Chinmoy Barua
142574 by: Matt Giddings
142575 by: Sebastian
142577 by: daniel

Re: RedHat
142576 by: John Taylor-Johnston

any package for lost and found
142579 by: SayOrange.com

alignment
142580 by: Diksha  Neel

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
No, the destination port will not change.  You must be looking at the
source port.

-Rasmus

On Sat, 5 Apr 2003, Alexander Weber wrote:

 So far so good, the next problem is now, that the port changes with every
 new request. Tried this on my personal server an my hoster's one.

 Perhaps there is another way? JScript, xml or anything other?

 Thanx so far,

 Alex


 Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
  Presumably you know the HTTPS port on your server.  Anything not SSL is
  going to be straight HTTP.  The point here is that SSL happens a layer
  below PHP.  PHP doesn't care whether it is running over SSL or not.  In
  fact it has no idea what transport layer is below it.  So your only way to
  tell is to depend on whatever the web server tells you.  Look at a
  phpinfo() for both an SSL and a non-SSL request and see what the
  differences are on your server.  For me, checking SERVER_PORT has been the
  most portable/reliable mechanism.
 
  -Rasmus
 
 
 
  On Sat, 5 Apr 2003, Alexander Weber wrote:
 
   But SERVER PORT is not always 80 using HTTP (not HTTPS). So this way is
 not
   really secure.
  
   Alex
  
   Rasmus Lerdorf [EMAIL PROTECTED] schrieb im Newsbeitrag
   news:[EMAIL PROTECTED]
I usually just use $_SERVER['SERVER_PORT']
   
-Rasmus
   
On Sat, 5 Apr 2003, Alexander Weber wrote:
   
 Unfortunally is not set. It's like the variable does not exist,
 because
   when
 I extract the varaible $_SERVER with foreach I don't get HTTPS as
 key,
   only
 SERVER_PROTOCOL.

 I'm using PHP 4.3.1 as Apache2 Module on Win2k SP3.
 register_globals OFF
 safe:mode OFF

 stunnel 4.04 on x86-pc-mingw32-gnu WIN32 with OpenSSL 0.9.7 31 Dec
 2002

 If you need more info:

 ICQ 46858764.

 Thanx

 Alex

 John W. Holmes [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
   anybody knows how to find out the connection type (http or
 httpS)?
  Tried
   out
   $HTTP_SERVER_VARS.
 
  $_SERVER['HTTPS'] will be set if it's over HTTPS.
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your
   copy
  today. http://www.phparch.com/
 
 



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

  
  
  
   --
   PHP General Mailing List 

Re: [PHP] alignment

2003-04-06 Thread Leif K-Brooks
This has asbolutley nothing to do with PHP!  Ask it on an HTML list.

Diksha Neel wrote:

dear all,

hi!
an html file is being created by my php script.
i have used tables for the alignment of html file's text
and images.
i have an image and the value of variable $cname to be
displayed in a cell.
i want both of these items to appear on the same line.
but what happens is the $cname value appears under the
image in the center of the page.
my question is is there any way without nesting tables to
ensure that my text will appear in the horizontal line
same as that of the image?
the code is as under.
thanks,
diksha.
table border=1 width=100% height=430
  tr
td width=100% colspan=2 height=61img src=C:\Documents
andSettings\mangesh\My Documents\My 
pictures\crows_eating_md_wht.gif
  div align=centerh1u';
  $string.=$wname;
  $string.='/u/h1/div/td
  /tr

___
Odomos - the only  mosquito protection outside 4 walls -
Click here to know more!
http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomoswn 



--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] alignment

2003-04-06 Thread Haseeb Iqbal
this is off topic but anyway try this

table border=1 width=100% height=430
tr
  td width=100% colspan=2 height=61 nowrapimg
src=C:\DocumentsandSettings\mangesh\My Documents\My
pictures\crows_eating_md_wht.gif align=ansMiddle
div align=centerh1u';
$string.=$wname;
$string.='/u/h1/div/td
/tr

don't use div as it gives line break automaticly

Friendship is always a sweet responsibility, never an opportunity.
HaSeEb IqBaL.
0300-4258030
- Original Message -
From: Diksha Neel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 06, 2003 4:08 PM
Subject: [PHP] alignment


 dear all,

 hi!
 an html file is being created by my php script.
 i have used tables for the alignment of html file's text
 and images.
 i have an image and the value of variable $cname to be
 displayed in a cell.
 i want both of these items to appear on the same line.
 but what happens is the $cname value appears under the
 image in the center of the page.
 my question is is there any way without nesting tables to
 ensure that my text will appear in the horizontal line
 same as that of the image?
 the code is as under.

 thanks,
 diksha.

 table border=1 width=100% height=430
tr
  td width=100% colspan=2 height=61img
 src=C:\DocumentsandSettings\mangesh\My Documents\My
 pictures\crows_eating_md_wht.gif
div align=centerh1u';
$string.=$wname;
$string.='/u/h1/div/td
/tr

 ___
 Odomos - the only  mosquito protection outside 4 walls -
 Click here to know more!

http://r.rediff.com/r?http://clients.rediff.com/odomos/Odomos.htmodomosw
n


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



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



Re: [PHP] Re: Q. Adding line numbers to highlighted source

2003-04-06 Thread Alan McFarlane
I suspect that is because of the regex code evaluation; but thanks for the
suggestion anyway.

BTW, I found a way to speed (my version) even more, something that I still
forget to use on a regular basis but has been proven to be ~extremely~ good
at boosting speed:

replace:

for ($i = 0; $i  count($source); $i++)

with:

for ($i = 0, $_count = count($source); $i  $_count; $i++)

This simply prevents a continual reevaluation of count($source) (or
whatever) and can provide some spectacular gains


--
Alan

John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This also works the same, for comparisons sake, but your solution
 benchmarks faster:

 $i=2;
 $fp = fopen($url,'r');
 $file = fread($fp,filesize($url));
 $file = highlight_string($file,TRUE);

 $file = str_replace('code','codespan
 style=color:black;1/span',$file);

 $file = preg_replace('/br \//e','sprintf(br /span
 style=\color:black;\%05d /span,$i++)',$file);

 echo hr;

 echo $file;

 Enjoy!

 ---John W. Holmes...

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/

  -Original Message-
  From: Alan McFarlane [mailto:[EMAIL PROTECTED]
  Sent: Friday, April 04, 2003 12:46 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Re: Q. Adding line numbers to highlighted source
 
  Well I finally found a workable solution:
 
  $url = index.php; /* for example */
  $source = explode(br /, preg_replace(`\/?code\`Ui, ,
  highlight_file($url, true)));
 
  for ($i = 0; $i  count ($source); $i++)
  $source[$i] = span style=\color:black;\ . str_pad($i, 5,
 0,
  STR_PAD_LEFT) . /span  . $source[$i];
 
  echo code . implode(br /, $source) . /code;
 
 
 
 
  Alan McFarlane [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   I've been trying to add line-numbers to my source code, but can't
 seem
  to
   work out how to do it.
  
   As an example, I tried the following:
  
   ?php
  
   function addPrefix( $matches )
   {
   static $line = 1;
  
   return $line++ . $matches[0];
   }
  
   $url = split(\?, $_GET['url']);
   $source = highlight_file($url[0], true);
   $source = preg_replace_callback(`\br \/\`U, addPrefix,
 $source);
  
   echo $source;
  
   ?
  
   which is called whenever the use user on a link like a
   href=show-source.php?url=index.phpShow Source/a
  
   The problem is that my regex does not correcly match the lines.
  
   Anyone got any bright ideas?
  
   --
   Alan McFarlane
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php






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



[PHP] counting words.

2003-04-06 Thread Sebastian
hello,

I am trying to count the words from text that is fetched from mysql, It
works, but it's a little inaccurate.. It's about 5 - 10 words off, My guess
it's probably counting some HTML or something. Is there a more accurate way
of counting words?

   $row[12] = strip_tags(strtr($row[12],
array_flip(get_html_translation_table(HTML_ENTITIES;
   $wordcount = preg_match_all(#(\w+)#, $row[12], $match_dummy);

   if($wordcount == 0) {
  $count =;
   } else {
  $count = preg_match_all(#(\w+)#, $row[12], $match_dummy);
   }


cheers,
- Sebastian




Re: [PHP] counting words.

2003-04-06 Thread Justin French
It depends on what you define as a word, but let's take the simple approach
of stripping HTML et al, and exploding the string on the spaces, then
counting the array of words:

?
$str = This is my b text /b that I want to count;
$words = explode(' ', strip_tags($str));
$count = count($words);
?

Really no need for regexp's here IMHO.


Justin



on 06/04/03 11:46 PM, Sebastian ([EMAIL PROTECTED]) wrote:

 hello,
 
 I am trying to count the words from text that is fetched from mysql, It
 works, but it's a little inaccurate.. It's about 5 - 10 words off, My guess
 it's probably counting some HTML or something. Is there a more accurate way
 of counting words?
 
 $row[12] = strip_tags(strtr($row[12],
 array_flip(get_html_translation_table(HTML_ENTITIES;
 $wordcount = preg_match_all(#(\w+)#, $row[12], $match_dummy);
 
 if($wordcount == 0) {
 $count =;
 } else {
 $count = preg_match_all(#(\w+)#, $row[12], $match_dummy);
 }
 
 
 cheers,
 - Sebastian
 
 
 


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



Re: [PHP] Great Opportunity for all group members!!!

2003-04-06 Thread sunfire
since this doesnt apply to php in any way whatsoever or any php code i think
it should be kept off of the php mailing list

actually it sort of looks like spam/junk mail


- Original Message -
From: Chinmoy Barua [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 06, 2003 2:43 AM
Subject: [PHP] Great Opportunity for all group members!!!



 Great Opportunity for all group members!!!

 Please Join its free!!! You will have $50 extra Bonuses and earnings
 only with sign up this progam.

 Bonuses and Earnings:

 A $50.00 sign-up bonus will be awarded to each new member of Platinum-
 Mails. This bonus will become payable when the member has earned
 $200.00. A member will receive a $15.00 bonus for each new member who
 joins Platinum-Mails through their referral link. This bonus will
 become payable when that new member has earned $200.00. It is real

 Limited number of new user will accepted. Good luck!!!

 For join please visit:
 http://platinum-mails.ebiz-enterprises.com/?r=chinmoy



 -
 Do you Yahoo!?
 Yahoo! Tax Center - File online, calculators, forms, and more



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



Re: [PHP] Great Opportunity for all group members!!!

2003-04-06 Thread SayOrange.com
hmm...this is spamming!!

sunfire wrote:
since this doesnt apply to php in any way whatsoever or any php code i think
it should be kept off of the php mailing list
actually it sort of looks like spam/junk mail

- Original Message -
From: Chinmoy Barua [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, April 06, 2003 2:43 AM
Subject: [PHP] Great Opportunity for all group members!!!


Great Opportunity for all group members!!!

Please Join its free!!! You will have $50 extra Bonuses and earnings
only with sign up this progam.
Bonuses and Earnings:

A $50.00 sign-up bonus will be awarded to each new member of Platinum-
Mails. This bonus will become payable when the member has earned
$200.00. A member will receive a $15.00 bonus for each new member who
joins Platinum-Mails through their referral link. This bonus will
become payable when that new member has earned $200.00. It is real
Limited number of new user will accepted. Good luck!!!

For join please visit:
http://platinum-mails.ebiz-enterprises.com/?r=chinmoy


-
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more




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


Re: [PHP] Great Opportunity for all group members!!!

2003-04-06 Thread sunfire
well in my case all i have to do is just push the block button on the
message and *poof* all gone... even on the php list thats all i have to do
(all the messages get sent to me from the original sender not the mailing
list itself)..


- Original Message -
From: daniel [EMAIL PROTECTED]
To: Sebastian [EMAIL PROTECTED]; [EMAIL PROTECTED]; Matt
Giddings [EMAIL PROTECTED]
Sent: Sunday, April 06, 2003 3:34 AM
Subject: RE: [PHP] Great Opportunity for all group members!!!


 lol this would have to be the first i got from this list, i get dozens of
 korean spam everyday , the encoding is all wrong and all comes out is
 gibberish characters , how do i stop this ?
 = Original Message From Sebastian [EMAIL PROTECTED] =
 hehe. i should get me one of those ;)
 
 cheers,
 - Sebastian
 
 
 - Original Message -
 From: Matt Giddings [EMAIL PROTECTED]
 
 
 | ?php
 |
 |   $user = Chinmoy Barua [mailto:[EMAIL PROTECTED];
 |
 |   function spam-o-meter( $sender ) {
 | return( is_real($sender) ? 'not spam' : 'spam' );
 |   }
 |
 |   if( spam-o-meter($user) == 'spam' ) {
 | echo punt user!;
 |   }
 |
 | ?
 |
 | This sender is correct; this was a great opportunity for me to brush up
 | on some PHP programming and code analysis.  For example if we were to
 | study this simple script we'll discover that it will always return SPAM
 | and suggests that the user should be punted.
 |
 |
 |
 |  -Original Message-
 |  From: Chinmoy Barua [mailto:[EMAIL PROTECTED]
 |  Sent: Sunday, April 06, 2003 1:43 AM
 |  To: [EMAIL PROTECTED]
 |  Subject: [PHP] Great Opportunity for all group members!!!
 | 
 | 
 |  Great Opportunity for all group members!!!
 | 
 |  Please Join its free!!! You will have $50 extra Bonuses and earnings
 |  only with sign up this progam.
 | 
 |  Bonuses and Earnings:
 | 
 |  A $50.00 sign-up bonus will be awarded to each new member of
Platinum-
 |  Mails. This bonus will become payable when the member has earned
 |  $200.00. A member will receive a $15.00 bonus for each new member who
 |  joins Platinum-Mails through their referral link. This bonus will
 |  become payable when that new member has earned $200.00. It is real
 | 
 |  Limited number of new user will accepted. Good luck!!!
 | 
 |  For join please visit:
 |  http://platinum-mails.ebiz-enterprises.com/?r=chinmoy
 | 
 | 
 | 
 |  -
 |  Do you Yahoo!?
 |  Yahoo! Tax Center - File online, calculators, forms, and more
 | 
 |  ---
 |  Incoming mail is certified Virus Free.
 |  Checked by AVG anti-virus system (http://www.grisoft.com).
 |  Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
 | 
 |
 | ---
 | Outgoing mail is certified Virus Free.
 | Checked by AVG anti-virus system (http://www.grisoft.com).
 | Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003
 |
 |
 |
 | --
 | PHP General Mailing List (http://www.php.net/)
 | To unsubscribe, visit: http://www.php.net/unsub.php
 |
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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





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



[PHP] RE: [newbie] drop down boxes

2003-04-06 Thread Bobby Rahman


Hiya,

I have created a dynamic table within my form.
Above the table I want to insert a filter to order by:the column names
Here is the static list:
select name=select4
   optionSeverity/option
   optionCrash/option
   optionMajor/option
   optionMinor/option
   optionReview/option
 /select
What I need suggestions on is:
1. recommended tutorials on lists and logic behind them.
2. How does the selected item in the list get stored (a variable?)and how 
can I place that in such a way to ORDER BY $filter_selected
3. also simple snippets of code always is appreciated (No one wants to 
reinvent the wheel) :)

Thanx

Bob

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

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


Re: [PHP] counting words.

2003-04-06 Thread Jome
Justin French wrote:
 It depends on what you define as a word, but let's take the simple
 approach of stripping HTML et al, and exploding the string on the
 spaces, then counting the array of words:

 ?
 $str = This is my b text /b that I want to count;
 $words = explode(' ', strip_tags($str));
 $count = count($words);

I believe substr_count() is faster than that method.

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


  Jome



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



Re: [PHP] Fast Templates error in PHP 4.3.1 ?

2003-04-06 Thread rush
Travel Jadoo [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 PHP 4.3.1 apparently doesn't allow anymore assigning of the same
 function name twice which FastTemplates still does around line 630 with
 function clear_assign for a perl module alias.

 So Fast Template users beware!

but the function in queston is very rarely used, and in most installations
can be renamed without problems.

rush
--
http://www.templatetamer.com/




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



[PHP] Permission issues with fopen on window xp pro.

2003-04-06 Thread Paul Kraus
I am working with chapter 10 in wrox Beginning php 4 book. I am running
my test system on windows XP pro.

I believe this error is due to a permissions setting. But when I look at
the properties for the default web page read write and scripts are all
checked.

Error:
Warning: fopen(./counter.dat) [function.fopen]: failed to create stream:
Permission denied in c:\inetpub\wwwroot\testing\counter.php on line 21

Code

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
  head
titleSimple Counter/title
  /head

  body
h1Simple Counter/h1
hr
?php
//counter.php
$counter_file = ./counter.dat;
if(!($COUNTER = fopen($counter_file, r))) die (Cannot open
$counter_file.);
$counter = (int) fread($COUNTER, 20);
fclose ($COUNTER);

$counter++;

echo ( You are visitor number $counter.);

$COUNTER = fopen($counter_file, w);
fwrite ($COUNTER, $counter_file);
fclose ( $COUNTER);
?
addressa href=mailto:[EMAIL PROTECTED]/a/address
!-- Created: Sun Apr 06 10:35:34 Eastern Standard Time 2003 --
!-- hhmts start --
Last modified: Sun Apr 06 11:01:02 Eastern Standard Time 2003
!-- hhmts end --
  /body
/html


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



Re: [PHP] any package for lost and found

2003-04-06 Thread Jason Sheets
Take a look at the Classifieds section on www.hotscripts.com/PHP

Jason

SayOrange.com wrote:

I am working on a project that shall have a section for 'Lost and 
Found' people lists with photographs. Does anyone knows of any package 
or code that could be reused here.
Thanks in advance.


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


Re: [PHP] Re: Q. Adding line numbers to highlighted source

2003-04-06 Thread Philip Olson

FWIW:

There is a proposal to add a runtime option to view
line numbers in the source, something like:

  http://www.example.com/hi.phps?SHOW_LINENUMBERS

In fact, some even thought it was applied but alas
it never was.  There is a little information on this
feature request here:

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

Don't hesistate to vote for this feature request :)

Regards,
Philip




On Sat, 5 Apr 2003, Alan McFarlane wrote:

 I suspect that is because of the regex code evaluation; but thanks for the
 suggestion anyway.
 
 BTW, I found a way to speed (my version) even more, something that I still
 forget to use on a regular basis but has been proven to be ~extremely~ good
 at boosting speed:
 
 replace:
 
 for ($i = 0; $i  count($source); $i++)
 
 with:
 
 for ($i = 0, $_count = count($source); $i  $_count; $i++)
 
 This simply prevents a continual reevaluation of count($source) (or
 whatever) and can provide some spectacular gains
 
 
 --
 Alan
 
 John W. Holmes [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  This also works the same, for comparisons sake, but your solution
  benchmarks faster:
 
  $i=2;
  $fp = fopen($url,'r');
  $file = fread($fp,filesize($url));
  $file = highlight_string($file,TRUE);
 
  $file = str_replace('code','codespan
  style=color:black;1/span',$file);
 
  $file = preg_replace('/br \//e','sprintf(br /span
  style=\color:black;\%05d /span,$i++)',$file);
 
  echo hr;
 
  echo $file;
 
  Enjoy!
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your copy
  today. http://www.phparch.com/
 
   -Original Message-
   From: Alan McFarlane [mailto:[EMAIL PROTECTED]
   Sent: Friday, April 04, 2003 12:46 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Re: Q. Adding line numbers to highlighted source
  
   Well I finally found a workable solution:
  
   $url = index.php; /* for example */
   $source = explode(br /, preg_replace(`\/?code\`Ui, ,
   highlight_file($url, true)));
  
   for ($i = 0; $i  count ($source); $i++)
   $source[$i] = span style=\color:black;\ . str_pad($i, 5,
  0,
   STR_PAD_LEFT) . /span  . $source[$i];
  
   echo code . implode(br /, $source) . /code;
  
  
  
  
   Alan McFarlane [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
I've been trying to add line-numbers to my source code, but can't
  seem
   to
work out how to do it.
   
As an example, I tried the following:
   
?php
   
function addPrefix( $matches )
{
static $line = 1;
   
return $line++ . $matches[0];
}
   
$url = split(\?, $_GET['url']);
$source = highlight_file($url[0], true);
$source = preg_replace_callback(`\br \/\`U, addPrefix,
  $source);
   
echo $source;
   
?
   
which is called whenever the use user on a link like a
href=show-source.php?url=index.phpShow Source/a
   
The problem is that my regex does not correcly match the lines.
   
Anyone got any bright ideas?
   
--
Alan McFarlane
   
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] RE: [newbie] drop down boxes

2003-04-06 Thread Philip Olson
On Sun, 6 Apr 2003, Bobby Rahman wrote:
 
 Hiya,
 
 I have created a dynamic table within my form.
 Above the table I want to insert a filter to order by:the column names
 
 Here is the static list:
 select name=select4
 optionSeverity/option
 optionCrash/option
 optionMajor/option
 optionMinor/option
 optionReview/option
   /select
 
 What I need suggestions on is:
 1. recommended tutorials on lists and logic behind them.
 2. How does the selected item in the list get stored (a variable?)and how 
 can I place that in such a way to ORDER BY $filter_selected
 3. also simple snippets of code always is appreciated (No one wants to 
 reinvent the wheel) :)

Checkbox, select, input text, textarea, who cares ... it
all comes out the same.  Read this:

  http://www.php.net/variables.external

The real question is is your form POST or GET, you will
find the answer within the above manual page on how to
retrieve the value.  Hint: $_POST['select4'];  Now let's
say you want to make sure it's appropriate first, and
then create the query, here's an example:

  $selects = array('severity','crash','major','minor','review');

  $select = strtolower($_POST['select4']);
  if (!in_array($select, $selects)) {
  $select = 'severity';
  }

  $sql = SELECT a FROM b ORDER BY $select LIMIT 40:

Of course that assumes those are table names in your db.  You
may want to be a little more user friendly and do for example:

  option value='severity'The Severity blah blah/option

Regards,
Philip


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



RE: [PHP] Permission issues with fopen on window xp pro.

2003-04-06 Thread John W. Holmes
What web server are you running? Are you using NTFS? PHP runs as the web
server (generally) so you have to make sure that user has permission to
access the file. If you're using IIS, it's the IUSR_computer_name
user. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Paul Kraus [mailto:[EMAIL PROTECTED]
 Sent: Sunday, April 06, 2003 11:32 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Permission issues with fopen on window xp pro.
 
 I am working with chapter 10 in wrox Beginning php 4 book. I am
running
 my test system on windows XP pro.
 
 I believe this error is due to a permissions setting. But when I look
at
 the properties for the default web page read write and scripts are all
 checked.
 
 Error:
 Warning: fopen(./counter.dat) [function.fopen]: failed to create
stream:
 Permission denied in c:\inetpub\wwwroot\testing\counter.php on line 21
 
 Code
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 html
   head
 titleSimple Counter/title
   /head
 
   body
 h1Simple Counter/h1
 hr
 ?php
 //counter.php
 $counter_file = ./counter.dat;
 if(!($COUNTER = fopen($counter_file, r))) die (Cannot open
 $counter_file.);
 $counter = (int) fread($COUNTER, 20);
 fclose ($COUNTER);
 
 $counter++;
 
 echo ( You are visitor number $counter.);
 
 $COUNTER = fopen($counter_file, w);
 fwrite ($COUNTER, $counter_file);
 fclose ( $COUNTER);
 ?
 addressa href=mailto:[EMAIL PROTECTED]/a/address
 !-- Created: Sun Apr 06 10:35:34 Eastern Standard Time 2003 --
 !-- hhmts start --
 Last modified: Sun Apr 06 11:01:02 Eastern Standard Time 2003
 !-- hhmts end --
   /body
 /html
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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



[PHP] creating new mail account on a domain

2003-04-06 Thread Lars Tvedt
How do i create a new mail account on a domain?

My domain is waveartists.com
and I wish to create a new mail account without using the server admin panel.
but rahter using a php script.

Do anyone know how to do this?

any help appreciated.





RE: [PHP] creating new mail account on a domain

2003-04-06 Thread Mark Douglas
This is entirely dependant on what mail server you are running, how it's
configured, and what tools you have at your disposal for controlling it
(CLI, web, ...).

If you actually want help with this issue, we're going to need a lot more
detail.

-Original Message-
From: Lars Tvedt [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 06, 2003 12:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] creating new mail account on a domain


How do i create a new mail account on a domain?

My domain is waveartists.com
and I wish to create a new mail account without using the server admin
panel.
but rahter using a php script.

Do anyone know how to do this?

any help appreciated.




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



Re: [PHP] Great Opportunity for all group members!!!

2003-04-06 Thread -{ Rene Brehmer }-
Luckily I've trained my mailserver to see spam a mile away ... so it's
only when the lists are spammed I actually see spam ... because I have to
whitelist those addresses, otherwise all mail from people's work addresses
would get into the spamtrap...but then atleast the spam reporting gets
manageable...

I get more spam for the harvesters on usenet though ...

Rene

On Sun, 6 Apr 2003 10:03:45 -0400, sunfire wrote about Re: [PHP] Great
Opportunity for all group members!!! what the universal translator turned
into this:

well in my case all i have to do is just push the block button on the
message and *poof* all gone... even on the php list thats all i have to do
(all the messages get sent to me from the original sender not the mailing
list itself)..

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



RE: [PHP] Great Opportunity for all group members!!!

2003-04-06 Thread John W. Holmes
Off topic, but here is a great report on the origins of spam:

http://www.cdt.org/speech/spam/030319spamreport.pdf

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: -{ Rene Brehmer }- [mailto:[EMAIL PROTECTED]
 Sent: Sunday, April 06, 2003 12:54 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Great Opportunity for all group members!!!
 
 Luckily I've trained my mailserver to see spam a mile away ... so it's
 only when the lists are spammed I actually see spam ... because I have
to
 whitelist those addresses, otherwise all mail from people's work
addresses
 would get into the spamtrap...but then atleast the spam reporting gets
 manageable...
 
 I get more spam for the harvesters on usenet though ...
 
 Rene
 
 On Sun, 6 Apr 2003 10:03:45 -0400, sunfire wrote about Re: [PHP]
Great
 Opportunity for all group members!!! what the universal translator
turned
 into this:
 
 well in my case all i have to do is just push the block button on the
 message and *poof* all gone... even on the php list thats all i have
to
 do
 (all the messages get sent to me from the original sender not the
mailing
 list itself)..
 
 --
 Rene Brehmer
 
 This message was written on 100% recycled spam.
 
 Come see! My brand new site is now online!
 http://www.metalbunny.net
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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



Re: [PHP] creating new mail account on a domain

2003-04-06 Thread Lars Tvedt
I have a Linux Server with PHP installed. that all i know..
imap and all the mail stuf are also installed but thats all i know..

LT.



Mark Douglas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This is entirely dependant on what mail server you are running, how it's
 configured, and what tools you have at your disposal for controlling it
 (CLI, web, ...).

 If you actually want help with this issue, we're going to need a lot more
 detail.

 -Original Message-
 From: Lars Tvedt [mailto:[EMAIL PROTECTED]
 Sent: Sunday, April 06, 2003 12:48 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] creating new mail account on a domain


 How do i create a new mail account on a domain?

 My domain is waveartists.com
 and I wish to create a new mail account without using the server admin
 panel.
 but rahter using a php script.

 Do anyone know how to do this?

 any help appreciated.






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