Re: [PHP] How to get all links from a webpage?

2004-07-24 Thread Wudi
Hm, Perl is OK. Could you send that program to me?
I have searched the class in phpclasses.org, but not found.
The classes I searched only can replace the link, can't get links.


On Sat, 24 Jul 2004 12:36:25 +0600
raditha dissanayake <[EMAIL PROTECTED]> wrote:

> 
> Wudi wrote:
> 
> >How can I get all links from a webpage?
> >  
> >
> You need to parse the HTML of the web page first there may be several 
> classes already available taht does it for you. The best I have seen 
> though is not in PHP but in perl.
> 
> 
> 
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
Comment: English is not my first language.
Wudi <[EMAIL PROTECTED]>

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



[PHP] Re: using the mssql functions on a linux server

2004-07-24 Thread Chris Martin
Skippy wrote:
On Mon, 12 Jul 2004 14:54:15 -0400 [EMAIL PROTECTED] (Edward Peloke) wrote:
Is this the only way around it?  Can I get to mssql without using the mssql
extension?

I don't think so. Plus, the entire setup is a bit complicated and you need
FreeTDS as well as UnixODBC installed, plus some /etc configuration "magic".
FWIW, I have an article on the subject. It's in Romanian, but the commands,
configuration files and testing PHP code are clearly marked and are of course
universal, so perhaps you can make do with just some copy&paste.
See here:
http://rowd.zuavra.net/articole/11/p2/
P.S.: If anyone wishes to put an English version on their site please contact
me in private. I'll take the time to translate it. I haven't put the English
version on the Web myself since my site is meant to be in Romanian only.
A bit late, but for future reference, I have an English translation of 
this article available at:
http://www.chriscodes.com/articles/Connecting_to_MSSQL_from_PHP_under_Linux/

--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: JavaScript in PHP or PHP in JavaScript

2004-07-24 Thread Torsten Roehr
"Robb Kerr" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Let me preface this by saying that I don't know JavaScript. I've got a
page
> that is built by a long complicated JavaScript that I was able to hack
just
> enough to function the way I wanted. There are some lines of code -- those
> that define div positioning -- that need to be different depending upon
> what it obtained from my database. I could build a simple PHP if/then
> statement and embed the entire JavaScript with the lines changed. Or, I
> could build a simple PHP if/then statement with only the lines of
> JavaScript that need to be changed and embed it within the JavaScript.
> which would be better?
>
> JavaScript in PHP
>
>if (conditional) {
> ?>
>   several lines of JavaScript
>  }
> ?>
>
>
> PHP in JavaScript
>
> 
>   several lines of JavaScript
>    if (conditional) {
>   echo 'lines of JavaScript';
> } else {
>   echo 'other lines of JavaScript';
> }
>   ?>
>   several lines of JavaScript
> 
>
>
> Thanx,
> Robb

Hi Rob,

maybe you can use the ternary operator syntax for the affected lines:

echo (conditional) ? 'lines of JavaScript'
   : 'other lines of JavaScript';

Regards, Torsten Roehr

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



[PHP] :)

2004-07-24 Thread thies
Argh, i  don't  like  the  plaintext :)
 
archive password:  74455

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

Re: [PHP] which user is a script executing as?

2004-07-24 Thread Peter Risdon
Matt M. wrote:
How do I determine with which user's permissions PHP scripts are executing?
I am experimenting with suEXEC and running PHPs as CGIs; I need to know
with which user's permissions PHP scripts are executing.
I've tried using getmyuid() and get_current_user(), but these only report the
owner of the script - not necessarily whether the script is actually executing
as this user or not. I couldn't find this information in phpinfo().
Suggestions much appreciated!
Do you have User and Group (apache1.3) or UserGroup (apache2) lines in 
your httpd.conf or virtual host include file? These specify which user 
to run as under suexec.

Once that is in place, I generally just create a file from the script to 
see the uid.

Peter.
Thanks!

on linux
$user = `whoami`;
print $user;
you might need to get rid of  \n
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Disk serial number

2004-07-24 Thread Rosen
Thanks,
But how I can parse this output ?

"Burhan Khalid" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Rosen wrote:
>
> > Yes, on Linux there is a command to get this info, but on windows I
think
> > there'n no thath command.
> > Is there a module for PHP to do this ?
>
> c:\>dir c:\test.txt
>   Volume in drive C is Primary
>   Volume Serial Number is 003E-6CEA
>
>   Directory of c:\
>
> 07/23/2004  01:43 PM11 test.txt
> 1 File(s) 11 bytes
> 0 Dir(s)  23,576,174,592 bytes free
>
> Just parse that.

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



Re: [PHP] How to get all links from a webpage?

2004-07-24 Thread raditha dissanayake
Wudi wrote:
Hm, Perl is OK. Could you send that program to me?
I have searched the class in phpclasses.org, but not found.
The classes I searched only can replace the link, can't get links.
 

I am refering to the perl html parser module available for download at CPAN.
--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] If...Or...Else

2004-07-24 Thread Robb Kerr
>From time to time I need an If statement that includes an Or condition...



What's the correct syntax for the If line?

Thanx
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



[PHP] Re: PHP editor that doesn't require installation

2004-07-24 Thread rush
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does anyone know of a good windows PHP editor that I can run from a USB
> flash drive without installing it? A good stand-alone editor. I know how
> to use Vi, so I'll even take a copy of that (so long as it's got syntax
> hightlighting) so long as installation isn't required.
>
> For everyone else, yes, I know what editor you use, so you don't have to
> tell me. I agree that what you use is the best editor ever. No, really.
> Honest. ;)

scite, from the scintilla fame. TemplateTamer would also work fine if you
just copy the whole directory

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

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



Re: [PHP] If...Or...Else

2004-07-24 Thread Marcus Strube
>if ((condition1 == TRUE) OR (condition2 == TRUE)) {
> do something;
>   } esle {
> do something else;
>   }
> ?>
>
> What's the correct syntax for the If line?

if(true == condition1 || true == condition2) {
echo "Hello World";
} else {
echo "Best Regards";
}

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



[PHP] Re: If...Or...Else

2004-07-24 Thread Tularis
if(a OR b) {
 do something
} else {
 do something else
}
or
if(a || b) {
 do something
} else {
 do something else
}
is enough :)
Robb Kerr wrote:
From time to time I need an If statement that includes an Or condition...

What's the correct syntax for the If line?
Thanx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] editor for remote files using ssh

2004-07-24 Thread Peter Risdon
I have been using emacs/tramp for editing files on remote machines, but 
I find it can be flaky - no doubt I am doing something wrong. Can anyone 
suggest a good programmers' text editor that at least has syntax 
highlighting and can use ssh for accessing files directly on remote 
machines? I need a Unix program, preferably a FreeBSD port, but am happy 
to compile something myself if it will work consistently or at least 
give some kind of error message if it has difficulty, and not just hang.

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


Re: [PHP] editor for remote files using ssh

2004-07-24 Thread Miroslav Hudak (php/ml)
Vi or ViM :)
m.
Peter Risdon wrote:
I have been using emacs/tramp for editing files on remote machines, but 
I find it can be flaky - no doubt I am doing something wrong. Can anyone 
suggest a good programmers' text editor that at least has syntax 
highlighting and can use ssh for accessing files directly on remote 
machines? I need a Unix program, preferably a FreeBSD port, but am happy 
to compile something myself if it will work consistently or at least 
give some kind of error message if it has difficulty, and not just hang.

