OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 18 Jan 2007 10:40:33 -0000 Issue 4576

php-general-digest-helplists.php.net
Date: Thu Jan 18 2007 - 04:40:33 CST


php-general Digest 18 Jan 2007 10:40:33 -0000 Issue 4576

Topics (messages 247269 through 247313):

Re: dynamic lists
        247269 by: Kevin Murphy
        247270 by: Roman Neuhauser
        247278 by: Jochem Maas

Re: Getting domain out of a URL
        247271 by: Andre Dubuc
        247273 by: Roman Neuhauser
        247275 by: Jay Blanchard
        247294 by: Jonesy

Script to generate a site thumbnails
        247272 by: Pablo L. de Miranda

Re: One last try at this!
        247274 by: Beauford
        247283 by: Jim Lucas
        247284 by: Jim Lucas
        247298 by: Roman Neuhauser
        247306 by: Jim Lucas
        247307 by: Roman Neuhauser

Re: Where can I get the Printer extension?
        247276 by: Chris
        247277 by: Chuck Anderson
        247279 by: Chris

Re: Getting domain out of a URL {SOLVED]
        247280 by: Andre Dubuc

Re: $_SESSION variable gets lost on FORM action
        247281 by: Nuno Vaz Oliveira
        247282 by: Roman Neuhauser
        247301 by: Nuno Vaz Oliveira
        247303 by: pub
        247310 by: Roman Neuhauser

Re: Storing values in arrays
        247285 by: Nicholas Yim

is there another way ??
        247286 by: Ali Nasser
        247288 by: Curt Zirzow
        247300 by: clive

May I be added to the list?
        247287 by: Bernie Graham
        247289 by: Curt Zirzow

format timestamp
        247290 by: weetat
        247291 by: Curt Zirzow
        247292 by: Jim Lucas
        247293 by: Jim Lucas

Scope of include
        247295 by: jekillen
        247296 by: Andrew Kreps
        247297 by: Andrew Kreps
        247299 by: Roman Neuhauser

Re: Php coding help - Newbie question
        247302 by: Ramdas

Newbie - help with a foreach
        247304 by: pub
        247305 by: Németh Zoltán
        247308 by: pub
        247309 by: Németh Zoltán
        247311 by: pub

phpmyadmin & mysql extensions
        247312 by: Ross

regular expression help!
        247313 by: William Stokes

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On Jan 17, 2007, at 2:20 PM, Jochem Maas wrote:

> Kevin Murphy wrote:
>>
>>
>> On Jan 17, 2007, at 1:39 PM, Brad Fuller wrote:
>>
>>>> -----Original Message-----
>>>> From: Jay Blanchard [mailto:jblanchardpocket.com]
>>>> Sent: Wednesday, January 17, 2007 4:05 PM
>>>> To: Don; php-generallists.php.net
>>>> Subject: RE: [PHP] dynamic lists
>>>>
>>>> [snip]
>>>> By dynamic drop list I mean the type where the options
>>>> contained in the subsequent list depend on what was picked in
>>>> the previous list without clicking submit.
>>>> [/snip]
>>>>
>>>> PHP is server side, you need to do this with AJAX or Javascript
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/) To
>>>> unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>
>>> Don,
>>>
>>> There's a few different ways to do this.
>>>
>>> #1) Submit the form (to itself) when a user chooses an option
>>> from the
>>> first
>>> list (using onChange=form.submit()) then with PHP query the database
>>> for the
>>> second set of options.
>>>
>>> #2) Use JavaScript to store all the values and pop them in when
>>> the user
>>> chooses an option from the first list (using onChange=someFunction
>>> (...)).
>>>
>>> I like #2. If you need a starting point, google for "javascript
>>> dynamic
>>> select list"
>>>
>>> Hope that helps,
>>>
>>> Brad
>>
>> FYI... Neither #1 or #2 are considered good practice for
>> Accessibility/ADA compliance. If you are using a keyboard or screen
>> reader to view your website, it will always pick the first one in the
>> list and you won't have the option of even seeing the rest of the
>> list.
>> Basically, anything that uses onchange or onselect will cause
>> accessibility issues. The only way to accomplish this is using
>> onclick
>> or submitting the form.
>
> that stance basically negates everything 'ajax', flash, video and
> everything
> considered to be remotely 'web2.0' - is the 'low-common-
> denominator' case
> always the correct choice?
>
> I understand the importance of accessibility but the practicality
> of most
> peoples' job in this sector means satisfying the requirements of a
> client
> that demands such dynamic functionality such as the auto-selection
> example
> given here.
>
> is there not an argument that screen-reader and [braille] keyboard
> software
> are somwhat responsible for being capable of 'keeping up' - given
> that an
> onclick can be handled why not an 'onchange' (in theory)?
>

Not saying I disagree with you..... which is why i tossed it out
there as an FYI rather than anything else. But its something that you
should be aware of when designing a site and weighing your options.
For me, working for a governmental institution, I really don't have a
choice. I can't throw anything into the website that has a negative
ADA impact.... unless of course I have an alternate way of
accomplishing the same thing.

And yes, there is an argument that screen-readers should keep up with
the technology, and I totally agree with you..... but that's not
reality. Target.com got sued recently for lack of ADA compliance on
their website. The screen reading software company wasn't the one sued.

YMMV.

--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326

attached mail follows:


# jochemiamjochem.com / 2007-01-17 23:20:23 +0100:
> Kevin Murphy wrote:
> > On Jan 17, 2007, at 1:39 PM, Brad Fuller wrote:
> >> #1) Submit the form (to itself) when a user chooses an option from the
> >> first list (using onChange=form.submit()) then with PHP query the
> >> database for the second set of options.
> >>
> >> #2) Use JavaScript to store all the values and pop them in when the user
> >> chooses an option from the first list (using onChange=someFunction(...)).
> >>
> >> I like #2. If you need a starting point, google for "javascript dynamic
> >> select list"
> >
> > FYI... Neither #1 or #2 are considered good practice for
> > Accessibility/ADA compliance. If you are using a keyboard or screen
> > reader to view your website, it will always pick the first one in the
> > list and you won't have the option of even seeing the rest of the list.
> > Basically, anything that uses onchange or onselect will cause
> > accessibility issues. The only way to accomplish this is using onclick
> > or submitting the form.
>
> that stance basically negates everything 'ajax', flash, video and everything
> considered to be remotely 'web2.0' - is the 'low-common-denominator' case
> always the correct choice?
 
And what about the my-ajax-is-longer-than-your-ajax (or whatever's "in"
right now (is "in" still a "cool" word?)) lemming-march mentality?

