[PHP] Regular Expressions....

2001-08-21 Thread Steve Wright

HEy, i am having major problems trying to work out this regular expression.
Regular expressions are still quite new to me, and i don't fully understand
them, so please bear with me... thanks!


This is what i wanmt to do, turn the following block of text:

if (top != self) top.location.replace(self.location.href) rcdb - Mantis
(Cedar Point) rcdbroller coaster database MantisCedar Point Quick Search
Coaster  Park Advanced Search Roller CoasterAmusement ParkTree ViewBy
Location  Distance Reports New for 2002New for 2001New for 2000CensusRecord
HoldersInversion Breakdown Other Stuff Site NewsAbout This SiteUser
CommentsFAQLinks Options  EnglishMetric Pictures Demographics Park:Cedar
Point Type:Steel Status:Operating since 5/11/1996 Categories:Stand Up
Builder:Bolliger  Mabillard (B  M) Cost:$12,000,000 Statistics Length
(feet):3900' Height (feet):145' Drop (feet):137' Inversions:4 Speed (mph):60
Duration (m:ss):2:40 Angle Of Descent (degrees):52 Capacity (riders per
hour):1800 Vehicles Arrangement:3 trains with 8 cars per train. Riders are
arranged 4 across in a single row for a total of 32 riders per train.
Restraints:Shoulder harnesses Height restriction:Riders must be 54 or
taller to ride. Other Information Features:Six elements: 119-foot-tall
vertical loop, 103-foot-high dive loop, heavily banked 360-degree turn,
83-foot-tall inclined loop, 360-degree flat spin and a figure-eight finale.
Problems? Questions? Comments? Your feedback is welcome here.All pages
Copyright © 1996-2001 Duane Marden. All Rights Reserved. Terms Of Use. CPU
Time: 0.040 seconds.


Into a nice block of text like this below:

Mantis
Park:Cedar Point
Type:Steel
Status:Operating since 5/11/1996
Categories:Stand Up
Builder:Bolliger  Mabillard (B  M)
Cost:$12,000,000
Statistics
Length (feet):3900'
Height (feet):145'
Drop (feet):137'
Inversions:4
Speed (mph):60
Duration (m:ss):2:40
Angle Of Descent (degrees):52
Capacity (riders per hour):1800
Vehicles Arrangement:3 trains with 8 cars per train. Riders are arranged 4
across in a single row for a total of 32 riders per train.
Restraints:Shoulder harnesses
Height restriction:Riders must be 54 or taller to ride.
Other Information
Features:Six elements: 119-foot-tall vertical loop, 103-foot-high dive loop,
heavily banked 360-degree turn, 83-foot-tall inclined loop, 360-degree flat
spin and a figure-eight finale.


CAN ANYONE WHO IS GOOD WITH REGULAR EXPRESSIONS HELP ME WITH THIS!!

I HAVE AROUND 1000 PAGES TO DO THIS ON!!
PLZ HELP!

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] you might like this

