Re: [PHP] [php] passing variables doesn't work

2006-10-25 Thread Max Belushkin

Whatever form information you want to pass has to be part of the form.


WILLEMS Wim (BMB) wrote:
select name=database size=1


In the second script, the value of this will be in $_POST[database].


?php
 $wim = 5; /* this is added to test the passing of the variables -
doesn't work either */


$wim isn't part of your form - it will /not/ get saved into the next PHP 
script. You can handle it through input type hidden elements in the 
form, or through sessions, for example, depending on what you want to do 
with it.


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



Re: [PHP] If array()

2006-10-12 Thread Max Belushkin

John Taylor-Johnston wrote:

How can I use if to see an array contains something?


if (sizeof($array)) ?

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



Re: [PHP] POPUP window in PHP

2006-10-09 Thread Max Belushkin

Captain wrote:

hi,
i want to do YES/NO confirmation (like POPUP). If YES, it will upload a file


PHP is server-side, not client-side. You can have the confirmation 
passed as a GET variable in a two-step process for example, i.e. first 
show a confirmation form if $_GET[confirm] is not set, else check 
$_GET[confirm] and process the uploaded file.


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



Re: [PHP] POPUP window in PHP

2006-10-09 Thread Max Belushkin

Captain wrote:

My requirement is, i want to upload one file. i am checking whether it
exists or not in Server side.


Your script will have to work in stages, generating a page and sending 
to the browser on each stage:
1. Make a form to upload a file for the user to submit - this is just 
ordinary HTML.
2. Once the form is submitted to your script, process the file: check if 
it already exists. If it does not, just move the file to a permanent 
location and go to step 4. If it does, move it a temporary location on 
the server, and generate a page with a second form, asking the user 
whether they want the file replaced.
3. Once the form from step 2 is submitted, if the file is to be 
replaced, move the file from its temporary location to the permanent 
location.

4. Generate a page saying the operation went through fine.

  For a reference on file uploads, check the online documentation:
http://www.php.net/manual/en/features.file-upload.php

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



Re: [PHP] Date verification

2006-10-09 Thread Max Belushkin

Ron Piggott (PHP) wrote:

Is there a PHP function which verifies a valid date has been entered
(-MM-DD)?  Ron


http://www.php.net/manual/en/function.checkdate.php

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



Re: [PHP] help me plz

2006-01-18 Thread Max Belushkin
If this is on the same web page, your question has nothing to do with 
PHP - look into, i.e., JavaScript.


suresh kumar wrote:

hi,
   i am using 2 combo box one for country  another
one for city.when i select country name from combo box
their corresponding city names has to be changed in
their corresponding combo box.i dont know how 2
implement this.pz give me some idea.its urgent.
  A.suresh

Send instant messages to your online friends http://in.messenger.yahoo.com 



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



Re: [PHP] Anyone getting bounces from

2005-12-07 Thread Max Belushkin

John Nichel wrote:

Jay Blanchard wrote:

[EMAIL PROTECTED] ?

I am getting failure notices out the wazoo for some very old messages 
to the

general list.


I am too.

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



Re: [PHP] checkng if string is a number

2005-11-17 Thread Max Belushkin
  Which version of PHP are you using? On php 4.4.0 (SuSE 10.0 default RPM, not 
custom build, so perhaps I'm missing some extras you're using?) the following 
script works fine:
?php
  if (10==intval(ten)) echo boo\n; else echo no boo\n;
?

  I get no boo. intval doesn't convert my ten to a number. Moreover, the 
output of the following:

?php
  echo intval(ten);
?

  produces an expected (by me) 0.

On Thursday 17 November 2005 20:37, blackwater dev wrote:
 do something else. is_int doesn't work, intval converts ten to a
 number so that doesn't work

 Thanks!

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



Re: [PHP] checkng if string is a number

2005-11-17 Thread Max Belushkin
  If I misunderstood the intval part of your post, than the [proposed already] 
is_numeric solutions are the way to go. is_numeric will, however, unlike the 
conversion functions, return false if there's anything but a number in the 
string, so, i.e., is_numeric (10a1) will return false, but intval (10a1) 
will give 10.

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



Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue

2005-11-17 Thread Max Belushkin
   Hi list,

  Does anyone have any information/updates on this issue perhaps? The thread 