TIA.
Peter.
--
Miroslav Hudak
developer & designer
http://hudak.info
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP5, XPath and count()

2004-07-24 Thread Victor Boivie
Christian Stocker wrote:
var_dump($xpath->query("count(/catalog/cd")->item(0));

this doesn't work yet in DOM. The returned value has to be a nodeset.
Will be fixed some day ;)
Thanks, both Jason and Christian
I found something else that I think is strange.
  $dom = new DOMDocument();
  $root = $dom->createElement("test");
  $dom->appendChild($root);
  $node = $dom->createElement("foo", "which entities does it 
escape & which doesn't it?");
  $root->appendChild($node);

  echo $dom->saveXML();
The result will be:

which entities does it escape 
It stops at the &, which I think is strange. It escapes the < to < 
and > to >, but not & to &. It would be better if it escaped none 
or all entites that "can do harm".

Or what do you think?
regards,
Victor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Nested If...Else...

2004-07-24 Thread Robb Kerr
What's wrong with this syntax. I just can't see my mistake.

if ($vBkgrndImage == "AnswerPage") {
  if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
$vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
  } else {
$vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
  }
}

Thanx
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Scot L. Harris
On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
> What's wrong with this syntax. I just can't see my mistake.
> 
> if ($vBkgrndImage == "AnswerPage") {
>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>   } else {
> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>   }
> }
> 
> Thanx

Single quotes around CorrectAnswer?

What is the error you are getting?

Guessing that if it passes the syntax checks I expect your problem is it
is always evaluating to one of the options and not the other.  
-- 
Scot L. Harris
[EMAIL PROTECTED]

Let not the sands of time get in your lunch. 

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 12:09:41 -0400, Scot L. Harris wrote:

> On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
>> What's wrong with this syntax. I just can't see my mistake.
>> 
>> if ($vBkgrndImage == "AnswerPage") {
>>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
>> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>>   } else {
>> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>>   }
>> }
>> 
>> Thanx
> 
> Single quotes around CorrectAnswer?
> 
> What is the error you are getting?
> 
> Guessing that if it passes the syntax checks I expect your problem is it
> is always evaluating to one of the options and not the other.

You've got it. Syntax passes checking - always returns..
 $vBkgrndImage = "Bkgrnd-Body-Correct.jpg"

Single quotes around 'CorectAnswer' is because that entry is in the style
of table_recordset['field']. How else should this be coded?

Thanx
-- 
Robb Kerr
Digital IGUANA

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Marek Kilimajer
Robb Kerr wrote:
On Sat, 24 Jul 2004 12:09:41 -0400, Scot L. Harris wrote:

On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
What's wrong with this syntax. I just can't see my mistake.
if ($vBkgrndImage == "AnswerPage") {
 if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
   $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
 } else {
   $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
 }
}
Thanx
Single quotes around CorrectAnswer?
What is the error you are getting?
Guessing that if it passes the syntax checks I expect your problem is it
is always evaluating to one of the options and not the other.

You've got it. Syntax passes checking - always returns..
 $vBkgrndImage = "Bkgrnd-Body-Correct.jpg"
Single quotes around 'CorectAnswer' is because that entry is in the style
of table_recordset['field']. How else should this be coded?
Thanx
I think all column names are returned lowercased, so use 
$row_RS_PageContent['correctanswer']

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


Re: [PHP] Nested If...Else...

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 18:18:23 +0200, Marek Kilimajer wrote:

> Robb Kerr wrote:
>> On Sat, 24 Jul 2004 12:09:41 -0400, Scot L. Harris wrote:
>> 
>> 
>>>On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
>>>
What's wrong with this syntax. I just can't see my mistake.

if ($vBkgrndImage == "AnswerPage") {
  if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
$vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
  } else {
$vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
  }
}

Thanx
>>>
>>>Single quotes around CorrectAnswer?
>>>
>>>What is the error you are getting?
>>>
>>>Guessing that if it passes the syntax checks I expect your problem is it
>>>is always evaluating to one of the options and not the other.
>> 
>> 
>> You've got it. Syntax passes checking - always returns..
>>  $vBkgrndImage = "Bkgrnd-Body-Correct.jpg"
>> 
>> Single quotes around 'CorectAnswer' is because that entry is in the style
>> of table_recordset['field']. How else should this be coded?
>> 
>> Thanx
> 
> I think all column names are returned lowercased, so use 
> $row_RS_PageContent['correctanswer']

Nope. That just changed the return to always be the other option.
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 12:09:41 -0400, Scot L. Harris wrote:

> On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
>> What's wrong with this syntax. I just can't see my mistake.
>> 
>> if ($vBkgrndImage == "AnswerPage") {
>>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
>> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>>   } else {
>> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>>   }
>> }
>> 
>> Thanx
> 
> Single quotes around CorrectAnswer?
> 
> What is the error you are getting?
> 
> Guessing that if it passes the syntax checks I expect your problem is it
> is always evaluating to one of the options and not the other.

To eliminate the single quotes in the IF statement I altered the code like
this...

$vPageContentCorrectAnswer = $row_RS_PageContent['CorrectAnswer'];
if ($vBkgrndImage == "AnswerPage") {
  if ($vPageContentCorrectAnswer != $vAnswerID_RS_PageContent) {
$vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
  } else {
$vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
  }
}

It still works the same. What's the deal?
-- 
Robb Kerr
Digital IGUANA

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Jason Davidson
print out all the values of the vars your comparing often youll
find one of them is not what your expecting

Jason

On Sat, 24 Jul 2004 11:05:06 -0500, Robb Kerr
<[EMAIL PROTECTED]> wrote:
> What's wrong with this syntax. I just can't see my mistake.
> 
> if ($vBkgrndImage == "AnswerPage") {
>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>   } else {
> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>   }
> }
> 
> Thanx
> --
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
> 
> --
> 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] Nested If...Else...

2004-07-24 Thread Matthew Sims
> What's wrong with this syntax. I just can't see my mistake.
>
> if ($vBkgrndImage == "AnswerPage") {
>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>   } else {
> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>   }
> }
>
> Thanx
> --
> Robb Kerr

I can't see anything wrong. What's the error you're receiving?

-- 
--Matthew Sims
--

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Matthew Sims
> print out all the values of the vars your comparing often youll
> find one of them is not what your expecting
>
> Jason
>
> On Sat, 24 Jul 2004 11:05:06 -0500, Robb Kerr
> <[EMAIL PROTECTED]> wrote:
>> What's wrong with this syntax. I just can't see my mistake.
>>
>> if ($vBkgrndImage == "AnswerPage") {
>>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer'])
>> {
>> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>>   } else {
>> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>>   }
>> }
>>
>> Thanx
>> --
>> Robb Kerr

Yes, see what the vars are, maybe something like this:

if ($vBkgrndImage == "AnswerPage") {
  echo "1: $vAnswerID_RS_PageContent";
  echo "2:".$row_RS_PageContent['CorrectAnswer']."";
}

Then look on your page for the numbers 1 and 2 and see if the vars are
what you're expecting.

-- 
--Matthew Sims
--

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 09:47:52 -0700 (PDT), Matthew Sims wrote:

