Re: [PHP] Shared Memory

2003-03-20 Thread Mincu Alexandru
nope!
of course not there are two different procs.

On Thu, 2003-03-20 at 17:19, Adam Voigt wrote:
 Is the Shared Memory allocated with the SHMOP functions
 persistent? Like when a script ends, on the next call
 of a script, can you read the same memory block and have
 the data be there?
 
 -- 
 Adam Voigt ([EMAIL PROTECTED])
 The Cryptocomm Group
 My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] Threading objects

2003-03-12 Thread Mincu Alexandru
I think that he wants a function that acts like steTimeout(..) in
JavaScript ex:
code
setTimeout('alert('tst2')',5000);
setTimeout('alert('tst1')',4000);
/code
When you exec this code in js the first alert that is executed is tst1
and then tst2.
I don't know if you can do this in php without using threads.
I am not sure that this is the only function he whants to use this way,
but if I am not wrong threading dose the job very well.

btw what is the status of that project? Is it functional yet? I havent
read the php-dev discutions on this yet.


On Wed, 2003-03-12 at 13:29, W. Enserink wrote:
 i'm not sure what you want. But you have created objects here in $a,$b and
 $c.
 If you want to order them in a special way you have to write the
 functionality of course. I think you have to do this before the object is
 created because you define the variables 10,5,1 before the objects are
 created. Once the objects are created they themselves don't know nothing
 form each other. So th eparent object has to control this, or in your case a
 'parent piece of script'.
 
 You can use $a,$b,and $c as regular,ordinary variables.  further on.
 
 hope it helped,
 
 Wilbert
 
 - Original Message -
 From: Kris [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 12:18 PM
 Subject: [PHP] Threading objects
 
 
  I want to be able to thread objects. I'm not really sure at all where to
  start. but I want a script where multiple objects are being processed at
 the
  same time.
  I have an example php script
 
  ?
 
  $a = new sleeper();
  $b = new sleeper();
  $c = new sleeper();
 
  $a-sleepFor(10);
  $b-sleepFor(5);
  $c-sleepFor(1);
 
  class sleeper {
 
   function sleepFor($num) {
sleep($num);
echo sorry I was a sleep for $num \r\n;
   }
 
  }
 
  ?
 
  I want so object $c would print then object $b then object $a as the
  sleeping time is less and less.
  Does that make sense? Please ask if you don't understand
 
  Thanks for any help you can offer what so ever.
 
  Kris
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 - 
 Pas de Deux 
 Van Mierisstraat 25 
 2526 NM Den Haag 
 tel 070 4450855 
 fax 070 4450852 
 http://www.pdd.nl
 [EMAIL PROTECTED] 
 -
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] Parsing my big file - I'm back

2003-03-11 Thread Mincu Alexandru
I would like to help you bu I whant to see at least 2 records from your
file ... i didn't understand the format very well..

On Tue, 2003-03-11 at 12:29, George Pitcher wrote:
 Hi all,
 
 I asked the question a couple of weeks ago and started off some kind of
 disagreement.
 
 I don't want to spark things off again, so if anyone wants to reply, fine -
 if not, fine too.
 
 The program,mers here have had a go with Perl and got halfway before other
 work pressures have put this on the back burner (at least another week).
 
 I'd still like to do this with PHP and would like some guidance at
 nitty-gritty level rather than on the concept (but a bit of that as well).
 
 My text file has a return at the end of every field and the only thing that
 separates the records is the name of the company who supplied the file.
 
 Within each 'field' there are subfields, with a completely different
 separator '|'.
 
 I expect to start by doing a quick and dirty search replace for the '|x'
 with '[return]|x', adding spaces to pad the label out so that the following
 value will match the start position of other values.
 
 My plan is then to loop through the file and create an array for each field
 with the key set to the field label and the value set to the 'value' (of
 course).
 
 I need to take account of duplicate field labels within some records by
 adding an index to each field label (nested loop).
 
 Finally, I need to gather these arrays into a bigger array set at record
 level.
 
 Can anyone see any flaws in this approach? I've not done this sort of stuff
 for about 5 years, and that was using Frontier on a Mac.
 
 All helpful suggestions appreciated
 
 George
 
 ===
 
 George Pitcher
 HERON Technical Manager
 Ingenta plc
 23-38 Hythe Bridge Street, Oxford, OX1 2ET
 T  +44 (0)1865 799137 direct
 T  +44 (0)1865 799000 switchboard
 F  +44 (0)1865 799134
 E  [EMAIL PROTECTED]
 
 www.ingenta.com
 Ingenta: Empowering the exchange of academic and professional content
 online.
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