2001-08-08 Thread Steve Wright

 For those of you with a scientific disposition some Theories to ponder
 over . especially the cat one
 
 An American magazine held a competition, inviting its readers to submit
 new scientific theories on ANY subject. Below are the winners:
 
  5th place (Subject: Probability Theory)
 
 If an infinite number of rednecks riding in an infinite number of pickup
 trucks fire an infinite number of shotgun rounds at an infinite number
 of highway signs, they will eventually write the complete works of
 Shakespeare in Braille.
 
 4th place (Subject: Bio-Mechanics)
 
 Why Yawning Is Contagious: You yawn to equalize the pressure on
 your eardrums. This pressure change outside your head unbalances
 other people's ear pressures, so they then yawn to even it out.
 
 3rd place (Subject: Symbolic Logic)
 
 The Chinese are technologically underdeveloped because each of their
 alphabetical characters represents a whole word or phrase, rather than
 a single letter. Thus they cannot use acronyms to communicate technical
 ideas at a faster rate.
 
 2nd place (Subject: Newtonian Mechanics)
 
 Deforestation may cause earthquakes, tidal waves, or even the total
 destruction of our planet. Just as a figure-skater's rate of spin
 increases
 when the arms are brought in close to the body, the cutting down of tall
 trees may cause the Earth to spin dangerously fast on its axis with
 disastrous results.
 
 Winner (Subject: Perpetual Motion)
 
 When a cat is dropped, it always lands on its feet, and when toast is
 dropped, it always lands buttered side down. Therefore, if a slice of
 toast s strapped to a cat's back, buttered side up, and the animal is
 then dropped, the two opposing forces will cause it to hover, spinning
 inches above the ground. If enough toast-laden felines were used, they
 could form the basis of a high-speed monorail system.
 
  and then this mail got this reply from one of the recipients.
 
 I've been thinking about this cat/toast business for a while. In the
 buttered toast case, it's the butter that causes it to land buttered
 side down - it doesn't have to be toast, the theory works equally well
 with Jacob's crackers. So to save money you just miss out the toast -
 and butter the cats. Also, should there be an imbalance between the
 effects of cat and butter, there are other substances that have a
 stronger affinity for carpet.
  
 Probability of carpet impact is determined by the following simple
  formula: p = s * t(t)/t? 
 where p is the probability of carpet impact s is the stain value of
 the
 toast-covering substance - an indicator of the effectiveness of the
 toast
 topping in permanently staining the carpet. Chicken Tikka Masala, for
 example, has a very high s value, while the s value of water is zero.
 
  t?  and t(t) indicate the tone of the carpet and topping - the value of
 p
  being strongly related to the relationship between the color of the
 carpet
 and topping, as even chicken tikka masala won't cause a permanent and
 obvious stain if the carpet is the same colour. So it is obvious that
 the
  probability of carpet impact is maximised if you use chicken tikka
  masala and a white carpet - in fact this combination gives a p value of
 one, which is the same as the probability of a cat landing on its feet.
 
  Therefore a cat with chicken tikka masala on its back will be certain
 to
  hover in mid air, while there could be problems with buttered toast as
  the toast may fall off the cat, causing a terrible monorail crash
 resulting
  in nauseating images of members of the royal family visiting accident
  victims in hospital, and politicians saying it wouldn't have happened
 if
 their party was in power as there would have been more investment in
 cat-toast glue research. Therefore it is in the interests not only of
 public
 safety but also public sanity if the buttered toast on cats idea is
 scrapped, to be replaced by a monorail powered by cats smeared with
 chicken tikka masala  floating above a rail made from white shag pile
 carpet.