>> What's wrong with this syntax. I just can't see my mistake.
>>
>> if ($vBkgrndImage == "AnswerPage") {
>>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
>> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>>   } else {
>> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>>   }
>> }
>>
>> Thanx
>> --
>> Robb Kerr
> 
> I can't see anything wrong. What's the error you're receiving?

$vBkgrndImage = "Bkgrnd-Body-Incorrect" whether $vAnswerID_RS_PageContent
equals $row_RS_PageContent['CorrectAnswer'] or not. I've added printouts of
my variables to the bottom of the page so that I can check their content.
And even when both associated variables match, "Bkgrnd-Body-Incorrect" is
returned.
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Stan F
Try this:

echo "";
print_r( variable_you_wanna_track );
echo "";

The output will be easy-readable. Or try var_dump().
This helps maintaining scripts in more pleasant way.

- Original Message -
From: "Robb Kerr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 24, 2004 8:49 PM
Subject: Re: [PHP] Nested If...Else...


> On Sat, 24 Jul 2004 09:47:52 -0700 (PDT), Matthew Sims wrote:
>
> >> What's wrong with this syntax. I just can't see my mistake.
> >>
> >> if ($vBkgrndImage == "AnswerPage") {
> >>   if ($vAnswerID_RS_PageContent !=
$row_RS_PageContent['CorrectAnswer']) {
> >> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
> >>   } else {
> >> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
> >>   }
> >> }
> >>
> >> Thanx
> >> --
> >> Robb Kerr
> >
> > I can't see anything wrong. What's the error you're receiving?
>
> $vBkgrndImage = "Bkgrnd-Body-Incorrect" whether $vAnswerID_RS_PageContent
> equals $row_RS_PageContent['CorrectAnswer'] or not. I've added printouts
of
> my variables to the bottom of the page so that I can check their content.
> And even when both associated variables match, "Bkgrnd-Body-Incorrect" is
> returned.
> --
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org
>
> --
> 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: If...Or...Else

2004-07-24 Thread Stan F
Operations OR and || have different execution priorities. I'd prefer "||" as
it's "more important" so not so many parentheses needed to ensure the order
of interpretation is exactly what u need.

- Original Message -
From: "Tularis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 24, 2004 6:57 PM
Subject: [PHP] Re: If...Or...Else


> if(a OR b) {
>   do something
> } else {
>   do something else
> }
>
> or
>
> if(a || b) {
>   do something
> } else {
>   do something else
> }
>
> is enough :)
>
> Robb Kerr wrote:
> > From time to time I need an If statement that includes an Or
condition...
> >
> >  >   if ((condition1 == TRUE) OR (condition2 == TRUE)) {
> > do something;
> >   } esle {
> > do something else;
> >   }
> > ?>
> >
> > What's the correct syntax for the If line?
> >
> > Thanx
>
> --
> 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] Nested If...Else...

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 12:09:41 -0400, Scot L. Harris wrote:

> On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
>> What's wrong with this syntax. I just can't see my mistake.
>> 
>> if ($vBkgrndImage == "AnswerPage") {
>>   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
>> $vBkgrndImage = "Bkgrnd-Body-Incorrect.jpg";
>>   } else {
>> $vBkgrndImage = "Bkgrnd-Body-Correct.jpg";
>>   }
>> }
>> 
>> Thanx
> 
> Single quotes around CorrectAnswer?
> 
> What is the error you are getting?
> 
> Guessing that if it passes the syntax checks I expect your problem is it
> is always evaluating to one of the options and not the other.

Sorry everyone. Found the problem. Thanx for all your trying. The problem
was a stupid error on my part - which they usually are.

The syntax of the IF statement was correct. I had the $_GET statement which
defined $vAnswer_ID_RS_PageContent below the IF in the script. Both of
these elements are in the  so the display of the variables are below
this in the . So, I was seeing variables containing the correct
values, but when the IF was executed, $vAnswer_ID_RS_PageContent had not
yet been defined.

Thanx again for your help.
-- 
Robb Kerr
Digital IGUANA

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



Re: [PHP] Re: If...Or...Else

2004-07-24 Thread Jason Davidson
OR is also bitwise is it not?

Jason

On Sat, 24 Jul 2004 21:23:13 +0400, Stan F <[EMAIL PROTECTED]> wrote:
> Operations OR and || have different execution priorities. I'd prefer "||" as
> it's "more important" so not so many parentheses needed to ensure the order
> of interpretation is exactly what u need.
> 
> 
> 
> - Original Message -
> From: "Tularis" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, July 24, 2004 6:57 PM
> Subject: [PHP] Re: If...Or...Else
> 
> > if(a OR b) {
> >   do something
> > } else {
> >   do something else
> > }
> >
> > or
> >
> > if(a || b) {
> >   do something
> > } else {
> >   do something else
> > }
> >
> > is enough :)
> >
> > Robb Kerr wrote:
> > > From time to time I need an If statement that includes an Or
> condition...
> > >
> > >  > >   if ((condition1 == TRUE) OR (condition2 == TRUE)) {
> > > do something;
> > >   } esle {
> > > do something else;
> > >   }
> > > ?>
> > >
> > > What's the correct syntax for the If line?
> > >
> > > Thanx
> >
> > --
> > 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] Weeeeee! ;)))

2004-07-24 Thread richard
I  don't bite, weah!
 
..btw, "10370" is  a  password  for archive

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

[PHP] Re: editor for remote files using ssh

2004-07-24 Thread Harlequin
I use HTML-Kit which highlights syntax for a number of languages, PHP
included.

I am unsure of its ability to connect using SSL but it's very customisable
when creating a new remote folder and I use it to work on remote files all
the time. It simply creates a connection if needed and saves the files when
you hit save.

Hope that was of use.

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
"Peter Risdon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have been using emacs/tramp for editing files on remote machines, but
> I find it can be flaky - no doubt I am doing something wrong. Can anyone
> suggest a good programmers' text editor that at least has syntax
> highlighting and can use ssh for accessing files directly on remote
> machines? I need a Unix program, preferably a FreeBSD port, but am happy
> to compile something myself if it will work consistently or at least
> give some kind of error message if it has difficulty, and not just hang.
>
> TIA.
>
> Peter.

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



[PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Harlequin
I've been working on a query to retrieve a user's data based on their UserID
that is stored in a variable "$_SESSION['logname']" which underneath I
convert using: $UserID = $_SESSION['logname'];

But when I execute a SELECT query:

$CaptureDetails = "SELECT * FROM RegisteredMembers
   WHERE UserID = $UserID";

I get:

Unknown column 'Admin' in 'where clause'

I've tried everything I can think of. any suggestions...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-

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



Re: [PHP] Re: Installing Php5 over Existing Php4.3.6

2004-07-24 Thread Curt Zirzow
* Thus wrote Francis Chang:
> 
> What is the proper way to "uninstall" the existing installation?  Do I just
> do a 'make distclean'?  Would that clean up all the libraries and the
> program files of the existing installation?

No, distclean only cleans up the temporary files in the source
tree.

If you didn't supply a --prefix option (or other special directory
location stuff) to php's configure, it generally will choose
/usr/local/ as the prefix. So you'll see most files that are
installed here:

  /usr/local/lib/php*   #config, pear etc.
  /usr/local/bin/php# cli binary