[PHP] Re: [PHP-DEV] Language Auto Detection / www.php.net

2003-03-10 Thread Mincu Alexandru
I don't like the Language Auto Detection system either but mabe others
do... so I don't think it should be removed .. 
On Mon, 2003-03-10 at 19:41, Wez Furlong wrote:
 Perhaps because he prefers to read most sites in his native language?
 
 --Wez.
 
 On Mon, 10 Mar 2003, Mincu Alexandru wrote:
 
  why not set your browser accept language to english?
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] how to abort script execution at a certain point?

2003-03-07 Thread Mincu Alexandru
die();
or 
exit;

On Fri, 2003-03-07 at 16:35, Chris Edwards wrote:
 How would I abort a scripts execution at a certain point in the script.
 Say, if stuff doesn't look good about halfway through execution, kill it.
 
 I thought there was this function. abort()  but I don't see it in the
 function reference.
 
 Any ideas?  Thanks.
 
 --
 Chris Edwards
 Web Application Developer
 Outer Banks Internet, Inc.
 252-441-6698
 [EMAIL PROTECTED]
 http://www.OuterBanksInternet.com
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] attaching php-action to form-button

2003-03-07 Thread Mincu Alexandru
On Fri, 2003-03-07 at 14:19, Ernest E Vogelsinger wrote:
 At 12:59 07.03.2003, Michiel van Heusden said:
 [snip]
 I have some variables defined which i'm sending through get
 
 form name=form1 method=get action=result.php
 // input's etc
 /form
 
 now I have $var1 defined in my PHP and I want to send it through that GET as
 well
 is there a way to do this?
 
 so it's not a user-defined but php-defined var, which i need to send through
 the form
 [snip] 
 
 use a hidden field:
 
 form name=form1 method=get action=result.php
 input type=hidden name=var value=?php echo htmlentities($var); ?
 // input's etc
 /form
 
or :
form name=form1 method=get action=result.php?var=?php echo
urlencode($var); ?
!-- inputs --
/form
 
 
 -- 
O Ernest E. Vogelsinger
(\)ICQ #13394035
 ^ http://www.vogelsinger.at/
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] rates for differents date?

2003-03-07 Thread Mincu Alexandru
On Fri, 2003-03-07 at 00:57, Shaine Gordon wrote:
 hey guys
 
 ok question: 7days in a week. day 1-2 costs $10,
 day 3-5 cost $15,
 day 4-7 costs $10.
ary you sure the line above is right ... could you explain the way that
you want the cost to be added ...
What happens in day 4 or 5?
What is the cost for that days?
 how can I work out the total if someone stays from say day 2-5?
 or what about day 3-7?
 any help would be great
 
 thanks
 shaine gordon
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] Making a true statement false.

2003-03-07 Thread Mincu Alexandru
On Fri, 2003-03-07 at 18:16, [EMAIL PROTECTED] wrote:
 Whenever I query a database with php I've always used the following code
 as a result.
 
this way:

if (!$row = mysql_fetch_array($result)) {
do something } 
else {
do seomthing else }

 This method will persuades you to take action on something true first then
 false. 
 
 How would I write it so it would assume false then true?
 
 Thanks,
 
 Ed
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] require_once adds a 1

2003-03-07 Thread Mincu Alexandru
On Fri, 2003-03-07 at 18:28, Gary wrote:
 Hi
 I've included the following in a php document:
 ?php
 echo @ require_once(anyfile.php)
 
