RE: [PHP] mediator between PHP and Perl (with sessions)
Hi What you can do is change the php.ini file In the [session] section like this: session.use_cookies = 0 session.use_only_cookies = 0 session.auto_start = 0 and now make sure that all script are running under the same session id at the beginning of each php script you should add the following lines : session_id("0f516a62cf2bab6f867dda9320358b6d"); session_start(); hope I've helped Yaron Khazai -Original Message- From: Eli [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 10:09 AM To: php-general@lists.php.net Subject: [PHP] mediator between PHP and Perl (with sessions) Hi... I got a shared lib API written in PHP, that depends on sessions for its operation. I took a prepared system in Perl that I want integrate with the shared lib API in PHP. What I thought about is, to write a mediator class in Perl that will define the same API functions as I got in the shared lib API in PHP. I do not want to imitate the API functions workflow in Perl, but instead call the shared lib API in PHP from Perl (this way I don't have to maintain 2 class APIs in different languages). I thought of making a PHP script that can run on shell and return serialized output of any API function in the shared lib. Then call that script from Perl and process the returned output in Perl. Problem in this way is, that the shared lib in PHP uses sessions which are un-accessable from a shell script. And I cannot put that script on the web, since it returns sensitive data. Is there a way to use sessions variables in PHP shell script (without reading the session file and parse it in the script)? If anyone is familiar with any other implementation of such a mediator, please tell. -thanks, Eli. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Passwords?
Hi Rory You can use crypt to encode a password, let say you want the password to be "my password", create a new php file : echo crypt("my password"); then you get a unique encoded string something like 'ABC12Fdfi654sdfkfpr67UPL' copy it and delete the php file in your password validation file write : $enc_pass = 'ABC12Fdfi654sdfkfpr67UPL'; if (@crypt($_POST['pass'], $enc_pass) == $enc_pass) /* password is o.k. */ Now even if someone will see the php script he won't knew your password Hope I've helped yaron -Original Message- From: rory walsh [mailto:[EMAIL PROTECTED] Sent: Sunday, March 06, 2005 1:35 PM To: php-general@lists.php.net Subject: [PHP] Passwords? I want to create a simple as possible password script, how secure is it to have the password actually appear in the script? I only need one password so I thought that this would be more straightforward than having a file which contains the password. I am not using any database. Actually this leads me to another question, is there anyway people can view your script without having access to your server that is? Cheers, Rory. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] destructor not called for static members?
Hi It is an expected behavior because when you define a static variable it is shared by all objects of the same class. If When you unset one object and the destruct of the static object will be called, all the other objects will lose the static var as well. Hope I've helped yaron -Original Message- From: Robert Janeczek [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 1:28 PM To: php-general@lists.php.net Subject: [PHP] destructor not called for static members? am i missing something or destructor isn`t called for objects that are assigned to static fields in other objects? here is some example code: _ref = new c1(); } } $obj = new c2(); unset($obj); ?> i thought this should display __destruct in both cases from c2::__construct, but only the one with non static access seems to call c1::destruct. and if i remove unsetting $obj from the end of code this one also doesn`t work. is it expected behaviour? or maybe when __destructor is called after script finishes execution than output is no longer possible? i tried also send some information to file and this also didn`t work. help please :) php 5.0.3 rash -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] VERY basic function question
Hi Don’t call you function count -Original Message- From: William Stokes [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 10:25 AM To: php-general@lists.php.net Subject: [PHP] VERY basic function question I'm trying to learn functions (just started). I can't see why this fails: I probably just didn't understand my manual. Any ideas? Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] VERY basic function question
And another thing Let say you called you function count1 Change : count1($setvar); to : $result = count1($setvar); echo "$result"; -Original Message- From: William Stokes [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 10:25 AM To: php-general@lists.php.net Subject: [PHP] VERY basic function question I'm trying to learn functions (just started). I can't see why this fails: I probably just didn't understand my manual. Any ideas? Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Damn escaping... Grunf...
Hi Try using " instead of ' Meaning you should write: Print ("http://www.dte.ua.pt/cv/email=?".$recordSet->fields[0]. "\" "); -Original Message- From: MÃrio Gamito [mailto:[EMAIL PROTECTED] Sent: Monday, March 21, 2005 12:50 PM To: php-general@lists.php.net Subject: [PHP] Damn escaping... Grunf... Hi, I want this code to display peoples' names within an hyperlink. I'm tired of trying different ways, read all about it in PHP's manual, but i can't get it there. You can visit http://www.dte.ua.pt/cv In the rightmost column it is suposed to apear two name below "Links", but... it doen't, becuase i can't straight the escaping :( Any help would be apreciated. The code follows my signature. Warm Regards, MÃrio Gamito -- // select names to display in the right column $recordSet = &$conn->Execute('SELECT name FROM users'); while (!$recordSet->EOF) { print ('http://www.dte.ua.pt/cv/email=?' . $recordSet->fields[0] . '\'' . ''); $recordSet->MoveNext(); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php + mysql: binary arrays
Hi First of all you can use the Bitwise Operators to set/clear a bit Let say $a is '00100' meaning group 2 is set and you want to set group 4 then write: $a = $a | (pow(2 ,4)); //using OR Operator Now $a is '10100' Let say that you want to unset group 2: $a = $a ^ (pow(2,2)); //using XOR Operator In Mysql: Let say you want to select groups 2,4,5 In your select string you should write something like : $mygroups = (pow(2,2) + pow (2,4) + pow(2,5)); $sql = 'select * from sometable where groups = ' || $mygroups Hope I was helpful Yaron Khazai -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Robert S Sent: Tuesday, March 29, 2005 12:35 PM To: php-general@lists.php.net Subject: [PHP] php + mysql: binary arrays I am writing a contact manager in php/mysql. I'd like to use a binary array as an efficient way to store information for groups that each contact belongs to eg: Field: 'group': 001010 means that the contact belongs to the second and fourth group. If the array is of type Byte, it should be able to store information about 255 groups. Is php/mysql able to handle this? My specific questions are: What functions set/clear a bit in an array in php? How do you query whether a bit is set in mysql? I hope I've made this clear enough to be followed - I'm not a pro! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Image and PHP
Hi Mario you can use something like And in delete_pic.php write something like: unlink ($_GET['fn']); -Original Message- From: Mario de Frutos Dieguez [mailto:[EMAIL PROTECTED] Sent: Thursday, April 14, 2005 10:53 AM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Image and PHP Petar Nedyalkov escribiÃ: >On Thursday 14 April 2005 10:06, Mario de Frutos Dieguez wrote: > > >>I have a page where i place an image but i want when i show the image >>delete it. How can i do this? >> >> > >You want to delete it from the clients machine or what? > > > >>-- >>Mario de Frutos Dieguez >> >>DivisiÃn de IngenierÃa del Software >>y Comunicaciones >> >>CARTIF -Parque TecnolÃgico Boecillo >> >> > > > Sorry, i want delete it from the server side. I put the images in a directory in the server. -- Mario de Frutos Dieguez DivisiÃn de IngenierÃa del Software y Comunicaciones CARTIF -Parque TecnolÃgico Boecillo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Image and PHP -Correction
Correction : u need to use a hidden frame or iframe using style="display:none" let call the hidden frame myhframe now in you code write -Original Message- From: Sent: Thursday, April 14, 2005 1:20 PM To: 'Mario de Frutos Dieguez'; [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: RE: [PHP] Image and PHP Hi Mario you can use something like And in delete_pic.php write something like: unlink ($_GET['fn']); -Original Message- From: Mario de Frutos Dieguez [mailto:[EMAIL PROTECTED] Sent: Thursday, April 14, 2005 10:53 AM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] Image and PHP Petar Nedyalkov escribiÃ: >On Thursday 14 April 2005 10:06, Mario de Frutos Dieguez wrote: > > >>I have a page where i place an image but i want when i show the image >>delete it. How can i do this? >> >> > >You want to delete it from the clients machine or what? > > > >>-- >>Mario de Frutos Dieguez >> >>DivisiÃn de IngenierÃa del Software >>y Comunicaciones >> >>CARTIF -Parque TecnolÃgico Boecillo >> >> > > > Sorry, i want delete it from the server side. I put the images in a directory in the server. -- Mario de Frutos Dieguez DivisiÃn de IngenierÃa del Software y Comunicaciones CARTIF -Parque TecnolÃgico Boecillo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] chat script
This error message is because you are trying to send header information after you already printed some text. The header information have to come before any other information sent to the browser meaning : http://www.example.com/'); ?> WON'T WORK!!! But http://www.example.com/'); print ("hello"); ?> Will work And another ting the Line 2=> header('Location: http://www.example.com/'); . . . WON'T WORK!! And you can use headers_sent() to check if you can send the header information if (!headers_sent()) { header('Location: http://www.example.com/'); exit; } Have a nice day Yaron Khazai -Original Message- From: sukalyan banga [mailto:[EMAIL PROTECTED] Sent: Sunday, April 17, 2005 8:46 AM To: php-general@lists.php.net Subject: [PHP] chat script Sir, I am hosted a chat script at www.bioraj.net/raj/chat/ but it shows some error what should I do. sukalyan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] JavaScript+Html+PH
yes -Original Message- From: çæä [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 17, 2005 7:26 AM To: php-general@lists.php.net Subject: [PHP] JavaScript+Html+PH Hiï Can I use JavaScript+Html+PHP in a file? Function sort(){ Sort_asc(); } E-mail/MSN: [EMAIL PROTECTED]
[PHP] Number of users
Hello all, I have some questions and I hope someone could answer them 1. Is there a way to find out how many users currently browsing pages at my web site? 2. If I write down the IP of a user that log on my web site, can I check later if the IP still browsing pages at my web site or if he had left my website? Thanks yaron
[PHP] Blocking login on the same username from diffrent computers
Hello I'm looking for away to block login to my web site from different computers on the same username, In other word: Only one person can be logged on to the web site with a username, if anyone else tries to log on while the first person is still logged on he will be blocked until the first person singed out. Thanks Yaron