And depending on your webserver setup (assuming apache) a .so file
here:
 /path/to/webserver/root/libexec/libphp4.so




Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Marek Kilimajer
Harlequin wrote:
I've been working on a query to retrieve a user's data based on their UserID
that is stored in a variable "$_SESSION['logname']" which underneath I
convert using: $UserID = $_SESSION['logname'];
But when I execute a SELECT query:
$CaptureDetails = "SELECT * FROM RegisteredMembers
   WHERE UserID = $UserID";
I get:
Unknown column 'Admin' in 'where clause'
because your query looks like:
SELECT * FROM RegisteredMembers WHERE UserID = Admin
you miss quotes around $UserID:
$CaptureDetails = "SELECT * FROM RegisteredMembers
   WHERE UserID = '$UserID'";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Jason Davidson
whats in UserId var.. any spaces or nonword chars.. if so, quote it.

Jason

On Sat, 24 Jul 2004 19:49:04 +0100, Harlequin
<[EMAIL PROTECTED]> wrote:
> I've been working on a query to retrieve a user's data based on their UserID
> that is stored in a variable "$_SESSION['logname']" which underneath I
> convert using: $UserID = $_SESSION['logname'];
> 
> But when I execute a SELECT query:
> 
> $CaptureDetails = "SELECT * FROM RegisteredMembers
>WHERE UserID = $UserID";
> 
> I get:
> 
> Unknown column 'Admin' in 'where clause'
> 
> I've tried everything I can think of. any suggestions...?
> 
> --
> -
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -
> 
> --
> 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] Unexpected T_ENCAPSED...

2004-07-24 Thread Jason Davidson
Sorry, let me clearify.. unless UserId is an integer, quote it !!

jason

On Sat, 24 Jul 2004 12:03:54 -0700, Jason Davidson
<[EMAIL PROTECTED]> wrote:
> whats in UserId var.. any spaces or nonword chars.. if so, quote it.
> 
> Jason
> 
> 
> 
> On Sat, 24 Jul 2004 19:49:04 +0100, Harlequin
> <[EMAIL PROTECTED]> wrote:
> > I've been working on a query to retrieve a user's data based on their UserID
> > that is stored in a variable "$_SESSION['logname']" which underneath I
> > convert using: $UserID = $_SESSION['logname'];
> >
> > But when I execute a SELECT query:
> >
> > $CaptureDetails = "SELECT * FROM RegisteredMembers
> >WHERE UserID = $UserID";
> >
> > I get:
> >
> > Unknown column 'Admin' in 'where clause'
> >
> > I've tried everything I can think of. any suggestions...?
> >
> > --
> > -
> >  Michael Mason
> >  Arras People
> >  www.arraspeople.co.uk
> > -
> >
> > --
> > 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] Unexpected T_ENCAPSED...

2004-07-24 Thread Philip Olson
> Sorry, let me clearify.. unless UserId is an integer, quote it !!

And quoting integers is not a problem, I even prefer it.  IMHO we should
tell people to quote all values so if someone "forgets" to do any sort of
input validation (i.e. make sure it's actually an integer) there won't be
a major problem otherwise problems (including SQL injection) may arise.

Regards,
Philip

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



Re: [PHP] Changing items in $_POST

2004-07-24 Thread Curt Zirzow
* Thus wrote Jeff Oien:
> I have items from a form that will be in $_POST that I want to send on.
> I'll be using this:
> $arr = array();
> 
> foreach($_POST as $key => $value) {
>   $arr[] = $key.'='.urlencode($value);
> }
> 
> $URL = "https://example.com/script.asp?".implode('&',$arr);
> header("Location: $URL\n");
> 
> However, there are a few variables I need changed. For example, the 
> people I'm sending it to need $rate_1m which is a mortgage rate but in 
> $_POST there is $rate_1m1 (the whole number) and $rate_1m2 (the two 
> numbers after the decimal). How do I get those two together and then 
> discard the two numbers and only send $rate_1m? If that makes any sense.

Instead of iterating through all the POST data, i would set up an
array of all the fields I need to pass to the other site:

$pass_fields = array('rate_1m', 'field2', 'field3');

Then iterate through those and fetch the appropriate POST variable
with some filtering:

foreach($pass_fields as $field) {

  switch ($field) {

case 'rate_1m':
  $arr[] = 'rate1m1=' . urlencode($_POST['rate1m1'] . '.' $_POST['rate1m2']);
  break;

default:
  $arr[] = urlencode($field) . '=' . urlencode($_POST[$field]);
  break;
  }

}
$URL = "https://example.com/script.asp?".implode('&',$arr);
  

Also, take note on the urlencode, it might be wise to do that.  A
note for PHP5 usage, simply defining a associative array will work:

$arr[$field] = $_POST['field'];
$URL = http_build_query($arr);


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Re: PHP editor that doesn't require installation

2004-07-24 Thread John W. Holmes
rush wrote:
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
Does anyone know of a good windows PHP editor that I can run from a USB
flash drive without installing it? 
scite, from the scintilla fame. TemplateTamer would also work fine if you
just copy the whole directory
Scite is perfect. You rock. A single 364KB file with PHP source code 
highlighting, brace matching, (regex) search and replace and more. It's 
so perfect I won't even make fun of you for mentioning TemplateTamer 
again! ;) Thanks, though, seriously.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHP editor that doesn't require installation

2004-07-24 Thread Curt Zirzow
* Thus wrote John W. Holmes:
> rush wrote:
> >"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
> >
> >>Does anyone know of a good windows PHP editor that I can run from a USB
> >>flash drive without installing it? 
> >
> >scite, from the scintilla fame. TemplateTamer would also work fine if you
> >just copy the whole directory
> 
> Scite is perfect. You rock. A single 364KB file with PHP source code 
> highlighting, brace matching, (regex) search and replace and more. It's 
> so perfect I won't even make fun of you for mentioning TemplateTamer 
> again! ;) Thanks, though, seriously.

364K? That seems almost impossible, i'm going to have check that out :)


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Re: If...Or...Else

2004-07-24 Thread Curt Zirzow
* Thus wrote Jason Davidson:
> OR is also bitwise is it not?

No, | is bitwise



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Re: PHP editor that doesn't require installation

2004-07-24 Thread rush
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Scite is perfect. You rock. A single 364KB file with PHP source code
> highlighting, brace matching, (regex) search and replace and more. It's
> so perfect I won't even make fun of you for mentioning ...

there is also code folding if I recall correctly. Not making fun of me is
also kindly appreciated, although I am not sure if I would have deserved
that kind of attention in the first place :). Anyway, I suggest that we put
it to rest, and enjoy the rest of the evening/day (depending on the time
zone). Good luck!

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

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



Re: [PHP] Re: If...Or...Else

2004-07-24 Thread Jason Davidson
ah right.. :)
Jason

On Sat, 24 Jul 2004 19:50:17 +, Curt Zirzow
<[EMAIL PROTECTED]> wrote:
> * Thus wrote Jason Davidson:
> > OR is also bitwise is it not?
> 
> No, | is bitwise
> 
> Curt
> --
> First, let me assure you that this is not one of those shady pyramid schemes
> you've been hearing about.  No, sir.  Our model is the trapezoid!
> 
> 
> 
> --
> 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] editor for remote files using ssh

2004-07-24 Thread Curt Zirzow
* Thus wrote Miroslav Hudak (php/ml):
> Vi or ViM :)

I swear that topics always come in bunches together.

vim++


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Weeeeee! ;)))