use only 
?php
require_once anyfile.php;
?
if you use echo require_once(somefile.php); it will include the file
and then echo 1 witch is the return value of require_once;

 and it works exactly as I expect except at the end of the included document
 theres a single 1 displayed. I've noticed also that if I include a
 document in the included document the end result will be the document I want
 exactly as I want it with the addition of two ones 11s can anyone tell me
 how to get rid of the ones?
 (if I run anyfile.php by itself there are no 1s)
 Gary


Mincu Alexandru 
 intelinet.ro 
Tel:
+4 0745 369 719 
+4 021 314 00 21 
www.intelinet.ro
[EMAIL PROTECTED]


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



Re: [PHP] assign gobal values in class?

2003-03-05 Thread Mincu Alexandru
On Wed, 2003-03-05 at 14:52, Chris Hayes wrote:
 At 13:35 5-3-03, you wrote:
 can you assign global value in a class like:
 
 class test{
 
 global $arr;
 
 }
 
 anyone?
 try! :)
 if it does not work in this place, try setting it in the constructor 
 function, which is a function in the class with the same name as the class,
 
 
 class test{
 var $test_arr;
 
function test()
{
/*
 gobal $arr;
$this-test_arr=$arr;
 //or maybe even
$this-test_arr=$arr;
*/
$this-text=$GLOBALS['arr'];
/* I guess this dose the job better ... 
when you declare global $arr you do $arr=$GLOBALS['arr'] and there is
no need to do a double reference!
*/
}
 
 
 }
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] post xml

2003-02-27 Thread Mincu Alexandru
yes you can connect to the server from your PHP script and send a post
request .. here is a function that would help:

--- PHP --

function http_post($server, $port, $url, $vars) {
// example:
//  http_post(
//  www.fat.com,
//  80,
//  /weightloss.pl,
//  array(name = obese bob, age = 20)
//  );
 
$urlencoded = ;
while (list($key,$value) = each($vars))
$urlencoded.= urlencode($key) . = . urlencode($value) . ;
$urlencoded = substr($urlencoded,0,-1);
$content_length = strlen($urlencoded);
$headers = POST $url HTTP/1.1
Accept:  text/plain, text/html, text/xml, image/gif, image/jpeg,
image/png, image/bmp
Accept-Charset: UTF-8
Accept-Language: en
Content-Length: $content_length
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
Host:  $server
User-Agent: Panasonic-GAD67/1.0 UP.Browser/5.0.3.5 (GUI)
Connection: Keep-Alive
 
;
$fp = fsockopen($server, $port, $errno, $errstr);
if (!$fp) {
return false;
}
fputs($fp, $headers);
fputs($fp, $urlencoded);
 
$ret = ;
while (!feof($fp))
$ret.= fgets($fp, 1024);
fclose($fp);
return $ret;
}

--- /PHP ---

You can change the headers if you like ...

Hope it helps.
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] post xml

2003-02-27 Thread Mincu Alexandru
you can provide only one variable in the array:
http_post(
'195.57.250.36',
80,
'/barceloDS/interface/xml',
array(
xml=$xml
)
);

On some date, Diana Castillo wrote:

thanks a lot I have a question, how would I specifiy the name of the
variable I am sending if I am sending only one? If I send it like this
does
it know that what I am sending as $xml is also named the variable xml ?
the
example only has an array.
http_post('195.57.250.36',80,'/barceloDS/interface/xml',$xml);
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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



Re: [PHP] button not seen

2003-02-21 Thread Mincu Alexandru
Now let's see  your sundar.html would look like this after your
script and a little indenting
html
head
title
diksha
/title
/head
body
h1 i solved problem /h1
pre
input type=button name=valid value=Validate
/body
/html