on http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027056.html 
hasn't had anything new (since Nov 6), and on 
http://bugs.php.net/bug.php?id=35059 it's been stated as fixed ever since 
(Nov 2).

  The FreeBSD php port doesn't seem to have moved past 4.1.1_1, which, as the 
thread implies, still has the problem, and since the PHP CVS commit was made 
4 days before that, I'm [wildly] guessing that fix was already consumed...

  On a side note, has anyone had an issue with PHP and mod_rewrite of the same 
nature on a non-FreeBSD install?

  Thanks!
  Max.

On Tuesday 08 November 2005 21:07, Geert Booster wrote:
 I've seen this problem on a FreeBSD 5.3 machine with Apache2 and PHP
 4.4.1_1. The problem looks to be a problem with mod_rewrite and PHP,
 because the different scripts (MovebleType, Gallery2, Dokuwiki)
 are rewriting and getting the same errors.

 Maybe the following [1] thread on the FreeBSD ports lists does help you.
 I (and the other sysops/users of this machine) are waiting for a patch
 for this problem
 (By PHP developers or maybe the FreeBSD porters, it could be a FreeBSD
 issue) because we don't want to go back to 4.4.0 when it's not needed
 (critically fixes in 4.4.1..)

 You're not the only one :-)

 [1]
 http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html


 Yours sincerely,

 Geert Booster

 --
 Geert Booster
 [EMAIL PROTECTED]

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



Re: [PHP] php related segmentation fault with Apache 2.0.55

2005-11-17 Thread Max Belushkin
  I have had various problems with upgrading one or the other, until I took it 
as a rule to recompile both upon an upgrade. On the machine I do things 
completely manually on [which has it's drawbacks], I generally also upgrade 
to the current version of PHP together with any Apache update, and 
vice-versa. The current 4.x version is 4.4.1 [although on a FreeBSD install I 
had some issues and downgraded to 4.4.0, but this behaviour hasn't been 
confirmed outside of FreeBSD until now] - perhaps try recompiling PHP to the 
current 4.x version (or if you feel up to it, upgrade to the 5.x versions?), 
and see if it helps? Resolved a lot of my problems in the past...

On Thursday 17 November 2005 22:31, kristina clair wrote:
 2.0.54 to Apache 2.0.55.  The scripts that are failing with the new
 Apache work with no problems with the old Apache.

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



Re: [PHP] checkng if string is a number

2005-11-17 Thread Max Belushkin
  Curt,

  yes, technically, 0 is a number - it's a bit late here, and I believe I
mis-understood the original question, which is why I re-posted in the thread.

  I guess my mind got a bit confused by the combination of is_int doesn't
work, intval returns a number and '10' vs 'ten' example.

  That's probably due to the fact I normally rely on intval() to do the job
for integers, which also helps remove some user mis-types at the end of
number fields, which is useful in situations when
A) you're ok with the user typing 11l when they mean 111
B) you don't want to accept a value of 0

  In principle, that's the only problem with intval - a 0 will evaluate
 as false in a logical statement. Unless one wants to make sure it's a full
 number from start to end, of course...

  Max.

On Thursday 17 November 2005 23:05, you wrote:
 On Thu, Nov 17, 2005 at 08:47:30PM +0100, Max Belushkin wrote:
extras you're using?) the following script works fine:
 
  ?php
if (10==intval(ten)) echo boo\n; else echo no boo\n;
  ?
 
I get no boo. intval doesn't convert my ten to a number.
Moreover, the output of the following:

 Yes it does.

   echo intval('a'); // 0
   echo intval('0'); // 0
   echo intval(0);   // 0
   echo intval(0.1); // 0

   $v = intval('ten');
   var_dump($v); // int(0)

   $v = intval('10');
   var_dump($v); // int(10)

 Curt.

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



Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd

2005-11-10 Thread Max Belushkin
I've been having a problem with PHP 4.4.1 and mod_rewrite, which, as Geert 
Booster kindly pointed out, has been reported on 
http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html, 
which also has a link to the PHP bug report in the thread. Not sure if this 
is relevant to PHP5, but thought I'd mention that something similar 
exist(ed?) in the 4.4.1 version.