2004-07-24 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED]:
> I  don't bite, weah!
>  
> ..btw, "10370" is  a  password  for archive
> 

And these come in groups also... I wonder if there is a relation
between the two :)


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Curt Zirzow
* Thus wrote Philip Olson:
> > Sorry, let me clearify.. unless UserId is an integer, quote it !!
> 
> And quoting integers is not a problem, I even prefer it.  IMHO we should
> tell people to quote all values so if someone "forgets" to do any sort of

One thing to note though, mysql/sqlite is the only dbms that I know
of that allows this, mysql may not even use the proper index if a
INT field is comparing to a string type.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Weeeeee! ;)))

2004-07-24 Thread Comex
but there isn't any archive..

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



Re: [PHP] Trouble with Apache, PHP, pear

2004-07-24 Thread Marek Kilimajer
Ron King wrote:
At 06:28 AM 7/23/2004, you wrote:
You need php-cli rpm, it's not an extension, it's command line binary.

And it won't hurt anything to have both cli and extension installed?
-- Ron
No
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread John W. Holmes
Philip Olson wrote:
And quoting integers is not a problem, I even prefer it.  IMHO we should
tell people to quote all values so if someone "forgets" to do any sort of
input validation (i.e. make sure it's actually an integer) there won't be
a major problem otherwise problems (including SQL injection) may arise.
I wouldn't recommend that you recommend that to everyone. Not all 
databases will allow you to enter a STRING into an numeric field. MySQL 
may be lenient on it, but that doesn't mean you should get in the habit 
of using it that way. Properly validate your data and none of this is an 
issue. :)

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] HTML Table display based upon field contents

2004-07-24 Thread Robb Kerr
I have a complicated table that needs to be altered depending upon the
contents of a field in one of my recordsets. I've tried several approaches
and need to know what you recommend.

I've created three totally different tables and put the HTML code for each
into a database. Then I used PHP to insert the relevant code into the page
depending upon the contents of a field in a different database. Result -
the appropriate code is inserted properly into the HTML. Problem - the HTML
table I'm trying to insert contains PHP code which is not executed after
being inserted.

Because sometimes the HTML table needs 4 rows and other times only 2, I
tried enclosing the appropriate s in a PHP IF statement (see below).
Problem - PHP IF wasn't executed, both s embedded appeared on page
anyway. And, sometimes, the relevant s will include PHP code so this
embedding technique won't work.


  
 
 
 
 
 
 
  
  
 
 
 
 
 
 
  


Should I simply describe the entire relevant s on one line,
appropriately escape them, assign the to a variable and then use an ECHO to
put them on the page? Or does someone have a simpler more elegant solution?

Thanx
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] Unexpected T_ENCAPSED...

2004-07-24 Thread Philip Olson
> > And quoting integers is not a problem, I even prefer it.  IMHO we should
> > tell people to quote all values so if someone "forgets" to do any sort of
> > input validation (i.e. make sure it's actually an integer) there won't be
> > a major problem otherwise problems (including SQL injection) may arise.
> 
> I wouldn't recommend that you recommend that to everyone. Not all 
> databases will allow you to enter a STRING into an numeric field. MySQL 
> may be lenient on it, but that doesn't mean you should get in the habit 
> of using it that way. Properly validate your data and none of this is an 
> issue. :)

Yeah, we all know you want magic_quotes_gpc off by default too but can
PHP coders really be that trusted? ;)  I was only referring to MySQL, will
look into the string/int index issue a bit later.  Yes it would be nice if
people validated data but having to write about that everytime gets old.
My advice wasn't ideal, I'll admit that.

Regards,
Philip

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



[PHP] Re: HTML Table display based upon field contents

2004-07-24 Thread Tularis
Robb Kerr wrote:
I have a complicated table that needs to be altered depending upon the
contents of a field in one of my recordsets. I've tried several approaches
and need to know what you recommend.
I've created three totally different tables and put the HTML code for each
into a database. Then I used PHP to insert the relevant code into the page
depending upon the contents of a field in a different database. Result -
the appropriate code is inserted properly into the HTML. Problem - the HTML
table I'm trying to insert contains PHP code which is not executed after
being inserted.
Because sometimes the HTML table needs 4 rows and other times only 2, I
tried enclosing the appropriate s in a PHP IF statement (see below).
Problem - PHP IF wasn't executed, both s embedded appeared on page
anyway. And, sometimes, the relevant s will include PHP code so this
embedding technique won't work.

  
 
 
 
 
 
 
  
  
 
 
 
 
 
 
  

Should I simply describe the entire relevant s on one line,
appropriately escape them, assign the to a variable and then use an ECHO to
put them on the page? Or does someone have a simpler more elegant solution?
Thanx
just use eval() on that string, it's not elegant, nor is it really 
secure, but it'll work fine.

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


RE: [PHP] HTML Table display based upon field contents

2004-07-24 Thread Kevin
Hi Robb,

I am a newbie so I wanted to ask a stupid question. In your code below if
the first if statement is true it ends the php processing and then you
reopen with a new  before the first  tag and the mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 24, 2004 4:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] HTML Table display based upon field contents

I have a complicated table that needs to be altered depending upon the
contents of a field in one of my recordsets. I've tried several approaches
and need to know what you recommend.

I've created three totally different tables and put the HTML code for each
into a database. Then I used PHP to insert the relevant code into the page
depending upon the contents of a field in a different database. Result -
the appropriate code is inserted properly into the HTML. Problem - the HTML
table I'm trying to insert contains PHP code which is not executed after
being inserted.

Because sometimes the HTML table needs 4 rows and other times only 2, I
tried enclosing the appropriate s in a PHP IF statement (see below).
Problem - PHP IF wasn't executed, both s embedded appeared on page
anyway. And, sometimes, the relevant s will include PHP code so this
embedding technique won't work.


  
 
 
 
 
 
 
  
  
 
 
 
 
 
 
  


Should I simply describe the entire relevant s on one line,
appropriately escape them, assign the to a variable and then use an ECHO to
put them on the page? Or does someone have a simpler more elegant solution?

Thanx
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

-- 
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] PHP5, XPath and count()

