[PHP] Re: testing for blank var

2002-03-21 Thread Julio Nobrega Trabalhando

if (ereg("^[[:blank:]]*$",$img_url)) {
// $img_url is blank
}

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Robert McPeak" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if $img_url has a value, then I'd like to show the image, if it doesn't,
> then I'd like to show a message.  What's wrong with my code?  Am I
> incorrectly testing for the value?  The else works fine, but not the if.
>  Thanks!
>
> if (!$img_url)
> {
> echo "No Image URL Entered"";
> }
> else
> {
> echo "";
> }
>



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




[PHP] Re: testing for blank var

2002-03-21 Thread Marcel Besancon

Hi Robert,

maybe your variable doesn't exist. Try using

if(!isset($variable))  {
missing-message  }
else  {
show $variable  }

I hope this helps.

Bye, Marcel

--
registered Fli4l-User #0388



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




[PHP] Re: Testing MySQL 4.0 ; detaching queries

2001-11-28 Thread Julio Nobrega Trabalhando

  Save the queries on different files, one for each query. Then make a
script that will read all these files and execute the queries, maybe run it
as a cron job, and delete the succesful ones . With several files will be
easier to spot an error if occur, just open it and see the query.

  Okay, it's not much 'on-the-fly', because doesn't have all agreggated
processes from the whole script running, but your queries will be tested...

--

Julio Nobrega

No matter where you go, &this.

"Steven Roussey" <[EMAIL PROTECTED]> wrote in message
news:003001c17844$9c7b9aa0$[EMAIL PROTECTED]...
> > You could just exec() the page again, with a parameter telling it to
> use
> > the test server, like so:
>
> I like this general idea, though the above method would take a little
> more work since I would have to pass the environment variables and
> apache variables (GET and POST, etc) to exec and I don't know how.
>
> However, I can try and setup a test web server on the test SQL server
> and have a auto_postpend file that sets up all these variables (cookies,
> post vars, etc) and sends them off using fsockopen, etc., as a HTTP
> request to the other server. If I setup the other server to ignore
> hangups, then I can send the request and quit.
>
> Thanks for the idea!
>
> Sincerely,
> Steven Roussey
> http://Network54.com/?pp=e
>
>
>



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




[PHP] Re: testing for cookies capable client (browser)

2002-02-02 Thread Manuel Lemos

Hello,

Justin French wrote:
> 
> Hi,
> 
> Is there a simple method for checking if cookies are enabled (able to be
> set) on a browser?  The only method I can think of is setting the
> cookie, then refreshing the page (or going to another URL) in order to
> tet if the cookie exists... which sounds messy.

It is the only reliable method, but make sure if you try persistent
cookies first to fallback to session cookies if persistent fail.


 
> I'd prefer not to use anything client-side (javascript etc).

The user may have a cookie enabled browser with Javascript disabled.

Regards,
Manuel Lemos

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




[PHP] Re: Testing PHP on a local machine

2002-06-26 Thread Craig

Thanks for pointing me in the right direction

However, just have a few other questions:-

Do i need to install apache if i use the windows self extracting version?
Can all this be also done on a laptop?

Thanks for all the advice

Craig
"Craig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...



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




[PHP] Re: Testing PHP on a local machine

2002-06-26 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Thanks for pointing me in the right direction
> 
> However, just have a few other questions:-
> 
> Do i need to install apache if i use the windows self extracting version?

I assume you are talking about php self extracting? If so, you will also 
need some sort of web server to be able ot develop php web based stuff.

> Can all this be also done on a laptop?
Works on mine.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Testing for the presence of HTML

2001-11-20 Thread Fred

This may not actually be a problem.  If you are expecting that users may
enter links as html you can still use nl2br and get a decent result.  The
only time this would be a problem, would be if the users actually entered
 as they filled in the form.  In my experience, it is highly unlikely
that a user will write their own  as they fill in a form, even if they
do enter other html such as links.

Fred

Richard S. Crawford <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
My database contains a field which may or may not contain HTML code,
depending on what a particular user enters when they enter the data.

Here's the challenge:

If there is HTML code in this field, then print the text with interpreted
HTML.  No problem at all.

If there is no HTML code in the field, then I still want the data printed
nice and neat; the users will probably use line returns to make their text
look somewhat decent.

So, assuming that $text contains the contents of this field, then what I
want to do is this:

 if (!HTMLin$text) then $text = nl2br($text);

What's the best way to check and see if HTML is present in the field?


Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"




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




[PHP] Re: Testing if Scripting has been disabled

2001-08-01 Thread Richard Lynch

> Is there a method to test if Scripting has been disabled in the browser?

Sure.

Use JavaScript to forward to another page, or set a variable, or something,
and check it on the next page.

Either JavaScript worked, or it didn't.

There is *NO* way, a priori, to tell for the first page though.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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




Re: [PHP] Re: Testing for the presence of HTML

2001-11-20 Thread Richard S. Crawford

Unfortunately, I also have users entering complex HTML code such as tables; 
which, if each tag of a table is on a separate line, renders badly with 
nl2br().  I mean, really badly.  You have no idea.

My users range from professional web developers to people who are still 
frightened by the idea of using a mouse.


