I sent this to the mysql list but it doesn't seem to be working so I was
hoping someone here could help.
I have the following 2 tables.
CREATE TABLE User (
UserKey INT NOT NULL AUTO_INCREMENT,
UserIDCHAR(16) NOT NULL UNIQUE ,
Name VARCHAR(20),
PRIMARY KEY (UserKey)
);
CREATE T
On 16-Sep-2003 Susan Ator wrote:
> I have a text file with the following format:
>
> name
> stuff
>
> message text
> message text
> message text
>
If you're sure the format is exactly that, then ...
$pat=array(
'',
'',
);
$marker='';
$data=file_get_contents('dafile.txt');
$msgblks=
hello
just a side note
instead of
> ereg( '^<$var>(.*)$', $line, $matches )
use
preg_match('/^<'.$var.'>(.*)$/', $line, $matches)
since it is faster than ereg.
Regards
Stefan Langer
Thank y'all so much for all your help.
sa
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 2:30 PM
To: Susan Ator
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] How do I do this PERL in PHP?
The following will do variable matching lik
he same thing over and over if
> there is a way to avoid it. :)
>
> sa
>
>
> -Original Message-
> From: Robert Cummings [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 16, 2003 12:05 PM
> To: Susan At
--- Susan Ator <[EMAIL PROTECTED]> wrote:
> It works beautifully. My only question is there a way to pass a
> variable to the ereg? In other words:
>
> if( ereg( '^(.*)$', $line, $matches ) )
>
> would become:
>
> if( ereg( '^<$var>(.*)$', $line, $matches ) )
>
> I've tried doing eval b
lot of fields and I hate doing the same thing over and over if
there is a way to avoid it. :)
sa
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 12:05 PM
To: Susan Ator
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How do I do this PERL i
This isn't tested, but should work :)
//
$to = '';
$subject = '';
$message = '';
$matches = array();
$data = file( $file );
foreach( $data as $id => $line )
{
if( ereg( '^(.*)$', $line, $matches ) )
{
$to = trim( $matches[1] );
I have a text file with the following format:
name
stuff
message text
message text
message text
I need to be able to assign a variable to the data like so:
$to = "everything to the left of ";
$subject = "everything to the left of ";
$message = "everything to the left of ";
so
$to = "name";
I've got the following possible (example) strings:
[hi] there, this is me [HI] there, this is me
[ho] there, that is you [HO] there, that is you
[hey] there, where are you [HEY] there, where are you
and so on. I'm trying to come up with a regex that will
find the capitalized text (only) between
get the webbrowser
> > > to switch the cities in the city-dropdown w/o reloading you'll need to
> > > use javascript or similar evil measures...
> >
> > I want to do it in pure php, how do I do this.
> >
> > I tried it in javascripts but I could
rom the dropdownbox, to get the webbrowser
> > to switch the cities in the city-dropdown w/o reloading you'll need to
> > use javascript or similar evil measures...
>
> I want to do it in pure php, how do I do this.
>
> I tried it in javascripts but I could
his with pure php you'll need to reload the page after
> the user selects the country from the dropdownbox, to get the webbrowser
> to switch the cities in the city-dropdown w/o reloading you'll need to
> use javascript or similar evil measures...
I want to do it in pure php, how
On Mon, Apr 23, 2001 at 04:59:49PM +0530, Adrian D'Costa produced this golden nugget:
> Hi,
>
> I have the following script. What I want is that when I select the
> country the corresponding cities should only be listed in the second
> dropdown box. Can some one guide me. Right below is my tab
Hi,
I have the following script. What I want is that when I select the
country the corresponding cities should only be listed in the second
dropdown box. Can some one guide me. Right below is my table
structure.
$searchStmt = "select name from airlines group by name order by name" ;
#$searc
Thanks Richard: I finally got it. I'm *really* rusty 'cos I went
completely code blind and struggled for a day with a silly syntax error!
This works just fine:
http://localhost/calculate_form.html");
exit;
}
if ($calc == "add") {
$result = $val1 + $val2;
} else if ($calc == "su
> if (ereg !=("^[0-9]+[.]?[0-9]*$", $val1)) {
> header("Location:http://localhost/calculate_form.html");
> exit;
>
> But the script will attempt to perform calculations on non numeric
> fields and
>
> I also want it to return the form if anyone puts in a non numeric value.
>
> I t
Can anyone show me how to do this?
I'm using a script out of Julie C. Meloni's book:
http://localhost/calculate_form.html");
exit;
if (ereg !=("^[0-9]+[.]?[0-9]*$", $val2)) {
header("Location:http://localhost/calculate_form.html");
18 matches
Mail list logo