2004-07-24 Thread Christian Stocker
On Sat, 24 Jul 2004 17:35:59 +0200, Victor Boivie <[EMAIL PROTECTED]> wrote:
> Christian Stocker wrote:
> 
> >>var_dump($xpath->query("count(/catalog/cd")->item(0));
> >
> >
> > this doesn't work yet in DOM. The returned value has to be a nodeset.
> > Will be fixed some day ;)
> >
> 
> Thanks, both Jason and Christian
> 
> I found something else that I think is strange.
> 
>$dom = new DOMDocument();
> 
>$root = $dom->createElement("test");
>$dom->appendChild($root);
> 
>$node = $dom->createElement("foo", "which entities does it
> escape & which doesn't it?");
>$root->appendChild($node);
> 
>echo $dom->saveXML();

Yep, that looks like a bug...  Can you please file a bug at bugs.php.net?

The workaround is the write the following:

$node = $dom->createElement("foo");
$text = $dom->createTextNode( "which entities does it
escape & which doesn't it?");
$node->appendChild($text);
$root->appendChild($node);


While a little more to type, it's at least the official W3C way ;)

chregu

> 
> The result will be:
> 
> 
> which entities does it escape 
> 
> It stops at the &, which I think is strange. It escapes the < to <
> and > to >, but not & to &. It would be better if it escaped none
> or all entites that "can do harm".
> 
> Or what do you think?
> regards,
> Victor
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

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



[PHP] Creation of MySQL Database Using PHP

2004-07-24 Thread Harlequin
Hello.

I have a friend who knows less than me about PHP and MySQL (which I know is
hard to believe) but she needs a login facility for her site.

I've passed over some script I use but she doesn't know how to create the
database. I can write some commands that create the tables OK - but can I do
the same for the database or does that have to be done through the UI...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-

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



Re: [PHP] Creation of MySQL Database Using PHP

2004-07-24 Thread Marek Kilimajer
Harlequin wrote:
Hello.
I have a friend who knows less than me about PHP and MySQL (which I know is
hard to believe) but she needs a login facility for her site.
I've passed over some script I use but she doesn't know how to create the
database. I can write some commands that create the tables OK - but can I do
the same for the database or does that have to be done through the UI...?
Do you know phpMyAdmin?
http://www.phpmyadmin.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Creation of MySQL Database Using PHP

2004-07-24 Thread Dennis Seavers
mysql_query ('CREATE DATABASE name_of_database');



> [Original Message]
> From: Harlequin <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Date: 07/24/2004 3:08:47 PM
> Subject: [PHP] Creation of MySQL Database Using PHP
>
> Hello.
>
> I have a friend who knows less than me about PHP and MySQL (which I know
is
> hard to believe) but she needs a login facility for her site.
>
> I've passed over some script I use but she doesn't know how to create the
> database. I can write some commands that create the tables OK - but can I
do
> the same for the database or does that have to be done through the UI...?
>
> -- 
> -
>  Michael Mason
>  Arras People
>  www.arraspeople.co.uk
> -
>
> -- 
> 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] HTML Table display based upon field contents

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 17:47:48 -0400, Kevin wrote:

> Hi Robb,
> 
> I am a newbie so I wanted to ask a stupid question. In your code below if
> the first if statement is true it ends the php processing and then you
> reopen with a new  out the ?> before the first  tag and the  work?
> 
> Sorry if this is just dumb. Trying to learn. :)
> 
> Kevin
> 
> -Original Message-
> From: Robb Kerr [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 24, 2004 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] HTML Table display based upon field contents
> 
> I have a complicated table that needs to be altered depending upon the
> contents of a field in one of my recordsets. I've tried several approaches
> and need to know what you recommend.
> 
> I've created three totally different tables and put the HTML code for each
> into a database. Then I used PHP to insert the relevant code into the page
> depending upon the contents of a field in a different database. Result -
> the appropriate code is inserted properly into the HTML. Problem - the HTML
> table I'm trying to insert contains PHP code which is not executed after
> being inserted.
> 
> Because sometimes the HTML table needs 4 rows and other times only 2, I
> tried enclosing the appropriate s in a PHP IF statement (see below).
> Problem - PHP IF wasn't executed, both s embedded appeared on page
> anyway. And, sometimes, the relevant s will include PHP code so this
> embedding technique won't work.
> 
>if ($row_RS_PageContent['PageType'] != "2") {
> ?>
>   
>  
>  
>  
>  
>  
>  
>   
>   
>  
>  
>  
>  
>  
>  
>   
>  }
> ?>
> 
> Should I simply describe the entire relevant s on one line,
> appropriately escape them, assign the to a variable and then use an ECHO to
> put them on the page? Or does someone have a simpler more elegant solution?
> 
> Thanx
> -- 
> Robb Kerr
> Digital IGUANA
> Helping Digital Artists Achieve their Dreams
> 
> http://www.digitaliguana.com
> http://www.cancerreallysucks.org

To do what you're suggesting, you'd have to put each line of HTML in
separate ECHO statements (see below). The problem with this approach is
that the table will eventually contain very complex code in each cell. I'd
have to do extensive escaping to make sure the code is correctly
interpreted.

I used a shortcut syntax that allows you to embed several lines of HTML in
an IF statement without having to escape everything. The short PHP
statement after the embedded lines tells PHP that the embedded code is
embedded as if it was ECHOed line by line. This works most of the time.
Just not in this instance.

To use your suggestion, the code would have to look like this...

';
echo ' ';
echo ' ';
echo ' ';
  etc.
  }
?>

Note all of the escaping required to simply define the table. You'd have
tons more to do when images, links, JavaScript calls, etc. are placed in
the table.
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



[PHP] Re: HTML Table display based upon field contents

2004-07-24 Thread Robb Kerr
On Sat, 24 Jul 2004 23:23:49 +0200, Tularis wrote:

> Robb Kerr wrote:
> 
>> I have a complicated table that needs to be altered depending upon the
>> contents of a field in one of my recordsets. I've tried several approaches
>> and need to know what you recommend.
>> 
>> I've created three totally different tables and put the HTML code for each
>> into a database. Then I used PHP to insert the relevant code into the page
>> depending upon the contents of a field in a different database. Result -
>> the appropriate code is inserted properly into the HTML. Problem - the HTML
>> table I'm trying to insert contains PHP code which is not executed after
>> being inserted.
>> 
>> Because sometimes the HTML table needs 4 rows and other times only 2, I
>> tried enclosing the appropriate s in a PHP IF statement (see below).
>> Problem - PHP IF wasn't executed, both s embedded appeared on page
>> anyway. And, sometimes, the relevant s will include PHP code so this
>> embedding technique won't work.
>> 
>> >   if ($row_RS_PageContent['PageType'] != "2") {
>> ?>
>>   
>>  
>>  
>>  
>>  
>>  
>>  
>>   
>>   
>>  
>>  
>>  
>>  
>>  
>>  
>>   
>> > }
>> ?>
>> 
>> Should I simply describe the entire relevant s on one line,
>> appropriately escape them, assign the to a variable and then use an ECHO to
>> put them on the page? Or does someone have a simpler more elegant solution?
>> 
>> Thanx
> just use eval() on that string, it's not elegant, nor is it really 
> secure, but it'll work fine.

This sounds like exactly what I need. But, can you help me with the synatx?
I've read the entry in the PHP documentation and I don't completely
understand. Let's assume all of the code to define the HTML table
(including appropriate PHP) is stored in a database table called
FooterTable. The field containing the code is called FooterField.

Do I first need to assign the field to a variable via the eval()...

$vFooterText = eval(FooterTable['FooterField']);
echo $vFooterText;

or does the eval statement automatically include the ECHO...

eval(FooterTable['FooterField']);

or do I have to read the contents into a variable first, then eval(), then
echo...

$vFooterText = FooterTable['FooterField'];
eval($vFooterText);
echo $vFooterText;
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams

http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



[PHP] Re: HTML Table display based upon field contents

2004-07-24 Thread Tularis
Robb Kerr wrote:
On Sat, 24 Jul 2004 23:23:49 +0200, Tularis wrote:

Robb Kerr wrote:

I have a complicated table that needs to be altered depending upon the
contents of a field in one of my recordsets. I've tried several approaches
and need to know what you recommend.
I've created three totally different tables and put the HTML code for each
into a database. Then I used PHP to insert the relevant code into the page
depending upon the contents of a field in a different database. Result -
the appropriate code is inserted properly into the HTML. Problem - the HTML
table I'm trying to insert contains PHP code which is not executed after
being inserted.
Because sometimes the HTML table needs 4 rows and other times only 2, I
tried enclosing the appropriate s in a PHP IF statement (see below).
Problem - PHP IF wasn't executed, both s embedded appeared on page
anyway. And, sometimes, the relevant s will include PHP code so this
embedding technique won't work.

 
    
    
    
    
    
    
 
 
    
    
    
    
    
    
 