> I understand the importance of accessibility but the practicality of most
> peoples' job in this sector means satisfying the requirements of a client
> that demands such dynamic functionality such as the auto-selection example
> given here.
 
That's typically a result of poor user requirements capture. :)

> is there not an argument that screen-reader and [braille] keyboard software
> are somwhat responsible for being capable of 'keeping up' - given that an
> onclick can be handled why not an 'onchange' (in theory)?

Yeah, wheelchairs can move along a sidewalk, so what's stopping them
from walking up and down stairs? If you haven't written an open source
browser on par with mozilla for blind people, it's IMO polite to not
raise the bar for them unless necessary. KISS and all that.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


Roman Neuhauser wrote:
> # jochemiamjochem.com / 2007-01-17 23:20:23 +0100:
>> Kevin Murphy wrote:
>>> On Jan 17, 2007, at 1:39 PM, Brad Fuller wrote:
>>>> #1) Submit the form (to itself) when a user chooses an option from the
>>>> first list (using onChange=form.submit()) then with PHP query the
>>>> database for the second set of options.
>>>>
>>>> #2) Use JavaScript to store all the values and pop them in when the user
>>>> chooses an option from the first list (using onChange=someFunction(...)).
>>>>
>>>> I like #2. If you need a starting point, google for "javascript dynamic
>>>> select list"
>>> FYI... Neither #1 or #2 are considered good practice for
>>> Accessibility/ADA compliance. If you are using a keyboard or screen
>>> reader to view your website, it will always pick the first one in the
>>> list and you won't have the option of even seeing the rest of the list.
>>> Basically, anything that uses onchange or onselect will cause
>>> accessibility issues. The only way to accomplish this is using onclick
>>> or submitting the form.
>> that stance basically negates everything 'ajax', flash, video and everything
>> considered to be remotely 'web2.0' - is the 'low-common-denominator' case
>> always the correct choice?
>
> And what about the my-ajax-is-longer-than-your-ajax (or whatever's "in"
> right now (is "in" still a "cool" word?)) lemming-march mentality?

I think 'correct' was the wrong word. still thinking what the right word
should be.

bare in mind I was playing devil's advocate rather than defending a particular
stance.

>
>> I understand the importance of accessibility but the practicality of most
>> peoples' job in this sector means satisfying the requirements of a client
>> that demands such dynamic functionality such as the auto-selection example
>> given here.
>
> That's typically a result of poor user requirements capture. :)

of course the level of requirement/functional specification one can do is
dependant on (at least) 2 things:

1. budget - building a small (<5000 euros) site leaves not much money for developing
detailed specs, it easy enough to blow 5 grand on a preliminary investigation let
alone something that resembles a fullblown spec.

2. client - can the client even comprehend the specs and the ramifications they entail,
a small local business has no idea (or interest) in the problems, ramifications and
technicalities of site building - he/she "just want's a website".

>
>> is there not an argument that screen-reader and [braille] keyboard software
>> are somwhat responsible for being capable of 'keeping up' - given that an
>> onclick can be handled why not an 'onchange' (in theory)?
>
> Yeah, wheelchairs can move along a sidewalk, so what's stopping them
> from walking up and down stairs?

no doubt the economics of greed - technically it possible to, I mean Honda
built a freakin' robot that runs up stair and I seen multiple axel wheelchairs
on TV more than 15 years ago (anyone in England know the 'Tomorrows World'
program from the time when it was still about real science? ;-) that were capable
of traversing stairs.

but applying the extreme accessiblity mantra to the stairs analogy would mean
making stairs more or less illegal. should we sue companies out of existence because
they have a set of stairs? should stairs be illegal?

> If you haven't written an open source
> browser on par with mozilla for blind people,

has anyone actually achieved that? actually my comment was aimed purely
at commercial software, which, for now, AFAICT is the only real option for
disabled people - and it's not a cheap option either, so the bar is
set very high in the economic sense, disabled people in a low/no income
are often shut out purely on budgetary grounds.

should commercial vendors that supply tools to enable disabled people
be held to a [very] high standard?

additionally it could be said that the only feasible proposition is
to make the the enabling tools adapt to the environment they are intended
to make accessible? to return to the wheel chair analogy: it's completely
impractical to replace all stairs in the world with suitable ramps but it
is technically achievable to build a wheelchair that is capable
of navigating a world full of chairs.

> it's IMO polite to not
> raise the bar for them unless necessary. KISS and all that.

there are plenty of multi-billion dollar corporations that pay nothing more than
lip service to accessibility - those same companies are the examples alot of
my clients point at when telling me what they want. (I'm painting
with a broad brush here)

if I completely refuse to 'raise the bar' then I'm going to be flipping burgers
at sooner than I'd like - my clients will go else where.

so I'm stuck between doing 'the right thing' and paying the bills - all this
is rather a moot issue in a world where millions of disabled people don't even have access
to running water, let alone wheelchairs - so extending KISS approach all the way down the
line I would say fuck what's happening online completely and let's all try to make sure
everyone on the planet is clothed, fed, watered, is free for abuse/persecution and
has access to basic tools that make life bareable.

