php-general Digest 17 Sep 2004 15:12:50 -0000 Issue 3001
Topics (messages 196934 through 196953):
Re: search query
196934 by: David Robley
Re: PHP4 readdir is_dir working incorrectly?
196935 by: Jack Gates
196936 by: Jack Gates
Auth class & /usr/share/pear
196937 by: Pahlevanzadeh Mohsen
Re: A native Windows binding for PHP - released
196938 by: Manuel Lemos
196946 by: Gryffyn, Trevor
196947 by: Octavian Rasnita
196952 by: Marek Kilimajer
$i++, incrementing by 10's
196939 by: Louie Miranda
196940 by: Andrew Kreps
detect a file if it exist and display an image
196941 by: Louie Miranda
196942 by: Louie Miranda
196944 by: John Holmes
Re: Secret Codes in Spam and PHP
196943 by: Fernando Gutierrez
Re: Novice PHP Variable/Link Question
196945 by: Gryffyn, Trevor
Re: Host for Mod PHP5
196948 by: Burhan Khalid
196949 by: Gryffyn, Trevor
Re: mysql_connect does not connect
196950 by: Sam Hobbs
Highest Key in an Array
196951 by: Daniel Schierbeck
196953 by: Martin Holm
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Thu, 16 Sep 2004 16:47, you wrote:
> Thank you for response
> and what if user choose for 300.000 than the query should bee
> SELECT fields FROM table WHERE something BETWEEN 250.000 AND 300.000
> But I don'n know what the user will choose do I need to make a if statement
> If($prijsklasse=='2'){
> $option ="WHERE something BETWEEN 250.000 AND 300.000";
> }elseif($prijsklasse=='3'){
> $option ="WHERE something BETWEEN 300.000 AND 350.000";
> }else....
> SELECT fields FROM table .$option;
> Is this a good aproach
> Thank you in advance
>
>
> "David Robley" <[EMAIL PROTECTED]> wrote in message
> news:<[EMAIL PROTECTED]>...
>
> > On Wed, 15 Sep 2004 23:30, Peppe wrote:
> > > Hi
> > > I have a option box with values
> > > <select name="prijsklasse" class="bodyzwart" id="prijsklasse">
> > > <option value="1" selected>Less than 150.000
> > > <option value="2">tot 175.000
> > > <option value="3">tot 200.000
> > > <option value="4">tot 250.000
> > > <option value="5">tot 300.000
> > > <option value="6">tot 350.000
> > > <option value="7">tot 400.000
> > > <option value="8">More than 400.000
> > > </select>
> > > I need help when the user chose option value 3 till 200.000 than the
>
> query
>
> > > should search between 175.000 and 200.000 how to achive this
> > > Regards
> >
> > SELECT fields FROM table WHERE something BETWEEN 175.000 AND 200.000
> >
> > More information at
> > http://dev.mysql.com/doc/mysql/en/Comparison_Operators.html or see the
>
> docs
>
> > for whatever other database you use.
It is better to keep your correspondence to the list, so tht you are likely to
receive responses from all the list subscribers.
Yor best solution would be to use a switch and build your query based on the
value of prijsklasse.
--
David Robley
Famous last words - Icarus: Aaaahhhhhhhhh.
--- End Message ---
--- Begin Message ---
> Out of respect for everyone on the list, it is probably best to not use
> this mailing list as a sales tool. Many of us here on the list are in
> the same business of developing and hosting. It is wise to assume
> everyone on the list is in the same business (even if it is untrue).
> Just know that if someone is looking for hosting, they will definitely
> post a request specifically looking for such services. It may also be
> beneficial to you personally if you were to have a working PHP5 server
> online before attempting to sell it as a service. I hope you take this
> advice kindly, as I mean you no harm.
>
> One thing that I am not sure of is whether or not the PHP.NET group
> already has a mailing list specifically for posting PHP related service
> availability. If so, you may want to look for business there.
>
> Best of luck in your ventures. The US economy is starting to pick up
> which is hopefully a benefit to all PHP programmers worldwide.
>
> Respectfully,
>
> --
> Kristopher Spencer-Yates
> Dev Mgr/Systems Administration
> [EMAIL PROTECTED]
--
Jack "The Rhino" Gates, Registered Linux user #342662
Morning Star Communications, www.morningstarcom.net
Web Hosting, Site Design, Domain Registration,
VMware Workstation Software and GSX Server Software
--- End Message ---
--- Begin Message ---
This is just to say that I never sent that to the list. I sent it privately.
So for you to send this to the list to say that I probably should not was not
good either. Because now the whole list has been bothered instead of just
one.
On Thursday 16 September 2004 03:15 pm, Kristopher Spencer-Yates wrote:
> Out of respect for everyone on the list, it is probably best to not use
> this mailing list as a sales tool. Many of us here on the list are in
> the same business of developing and hosting. It is wise to assume
> everyone on the list is in the same business (even if it is untrue).
> Just know that if someone is looking for hosting, they will definitely
> post a request specifically looking for such services. It may also be
> beneficial to you personally if you were to have a working PHP5 server
> online before attempting to sell it as a service. I hope you take this
> advice kindly, as I mean you no harm.
>
> One thing that I am not sure of is whether or not the PHP.NET group
> already has a mailing list specifically for posting PHP related service
> availability. If so, you may want to look for business there.
>
> Best of luck in your ventures. The US economy is starting to pick up
> which is hopefully a benefit to all PHP programmers worldwide.
>
> Respectfully,
>
> --
> Kristopher Spencer-Yates
> Dev Mgr/Systems Administration
> [EMAIL PROTECTED]
--
Jack "The Rhino" Gates, Registered Linux user #342662
Morning Star Communications, www.morningstarcom.net
Web Hosting, Site Design, Domain Registration,
VMware Workstation Software and GSX Server Software
--- End Message ---
--- Begin Message ---
Deras,I have deleted /usr/share/pear/*
Also i have downloaded PEAR.1.3.5.Then i copy content
of PEAR.1.3.5 directory to /usr/share/pear
But now i recv following message:
Warning: _factory(Auth/DB.php): failed to open stream:
No such file or directory in
/var/www/html/forum/Auth/Auth.php on line 218
Fatal error: _factory(): Failed opening required
'Auth/DB.php' (include_path='.:/usr/share/pear') in
/var/www/html/forum/Auth/Auth.php on line 218
I'm using Auth class.
Please guide me......
Yours,Mohsen
=====
---------DIGITAL SIGNATURE-------------------
///Mohsen Pahlevanzadeh////////
Network administrator & programmer
My home phone is: +98213810146
My email address is
m_pahlevanzadeh at yahoo dot com
My website is: http://webnegar.net
----------------------------------------------------------------
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
--- End Message ---
--- Begin Message ---
Hello,
On 09/16/2004 09:01 PM, Rubem Pechansky wrote:
I have designed and successfully prototyped a native Windows binding
for PHP. This binding is very lightweight and it is already capable of
doing dialogs, controls, and a lot more with a few dozen lines of
code. PHP can thus be used as a tool for quick development of native
Windows applications.
I have just released this project to the public as Open Source at
http://winbinder.sourceforge.net/. Although it is still a work in
progress, you can take a look at the source code, download a working
demo and play with it a little bit.
Your ideas, comments, criticisms and suggestions are very welcome.
This looks like a good extension for submitting to PECL:
http://pecl.php.net/
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--- End Message ---
--- Begin Message ---
> On 09/16/2004 09:01 PM, Rubem Pechansky wrote:
> > I have designed and successfully prototyped a native Windows binding
> > for PHP. This binding is very lightweight and it is already
> capable of
> > doing dialogs, controls, and a lot more with a few dozen lines of
> > code. PHP can thus be used as a tool for quick development of native
> > Windows applications.
> >
> > I have just released this project to the public as Open Source at
> > http://winbinder.sourceforge.net/. Although it is still a work in
> > progress, you can take a look at the source code, download a working
> > demo and play with it a little bit.
> >
> > Your ideas, comments, criticisms and suggestions are very welcome.
This looks EXCELLENT! I just got around to downloading PHP-GTK and was
kind of put off by it's clunky interface. Reminded me of old-school
xwindows stuff or something. Not a very fluid or functional feel. And
I started wondering if anyone had done a more Windows-like GUI (or a
direct interface to the Windows window system) for PHP.
I look forward to the development of this product. Definitely submit it
to PECL!
Thanks Rubem!
-TG
--- End Message ---
--- Begin Message ---
I haven't downloaded it yet because I have seen that I need PHP 4 and that
it won't work with PHP 5, but I will install PHP4 just for testing it.
I am glad that it uses Win32 native classes because those classes are
accessible for the most screen readers used by the blind, so the interfaces
will be accessible for the blind also.
GTK for PHP, like the TK package for perl don't create accessible interfaces
but perl can use the Win32:: libraries or the XW:: and it is great that now
we can create programs with Windows GUI's also, using PHP.
Teddy
----- Original Message -----
From: "Gryffyn, Trevor" <[EMAIL PROTECTED]>
To: "Rubem Pechansky" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 5:08 PM
Subject: RE: [PHP] Re: A native Windows binding for PHP - released
> On 09/16/2004 09:01 PM, Rubem Pechansky wrote:
> > I have designed and successfully prototyped a native Windows binding
> > for PHP. This binding is very lightweight and it is already
> capable of
> > doing dialogs, controls, and a lot more with a few dozen lines of
> > code. PHP can thus be used as a tool for quick development of native
> > Windows applications.
> >
> > I have just released this project to the public as Open Source at
> > http://winbinder.sourceforge.net/. Although it is still a work in
> > progress, you can take a look at the source code, download a working
> > demo and play with it a little bit.
> >
> > Your ideas, comments, criticisms and suggestions are very welcome.
--- End Message ---
--- Begin Message ---
Gryffyn, Trevor wrote:
On 09/16/2004 09:01 PM, Rubem Pechansky wrote:
I have designed and successfully prototyped a native Windows binding
for PHP. This binding is very lightweight and it is already
capable of
doing dialogs, controls, and a lot more with a few dozen lines of
code. PHP can thus be used as a tool for quick development of native
Windows applications.
I have just released this project to the public as Open Source at
http://winbinder.sourceforge.net/. Although it is still a work in
progress, you can take a look at the source code, download a working
demo and play with it a little bit.
Your ideas, comments, criticisms and suggestions are very welcome.
This looks EXCELLENT! I just got around to downloading PHP-GTK and was
kind of put off by it's clunky interface.
http://themes.freshmeat.net/browse/923/
particularly http://themes.freshmeat.net/projects/1in1-xp-gtk/ as you
like windows so much
--- End Message ---
--- Begin Message ---
is it possible to increment by 10's? or 20's?
i have this piece of code, but it selects from 1 to 1000 and counts by 1's.
for($i = 1; $i <= 1000; $i++)
--
Louie Miranda
http://www.axishift.com
--- End Message ---
--- Begin Message ---
On Fri, 17 Sep 2004 14:07:08 +0800, Louie Miranda <[EMAIL PROTECTED]> wrote:
> is it possible to increment by 10's? or 20's?
>
> i have this piece of code, but it selects from 1 to 1000 and counts by 1's.
> for($i = 1; $i <= 1000; $i++)
>
Yep, just change that last part from $i++ to $i += 10, or 20, or
whatever you wish.
--- End Message ---
--- Begin Message ---
im not sure if i coded one of my application wrong, i am displaying an
image by displaying the itemcode and just adding a ".jpg" extension at
the end.
like this..
$itemCode = $row['itemCode'];
..
<img src=/images/$itemCode.jpg>
i assumed before that i can show it all, but i found out that i cannot.
my problem now is the $itemCode is on a database and the image
filename is on directory.
Will it be possible to detect a image file it exist or not?
--
Louie Miranda
http://www.axishift.com
--- End Message ---
--- Begin Message ---
this might work.
<?php
$filename = '/path/to/foo.txt';
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
?>
On Fri, 17 Sep 2004 15:04:44 +0800, Louie Miranda <[EMAIL PROTECTED]> wrote:
> im not sure if i coded one of my application wrong, i am displaying an
> image by displaying the itemcode and just adding a ".jpg" extension at
> the end.
>
> like this..
>
> $itemCode = $row['itemCode'];
> ..
> <img src=/images/$itemCode.jpg>
>
> i assumed before that i can show it all, but i found out that i cannot.
>
> my problem now is the $itemCode is on a database and the image
> filename is on directory.
> Will it be possible to detect a image file it exist or not?
>
> --
> Louie Miranda
> http://www.axishift.com
>
--
Louie Miranda
http://www.axishift.com
--- End Message ---
--- Begin Message ---
From: "Louie Miranda" <[EMAIL PROTECTED]>
im not sure if i coded one of my application wrong, i am displaying an
image by displaying the itemcode and just adding a ".jpg" extension at
the end.
like this..
$itemCode = $row['itemCode'];
..
<img src=/images/$itemCode.jpg>
i assumed before that i can show it all, but i found out that i cannot.
my problem now is the $itemCode is on a database and the image
filename is on directory.
Will it be possible to detect a image file it exist or not?
I'm not really following what you're asking for...
If you're asking if you can just detect if an image file exists...
if(file_exists("images/{$itemCode}.jpg"))
{ echo "<img src=\"images/{$itemCode}.jpg\">"; }
else
{ echo "No image"; }
---John Holmes...
--- End Message ---
--- Begin Message ---
i'm mail admin and works with spam filters .... I tell you some tricks
to fix your problem:
1- If you email is HTML based, it should be correct.....
2- If you put a "unsuscribe" code with the email address of the
recipient the spam filter "score" high your email.
3- If you send a mail header X-Mailer: PHP some filters "score" high
This are only a little tricks , for testing you should install a test
spam filter , for example bogofilter, spamassassin ,or DSPAM. For
example i have spamassassin configured to tell me what rules score my
messages.
P.D: Sorry for my bad english
On Thu, 16 Sep 2004 15:14:14 -0500, Kristopher Spencer-Yates
<[EMAIL PROTECTED]> wrote:
> As many of you may have noticed, A friend and I have noticed the odd
> text at the bottom of spam. My friend once stated "What if this is some
> secret code.. they send it to everyone to hide that it is code.. but the
> person it is intended for knows how to decipher?" Hmm.. interesting.
> So that got me to coding.. I havent had much time to tinker but I do
> have some Fred Wrixon books.. anyway overall just getting started on
> this off-time project. If this strange text at bottom of spam is indeed
> some ciphertext, they are probably using some old cipher methods. This
> thought is based simply on comparing known cipher appearance to that of
> the text in spam and often seeing some similarities.
>
> I was wondering if anyone else has wondered the same thing about the
> wierd text at the bottom of a lot of the spam, and if anyone has ever
> used PHP to create any cipher tools in an attempt to crack the following:
>
> Columnar Transposition ciphers
> Word transposition ciphers
> Franklin-Dumas cipher
>
> My first round is creating a script that goes through and takes various
> combinations (1st letter of each word, 3rd letter of every 3rd word,
> etc., etc., etc.,) I guess this is considered letter transposition
> ciphering. I have some vague ideas to incorporate dictionary database..
> so if my script attempts to decrypt a peice of text with "method 402"
> and the result contains actual words from a dictionary, it will flag it
> or save it to a seperate database.. something along those lines.
>
> This is just for fun... no one is sponsoring/financing anything here..
> just wondering if anyone is interested in sharing ideas and/or code,
> philosophy, etc. Of course, this could be done in any language, or even
> on paper... I can burn a ream of notebook paper fast doing double
> columnar by hand but my interest is using PHP specifically. I figure,
> even if my friend is just crazy and no one is sending secret messages
> inside spam, it is at least going to be fun, rewarding in knowledge and
> the sharing of information and ideas. And if we do crack something,
> maybe Fred Wrixon can mention PHP in his next book. :)
>
> Kris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
-- Fernando Gutierrez Perez --
gmeileando un poco :)
--- End Message ---
--- Begin Message ---
Alternately, you can do it the lazy way like me:
<a href="<?=$url?>"><?=$url?></a>
<? Echo $url; ?>
Is the same as...
<?=$url?>
I also think that's a little easier to read. But that's my preference
in style.
-TG
> -----Original Message-----
> From: Greg Donald [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 16, 2004 6:02 PM
> To: revDAVE
> Cc: PHP
> Subject: Re: [PHP] Novice PHP Variable/Link Question
>
>
> On Thu, 16 Sep 2004 14:54:34 -0700, revDAVE
> <[EMAIL PROTECTED]> wrote:
> > How can I use a PHP variable as the destination for a link?
> >
> > <? $mylink = 'thispage.htm'
> >
> > <a href="thispage.htm">go here</a>
> >
> > With var...? How do I write this....?
> >
> > <a href="??? $mylink ???">go here</a>
>
>
> <a href="<?php echo $url;?>"><?php echo $url;?></a>
>
>
> --
> Greg Donald
> http://gdconsultants.com/
> http://destiney.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
I know this is going to be tough but I need a hosting company that supports
PHP5, has unlimited disk space and a good amount of bandwidth with a
decently fast connection for a decent price. I realize that this might be
rare, but is anyone offering such a package like this anywhere? My client
doesn't want a dedicated server because it costs too much for him at the
moment. He wants to build a music website where people can download free
music from. The music is recorded by him and he has artists that are eager
to get their music out there into the public. Any suggestions on a temporary
shared hosting company for him? Any help would be appreciated.
1. There is no such thing as unlimited disk space. When have you heard
of an unlimited disk?
2. Decently fast connection -- this could be my home DSL at 512/512
Get more realistic expectations, then hop on over to
http://www.webhostingtalk.com
<full_disclosure>
I'm a Community Guide at webhostingtalk, but I have no other interests
in the board
</full_disclosure>
--- End Message ---
--- Begin Message ---
I use DixieSys.com. They seem to have fairly reasonable rates and good
speed. They have a very personable support staff that you can reach via
their IRC server, ICQ or through conventional email, trouble tickets,
etc. They'd big and well equipped but still have a "down home" manner
that I really enjoy.
They don't run PHP5 yet, but I posted a suggestion to set it up side by
side with PHP4 for people who want to use one or the other.
Disk space and bandwidth are cheap and you can add services "a la carte"
depending on your needs.
When asking for unlimited disk space and lots of bandwidth, you might be
over-estimating your needs.
You might also find a good balance in hosting a PHP-enabled website with
less space/bandwidth and going with a file hosting service for the
actual songs that are planned on being posted. Some places specialize
in file serving and not actual web hosting, per se.
I have seen some free hosting services that claim "unlimited" space and
such, but you get what you pay for.
-TG
> -----Original Message-----
> From: Burhan Khalid [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 10:40 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Host for Mod PHP5
>
>
> [EMAIL PROTECTED] wrote:
>
> > I know this is going to be tough but I need a hosting
> company that supports
> > PHP5, has unlimited disk space and a good amount of bandwidth with a
> > decently fast connection for a decent price. I realize that
> this might be
> > rare, but is anyone offering such a package like this
> anywhere? My client
> > doesn't want a dedicated server because it costs too much
> for him at the
> > moment. He wants to build a music website where people can
> download free
> > music from. The music is recorded by him and he has artists
> that are eager
> > to get their music out there into the public. Any
> suggestions on a temporary
> > shared hosting company for him? Any help would be appreciated.
>
> 1. There is no such thing as unlimited disk space. When have
> you heard
> of an unlimited disk?
>
> 2. Decently fast connection -- this could be my home DSL at 512/512
>
> Get more realistic expectations, then hop on over to
> http://www.webhostingtalk.com
>
> <full_disclosure>
> I'm a Community Guide at webhostingtalk, but I have no other interests
> in the board
> </full_disclosure>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> The firewall is relevant depending on your circumstances. In any case it
> would
> take you all of one minute to disable your firewall to test out this "wild
> far out suggestion". At the most you would have lost one minute but you
> would
> have either:
>
> - gained the satisfaction of saying "I told you the firewall was
> irrelevant,
> now go away and stop wasting my time with your ridiculous suggestions"
>
> or
>
> - you would have found the cause of your problem
It definitely takes more than a minute. It takes nearly a minute just to
logoff one user and I often have another user, the Administrator account,
also logged in. If the Administrator account is not lgged in already, then I
must log in to it to shutdown ZoneAlarm. Then the system must shutdown and
restart. While that is happening, I must unplug the cable modem to ensure I
get nothing from/to the outside, but that can be done in parrallel with
system shutdown. However I must stay at the system while this is happening;
I prefer to unplug the cable after the system disconnects from the modem.
Then I must log in to at least one account and start a few things, such as
Apache. Relatively speaking, Apache starts immediatley, so it is not very
relevant, but it does take time for my system to start. Then after the test
I must restart ZoneAlarm, restart the system and be sure to plug the modem
back in while the system starts. The whole operation is likely to take
nearly a half hour at least.
> Contrast that with the number of posts you have made denying that the
> firewall
> could be a problem, and stating adamantly that you will not do
> such-and-such
> a thing because it is 'not supposed' to happen like that.
The problem is all the people that persist in saying the same thing. I am
smart enough to think of the things being suggested. It is the type of thing
that is very easy to suggest. I get frustrated by people suggesting things
just because they are easy to suggest. Therefore when people make a
suggestion that is more likely to be relevant it is difficult for me to
determine which ones are worthwhile. And again, I am able to think of things
such as eliminating the firewall as a possibility. It is okay for people to
suggest that, but unless they can show me something that clearly says it is
relevant, then they won't accomplish anything by insisting.
One problem is that I get answers that are not accurate, so it is difficult
to know which ones are accurate.
The most important thing is that unless people give me a clear explanation
of what they are saying, it is useless to insist. I don't mind a suggestion
as much as it is the insisting that causes problems. Therefore from my point
of view, it is the insistance by others that keep the discussion going (in
useless directions).
There is one person in particular that tries too hard to help and then when
I politely say I am getting too much help I get criticized. That is not a
productive attitude.
--- End Message ---
--- Begin Message ---
I've been looking at php.net, but i couldn't find what i'm searching for.
I have a numeric array, and i'd like to get the highest key. E.g.
$arr = array(3 => "foo", 7 => "bar", 43 => "foobar");
What i want is a function that, in this case, returns 43.
Daniel Schierbeck
--- End Message ---
--- Begin Message ---
Daniel Schierbeck wrote:
I've been looking at php.net, but i couldn't find what i'm searching for.
I have a numeric array, and i'd like to get the highest key. E.g.
$arr = array(3 => "foo", 7 => "bar", 43 => "foobar");
What i want is a function that, in this case, returns 43.
Daniel Schierbeck
$arr = array(3 => "foo", 7 => "bar", 43 => "foobar");
krsort($arr);
$highestkey = key($arr);
--- End Message ---