Should I simply describe the entire relevant s on one line,
appropriately escape them, assign the to a variable and then use an ECHO to
put them on the page? Or does someone have a simpler more elegant solution?
Thanx
just use eval() on that string, it's not elegant, nor is it really 
secure, but it'll work fine.

This sounds like exactly what I need. But, can you help me with the synatx?
I've read the entry in the PHP documentation and I don't completely
understand. Let's assume all of the code to define the HTML table
(including appropriate PHP) is stored in a database table called
FooterTable. The field containing the code is called FooterField.
Do I first need to assign the field to a variable via the eval()...
$vFooterText = eval(FooterTable['FooterField']);
echo $vFooterText;
or does the eval statement automatically include the ECHO...
eval(FooterTable['FooterField']);
or do I have to read the contents into a variable first, then eval(), then
echo...
$vFooterText = FooterTable['FooterField'];
eval($vFooterText);
echo $vFooterText;
once you get the code you posted a few lines up out of the database it 
usually already resides in a variable. eg. $footertable['FooterField']. 
What eval() does is take a string and just "imagine" it is actually an 
included piece of PHP. If this helps you, you could imagine the eval 
string as follows:
-
// write the string contents to a new php file
$stream = fopen('tmpfile.php', 'w+');
fwrite($stream, $string, strlen($string));
fclose($stream)
include 'tmpfile.php';	// include it, seems obvious...
unlink('tmpfile.php');	// remove the file again


This means that if you pass a string like eg:
A is B!A is not B!
it would parse that as-if it were a piece of php-code, which it is in 
this case. Remember though that everything you tell php to do in that 
string is done at the time the eval() is called. That means that if you 
use that string, eg. called $string (how obvious :P) in such an expression:


$string = '...'; // that php code but then as a string, or gotten from 
the database
$a = 1;
$b = 2;
echo 'starting...';
eval($string);
echo 'stopping';
?>

it would output:
starting...
A is not B!
stopping
Hope that helps :)
- Tul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Trouble with Apache, PHP, pear

2004-07-24 Thread Ron King
Matthew (and Marek),
>>Sounds like you've done everything correctly, just PHP wasn't installed
>> as a
>>CLI. Just to be sure, do a $ find / -name php
>
> Is it ok to have PHP installed as both CLI and as a module?
>
It is perfectly okay to have both. I'm using both on a server I have.
I installed the CLI rpm, and was then able to install pear. Now I just need 
to get the path situation straightened out.

Thanks for the help,
-- Ron 

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


[PHP] exec works with some, but not all commands

2004-07-24 Thread Jonathan Villa

why would exec("touch /var/www/testfile.txt") work but not

exec("/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah")

the dir used in homedir has mode 777 just for testing


this is the actual command I'm trying to run...
exec("/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg
-e -r uid_someuser sf.txt");

if I run it from the command line, it works fine...


In summary, I'm trying to get a working gpg script going...

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



Re: [PHP] exec works with some, but not all commands

2004-07-24 Thread Matthew Sims
>
> why would exec("touch /var/www/testfile.txt") work but not
>
> exec("/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah")
>
> the dir used in homedir has mode 777 just for testing
>
>
> this is the actual command I'm trying to run...
> exec("/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg
> -e -r uid_someuser sf.txt");
>
> if I run it from the command line, it works fine...
>

I'm not sure but what if you defined an absolute path for your output
files (e.gpg and sf.txt).

-- 
--Matthew Sims
--

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



Re: [PHP] How to get all links from a webpage?

2004-07-24 Thread Jason Wong
On Saturday 24 July 2004 16:08, Wudi wrote:
> Hm, Perl is OK. Could you send that program to me?
> I have searched the class in phpclasses.org, but not found.
> The classes I searched only can replace the link, can't get links.

Hmmm it needs to be able to *find* the links before it can replace them. Just 
borrow the code that finds the links.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Calling you stupid is an insult to stupid people!
-- Wanda, "A Fish Called Wanda"
*/

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



[PHP] Re: exec works with some, but not all commands

2004-07-24 Thread Chris Martin
Matthew Sims wrote:
why would exec("touch /var/www/testfile.txt") work but not
exec("/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah")
the dir used in homedir has mode 777 just for testing
this is the actual command I'm trying to run...
exec("/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg
-e -r uid_someuser sf.txt");
if I run it from the command line, it works fine...

I'm not sure but what if you defined an absolute path for your output
files (e.gpg and sf.txt).
I'm not sure either, but I was thinking absolute too.
Also you might try system(), shell_exec(), or passthru() if you're 
trying to get output back.

--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Disk serial number

2004-07-24 Thread Jason Wong
On Saturday 24 July 2004 19:15, Rosen wrote:

Please do not top post.

> But how I can parse this output ?

> > c:\>dir c:\test.txt
> >   Volume in drive C is Primary
> >   Volume Serial Number is 003E-6CEA

There are many ways to go about this, I'll outline one of them. First you need 
to grab the output so:

  exec('dir c:\', $output);

Then you can use something like substr() on $output[1] (the second line) to 
grab the serial number.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A fanatic is a person who can't change his mind and won't change the subject.
- Winston Churchill
*/

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



[PHP] Fwd: IMPORTANT: Please Verify Your Message

2004-07-24 Thread Mark
Am I the only one who gets annoyed at these?

--- [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
> Date: Sat, 24 Jul 2004 04:22:16 -0400
> To: [EMAIL PROTECTED]
> Subject: IMPORTANT: Please Verify Your Message
> From: <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> 

-
Verify Email
Hello [EMAIL PROTECTED] ,

[EMAIL PROTECTED], [EMAIL PROTECTED] is currently
protecting themselves from receiving junk mail using SpamceaseJust
this once, click the link below so I can receive your emails.
You won't have to do this again.

http://www.tgpwizards.com/spamcease2/verify.php?id=1334886
 



=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] Fwd: IMPORTANT: Please Verify Your Message

2004-07-24 Thread Jason Wong
On Sunday 25 July 2004 09:42, Mark wrote:
> Am I the only one who gets annoyed at these?

No you're not. Look in the past week's archives.

> [EMAIL PROTECTED], [EMAIL PROTECTED] is currently

You've got the culprit here. Either lambast him publically (since he doesn't 
want to receive your private mail). Or do what this says:

> http://www.tgpwizards.com/spamcease2/verify.php?id=1334886

Or set a filter to trash these messages.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A is for Apple.
-- Hester Pryne
*/

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



RE: [PHP] Re: exec works with some, but not all commands

2004-07-24 Thread bruce
when running shell commands form php/web apps... it's a good idea to check
the ownership/privs/permissions of both the exe being run, as well as any
output/input files for the exe app.

you should also check the web/apache/iis error/log files to determine if
everything is correct...

regards,



-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Chris Martin
Sent: Saturday, July 24, 2004 6:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: exec works with some, but not all commands


Matthew Sims wrote:
>>why would exec("touch /var/www/testfile.txt") work but not
>>
>>exec("/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah")
>>
>>the dir used in homedir has mode 777 just for testing
>>
>>
>>this is the actual command I'm trying to run...
>>exec("/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg
>>-e -r uid_someuser sf.txt");
>>
>>if I run it from the command line, it works fine...
>>
>
>
> I'm not sure but what if you defined an absolute path for your output
> files (e.gpg and sf.txt).
>
I'm not sure either, but I was thinking absolute too.

Also you might try system(), shell_exec(), or passthru() if you're
trying to get output back.

--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/

--
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] Fwd: IMPORTANT: Please Verify Your Message

2004-07-24 Thread John W. Holmes
Jason Wong wrote:
> On Sunday 25 July 2004 09:42, Mark wrote:
>>[EMAIL PROTECTED], [EMAIL PROTECTED] is currently
>
> You've got the culprit here. Either lambast him publically (since he 
doesn't
> want to receive your private mail). Or do what this says:

The thing is, though, none of these people have actually signed up for 
this service as far as I can tell. It's like there's a spamcease bot 
signed up to the list and is sending out these "notices" to people that 
post to the list saying that some random address has signed up for it. 
It's saying the list is signed up and people are receiving messages 
saying themselves are signed up when they know they haven't.

I really wish we could get an active admin on the list that would react 
to these sorts of things. I'd volunteer, but I don't think anyone cares 
besides the people actually on the list.

All that being said, I just trash these, anyhow. :)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Weeeeee! ;)))