now I'm really playing devil's advocate :-> I have working legs and 20/20 vision,
I live in a properous western country (that boasts some of the most liberal laws on
the planet to boot) and I have a job that pays a decent wage! all this bla bla
doesn't really do much for any disabled person stuck in a mudhut in the middle africa.
rather a embarassing & painful reality I would hazard to say :-(

okay I'll shut up now, enough OT blabbing from me.

>

attached mail follows:


On Wednesday 17 January 2007 03:35 pm, Jay Blanchard wrote:
> [snip]
> I receive posts from an open moderated forum that need to be filtered
> for
> urls. I've successfully managed to trap any entires that use 'http://'
> 'www.'
> with the standard '.com' '.org', '.net' endings.
>
> What I need to do is to strip the prefix part ('http:// or http://www.
> or
> 'www') and suffix as well (the .com, etc.) I need only the domain name.
> I
> can't seem to trim away the suffix part.
> [/snip]
>
> Have you looked at http://us3.php.net/manual/en/function.parse-url.php

Thanks Jay for the function reference, but it doesn't seem like it's what I'm
after since the url is packed into the text.

What i really need is something that will take the first part of an array
cutting the remainder after a delimiter word '.com'.

Something along the lines of:

<?php

$boom[1] = "ranchy.stuff.com and other junk";

$input = $boom[1];
$out = array_slice($input, 0, 1);

?>

Part of my problem, I'm beginning to realize, is that the array '$boom[1]'
contains only one element. Is there a similar string function I could use
that would accomplish what I need?

Tia,
Andre

attached mail follows:


# aajdubucwebhart.net / 2007-01-17 17:53:09 -0500:
> On Wednesday 17 January 2007 03:35 pm, Jay Blanchard wrote:
> > [snip]
> > I receive posts from an open moderated forum that need to be filtered
> > for urls. I've successfully managed to trap any entires that use
> > 'http://' 'www.' with the standard '.com' '.org', '.net' endings.
> >
> > What I need to do is to strip the prefix part ('http:// or http://www.
> > or 'www') and suffix as well (the .com, etc.) I need only the domain
> > name. I can't seem to trim away the suffix part.
> > [/snip]
> >
> > Have you looked at http://us3.php.net/manual/en/function.parse-url.php
>
> Thanks Jay for the function reference, but it doesn't seem like it's what I'm
> after since the url is packed into the text.
>
> What i really need is something that will take the first part of an array
> cutting the remainder after a delimiter word '.com'.
>
> Something along the lines of:
>
> <?php
>
> $boom[1] = "ranchy.stuff.com and other junk";
>
> $input = $boom[1];
> $out = array_slice($input, 0, 1);
>
> ?>
>
> Part of my problem, I'm beginning to realize, is that the array '$boom[1]'
> contains only one element. Is there a similar string function I could use
> that would accomplish what I need?

If there isn't one you can always compose it from the ones already available.
That's programming.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


[snip]
Something along the lines of:

<?php

$boom[1] = "ranchy.stuff.com and other junk";

$input = $boom[1];
$out = array_slice($input, 0, 1);

?>

Part of my problem, I'm beginning to realize, is that the array
'$boom[1]'
contains only one element. Is there a similar string function I could
use
that would accomplish what I need?
[/snip]

Why not use explode with the period (.) as the delimiter?

$url = ranchy.stuff.com and other junk";
$boom = explode(".", $url);
print_r($boom);

$boom is now an array containing 'ranchy', 'stuff', 'com and other junk'

attached mail follows:


> [snip]
> I receive posts from an open moderated forum that need to be filtered
> for urls. I've successfully managed to trap any entires that use
> 'http://' 'www.' with the standard '.com' '.org', '.net' endings.
>
> What I need to do is to strip the prefix part ('http:// or http://www.
> or 'www') and suffix as well (the .com, etc.) I need only the domain
> name.
> I can't seem to trim away the suffix part.
> [/snip]

What I've done in situations like this is reverse the text and tackle it
from the _back_ end. It's a simpler approach to first trim off the TLD,
and then to extract only the (reversed) domain name. (Tho', it's not a
domain name without the TLD.)
Then, obviously, reverse your results.

HTH
Jonesy
--
  Marvin L Jones | jonz | W3DHJ | linux
   38.24N 104.55W | config.com | Jonesy | OS/2
    *** Killfiling google posts: <http://jonz.net/ng.htm>

attached mail follows:


Hi People,

I'm needing a script that generate a site thumbnail from a given URL.
Anybody can help me?

Thanks,

--
Pablo Lacerda de Miranda
Graduando Sistemas de Informação
Universidade Estadual de Montes Claros
pablolmirandagmail.com

attached mail follows:


This is what I am trying to do, and for the most part it works, but it also
may be causing some of my other problems.

If $event contains invalid characters, I am returning a string that says
"Invalid Characters" So $result now contains the value 'Invalid Characters'.
Then $formerror['event'] = $result - is self explanatory.

If there are no errors nothing is returned and $result should contain
anything. But this doesn't always seem to be the case. This is one of the
problems I am having.

This is the code in a nutshell.

if($result = ValidateString($event)) { $formerror['event'] = $result;

function ValidateString($string) {

        if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) {
        return "Invalid Characters";
}
 
Thanks

> -----Original Message-----
> From: Jim Lucas [mailto:listscmsws.com]
> Sent: January 17, 2007 4:36 PM
> To: Jay Blanchard
> Cc: Beauford; PHP
> Subject: Re: [PHP] One last try at this!
>
> Jay Blanchard wrote:
> > [snip]
> >
> >> The second condition of each if statement does not contain
> equality
> >> checking, it sets the $result to ValidateString($event, "2"). That
> >> should be if($result == ValidateString($event, "2")) or if($result
> >> === ValidateString($event, "2"))
> >>
> >>
> >>
> > What if the intension was to fail if the result of ValidateString()
> > was false??
> >
> > Then it should be writen as such.
> >
> > if ( ( $result = ValidateString($event, "2") ) !== FALSE ) {
> > $formerror['event'] = $result;
> > }
> > [/snip]
> >
> > Hmmm.....did you test that?
> > $result = ValidateString($event, "2") is always TRUE,
> $result has had
> > something assigned to it unless the function ValidateString
> returns a
> > FALSE. The OP never provided the code for the function so we just
> > don't know. Also, the OP forgot to run subsequent conditions in an
> > elseif check, instead he used 3 if statements that will be
> executed each time.
> >
> >
> At one point he mentioned changing ValidateString() to return
> false on an error.
>
> At least that is what I thought he said.
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Beauford wrote:
> This is what I am trying to do, and for the most part it works, but it also
> may be causing some of my other problems.
>
> If $event contains invalid characters, I am returning a string that says
> "Invalid Characters" So $result now contains the value 'Invalid Characters'.
> Then $formerror['event'] = $result - is self explanatory.
>
> If there are no errors nothing is returned and $result should contain
> anything. But this doesn't always seem to be the case. This is one of the
> problems I am having.
>
> This is the code in a nutshell.
>
> if($result = ValidateString($event)) { $formerror['event'] = $result;
>
> function ValidateString($string) {
>
> if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) {
> return "Invalid Characters";
> }
>
> Thanks
>
>
In your regex you have a "." this will match anything

try this:

<plaintext><?php

function ValidateString($string) {
        if ( preg_match("/[^a-zA-Z0-9\_\.\' -]+/", $string) ) {
                return "Invalid Characters";
        }
        return false;
}

$formerror = array();
$formerror['firstAttempt'] = 'first attempt';
$formerror['secondAttempt'] = 'second attempt';

$event = "A-Z and a-z plus 0-9 and an '_' are allowed.";
if ( ( $result = ValidateString($event) ) !== false ) {
        $formerror['firstAttempt'] = $result;
}

$event = "But bad chars like !#$ and %^&* are not allowed.";
if ( ( $result = ValidateString($event) ) !== false ) {
        $formerror['secondAttempt'] = $result;
}

var_dump($formerror);

?>

Jim Lucas

>> -----Original Message-----
>> From: Jim Lucas [mailto:listscmsws.com]
>> Sent: January 17, 2007 4:36 PM
>> To: Jay Blanchard
>> Cc: Beauford; PHP
>> Subject: Re: [PHP] One last try at this!
>>
>> Jay Blanchard wrote:
>>
>>> [snip]
>>>
>>>
>>>> The second condition of each if statement does not contain
>>>>
>> equality
>>
>>>> checking, it sets the $result to ValidateString($event, "2"). That
>>>> should be if($result == ValidateString($event, "2")) or if($result
>>>> === ValidateString($event, "2"))
>>>>
>>>>
>>>>
>>>>
>>> What if the intension was to fail if the result of ValidateString()
>>> was false??
>>>
>>> Then it should be writen as such.
>>>
>>> if ( ( $result = ValidateString($event, "2") ) !== FALSE ) {
>>> $formerror['event'] = $result;
>>> }
>>> [/snip]
>>>
>>> Hmmm.....did you test that?
>>> $result = ValidateString($event, "2") is always TRUE,
>>>
>> $result has had
>>
>>> something assigned to it unless the function ValidateString
>>>
>> returns a
>>
>>> FALSE. The OP never provided the code for the function so we just
>>> don't know. Also, the OP forgot to run subsequent conditions in an
>>> elseif check, instead he used 3 if statements that will be
>>>
>> executed each time.
>>
>>>
>>>
>> At one point he mentioned changing ValidateString() to return
>> false on an error.
>>
>> At least that is what I thought he said.
>>
>> --
>> PHP General Mailing List (http://www.php.net/) To
>> unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>
>

attached mail follows:


Jim Lucas wrote:
> Beauford wrote:
>> This is what I am trying to do, and for the most part it works, but
>> it also
>> may be causing some of my other problems.
>>
>> If $event contains invalid characters, I am returning a string that says
>> "Invalid Characters" So $result now contains the value 'Invalid
>> Characters'.
>> Then $formerror['event'] = $result - is self explanatory.
>>
>> If there are no errors nothing is returned and $result should contain
>> anything. But this doesn't always seem to be the case. This is one of
>> the
>> problems I am having.
>>
>> This is the code in a nutshell.
>>
>> if($result = ValidateString($event)) { $formerror['event'] = $result;
>> function ValidateString($string) {
>>
>> if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) {
>> return "Invalid Characters";
>> }
>>
>> Thanks
>>
>>
> In your regex you have a "." this will match anything
>
> try this:
>
> <plaintext><?php
>
> function ValidateString($string) {
> if ( preg_match("/[^a-zA-Z0-9\_\.\' -]+/", $string) ) {
> return "Invalid Characters";
> }
> return false;
> }
>
> $formerror = array();
forgot to say that all you need to do to get rid of the default values
is remove the following two lines

> $formerror['firstAttempt'] = 'first attempt';
> $formerror['secondAttempt'] = 'second attempt';
>
> $event = "A-Z and a-z plus 0-9 and an '_' are allowed.";
> if ( ( $result = ValidateString($event) ) !== false ) {
> $formerror['firstAttempt'] = $result;
> }
>
> $event = "But bad chars like !#$ and %^&* are not allowed.";
> if ( ( $result = ValidateString($event) ) !== false ) {
> $formerror['secondAttempt'] = $result;
> }
>
> var_dump($formerror);
>
> ?>
>
> Jim Lucas
>
>
>
>>> -----Original Message-----
>>> From: Jim Lucas [mailto:listscmsws.com] Sent: January 17, 2007 4:36 PM
>>> To: Jay Blanchard
>>> Cc: Beauford; PHP
>>> Subject: Re: [PHP] One last try at this!
>>>
>>> Jay Blanchard wrote:
>>>
>>>> [snip]
>>>>
>>>>> The second condition of each if statement does not contain
>>> equality
>>>>> checking, it sets the $result to ValidateString($event, "2"). That
>>>>> should be if($result == ValidateString($event, "2")) or if($result
>>>>> === ValidateString($event, "2"))
>>>>>
>>>>>
>>>> What if the intension was to fail if the result of ValidateString()
>>>> was false??
>>>>
>>>> Then it should be writen as such.
>>>>
>>>> if ( ( $result = ValidateString($event, "2") ) !== FALSE ) {
>>>> $formerror['event'] = $result;
>>>> }
>>>> [/snip]
>>>>
>>>> Hmmm.....did you test that?
>>>> $result = ValidateString($event, "2") is always TRUE,
>>> $result has had
>>>> something assigned to it unless the function ValidateString
>>> returns a
>>>> FALSE. The OP never provided the code for the function so we just
>>>> don't know. Also, the OP forgot to run subsequent conditions in an
>>>> elseif check, instead he used 3 if statements that will be
>>> executed each time.
>>>
>>>>
>>> At one point he mentioned changing ValidateString() to return false
>>> on an error.
>>>
>>> At least that is what I thought he said.
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/) To unsubscribe,
>>> visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>>
>>
>>
>

attached mail follows:


# listscmsws.com / 2007-01-17 17:02:12 -0800:
> Beauford wrote:
> > if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) {
> > return "Invalid Characters";
> >}

> In your regex you have a "." this will match anything
>
> try this:
>
> <plaintext><?php
>
> function ValidateString($string) {
> if ( preg_match("/[^a-zA-Z0-9\_\.\' -]+/", $string) ) {
> return "Invalid Characters";
> }
> return false;
> }

That "." is inside a character class where it is a literal character
(matches only "."). Why are you backslashing the underscore is beyond
me.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


Roman Neuhauser wrote:
> # listscmsws.com / 2007-01-17 17:02:12 -0800:
>> Beauford wrote:
>>> if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) {
>>> return "Invalid Characters";
>>> }
>
>> In your regex you have a "." this will match anything
>>
>> try this:
>>
>> <plaintext><?php
>>
>> function ValidateString($string) {
>> if ( preg_match("/[^a-zA-Z0-9\_\.\' -]+/", $string) ) {
>> return "Invalid Characters";
>> }
>> return false;
>> }
>
> That "." is inside a character class where it is a literal character
> (matches only "."). Why are you backslashing the underscore is beyond
> me.
>
This is fine, is there any harm in escaping them?
The match will work either way right?

attached mail follows:


# listscmsws.com / 2007-01-18 01:48:25 -0800:
> Roman Neuhauser wrote:
> ># listscmsws.com / 2007-01-17 17:02:12 -0800:
> >>Beauford wrote:
> >>> if(!preg_match("/^[-A-Za-z0-9_.' ]+$/", $string)) {
> >>> return "Invalid Characters";
> >>>}
> >
> >>In your regex you have a "." this will match anything
> >>
> >>try this:
> >>
> >><plaintext><?php
> >>
> >>function ValidateString($string) {
> >> if ( preg_match("/[^a-zA-Z0-9\_\.\' -]+/", $string) ) {
> >> return "Invalid Characters";
> >> }
> >> return false;
> >>}
> >
> >That "." is inside a character class where it is a literal character
> >(matches only "."). Why are you backslashing the underscore is beyond
> >me.
> >
> This is fine, is there any harm in escaping them?
> The match will work either way right?

It's misleading. I don't want to be confronted with another legacy
program full of almost-reular expressions whose author didn't understand
the syntax at all, but was so stubborn that he eventually (using the
hit-and-miss method) found whatever garbage worked for him for
completely accidental reasons.

Know your tools.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


Chuck Anderson wrote:
> It thought it would be bundled with my Windows version pf Php 4.4.1, but
> it is not.
>
> I've searched for it and can't find it at php.net.

You didn't search very hard.

On this page:

http://php.net/printer

Read the bit under "Installation".

"This PECL extension is not bundled with PHP."

and

"You may obtain this unbundled PECL extension from the various PECL
snaps pages (select the appropriate repository for your version of PHP):
PECL for PHP 4.3.x, PECL for PHP 5.0.x or PECL Unstable."

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


Chris wrote:
> Chuck Anderson wrote:
>
>> It thought it would be bundled with my Windows version pf Php 4.4.1, but
>> it is not.
>>
>> I've searched for it and can't find it at php.net.
>>
>
> You didn't search very hard.
>

> On this page:
>
> http://php.net/printer
>
> Read the bit under "Installation".
>
> "This PECL extension is not bundled with PHP."
>
> and
>
> "You may obtain this unbundled PECL extension from the various PECL
> snaps pages (select the appropriate repository for your version of PHP):
> PECL for PHP 4.3.x, PECL for PHP 5.0.x or PECL Unstable."
>
>

I did look there. I did read that.

You didn't try those links, though, did you? (Not Found)

(btw, .... I asked in another group and just found that it is located
here: <http://pecl4win.php.net/index.php>)

I don't see how to get there from the main PECL site, but there it is.

--
*****************************
 Chuck Anderson • Boulder, CO
 http://www.CycleTourist.com
*****************************

attached mail follows:


Chuck Anderson wrote:
> Chris wrote:
>> Chuck Anderson wrote:
>>
>>> It thought it would be bundled with my Windows version pf Php 4.4.1,
>>> but it is not.
>>>
>>> I've searched for it and can't find it at php.net.
>>>
>>
>> You didn't search very hard.
>>
>
>> On this page:
>>
>> http://php.net/printer
>>
>> Read the bit under "Installation".
>>
>> "This PECL extension is not bundled with PHP."
>>
>> and
>>
>> "You may obtain this unbundled PECL extension from the various PECL
>> snaps pages (select the appropriate repository for your version of
>> PHP): PECL for PHP 4.3.x, PECL for PHP 5.0.x or PECL Unstable."
>>
>>
>
> I did look there. I did read that.
>
> You didn't try those links, though, did you? (Not Found)
>
> (btw, .... I asked in another group and just found that it is located
> here: <http://pecl4win.php.net/index.php>)
>
> I don't see how to get there from the main PECL site, but there it is.

Consider myself reprimanded :P

However you didn't mention that the links didn't work ;)

Post a documentation bug at http://bugs.php.net :)

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On Wednesday 17 January 2007 06:16 pm, Jay Blanchard wrote:
> [snip]
> Why not use explode with the period (.) as the delimiter?
>
> $url = ranchy.stuff.com and other junk";
> $boom = explode(".", $url);
> print_r($boom);
>
> $boom is now an array containing 'ranchy', 'stuff', 'com and other junk'

Sigh.

I have used that code just above the area I have been working on . . . it's
been a long day.

Thanks - it does the job very well!

Andre

attached mail follows:


>Roman wrote:
> # dreasi0n.php.netgmail.com / 2007-01-17 19:06:16 +0000:
>
>> Stut wrote:
>>
>>> Redirecting using a Location header is not the only thing you can do
>>> with the header() function. It will never end processing of the
>>> script no matter what you pass to it. The example on the manual page
>>> for the header() function says as much (http://php.net/header), you
>>> read that right?
>>>
>> Well, I feel like a du***ss!
>>
>> No, I hadn't read that. I promisse, and this one is to keep, I won't
>> post to this list again without dedicate enough time to the problem,
>> at least to read the manual.
>>
>> Anyway, thank you for confirm what I should have known in advance and
>> also for remembering me that PHP developers have a PHP manual for PHP
>> users...
>>
> Also, the header() call you provided in the original post was a
> violation of HTTP. Knowing the programming language is just one of
> your responsibilities IMNSHO. The manual for HTTP users (you!) is at
> ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt
>

Hi Roman,

My English is not the best and I'm not sure what you mean. By looking at
the document you linked I'm thinking that the problem you're talking about
is not the '?var=value' but instead, the fact of being using a relative URL.

Am I correct?

If so, is there a way to know the full address of the index.php file?
I'm asking this because my IP is dynamic and I'm using a free redirection
service. My site is at 'http://something.no-ip.org/sitename' can I use
'http://something.no-ip.org/sitename/index.php?vaz=value' on the
Locarion header?

Thanks

attached mail follows:


# dreasi0n.php.netgmail.com / 2007-01-18 00:06:27 +0000:
> >Roman wrote:
> >Also, the header() call you provided in the original post was a
> >violation of HTTP. Knowing the programming language is just one of
> >your responsibilities IMNSHO. The manual for HTTP users (you!) is at
> >ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt
>
> My English is not the best and I'm not sure what you mean. By looking at
> the document you linked I'm thinking that the problem you're talking about
> is not the '?var=value' but instead, the fact of being using a relative URL.
>
> Am I correct?
 
Yes.

> If so, is there a way to know the full address of the index.php file?

You don't need to know your IP. See the grammar for AbsoluteURI:
ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt

> I'm asking this because my IP is dynamic and I'm using a free redirection
> service. My site is at 'http://something.no-ip.org/sitename' can I use
> 'http://something.no-ip.org/sitename/index.php?vaz=value' on the
> Locarion header?

Actually you *must* use it instead of just the "index..." part.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


> Roman:
> [...]
> You don't need to know your IP. See the grammar for AbsoluteURI:
> ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt
>
>> I'm asking this because my IP is dynamic and I'm using a free
>> redirection
>> service. My site is at 'http://something.no-ip.org/sitename' can I
>> use
>> 'http://something.no-ip.org/sitename/index.php?vaz=value' on the
>> Locarion header?
> Actually you *must* use it instead of just the "index..." part.
>

Thank you Roman, I'm now working with absolute paths! :)

I Never thought that HTML had those specs...
With the relative link it worked and so it was OK for me...

Bye

attached mail follows:


On Jan 18, 2007, at 12:59 AM, Nuno Vaz Oliveira wrote:

>> Roman:
>> [...]
>> You don't need to know your IP. See the grammar for AbsoluteURI:
>> ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt
>>> I'm asking this because my IP is dynamic and I'm using a free
>>> redirection
>>> service. My site is at 'http://something.no-ip.org/sitename' can I
>>> use
>>> 'http://something.no-ip.org/sitename/index.php?vaz=value' on the
>>> Locarion header?
>> Actually you *must* use it instead of just the "index..." part.
>
> Thank you Roman, I'm now working with absolute paths! :)
>
> I Never thought that HTML had those specs...
> With the relative link it worked and so it was OK for me...
>
> Bye
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


# dreasi0n.php.netgmail.com / 2007-01-18 08:59:11 +0000:
> >Roman:
> >[...]
> >You don't need to know your IP. See the grammar for AbsoluteURI:
> >ftp://ftp.rfc-editor.org/in-notes/rfc2396.txt
> >
> >>I'm asking this because my IP is dynamic and I'm using a free
> >>redirection service. My site is at
> >>'http://something.no-ip.org/sitename' can I use
> >>'http://something.no-ip.org/sitename/index.php?vaz=value' on the
> >>Locarion header?
> >Actually you *must* use it instead of just the "index..." part.
> >
>
> Thank you Roman, I'm now working with absolute paths! :)
>
> I Never thought that HTML had those specs...

It's not HTML, that's a completely different animal! HTTP is a transport
protocol, HTML is a document format. HTML documents are but one type
of things you can transport using HTTP.

> With the relative link it worked and so it was OK for me...

Don't rely on browser bugs and features present to work around popular
bugs in server-side scripts.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


Hello Ryan A,

   PHP has not application var, and not multi thread

   the only way is database, share memory.

Best regards,
  
======= At 2007-01-17, 16:39:31 you wrote: =======

>Hi,
>
>I think its easier to explain what I want to do.. so here goes:
>I want to store values in arrays for one minute and then write them to file.
>
>For example, everytime someone logs in I want their username to be in an array....
>1 or 100 or X people may login in 60 seconds...but it should only write all the usernames that logged in to disk every 1 minute.
>
>Ideas? suggestions? starting points or a link to a specific spot in the manual with a RTFM would be appreciated :)
>
>Thanks in advance,
>Ryan
>
>
>------
>- The faulty interface lies between the chair and the keyboard.
>- Creativity is great, but plagiarism is faster!
>- Smile, everyone loves a moron. :-)
>
>---------------------------------
>It's here! Your new message!
>Get new email alerts with the free Yahoo! Toolbar.

= = = = = = = = = = = = = = = = = = = =
                        
Nicholas Yim
nick.yimtaowap.com
2007-01-18

attached mail follows:


can you please check these out and tell me if there another way without
installing externsions??

http://groups-beta.google.com/group/cpdevgroup/web/how-easy-is-these-project?&_done=%2Fgroup%2Fcpdevgroup%2Fweb%2Fhow-easy-is-these-project%3Fmsg%3Dns

attached mail follows:


Oops, i forgot to reply to php-general on this use this reply instead
of the one i sent to your specific email.

On 1/16/07, Ali Nasser <phpdevstergmail.com> wrote:
> can you please check these out and tell me if there another way without
> installing externsions??
>
> http://groups-beta.google.com/group/cpdevgroup/web/how-easy-is-these-project?&_done=%2Fgroup%2Fcpdevgroup%2Fweb%2Fhow-easy-is-these-project%3Fmsg%3Dns
>

Perhaps, php.net/proc_open

Curt.

attached mail follows:


Ali Nasser wrote:
> can you please check these out and tell me if there another way without
> installing externsions??

no sorry I cant check for you!

>
> http://groups-beta.google.com/group/cpdevgroup/web/how-easy-is-these-project?&_done=%2Fgroup%2Fcpdevgroup%2Fweb%2Fhow-easy-is-these-project%3Fmsg%3Dns
>
>

attached mail follows:


Hello,
 I am hoping to be able to be added to the pear general mailing list.

Thanks,
--Bernie Graham

attached mail follows:


On 1/15/07, Bernie Graham <bernie.grahamgmail.com> wrote:
> Hello,
> I am hoping to be able to be added to the pear general mailing list.

Go to http://pear.php.net/support/

Curt.

attached mail follows:


Hi all ,

  I am using php 4.2 , mysql and Linux OS.

  I need to format timestamp to string using
   strftime , for e.g:

   strftime('%e',1170000000) -> the day should be 28 , but is 29 when i
execute strftime() function.

Anyone have ideas what is the problems ?

Thanks

attached mail follows:


On 1/17/07, weetat <weetat.yeocxrus.com> wrote:
> Hi all ,
>
> I am using php 4.2 , mysql and Linux OS.
>
> I need to format timestamp to string using
> strftime , for e.g:
>
> strftime('%e',1170000000) -> the day should be 28 , but is 29 when i
> execute strftime() function.
>
> Anyone have ideas what is the problems ?

Upgrade to a more recent version of php? with php5.2 i get 28, with
php version 4.4 i get 28.

You have to remember the last version of 4.2 was release on 6
September 2002, it is 2007 right now iirc.

See php.net/releases/ for more information.

Curt.

attached mail follows:


weetat wrote:
> Hi all ,
>
> I am using php 4.2 , mysql and Linux OS.
>
> I need to format timestamp to string using
> strftime , for e.g:
>
> strftime('%e',1170000000) -> the day should be 28 , but is 29 when i
> execute strftime() function.
>
> Anyone have ideas what is the problems ?
>
> Thanks
>
could be as simple as the TZ of your system.
or
day lights saving ???

What TZ is your server set for?

attached mail follows:


weetat wrote:
> Hi all ,
>
> I am using php 4.2 , mysql and Linux OS.
>
> I need to format timestamp to string using
> strftime , for e.g:
>
> strftime('%e',1170000000) -> the day should be 28 , but is 29 when i
> execute strftime() function.
>
> Anyone have ideas what is the problems ?
>
> Thanks
>
I am running 4.3.11
my current time is Wed Jan 17 19:32:31 PST 2007
and I get 28.

Check also the date and time of the server you are running on and make
sure that it is set correctly to your local

attached mail follows:


Hello php list:
If I include a php script inside a php function definition and then
call the
function in another script. What is the scope of variables in the
included
script? Are they local to the function that calls include with the file
name?
Thanks in advance;
I'm not sure where to look for this answer;
JK

attached mail follows:


On 1/17/07, jekillen <jekillenprodigy.net> wrote:
> Hello php list:
> If I include a php script inside a php function definition and then
> call the
> function in another script. What is the scope of variables in the
> included
> script? Are they local to the function that calls include with the file
> name?
> Thanks in advance;
> I'm not sure where to look for this answer;
> JK

Does your included PHP script contain any functions? Or is it more like:

file1.php contents:

function my_function () {
  if (i_feel_like_it) {
    include("inc.php");
  }
}

and inc.php contains variables at the global level such as:

inc.php:
$var1 = 2;
$var2 = 3;

Am I close?

attached mail follows:


On 1/17/07, Andrew Kreps <andrew.krepsgmail.com> wrote:
> On 1/17/07, jekillen <jekillenprodigy.net> wrote:
> > Hello php list:
> > If I include a php script inside a php function definition and then
> > call the
> > function in another script. What is the scope of variables in the
> > included
> > script? Are they local to the function that calls include with the file
> > name?
> > Thanks in advance;
> > I'm not sure where to look for this answer;
> > JK
>

FYI, I just ran a quick scope test based on my guess of your
situation. If you include a PHP file containing global variables
inside a function, the variables will _only_ be available after you
include the file, and only for the duration of the function. They
will not exist after the function ends, even if you specify global
$var1; in your other functions, or at the global level of your script.

This was tested using PHP 5.0.4.

Here is my sample code:

test.php:
<?

print "Top Level: Var1: $var1 Var2: $var2\n<br>";

test1();
test2();

function test1 ()
{
        print "Before: Var1: $var1 Var2: $var2\n<br>";
        include("testinc.php");
        print "After: Var1: $var1 Var2: $var2\n<br>";
}

function test2 ()
{
        print "Test2: Var1: $var1 Var2: $var2\n<br>";
}

print "Bottom Level: Var1: $var1 Var2: $var2\n<br>";

testinc.php:
<?
$var1 = 1;
$var2 = 2;
?>

attached mail follows:


# jekillenprodigy.net / 2007-01-17 21:49:05 -0800:
> Hello php list:
> If I include a php script inside a php function definition and then
> call the function in another script. What is the scope of variables in
> the included script? Are they local to the function that calls include
> with the file name?

Yes.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


On 1/17/07, Jochem Maas <jochemiamjochem.com> wrote:
> Ramdas wrote:
> > Hi Group,
> >
> > A very newbie question. Might be discussed earlier, please forgive.
>
> Are so much of a noob that STFW is not within your capabilities?
> (just thought I'd ask, given that you admit to realising the info *might*
> be out there already)
>
> >
> > I am having a site in PHP ( not very great design ) which I need to
> > convert/modify to use functions. Such the code for connecting /
> > binding to Ldap is not repeated & scripts are more readable.
> >
> > The site deals with modifying / adding / deleting entries in a LDAP dir.
> >
> > In each of the pages following is done:
> >
> > <?php
> >
> > require 'validate.php' ;// validate.php checks if the user is loged in
> >
> > $connect = ldap_connect(ldapserver);
> > if ($connect) {
> >
> > bind ...
> > do the things....
> >
> > }else { echo erro..}
> >
> > ?>
> >
> >
> > Also please advice what is a correct method of checking the user's
> > session. Currenlty I use a "HTTP_SESSION_VARS" variable to store the
>
> recommended to use the $_SESSION superglobal instead and stuff values
> directly into (after having called session_start()) instead of using session_register()
> et al.
>
> > user's login & passwd . Each time the user hits the page these vars
>
> you only need to store *whether* they are logged in - and set that value when you
> actually handle a login attempt (obviously storing their username could be handy)
>
> I don't see any reason to store the passwd and validate against ldap on
> every request ... in fact I believe that storing the pwd in such a way is essentially less
> secure.
>
> > are checked with the existing values in the LDAP (this is done by
> > validate.php).
> >
> > Please suggest me some good starting point where I can start a fresh
> > with more compact/cleaner Code.
>
> that question is about as vague as 'how long is a chinaman?'
> (the answer to that question being 'yes he is')
>
> here are some very vague ideas/functions:
>
> an include file ...
> =========== 8< =====================
> <?php
> function sessionCheck()
> {
> if (!isset($_SESSION['loggedin']) || !$_SESSION['loggedin']) {
> /* show login page then .. */
> exit;
> }
> }
>
> function doLogin($username, $passwd)
> {
> $_SESSION['loggedin'] = false;
> if (/* given $username+$passwd check outs in ldap*/)
> $_SESSION['loggedin'] = true;
>
> return $_SESSION['loggedin'];
> }
> ?>
>
> an 'init' include file
> =========== 8< =====================
> <?php
>
> require 'your-include-file.php'; // see above
>
>
> session_start();
>
> if (isset($_POST['uname'], $_POST['pwd'])) {
> doLogin($_POST['uname'], $_POST['pwd']);
> }
>
> sessionCheck();
>
> ?>
>
> any other file (other than the login 'page')
> =========== 8< =====================
> <?php
>
> require 'your-init-file.php';
>
> // we are logged in - it's magic
>
> // do some shit
>
> // the end, congrats go get laid :-)
>
> ?>
>

Thanx for the all responses.

Regards
Ram

attached mail follows:


Could someone please help me figure out how to hide the info in the
right bottom part of my page unless the corresponding link is
selected in the top left.

The company names and job types at the top left need to show at all
time. But the corresponding picture at the bottom left and the web
address/info at the bottom right should appear only when selected.

I have the same query repeating twice once for the top left part and
once for the bottom right part because I can't figure out how else to
do it!

Thank you.

http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg

attached mail follows:


I can't really understand what your problem is, because it seems to me
that the site is working like you want it to work. Or not?

And if there is a problem with the code then please show us the code
somehow, not the resulting webpage

greets
Zoltán Németh

On cs, 2007-01-18 at 01:31 -0800, pub wrote:
> Could someone please help me figure out how to hide the info in the
> right bottom part of my page unless the corresponding link is
> selected in the top left.
>
> The company names and job types at the top left need to show at all
> time. But the corresponding picture at the bottom left and the web
> address/info at the bottom right should appear only when selected.
>
> I have the same query repeating twice once for the top left part and
> once for the bottom right part because I can't figure out how else to
> do it!
>
> Thank you.
>
> http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg

attached mail follows:


Thank you for your reply.

My problem is that the web addresses on the bottom right show at all
times as is instead of appearing only when active or selected on the
left top navigation!

Does that make sense?

On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:

> I can't really understand what your problem is, because it seems to me
> that the site is working like you want it to work. Or not?
>
> And if there is a problem with the code then please show us the code
> somehow, not the resulting webpage
>
> greets
> Zoltán Németh
>
> On cs, 2007-01-18 at 01:31 -0800, pub wrote:
>> Could someone please help me figure out how to hide the info in the
>> right bottom part of my page unless the corresponding link is
>> selected in the top left.
>>
>> The company names and job types at the top left need to show at all
>> time. But the corresponding picture at the bottom left and the web
>> address/info at the bottom right should appear only when selected.
>>
>> I have the same query repeating twice once for the top left part and
>> once for the bottom right part because I can't figure out how else to
>> do it!
>>
>> Thank you.
>>
>> http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


ok, but how could anyone help without seeing your code?

greets
Zoltán Németh

On cs, 2007-01-18 at 01:54 -0800, pub wrote:
> Thank you for your reply.
>
> My problem is that the web addresses on the bottom right show at all
> times as is instead of appearing only when active or selected on the
> left top navigation!
>
> Does that make sense?
>
> On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:
>
> > I can't really understand what your problem is, because it seems to me
> > that the site is working like you want it to work. Or not?
> >
> > And if there is a problem with the code then please show us the code
> > somehow, not the resulting webpage
> >
> > greets
> > Zoltán Németh
> >
> > On cs, 2007-01-18 at 01:31 -0800, pub wrote:
> >> Could someone please help me figure out how to hide the info in the
> >> right bottom part of my page unless the corresponding link is
> >> selected in the top left.
> >>
> >> The company names and job types at the top left need to show at all
> >> time. But the corresponding picture at the bottom left and the web
> >> address/info at the bottom right should appear only when selected.
> >>
> >> I have the same query repeating twice once for the top left part and
> >> once for the bottom right part because I can't figure out how else to
> >> do it!
> >>
> >> Thank you.
> >>
> >> http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

attached mail follows:


On Jan 18, 2007, at 2:00 AM, Németh Zoltán wrote:

> ok, but how could anyone help without seeing your code?
>
> greets
> Zoltán Németh
>
Here is the code:

Here is the entire page:

<!-- nav/box 1 starts here -->

<?php
   include("../include/etc_inc.php");

   $connection = mysql_connect($host,$user,$password)
                                or die ("couldn't connect to server");
        
// connect to database
   $db = mysql_select_db($database,$connection)
                                or die ("Couldn't select database");

// query a from client
   $query = "SELECT * FROM client
                                where status='active' or status='old'
                                order by companyName";
                                
        $result = mysql_query($query)
        or die ("Couldn't execute query");
                
   while ($aaa = mysql_fetch_array($result,MYSQL_ASSOC))
   {
   echo "<span class='navCompany'>{$aaa['companyName']}</span><span
class='navArrow'> > </span>\n";

// query b from job
        $query = "SELECT * FROM job
                                WHERE companyId='{$aaa['companyId']}'";
           $result2 = mysql_query($query)
                or die ("Couldn't execute query b");

                        foreach($aaa as $jobType)
                        {
                        $bbb = mysql_fetch_array($result2,MYSQL_ASSOC);
                        echo "<span class='navText'><a href='single_page_t2.php?art=".$bbb
['pix']."'>{$bbb['jobType']}</a></span>\n";

                        }

        echo "<br>";
        }
        ?>
        

<!-- nav/box 1 ends here -->

</div>
<div class="navbox2"><img src="images/sq_logo_137.gif" alt="Square
Inch logo" width="137" height="137"></div>

<div class="navbox3"><?php $image = $_GET['art']; ?>
                        <img src="images/<?php print ($image) ?>" alt="Portfolio Item"
border="0" width="285" height="285"></div>

<div class="navbox4">

<!-- info/box 4 starts here -->
<?php
/* query 1 from client */
$query = "SELECT * FROM client
                        where status='active' or status='old'
                        order by companyName";
                                
           $result = mysql_query($query)
        or die ("Couldn't execute query");

while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
                        
/* query 2 from job */
$query = "SELECT * FROM job
                                WHERE companyId='{$row['companyId']}'";
                   $result2 = mysql_query($query)
                or die ("Couldn't execute query2");
                $url = mysql_query($result2);
                
        foreach($row as $url)
                {
                $row = mysql_fetch_array($result2,MYSQL_ASSOC);
                if ("url={$row['url']}")
                echo "<span class='navText'><a href='{$row['url']}'>{$row['web']}</
a></span>";
                }

        echo "<br>";
        }
        ?>

<!-- info/box 4 ends here -->

> On cs, 2007-01-18 at 01:54 -0800, pub wrote:
>> Thank you for your reply.
>>
>> My problem is that the web addresses on the bottom right show at all
>> times as is instead of appearing only when active or selected on the
>> left top navigation!
>>
>> Does that make sense?
>>
>> On Jan 18, 2007, at 1:43 AM, Németh Zoltán wrote:
>>
>>> I can't really understand what your problem is, because it seems
>>> to me
>>> that the site is working like you want it to work. Or not?
>>>
>>> And if there is a problem with the code then please show us the code
>>> somehow, not the resulting webpage
>>>
>>> greets
>>> Zoltán Németh
>>>
>>> On cs, 2007-01-18 at 01:31 -0800, pub wrote:
>>>> Could someone please help me figure out how to hide the info in the
>>>> right bottom part of my page unless the corresponding link is
>>>> selected in the top left.
>>>>
>>>> The company names and job types at the top left need to show at all
>>>> time. But the corresponding picture at the bottom left and the web
>>>> address/info at the bottom right should appear only when selected.
>>>>
>>>> I have the same query repeating twice once for the top left part
>>>> and
>>>> once for the bottom right part because I can't figure out how
>>>> else to
>>>> do it!
>>>>
>>>> Thank you.
>>>>
>>>> http://www.squareinch.net/single_page_t2.php?art=btw_logo.jpg
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>

attached mail follows:


 did the following...

-installed apache
-installed php (C:\PHP) with the windows installer
-moved my websites to the htdocs folder..so far so good can access pages
- downlaoded php my admin to htdocs
-downloaded the FULL php version
-copied the extensions folder (C:\PHP\ext)
-changd the line in php.ini

extension_dir = "C:\PHP\ext"

- the extensions in .ini look like this

;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll

The .dll file is in C:\PHP\ext\mysql

Phpmyadmin cannot load I get the error " Cannot load mysql extension. "

attached mail follows:


Hello,

Can someone here give me a glue how to do the following. I guess I need to
use regular expressions here. I have absolutely zero experience with regular
expressions. (if there's another way to do this I don't mind. I jus need to
get this done somehow :)

I need to strip all characters from the following text string exept the
image path...

"<img width=\"99\" height=\"120\" border=\"0\"
src=\"../../images/new/thumps/4123141112007590373240.jpg\" />"...and then
store the path to DB. Image path lengh can vary so I guess that I need to
extract all characters after scr=\" until next \" or somethig
similar.

Thanks for your advise!
-Will