On Thursday 10 November 2005 22:36, Richard Lynch wrote:
 On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
  Hi there, ive been having issues with mod_rewrite and apache2 with PHP
  5.1RC1. I have googled the php bugs and people have been experiencing
  the same issue however the php people cant see to reproduce the bug.
  Its most definately doing it for me, here is a rewrite rule i have
  setup, if i [L] to a php script, it either tries to download the faked
  url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
  What do i do ?
 
  RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
  ../../phpscript.php

 I should think all those .* should be .+ instead...

 I mean, if somebody surfs to this URL:

 http://example.com//example.video

 Do you really want that to hit ../../phpscript.php

 This probably will not fix your bug, mind you, but it's probably worth
 trying just to see.

 I think you could also lose all those ()s in the Regex, as you don't
 seem to be doing anything with them.  Or perhaps mod_rewrite collects
 them and passes them in to phpscript.php somehow?

 You could also consider using:
 [^/]* instead of . because, after all, .* does match /, so maybe you
 are confusing the Regex so that:
 //example.video actually matches your pattern, even though you
 really don't want it to.

 I haven't used mod_rewrite enough to know what pattern system it uses,
 so I could be full of [bleep] here.

 If all else fails, consider not using mod_rewrite at all, and having a
 ForceType on some convenient directory to change that directory into a
 PHP script.

 For example, suppose you now have:
 ~/videos/*.video
 with a zillion video files in there for the *

 mkdir video_files
 mv videos/*.video video_files
 rmdir videos
 cp phpscript.php videos
 echo -e Files videos\nForceType application/x-httpd-php\n/Files

  .htaccess

 Now, your videos directory is *REALLY* your phpscript.php, but it
 just *looks* like a directory in the URL.

 You'd need to change phpscript.php to read the videos (or whatever it
 does to them) from /video_files/ instead of where they are now.

 --
 Like Music?
 http://l-i-e.com/artists.htm

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



Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue

2005-11-09 Thread Max Belushkin
 Maybe the following [1] thread on the FreeBSD ports lists does help you.
 I (and the other sysops/users of this machine) are waiting for a patch
 for this problem

 You're not the only one :-)
 [1]
 http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html

Oh, thanks a lot! I'll be keeping an eye on the thread - I have mod_rewrite 
employed... well, everywhere, so I'm guessing that's what the culprit was. 
Will be waiting for patch news before trying to update to 4.4.1 again! :)

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



Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue

2005-11-05 Thread Max Belushkin
 Try using require_once or include_once
Well, here's all the fun starting. This is relatively long, but please bear 
with me.
First of all, yes, I did include_once, require_once, even resorted to if (!
$inc_done) include_once(func.php), and setting $inc_done in func.php. 
No-go, was still getting the Cannot redefine mquery() error message.
Now for the fun.
I've had a different set of scripts employing a different func.php. Let's 
say, for simplicity, /home/test1/index.php included /home/test1/func.php, 
and /home/test2/index.php included /home/test2/func.php. However, in both of 
those, mquery() is defined. But they do *not* include anything else, and the 
paths where set as written above. And, what do you know? If I worked inside 
test1 for a while, and went to test2, I'd get:
Cannot redefine mquery() in /home/test2/func.php line 9 (first defined 
in /home/test1/func.php on line 9). Voila.

  Going through PHP 4.4.1 release notes, I noticed the change stating fixed a 
memory corruption bug in include(). Now, I don't know how FreeBSD ported the 
PHP code into it's ports tree, but for me, on FreeBSD 5.1, PHP 4.4.1 
*introduced* a memory corruption bug in include.

  I downgraded to 4.4.0, and everything works perfectly fine again.

  I've written to the freebsd-questions mailing list, but got no sensible 
reply so far (only one was upgrade the ports that use PHP to newer versions, 
but my own simple set of scripts exhibits this very strange behaviour, so 
it's not a solution).

  I'll wait a few days to see if anyone else in FreeBSD experiences the same 
behaviour (the port was only introduced 2-3 days ago) before posting a bug 
report, else if no one else sees the same thing I did, I'll have to dig 
through PHP code to see what was modified in the include()-related code, I 
guess, and see what influences the behaviour I'm seeing...

  Comments?

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



Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue

2005-11-05 Thread Max Belushkin
On Saturday 05 November 2005 17:49, James Benson wrote:
  I've had a different set of scripts employing a different func.php.
  However, in both of those, mquery() is defined. But
  they do *not* include anything else, and the

 So you defined mquery() in both files and one include's or require's the
 other file?

  I'm sorry, but what wasn't clear in my post? A *separate* set of scripts 
includes a *separate* func.php, and even not by relative, but by absolute 
paths! Example:
/home/test1/index.php:
?php include (/home/test1/func.php); ?
/home/test2/index.php:
?php include (/home/test2/func.php); ?

Both func.php are the same, defining a function mquery, which connects to 
mysql, and returns.

  After working with the index.php in Test1 until I get the Cannot redefine 
error, I go to test2, and I get the error that *that function was defined 
in /home/test1/func.php. Test1, while I'm in Test2, and that never ever ever 
ever (...) includes *anything* from Test1. So the *Test1* func.php is still 
sitting somewhere in memory in the thread test2 is being loaded on - thus, 
include_once does not help, as the test2 func.php is NOT included. The weird 
thing is, $inc_done isn't defined either for the PHP thread, as when I tried 
the piece of code I quoted in my last message, the include_once still went 
through.

  How can this be happening? I do not know, but since a downgrade to 4.4.0 
fixed it all back proper, I am seriously beginning to suspect a problem or 
undocumented (widely documented, at least) change in PHP 4.4.1 on FreeBSD 
ports.

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



Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue

2005-11-05 Thread Max Belushkin
 It would also be helpful to see the mquery() script - maybe someone else
 may know more then!

  Well, mquery is simply mysql_query($query);, in the stipped-down version 
I've had to resort to for testing. Basically, does nothing, since even 
mysql_connect that USED to be at the start of func.php got removed in the 
tests.

  I'm quessing this is a FreeBSD 5.1-PHP 4.4.1 specific issue by now, but 
until now, no one on the FreeBSD mailing lists seems to have cried wolf, so 
I'll wait and see what on earth is going on...

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



Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue

2005-11-05 Thread Max Belushkin
 I cant see this being an issue with PHP because it would do that for
 every function, have you tried using a different function, something
 simple say,

  I've been trying it in various ways - for the simplest functions, it takes 
hundreds of request to appear, for the more involved things which employ 
database functions, for example, it only takes 5-10 requests.

  The main issue is that all of this has been working for over 3 years, let 
alone tiny problems with apache/openssl upgrades, but there has been nothing 
like the upgrade of PHP 4.4.0 to 4.4.1 - which is what makes me wonder, what 
DID change so radically in PHP 4.4.1, or is it just a porting problem?

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



[PHP] PHP 4.4.1 on Apache 2.0.x issue

2005-11-04 Thread Max Belushkin
   Hi list,

  after upgrading to PHP 4.4.1, I'm having the following problem: Apache is 
running in prefork mode. index.php includes func.php, which defines some 
functions and connects to MySQL. For a while (1-2 requests) everything runs 
ok, except mysql sockets keep stacking up. And then - wham, suddenly, I'm 
getting errors:
Cannot redeclare mquery() (previously declared in /home/test/func.php:9) 
in /home/test/func.php on line 9

  If I wait a few seconds, it works for a couple of requests again. And then 
the error is back.

  What on EARTH is happening? My wild guess is, somehow the memory gets 
shared, and the previous script is still loaded into a thread when the new 
one is called, but how can this be happening?

  I would greatly appreciate any advice...

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



[PHP] proc_open, fwrite, 16384 bytes magic

2005-11-01 Thread Max Belushkin

  Hi everyone,

 I've ran into a rather strange problem with Apache 2.0.x, PHP 4.4.0, 
FreeBSD. When I proc_open qmail-inject, the first 16384 bytes from a 
buffer are accepted perfectly, which makes it an exact 16 KB. If a 
buffer is larger, the rest is discarded. No errors appear anywhere - and 
I think I've looked just about everywhere I could think of by now. This 
problem does not manifest itself on a different installation of Apache 
2.0.x, PHP 4.3.8, SUSE Linux, but tested against postfix, up to sizes of 
95 KB.


 I've searched Google all over, but could not find any hints. My best 
guess so far is that I'm missing something in configuration directives, 
or it's a qmail problem - although, with qmail-inject fed via cat, 
everything works just fine, regardless of size.


 I would be grateful for any hints. Thanks!

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