2004-07-24 Thread Jason Barnett
Comex wrote:
but there isn't any archive..
Let's see I shake my magic 8-ball and it says... PEAR?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Learning Regex

2004-07-24 Thread PHP Gen
Hi,

Does anybody know of a good place to learn how to work
with regex? 

Google has quite a few links for "learn pattern
matching" or "learn php regex" but none that start you
on "baby steps".

Any recommendations?

Thnx,
Mag

=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)




__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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



[PHP] include_path ???

2004-07-24 Thread D_Angle
Hi.

I am a bit confused about the  include_path  in php.ini, I am using PHP
5.0.0 on IIS

;
; Paths and Directories ;
;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;/php/includes"

When I run "phpinfo()" the include_path points to ".;c:\php\PEAR" but that
is incorrect the correct path is "c:\inetpub\php5\PEAR".

My question is, is it correct to set the include_path to
"c:\inetpub\php5\PEAR" or just leave it as is???

Thanks in advanced :)

D_Angle

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



Re: [PHP] Fwd: IMPORTANT: Please Verify Your Message

2004-07-24 Thread Jason Wong
On Sunday 25 July 2004 10:30, John W. Holmes wrote:

> The thing is, though, none of these people have actually signed up for
> this service as far as I can tell. 

Some previous posts imply that some people *did* use spamcease, my anti-spam 
measures protects me from seeing these "Please Verify Your Message" messages.

> It's like there's a spamcease bot
> signed up to the list and is sending out these "notices" to people that
> post to the list saying that some random address has signed up for it.
> It's saying the list is signed up and people are receiving messages
> saying themselves are signed up when they know they haven't.

If it's an email harvesting scam then I think it's rather over elaborate. 

> I really wish we could get an active admin on the list that would react
> to these sorts of things. I'd volunteer, but I don't think anyone cares
> besides the people actually on the list.

If individuals are using spamcease then there's very little a list admin can 
do short of chucking them off the list. BUt if it's a bot that's subscribed 
to the list then yes throw it off.

> All that being said, I just trash these, anyhow. :)

Exactly.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
All this time I've been VIEWING a RUSSIAN MIDGET SODOMIZE a HOUSECAT!
*/

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



[PHP] Re: include_path ???

2004-07-24 Thread Jason Barnett
When I run "phpinfo()" the include_path points to ".;c:\php\PEAR" but that
is incorrect the correct path is "c:\inetpub\php5\PEAR".
Are you *certain* you're looking at the correct ini file?  phpinfo() should show 
the settings currently in use for your server (assuming you're calling the 
phpinfo in a page served by IIS instead of for example the CLI version of PHP). 
 Magic 8-ball says: you have an old php.ini from PHP4 and it is in your 
system32 folder.

My question is, is it correct to set the include_path to
"c:\inetpub\php5\PEAR" or just leave it as is???
If this is the path to your PEAR files then you'll need to change your 
include_path.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Learning Regex

2004-07-24 Thread Jason Barnett
This helped me get started with Perl-compatible regular expressions:
http://www.weitz.de/regex-coach/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to get all links from a webpage?

2004-07-24 Thread Wudi
This script can replace links:
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "\\0", $text);
But it cannot get the links.

On Sun, 25 Jul 2004 09:18:28 +0800
Jason Wong <[EMAIL PROTECTED]> wrote:

> On Saturday 24 July 2004 16:08, Wudi wrote:
> > Hm, Perl is OK. Could you send that program to me?
> > I have searched the class in phpclasses.org, but not found.
> > The classes I searched only can replace the link, can't get links.
> 
> Hmmm it needs to be able to *find* the links before it can replace them. Just 
> borrow the code that finds the links.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Calling you stupid is an insult to stupid people!
>   -- Wanda, "A Fish Called Wanda"
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
Comment: English is not my first language.
Wudi <[EMAIL PROTECTED]>

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



[PHP] Re: include_path ???

2004-07-24 Thread D_Angle
This is taken right out of the download of PHP 5 zip file
"php-5.0.0-Win32.zip". Opening the "php.ini-recommended" it states the
following configuration

;
; Paths and Directories ;
;

; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

But phpinfo() shows this

  include_path = .;C:\php5\pear


the correct windows path is

c:\inetpub\php5\pear

Do I change the path include_path to "c:\inetpub\php5\pear" ?

Why is it writen as ".;c:\php\includes" in recommended php.ini ?

Wy not call it pear_path = ".;C:\php5\pear" instead?



"Jason Barnett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > When I run "phpinfo()" the include_path points to ".;c:\php\PEAR" but
that
> > is incorrect the correct path is "c:\inetpub\php5\PEAR".

Sorry it was ment to be ".;c:\php5\PEAR" :p
>
> Are you *certain* you're looking at the correct ini file?  phpinfo()
should show
> the settings currently in use for your server (assuming you're calling the
> phpinfo in a page served by IIS instead of for example the CLI version of
PHP).
>   Magic 8-ball says: you have an old php.ini from PHP4 and it is in your
> system32 folder.
>
> >
> > My question is, is it correct to set the include_path to
> > "c:\inetpub\php5\PEAR" or just leave it as is???
>
> If this is the path to your PEAR files then you'll need to change your
include_path.

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



Re[2]: [PHP] Re: PHP editor that doesn't require installation

2004-07-24 Thread Tom Rogers
Hi,

Sunday, July 25, 2004, 5:18:44 AM, you wrote:

JWH> Scite is perfect. You rock. A single 364KB file with PHP source code
JWH> highlighting, brace matching, (regex) search and replace and more. It's
JWH> so perfect I won't even make fun of you for mentioning TemplateTamer
JWH> again! ;) Thanks, though, seriously.

JWH> -- 

JWH> ---John Holmes...

JWH> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

JWH> php|architect: The Magazine for PHP Professionals – www.phparch.com


I have a modified lexer dll which has slightly better colouring
for php (basically it means php functions can be coloured differently
from the keywords) which I find useful. Your quite welcome to try it
out. Warning: it will add 3K to the dll size :)

-- 
regards,
Tom

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