At 01:20 PM 11/20/2001, Fred wrote:
>This may not actually be a problem.  If you are expecting that users may
>enter links as html you can still use nl2br and get a decent result.  The
>only time this would be a problem, would be if the users actually entered
> as they filled in the form.  In my experience, it is highly unlikely
>that a user will write their own  as they fill in a form, even if they
>do enter other html such as links.
>
>Fred
>
>Richard S. Crawford <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>My database contains a field which may or may not contain HTML code,
>depending on what a particular user enters when they enter the data.
>
>Here's the challenge:
>
>If there is HTML code in this field, then print the text with interpreted
>HTML.  No problem at all.
>
>If there is no HTML code in the field, then I still want the data printed
>nice and neat; the users will probably use line returns to make their text
>look somewhat decent.
>
>So, assuming that $text contains the contents of this field, then what I
>want to do is this:
>
>  if (!HTMLin$text) then $text = nl2br($text);
>
>What's the best way to check and see if HTML is present in the field?
>
>
>Sliante,
>Richard S. Crawford
>
>http://www.mossroot.com
>AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
>MSN: [EMAIL PROTECTED]
>
>"It is only with the heart that we see rightly; what is essential is
>invisible to the eye."  --Antoine de Saint Exupéry
>
>"Push the button, Max!"
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"


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




RE: [PHP] Re: Testing for the presence of HTML

2001-11-20 Thread Matthew Luchak


If I understand the question correctly - came late to the thread - I
think the easiest way to do this would be to check for the presence of
"mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 20, 2001 4:29 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Testing for the presence of HTML


Unfortunately, I also have users entering complex HTML code such as
tables; 
which, if each tag of a table is on a separate line, renders badly with 
nl2br().  I mean, really badly.  You have no idea.

My users range from professional web developers to people who are still 
frightened by the idea of using a mouse.


At 01:20 PM 11/20/2001, Fred wrote:
>This may not actually be a problem.  If you are expecting that users
may
>enter links as html you can still use nl2br and get a decent result.
The
>only time this would be a problem, would be if the users actually
entered
> as they filled in the form.  In my experience, it is highly
unlikely
>that a user will write their own  as they fill in a form, even if
they
>do enter other html such as links.
>
>Fred
>
>Richard S. Crawford <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>My database contains a field which may or may not contain HTML code,
>depending on what a particular user enters when they enter the data.
>
>Here's the challenge:
>
>If there is HTML code in this field, then print the text with
interpreted
>HTML.  No problem at all.
>
>If there is no HTML code in the field, then I still want the data
printed
>nice and neat; the users will probably use line returns to make their
text
>look somewhat decent.
>
>So, assuming that $text contains the contents of this field, then what
I
>want to do is this:
>
>  if (!HTMLin$text) then $text = nl2br($text);
>
>What's the best way to check and see if HTML is present in the field?
>
>
>Sliante,
>Richard S. Crawford
>
>http://www.mossroot.com
>AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
>MSN: [EMAIL PROTECTED]
>
>"It is only with the heart that we see rightly; what is essential is
>invisible to the eye."  --Antoine de Saint Exupéry
>
>"Push the button, Max!"
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail:
[EMAIL PROTECTED]


Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"


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


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




[PHP] Re: Testing Alert: Significant changes to DOM-XML

2001-12-01 Thread Markus Fischer

[This mail goes out to php-dev, php-qa and php-general and
has its Reply-To: set to php-dev!]

Hi Zak,

thanks for the mail, I was thinking about writing such a mail
myself but was to tired I guess.


Yep, the CVS note to the latest ext/domxml changes state it
clearly:

# Testers/patches/contribs welcome.

The actual changelog can be found here [1].


Also for anyone out there who has no idea about CVS: It won't
help me anything filing bug reports against any released
source code of PHP out there. Please use the HEAD branch when
filing bug reports. See CVS instructions at
http://www.php.net/anoncvs.php how to achive this.


Although I don't expect a rush on this ;) I want to give out
some simple rules for anyone helping us getting domxml more
stable:

.) If you have a reproduceable crash with small
   self-containing script with no other external
   dependencies than loading a file ->

don't forget to use the bug reporting system!

   Do not mail me privately about it!

   No, I'm not lazy or whatever but I wan't to broaden
   the audience reading about the bugs (two eyes see less
   than more eyes) and it also helps me keeping track of
   all the problems.

.) If you have a reproduceable crash but can't create a
   small self-containing script, there are three options:

1) still try to create one (prefered)

2) Provide backtrace in your bug report
   ('bt full' command, not normal bt)

3) give me access to your devel system
   (no, no joke. This has worked in the past, it can
   in the future) But no promises.

.) Before reporting, try creating a testcase which is
   suiteable to run on the command line of PHP (read:
   with the CGI version).

   Apache is nice but it adds some extra work when
   handling the bugs I prefer the reproduceable scripts
   which use the CGI version for testing and don't
   contain any fancy  tags but newlines and such
   instead. The find bug/fix it cycle is much faster
   without apache.

   Again, I'm not lazy, but I'm also using MSVC for
   debugging and although I'm not a windows fan I've seen
   myself being faster chasing down bugs with it then
   with gdb (doh!).

.) Patches can go directly to me; but please also tell me
   why and what and give a testing script and not only
   send a diff to me.

   Of cousre, anyone with the proper karma is encouraged
   to fix it himself (you might want to check back if I'm
   not currently working on it).

.) NEW FEATURES

   No, I do NOT plan to add now featuers. I'm just
   interesting in making the current version more stable
   but time doesn't permit to expand this scope.

   But you're still encouraged to use the bug report
   system to put your feature requests there or do it
   yourself.


What I wrote done seems normal to me and I do not explicetely
prefer this for domxml but anything else too. Saves mit quite
lot of time.


On Sat, Dec 01, 2001 at 08:19:47PM -0700, Zak Greant wrote : 
> Marcus Fischer has made [...]

Yo, and its still MarKKKus ;-)

- Markus

[1] http://cvs.php.net/cvs.php/php4/ext/domxml/php_domxml.c

-- 
Please always Cc to me when replying to me on the lists.

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