The first thing you do if you would like to write good html you validate
it at http://www.w3.org/ HTML Validator section.
The HTML Validator 1st error: No DOCTYPE definition (of course it's
optional in almost all browsers but the HTML standard says that it is
REQUIRED)
I added this DOCTYPE:
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  http://www.w3.org/TR/html4/loose.dtd;
revalidate and you get this errors:
-- W3c Validator --
Below are the results of attempting to parse this document with an SGML
parser. 

 1. Line 13, column 7:  end tag for PRE omitted, but its
declaration does not permit this (explain...). 
   /body
 ^
 2. Line 11, column 5:  start tag was here (explain...). 
   pre
   ^
-- /W3c Validator --

so the code must look like this:
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  http://www.w3.org/TR/html4/loose.dtd;
html
head
title
diksha
/title
/head
body
h1 i solved problem /h1
pre
input type=button name=valid value=Validate
/pre
/body
/html

And of course:

-- W3c Validator --
This Page Is Valid HTML 4.01 Transitional!
-- W3c Validator --

now .. your php script would look something like this:
-- PHP SCRIPT --
?php
$fp=fopen(sundar.html,w);
$html_page=END_HTML
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  http://www.w3.org/TR/html4/loose.dtd;
html
head
title
diksha
/title
/head
body
h1 i solved problem /h1
pre
input type=button name=valid value=Validate
/pre
/body
/html
END_HTML;
fwrite($fp,$html_page);
fclose($fp);
?
-- /PHP SCRIPT --

This should solve the problem .. It works great in Mozilla and IE but I can't test
it in Netscape because I don't have Netscape installed.
Hope it helps ...
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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




Re: [PHP] Reading remote image into a file and displaying..

2003-02-20 Thread Mincu Alexandru
use header(Content-type: image/jpeg); and then you can echo it's
content.
On Thu, 2003-02-20 at 17:30, Chad Day wrote:
 I'm trying to get weather channel information without using their form to
 submit the zip code .. the url format is :
 
 http://oap.weather.com/fcgi-bin/oap/generate_magnet?loc_id=$ZIPcode=689861;
 destination=$ZIP
 
 so I tried:
 
 $weatherfile =
 readfile(http://oap.weather.com/fcgi-bin/oap/generate_magnet?loc_id=$_SESSI
 ON[ZIP]code=689861destination=$_SESSION[ZIP]);
 echo $weatherfile;
 
 but of course it just outputs the raw image data .. I tried echoing it out
 in a img src tag, same result.  Is there some function I'm unaware of that
 will help me out here?
 
 Thanks,
 Chad
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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




Re: [PHP] Javascript function

2003-02-19 Thread Mincu Alexandru
If you realy need string parameter you could do some string parsing
and the function would look something like this:

/*
 * focusTheElement(string)
 * the parameter should have the folowing format :
 * 'form_name.element_name'
*/
fuction focusTheElement(element) {
   var form=element.substring(1,element.indexOf('.'));
   var child=element.substring(element.indexOf('.')+1,element.length);
/*
You should test the function and see if it works well
use : 
alert(form); 
or 
document.write('form='+form+'br/');

alert(child); 
or 
document.write(child='+child+'br/);
*/
/*   then you should do something like this: */
 document.forms[form].elements[child].focus();

}

or

/*
 * focusTheElement(string)
 * the parameter should have the folowing format :
 * 'form_name.element_name'
 * I don't know if this function will improve the speed but it would do
the job!
*/
fuction focusTheElement(element) {
eval('document.'+element+'.focus();');
}

If you do not ned a string parameter you could use what John Nichel
wrote before me.
On Wed, 2003-02-19 at 17:47, Christian Ista wrote:
 Hello,
 
 Example, I have this function :
 
 void function MyExampleFunction(){
  document.form_name.element_name.focus();
 }
 
 I'd like do something like that, I call the function like that :
 MyExampleFunction('form_name.element_name');
 
 And do that :
 void function MyExampleFunction(theelement){
  document.theelement.focus();
 }
 
 but that's not work ?
 
 An idea ?
 
 Christian,
-- 
Mincu Alexandru intelinet.ro
Tel:+4 0745 369719  +4 021 3140021
www.intelinet.ro[EMAIL PROTECTED]



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