-- 
PHP General Mailing List (http://www.php.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 make it so....

2001-08-01 Thread Steve Wright

Hi,

I have modified an authentication script to my own liking, but being new, don't know 
how to go about my next stage.

Once the user has inserted the UN, and PW, it is campared against the MySQL database, 
nowm what i want to do is get rid of the login form which still appears, and is very 
annoying. I can't seem to see anything on this particular subject, but if their is 
any, can u point me in the right direction.

It can be viewed at: http://www.stevewrightonline.co.uk/auth/auth.php
UN: guest
PW: guest

Here's the code:
P
  FORM ACTION=? echo $PHP_SELF; ? METHOD=POST
  PUserName:br
  input type=text name=PHP_AUTH_USER size=15
  /p

  PPassword:br
  input type=password name=PHP_AUTH_PW size=15
  /p

  input type=submit value=Log In
  /form
 /P

?php 

$auth = false; // user is not authenticated yet

if (isset( $PHP_AUTH_USER )  isset($PHP_AUTH_PW)) { 

// Connect the MySQL  Database

mysql_connect( **.net', '**', '***' ) 
or die ( 'Unable to connect to server.' ); 

// Select database on MySQL server 

mysql_select_db( 'Demonstration' ) 
or die ( 'Unable to select database.' ); 

// the query 

$sql = SELECT * FROM users WHERE UserName = '$PHP_AUTH_USER' AND Password = 
'$PHP_AUTH_PW'; 

// Execute query and put results in $result 

$result = mysql_query( $sql ) 
or die ( 'Unable to execute query.' ); 

// Get number of rows in $result. 

$num = mysql_numrows( $result ); 

if ( $num != 0 ) { 

// matching row was found -  user authenticated. 

$auth = true; 

} 

} 

if ( ! $auth ) { 
 
 echo 'Sign In Required.'; 
exit; 

} else { 

echo 'pYou are Signed In!/p'; 
} 


? 





[PHP] Good Tutorial

2001-07-31 Thread Steve Wright


Hey,

I have done a few tutorials, but they aren't very long, and have only covered a small 
amount of what i need to know.

Can anyone recommend any good comprehensive tutorials out thier, and/or any good books 
that would be worth purchasing.


Kind Regards,
Steven Wright
-
[EMAIL PROTECTED]

ICQ Number:  47106748
AOL IM:SchumieFSK
MSN Messenger:   [EMAIL PROTECTED]



[PHP] Attitude of B van Ouwerkerk

2001-07-31 Thread Steve Wright

I have to say, after only being a member of the list for a while that the
attitude of  B van Ouwerkerk to be disgraceful.

Everybody needs help sometimes, and no one can know it all.. so if you don't
have anything positive to say, then don't say anything!


Thanks for reading,

Steve Wright


-- 
PHP General Mailing List (http://www.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: What tools do you use to develop PHP?

2001-07-31 Thread Steve Wright

I personally use a program called EditPlus, because it supports every darn
language that i can think of, Java, C, C++, PHP, Perl, HTMl, etc.. etc...

And it is really custimizable too!

- Original Message -
From: Anton Stroganov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 31, 2001 6:34 PM
Subject: Re: [PHP] Re: What tools do you use to develop PHP?


 FrontPage has PHP support built-in? who knew...

 At any rate, I recommend UltraEdit - it supports PHP syntax highlighting,
 FTP save and get and quite a few other useful features.

 And if you HAVE to have graphical environment, Dreamweaver 4 is not half
 bad, what with its customizeable tags and all, with a little work it can
be
 made work with PHP quite well.

 Anton Stroganov
 webmaster
 www.artwithin.com

 - Original Message -
 From: Matt Rogers [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, July 31, 2001 10:40
 Subject: Re: [PHP] Re: What tools do you use to develop PHP?


  Why would I pay $100 for something that I'd get sick of using anyway?
  FrontPage -- Now that's worth paying for!  I bought FP98 almost 4 years
 ago
  and I still use it to this day.
 
 
  ---
  -- MD Creations
  - Matt Rogers
  - Web Design Dept.
  - [EMAIL PROTECTED]
  Ralph Guzman [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Homesite: http://www.allaire.com/products/HomeSite/
  
   -Original Message-
   From: Matt Rogers [mailto:[EMAIL PROTECTED]]
   Sent: Monday, July 30, 2001 7:55 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Re: What tools do you use to develop PHP?
  
   I like PHPCoder for Winblowz:
  
   http://www.phpide.de
  
  
   There are a couple of others, but this one lets you do all kinds of
 stuff
   built-in.  Of course, it's for Windows and you have to download the
   documentation (mySQL, PHP, and htmlhelp.com's HTML docs)
  
   And the fact that it's still kinda buggy But it works and keeps me
  from
   having to load a bunch of different programs all at once to write,
 upload,
   and test my php scripts. =)
  
   (I'm a Beta enthuisiast)
   ---
   -- MD Creations
   - Matt Rogers
   - Web Design Dept.
   - [EMAIL PROTECTED]
   Gerry Kirk [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,
   
I'm putting together a PHP development framework for our small
group.
 We
have worked on a couple of small apps, so now it's time to do things
a
little more methodically, i.e. make life easier for everyone. :)
   
So, I scanned the web and found quite a few options for code
 libraries,
and a few for PHP code editors.
   
I'm interested to know what tools / libraries people prefer -
   
1. Code libraries:
a) Metabase (for database abstraction)
b) PHPLib
c) PEAR
d) BinaryCloud
e) other
   
2. What code editor do you use?
   
3. Source code control. CVS appears to be the only real option here.
   
TIA,
Gerry
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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



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




[PHP] Visual Login

2001-07-31 Thread Steve Wright

How can i go about doing a visual login on a web page... instead of the pop up window 
i have at the min like with .htaccess ??

I apologize if this is in the manual, but i couldn't see it

Kind Regards,

Steve



[PHP] Newbie: Simple site search To bit more Complex...

2001-07-30 Thread Steve Wright

Hey,

I have just developed a simple site search.. .and am after learning how to
get it to search all directories... at present, it only searches the one it
is in!!


Here's the code:

?
include(include/common.inc);
$title = Search;
include(include/header.inc);
?
P
FORM ACTION=? echo $PHP_SELF; ? METHOD=POST
INPUT TYPE=text NAME=searchstr value=? echo $searchstr; ?
   SIZE=20 MAXLENGTH=30
INPUT TYPE=submit VALUE=Search!
/FORM
/P
?
if ( ! empty($searchstr) ) {
// empty() is used to check if we've any search string
// if we do, call grep and display the results.
echo HR\n;
// call grep with case-insensitive search mode on all files
$cmdstr = grep -i $searchstr *;
$fp = popen( $cmdstr, r ); file://open the output of command
as a  pipe
$myresult = array(); // to hold my search results
while( $buffer = fgetss ($fp, 4096 )) {
// grep returns in the format
// filename: line
// So, we use split() to split the data
list($fname, $fline) = split(:,$buffer, 2);
// we take only the first hit per file
if ( !defined($myresult[$fname]))
$myresult[$fname] = $fline;
}
// we have results in a hash. lets walk through it and print
it
if ( count($myresult) ){
echo OL\n;
while(list($fname,$fline) = each($myresult))
echo LI
   A HREF=\$fname\$fname/A : $fline /LI\n;
echo /OL\n;
} else {
// no hits
echo Sorry. Search on B$searchstr/B
  returned no results.BR\n;
}
pclose($fp);
}
?
?
include(include/footer.inc);
?



I think it centers around the line whcich contains but am not definate:
while( $buffer = fgetss ($fp, 4096 )) {


Any help much appreciated..

Steve Wright





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




[PHP] Newbie: Site search, more than one directory

2001-07-30 Thread Steve Wright

Hey,

I have just developed a simple site search.. .and am after learning how to
get it to search all directories... at present, it only searches the one it
is in!!


Here's the code:

?
include(include/common.inc);
$title = Search;
include(include/header.inc);
?
P
FORM ACTION=? echo $PHP_SELF; ? METHOD=POST
INPUT TYPE=text NAME=searchstr value=? echo $searchstr; ?
   SIZE=20 MAXLENGTH=30
INPUT TYPE=submit VALUE=Search!
/FORM
/P
?
if ( ! empty($searchstr) ) {
// empty() is used to check if we've any search string
// if we do, call grep and display the results.
echo HR\n;
// call grep with case-insensitive search mode on all files
$cmdstr = grep -i $searchstr *;
$fp = popen( $cmdstr, r ); file://open the output of command
as a  pipe
$myresult = array(); // to hold my search results
while( $buffer = fgetss ($fp, 4096 )) {
// grep returns in the format
// filename: line
// So, we use split() to split the data
list($fname, $fline) = split(:,$buffer, 2);
// we take only the first hit per file
if ( !defined($myresult[$fname]))
$myresult[$fname] = $fline;
}
// we have results in a hash. lets walk through it and print
it
if ( count($myresult) ){
echo OL\n;
while(list($fname,$fline) = each($myresult))
echo LI
   A HREF=\$fname\$fname/A : $fline /LI\n;
echo /OL\n;
} else {
// no hits
echo Sorry. Search on B$searchstr/B
  returned no results.BR\n;
}
pclose($fp);
}
?
?
include(include/footer.inc);
?



I think it centers around the line whcich contains but am not definate:
while( $buffer = fgetss ($fp, 4096 )) {


Any help much appreciated..

Steve Wright