[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:



" METHOD="POST">
"
   SIZE="20" MAXLENGTH="30">



\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 "\n";
while(list($fname,$fline) = each($myresult))
echo "
   $fname : $fline \n";
echo "\n";
} else {
// no hits
echo "Sorry. Search on $searchstr
  returned no results.\n";
}
pclose($fp);
}
?>




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:



" METHOD="POST">
"
   SIZE="20" MAXLENGTH="30">



\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 "\n";
while(list($fname,$fline) = each($myresult))
echo "
   $fname : $fline \n";
echo "\n";
} else {
// no hits
echo "Sorry. Search on $searchstr
  returned no results.\n";
}
pclose($fp);
}
?>




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] 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] HELP!! What wrong with this code...

2001-07-31 Thread Steve Wright

Hey, i am getting an error passed back for this line of code, the rest of the code is 
below:

echo "Your feedback has been sent to mailto:$address";>$name";

the error is:

Parse error: parse error, expecting `','' or `';'' in 
/www/customers/stevewrightonline.co.uk/form/do_sendform.php on line 20


Does anyone know y this is?? If i remove the a href tags it works fine. Can you not 
use links properly in PHP??

--
 \n";
$mailheaders = "Reply-To: $sender_email\n\n";

/*The Message*/
$msg = "Sender:\t mailto:$sender_email \t $sender_name\n\n";
$msg = "Message:\t$message\n\n";

/*Mail to Me*/
mail($recipient, $subject, $msg, $mailheaders);


/*Onscreen confirmation of sending*/
echo "Form Sent!";
echo "Thank You, $sender_name";
echo "Your feedback has been sent to mailto:$address";>$name";
echo "";
?>




[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.
> >
> >
> > ---
> > -- M&D 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)
> > > ---
> > > -- M&D 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] Types of table....

2001-07-31 Thread Steve Wright

HEy,

I am still a newbie, and have no idea how to use phpMyAdmin yet, and don't really know 
much about MySQL databases and setting up tables.

My Question:What table type should i use for a users REAL NAME, USERNAME, 
PASSWORD, how long should i set these to, and should i have anything else clicked 
while in the process??


Thanks..

Steve



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

  " METHOD="POST">
  UserName:
  
  

  Password:
  
  

  
  
 

You are Signed In!'; 
} 


?> 





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