[PHP] Parsing PHP
I am using PHP to develop and web app. The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply eval it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system. I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc. Any ideas on how I should proceed? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing PHP
There is the tokenizer extension... http://www.php.net/tokenizer This might give you a good start. -- Peter James [EMAIL PROTECTED] php|architect The Magazine for PHP Professionals http://www.phparch.com - Original Message - From: Nikhil G. Daddikar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 1:06 AM Subject: [PHP] Parsing PHP I am using PHP to develop and web app. The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply eval it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system. I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc. Any ideas on how I should proceed? Thanks. -- 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
[PHP] unique id
Hi there! What's the best way to create uids (unique ids) even when runnig at exactly same time (microseconds)? is this enough ??? $r = mt_rand(); $uid = uniqid(getmypid() . $r); thanks Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parsing PHP
Hi Nikhil, There are a number of choices already out there. In phpDocumentor (http://www.phpdoc.org) is a parser that is based on the tokenizer. Also available in PEAR CVS is the PHP_Parser, which is a generated parser based on PHP's own zend_language_parser.y (http://cvs.php.net/cvs.php/pear/PHP_Parser?login=2) Regards, Greg -- phpDocumentor http://www.phpdoc.org Nikhil G. Daddikar wrote: I am using PHP to develop and web app. The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple subset of PHP to them (foreach, if-then-else, variable assignments and comments) and then simply eval it. But I don't want them to use calls like system or do infinite loops etc. that will screw up the system. I was thinking if I had a PHPparser that returns tokens, then I can eliminate the call to unwanted funtions, etc. Any ideas on how I should proceed? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 26 Jul 2003 08:52:02 -0000 Issue 2198
php-general Digest 26 Jul 2003 08:52:02 - Issue 2198 Topics (messages 156938 through 156985): Re: Debugging a Session Problem 156938 by: Johnson, Kirk 156948 by: Lee Stewart 156952 by: Johnson, Kirk 156959 by: Curt Zirzow 156964 by: Lee Stewart 156968 by: Curt Zirzow Re: Permission Denied (in FTP) 156939 by: Stephen Re: Display Records (brief summary and full details) 156940 by: Pushpinder Singh Garcha 156965 by: Curt Zirzow 156977 by: Tom Rogers Reading a file from another server 156941 by: Thomas 156945 by: Chris Shiflett 156946 by: Comex 156949 by: Thomas 156966 by: Chris Shiflett Re: Link acting as a submit button 156942 by: Comex 156950 by: Ray Hunter Re: PHP should know my data! 156943 by: Comex Re: html and php in the same document 156944 by: Comex php5 + php4 on same server 156947 by: Thomas Hochstetter 156951 by: Comex 156953 by: Comex 156956 by: Volker how to make a global scope array 156954 by: Jack Lee 156955 by: Comex 156958 by: David Nicholson 156961 by: Jack Lee 156962 by: Curt Zirzow 156974 by: David Nicholson Re: Freeze Pane 156957 by: Jason Martyn Re: Rewrite img and a tags. 156960 by: Curt Zirzow Best way to transfer session IDs 156963 by: Matthew A. Blasinski 156971 by: Chris Shiflett 156976 by: Matthew A. Blasinski 156978 by: John W. Holmes 156979 by: Curt Zirzow 156981 by: Chris Shiflett Re: incrementing string value 156967 by: Curt Zirzow Re: file_put_contents()? 156969 by: Curt Zirzow 156970 by: Curt Zirzow funny output 156972 by: Ryan A 156973 by: Chris Shiflett 156975 by: Ryan A 156980 by: Chris Shiflett Parsing PHP 156982 by: Nikhil G. Daddikar 156983 by: Peter James 156985 by: Greg Beaver unique id 156984 by: jan 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] -- ---BeginMessage--- Your original code works for me, so it is a config issue somewhere. Add this code to each file, to verify that the session ID is being correctly passed: echo session id is . session_id() . br; Also, is your php.ini in /usr/local/lib? If PHP can't find it, it will use its built-in defaults, which is register_globals off. Kirk -Original Message- From: Lee Stewart [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 2:00 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Debugging a Session Problem At 11:55 AM 7/25/2003, you wrote: If you are relying on cookies to transmit the session ID, make sure you have session cookies enabled in your browser. Also check that you don't have an .htacess file in your directory that is overriding the register_globals setting. Turn your error_reporting up to E_ALL and see if PHP has anything to say to you. Yes, cookies are enabled in the browser (and the same browser works with the application on the old system). And no .htaccess files. When I set error_reporting to E_ALL I do get: Notice: Undefined variable: test in /srv/www/htdocs/etrak/page2.php on line 3 which is the reference to $test in echo test is $testbr; because $test was to have been a session variable, but wasn't passed. Other than that, no errors. CPT John W. Holmes wrote: Seem to remember something about starting a session and then redirecting with header causing trouble. Try using session_write_close() before you redirect. I also tried adding the session_write_close() with no change... Each time I get a new session file in /tmp, but all are zero length... ls -l /tmp drwxrwxrwt6 root root 592 Jul 25 12:48 . drwxr-xr-x 18 root root 408 Jul 25 12:47 .. -rw---1 wwwrun nogroup 0 Jul 25 12:49 sess_39e04150efb3de58764ce04dae572401 -rw---1 wwwrun nogroup 0 Jul 25 11:57 sess_4d9573209bf3688c380d33c94f64be47 -rw---1 wwwrun nogroup 0 Jul 17 16:55 sess_5160b002714849a598a8a1e62a78a2eb -rw---1 wwwrun nogroup 0 Jul 20 08:36 sess_7a053a0dd515170e6d0ace739860b71f -rw---1 wwwrun nogroup 0 Jul 25 11:55 sess_903ef4579ee2f596981aad08efd3bc9d Thanks for any debugging suggestions... Lee -- Lee Stewart, Senior SE Sytek Services, a Division of DSG (719) 566-0188 , Fax (719) 566-0655 [EMAIL PROTECTED] www.sytek-services.com www.dsgroup.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message---
Re: [PHP] unique id
Hi, Saturday, July 26, 2003, 5:58:41 PM, you wrote: j Hi there! j What's the best way to create uids (unique ids) even when runnig at j exactly same time (microseconds)? j is this enough ??? j $r = mt_rand(); j $uid = uniqid(getmypid() . $r); j thanks j Jan I use: $id = md5(uniqid(rand(),1)); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Type safety
We all know PHP is great and flexible but, I have this problem... I had a function that took an object as parameter, someone went ahead and changed that to accept object's id (integer), because there is no compilation, some of the code broke. Is there any way to alleviate these kinds of problems that happen w/ scripting? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [security] NOT the path of the script in case of error
Hello ! I have a problem with security found no satisfying solution yet : at home, when an error occurs in my script I got something like this : Warning: unlink() failed (No such file or directory) in c:\program files\easyphp\www\page_perso_free\php_scripts\ultra_php.php on line 356 texte.txt n'est pas supprimé... but my provider in the same case delivers this : Warning: unlink() failed (No such file or directory) in ultra_php.php on line 347 texte.txt n'est pas supprimé... that's much better !! My question is : How do they do that ?? My provider runs PHP 4.2.2 Thanx a lot !! ps. to this : ?php echo $_SERVER [SERVER_SOFTWARE] ? my provider returns : Apache/1.3.26 (Unix) Debian GNU/Linux mod_fastcgi/2.2.12 mod_perl/1.26 pps. sorry if I have not sent this message the right way (and for my poor english too)... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Want to join PHP open source projects, but who wants me?
Hello I've been googling for last couple of hours looking for an open source project to join but whether i find inactive ones or some that are not welcoming new coders. I would like to join an OO project, that is not quite well developed so far, but looks promising. Could you suggest any? -- Best regards, Pietuka --- This message contains no viruses. Guaranteed by Kaspersky Anti-Virus. www.antivirus.lv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Which templates to use??
Hi all! As a php developer i need to know how can i separate my business logic tier with presentation. I mean wht all different kinds of php Templates are available and which one to go for better efficiency and speed? Where can i find the resources. Please help me out. Thanks in advance Binay
Re: [PHP] funny output
Chris Shiflett wrote: --- Ryan A [EMAIL PROTECTED] wrote: So how do i get my scripts working again? the authentication part was working perfectly but now it just kicks me back to the login page... plus it looks like I am unable to set sessions properly, and i suspect thats why i am getting kicked back to the login page. You're probably right. This is a wild guess, but I bet register_globals is disabled on your new host. Check the archives for lots of good information about what this means, what you need to do, etc. This question comes up weekly, so there should be plenty of information. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ It's actually ENabled, from the link that he sent us. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php5 + php4 on same server
Volker wrote: hi, you also could run two static compiled versions of apache (if apache) with php4 and 5 compiled in, Possible... but you need another ip-address to bind to No, you can run them both on the same IP address... that's what he wanted. - also have to manage 2 apaches(not a problem or what? ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail problem
Hi, i have to send some e-mails with pictures, in html format, i was wondering if anyone knows where to find a php class that dose this. Thanks, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php5 + php4 on same server
Two different types of apache php on the same mashine is possible. I used to do that when I used both apache-2 apache-1. The thing I did is that I used different ports, one ot them default 80 and the other 8000 for example. On Sat, 2003-07-26 at 09:24, Comex wrote: Volker wrote: hi, you also could run two static compiled versions of apache (if apache) with php4 and 5 compiled in, Possible... but you need another ip-address to bind to No, you can run them both on the same IP address... that's what he wanted. - also have to manage 2 apaches(not a problem or what? ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] funny output
Hi, The first thing I checked was register_globals.they are on. (http://www.bestwebhosters.com/phpinfo.php) Any other ideas/suggestions? Please help as I am hitting a total blank trying to find out where the problem is. Thanks, -Ryan - Original Message - From: Comex [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 8:22 AM Subject: Re: [PHP] funny output Chris Shiflett wrote: --- Ryan A [EMAIL PROTECTED] wrote: So how do i get my scripts working again? the authentication part was working perfectly but now it just kicks me back to the login page... plus it looks like I am unable to set sessions properly, and i suspect thats why i am getting kicked back to the login page. You're probably right. This is a wild guess, but I bet register_globals is disabled on your new host. Check the archives for lots of good information about what this means, what you need to do, etc. This question comes up weekly, so there should be plenty of information. Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ It's actually ENabled, from the link that he sent us. -- 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
[PHP] Re: mail problem
Paul Marinas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, i have to send some e-mails with pictures, in html format, i was wondering if anyone knows where to find a php class that dose this. http://phpmailer.sourceforge.net/ should do the trick. J. Cox http://www.xaraya.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which templates to use??
Binay Agarwal wrote: Hi all! As a php developer i need to know how can i separate my business logic tier with presentation. I mean wht all different kinds of php Templates are available and which one to go for better efficiency and speed? Where can i find the resources. Please help me out. Basic: Include files Medium: Template Engine (Smarty, patTemplate, etc) Advanced: Some kind of XML / XSL(T) solution -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] funny output
* Thus wrote Ryan A ([EMAIL PROTECTED]): Hi everyone, I am having some funny output and funny things happening to my scripts since I changed hosts... my login scripts were working fine before but now they dont seem to work...also there is a hidden text box appearing in the code that i didnt write...this is it: input type=hidden name=PHPSESSID value=ad2e5a31727b2b4eb28b2d0c2d6ee67e / The login script is looking in the $_POST var correct? Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unique id
* Thus wrote jan ([EMAIL PROTECTED]): Hi there! What's the best way to create uids (unique ids) even when runnig at exactly same time (microseconds)? is this enough ??? $r = mt_rand(); $uid = uniqid(getmypid() . $r); If you're running a cluster of machines I would include information on the machine that is generating the uid. $uid = uniqid(getmypid() . $r . '_MACHINE_NAME_'); Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Type safety
* Thus wrote Nikhil G. Daddikar ([EMAIL PROTECTED]): We all know PHP is great and flexible but, I have this problem... I had a function that took an object as parameter, someone went ahead and changed that to accept object's id (integer), because there is no compilation, some of the code broke. Is there any way to alleviate these kinds of problems that happen w/ scripting? http://us3.php.net/is_object Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] funny output
Hi, thanks for replying. No, its looking for get, and globals is on. This is my code: *Start code* ? session_start(); header(Cache-control: private); //IE 6 Fix require_once(configbwh.php); $type=$_GET[type]; $_SESSION['type'] = $type; if(!isset($type)) { include(my.top.php); print(ERROR: 69723. Please contact support); include(my.bottom.php); exit; } if(session_is_registered('my_user')){} else{ $_SESSION['id'] = $id; header(Location: my.login.php); exit; } $result = count ($id); if($result1 || $result5) {include(my.top.php); Print(Error: Plans not saved.brYou have not either not chosen a plan to add to your MyList account bror you have tried to add more than 5 plans at a time to your MyList account.brPlease press your back button to correct the problem.); include(my.bottom.php); exit; } $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $my_user=$_SESSION['my_user']; $my_ccno=$_SESSION['my_ccno']; /* the below lines take the string (nname) from between the [] of the id[] and the the value of the id[] (eg id[]=23 where 23 is the value) then inserts it into the db thanks to John Holmes. */ foreach($id as $nname = $pppno) { $q=insert into mylist_slave values('','$pppno','$nname','$type','$my_user',$my_ccno); if(!($rs = mysql_query($q))) { echo Query failed for ID: $r; exit; } } include(my.top.php); print(Data has been successfully entered.); include(my.bottom.php); exit; ? End Code* This was working fineI just cant understand it. Kindly reply, -Ryan. - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 4:05 PM Subject: Re: [PHP] funny output * Thus wrote Ryan A ([EMAIL PROTECTED]): Hi everyone, I am having some funny output and funny things happening to my scripts since I changed hosts... my login scripts were working fine before but now they dont seem to work...also there is a hidden text box appearing in the code that i didnt write...this is it: input type=hidden name=PHPSESSID value=ad2e5a31727b2b4eb28b2d0c2d6ee67e / The login script is looking in the $_POST var correct? Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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
[PHP] Configure vpopmail with php
how can i configure php with vpopmail on linux 7.3 please reply ASAP Haseeb. IncrediMail - Email has finally evolved - Click Here
Re: [PHP] Configure vpopmail with php
* Thus wrote Haseeb ([EMAIL PROTECTED]): how can i configure php with vpopmail on linux 7.3 please reply ASAP RTFM Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML error: junk after document element
I am trying to parse and xml document: ?xml version=1.0? !DOCTYPE PrequalResponse PUBLIC -//New Edge Networks//DTD Pilot Prequalification Response 2.3//EN http://api.newedgenetworks.com/dtd/prequalresponse.dtd; PrequalResponse TransactionCodeCode1005/CodeMessageAuthentication failed: Invalid user name or password/Message/TransactionCode /PrequalResponse I received 'XML error: junk after document element at line 5'. I found some mention searching the web that the xml_parse() function does not know the end of the stream: The problem is that, in the general case, there's no way to determine if a stream is *supposed* to contain multiple documents. What is needed is some external way to determine the end of the input; you can then feed the parser data buffers until the end-of-buffer function returns true. You can do this by embedding the chunks of XML into another protocol; this should not be difficult if you can determine the size of each XML document in bytes before sending it, so that each document can be preceeded by the byte-count. Otherwise, you'll need a stream encoding that contains explicit end-of-file markers. I can set my passing xml document with just 'trythis1/trythis' and I get the same error, except of course it says line 1 instead of line 5. Any help on how I can be sure the function knows the end of ? -- Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how do I get a remote db connection?
I have two independent websites, both with their own mySQL db's. I would like to run a query in site A against site B's database. I am trying to establish a connection using something like: $conn = mysql_connect(abc.com:3306, $user, $pass); A warning is returned to the browser : Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the name of the host server. The db's name would be abc_com (This is not the actual name but the form is consistent with the real db name). If I try port 3307 I get Can't connect to MySQL server on 'abc.com'(111), so I assume that I am able to communicate with the msSQL server itself, but is a permissions issue. I know that the username and password are correct. Could it be that remote acccess to the db is disabled? Or am I omitting something? Your help is appreciated. Irvin Amoraal. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how do I get a remote db connection?
Irvin Amoraal wrote: I have two independent websites, both with their own mySQL db's. I would like to run a query in site A against site B's database. I am trying to establish a connection using something like: $conn = mysql_connect(abc.com:3306, $user, $pass); A warning is returned to the browser : Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the name of the host server. The db's name would be abc_com (This is not the actual name but the form is consistent with the real db name). If I try port 3307 I get Can't connect to MySQL server on 'abc.com'(111), so I assume that I am able to communicate with the msSQL server itself, but is a permissions issue. I know that the username and password are correct. Could it be that remote acccess to the db is disabled? Or am I omitting something? Yes, more than likely. You need permission within the grant tables for Site A to connect to it from host Site B. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how do I get a remote db connection?
* Thus wrote Irvin Amoraal ([EMAIL PROTECTED]): I have two independent websites, both with their own mySQL db's. I would like to run a query in site A against site B's database. I am trying to establish a connection using something like: $conn = mysql_connect(abc.com:3306, $user, $pass); A warning is returned to the browser : Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the name of the host server. The db's name would be abc_com (This is not the actual name but the form is consistent with the real db name). If I try port 3307 I get Can't connect to MySQL server on 'abc.com'(111), so I assume that I am able to communicate with the msSQL server itself, but is a permissions issue. I know that the username and password are correct. Correct. Could it be that remote acccess to the db is disabled? Or am I omitting something? Yes, the remote host doesn't allow connection from the host you are conecting to. You'll need to add permissions on B's database for host A. HTH, Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thanks!
Thanks to both John and Curt who gave me the same answer ... and it actully makes sense. Don't know why I didn't think of it myslef g. Irvin. Irvin Amoraal [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have two independent websites, both with their own mySQL db's. I would like to run a query in site A against site B's database. I am trying to establish a connection using something like: $conn = mysql_connect(abc.com:3306, $user, $pass); A warning is returned to the browser : Access denied for user: '[EMAIL PROTECTED]' where my_web_host.net is the name of the host server. The db's name would be abc_com (This is not the actual name but the form is consistent with the real db name). If I try port 3307 I get Can't connect to MySQL server on 'abc.com'(111), so I assume that I am able to communicate with the msSQL server itself, but is a permissions issue. I know that the username and password are correct. Could it be that remote acccess to the db is disabled? Or am I omitting something? Your help is appreciated. Irvin Amoraal. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Want to join PHP open source projects, but who wants me?
--- Pietuka Krustiòð [EMAIL PROTECTED] wrote: I would like to join an OO project, that is not quite well developed so far, but looks promising. Could you suggest any? Check out SourceForge (http://sf.net/). There are thousands of open source projects hosted there, and there is a help wanted section where project managers can request aid. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Ping: list admins
It seems every time I post to the list now I keep getting bounced message back from someone on the list: To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED]) Will he get unsubed automatically or do you have to initiate the change? If its the latter please do so ASAP.. Thanks Mucho! Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Settings problem?
Hi, below is my script which was working fine before and i have looked at the code for the past 2 hours but still get this error: Parse error: parse error, unexpected $end in c:\phpdev\www\bwh\project\my.details.php on line 84 I am on localhost, win2k machine,PHP Version 4.3.1. As you can see below it really a pretty simple script and line 84 is the last line AFTER php terminates, Please help. heres my code: ?php session_start(); header(Cache-control: private); //IE 6 Fix require_once(configbwh.php); error_reporting (E_ALL); if(isset($_SESSION['my_user']) isset($_SESSION['my_ccno'])) { $mmy_user=$_SESSION['my_user']; $mmy_ccno=$_SESSION['my_ccno']; $connected=mysql_connect ($hostt, $userr, $passs) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($db); $tt = SELECT ptype, count(*) FROM list_slave WHERE ptype IN ('1', '2', '3','4','5') and userr='.$mmy_user.' and ccno='.$mmy_ccno.' GROUP BY ptype; if($res = mysql_query($tt)) { $x = 1; while($row = mysql_fetch_row($res)) { $var[$x++] = $row[1]; } } include(my.top.php); if (isset($var[1])){ $one = $var[1];} else {$one = 0;} if (isset($var[2])){ $two = $var[2];} else {$two = 0;} if (isset($var[3])){ $thr = $var[3];} else {$thr = 0;} if (isset($var[4])){ $fou = $var[4];} else {$fou = 0;} if (isset($var[5])){ $fiv = $var[5];} else {$fiv = 0;} $tot=$one + $two + $thr + $fou + $fiv; ? p bW/belcome, this is your MyList control panel.br You may add/save all your favourite plans here for later comparision.br You can add upto 5 plans at a time and edit, delete them as and when you so wish.br /p table width=40% border=0 align=center cellpadding=0 cellspacing=0 tr td colspan=2 NOWRAPdiv align=centerfont color=redbYour current list of saved plans are:/div/font/b/td /tr tr td width=24%strongS/stronghared:/td td width=38%?php echo $one; ?/td /tr tr tdstrongD/strongedicated:/td td?php echo $two; ?/td /tr tr tdstrongR/strongeseller/td td?php echo $thr; ?/td /tr tr tdstrongC/strongoLocation:/td td?php echo $fou; ?/td /tr tr td nowrapstrongF/strongreeHosting:/td td?php echo $fiv; ?/td /tr tr td colspan=2strongYou have totally font color=red?php echo $tot; ?/font plans saved. /strong/td /tr /table pbr If you have any questions use the contact us link at the side and we will get back to you ASAP.br br Cheers,br -The BWH team.br /p ?php include(my.bottom.php); ? // This is line 84 What do you think is there problem? some settings in php.ini or something? Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading a file from another server
I know the url is good, cause I can go on to this domain and look at all my files. I guess I should explain a little further... This server is a game server for Counter-Strike. I'm trying to read a file on there called mapcycle.txt. This server is a secure server, so I would need to use a username and password to get on. I I've tried a bunch of different things, and now I find that it has a problem connecting to secure servers. DO you know of a different way to connect to a secure server anhd get information other than the way I have been trying? This is what I'm usuing right now: ?php $prefix = ftp://;; $username = myUsername; $password = **; $url = server.username.gameserver.com/; $filename = test.txt; $result = readfile($prefix . $username . : . $password . @ . $url . $filename); print ($result); ? // OUTPUT 0 if I use anythign other than the ftp:// for a prefix (like http. or https) I get an error. Cheers. Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Thomas [EMAIL PROTECTED] wrote: readfile(ftp://username:[EMAIL PROTECTED]/test.txt); It doesn't have any errors and comes up blank. If I put: $result = readfile(ftp://username:[EMAIL PROTECTED]/test.txt); print ($result); it ends up showing a '0' by iteself. The readfile() functions outputs the contents of the file and returns the size of the file in bytes. So, when you assigned $result to the return value, you demonstrated that readfile() output 0 bytes (which explains why you didn't see anything). I'm pretty sure your php.ini is set to allow this, otherwise you would receive an error. I'm doubting whether that URL actually contains any content. How have you tested to be sure it does? Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading a file from another server
Have you tried downloading the file to your server and then read it from there? I do this at least 15 times a day with several different sites and I rarely have any problems. CDitty At 11:28 AM 7/26/2003, Thomas wrote: I know the url is good, cause I can go on to this domain and look at all my files. I guess I should explain a little further... This server is a game server for Counter-Strike. I'm trying to read a file on there called mapcycle.txt. This server is a secure server, so I would need to use a username and password to get on. I I've tried a bunch of different things, and now I find that it has a problem connecting to secure servers. DO you know of a different way to connect to a secure server anhd get information other than the way I have been trying? This is what I'm usuing right now: ?php $prefix = ftp://;; $username = myUsername; $password = **; $url = server.username.gameserver.com/; $filename = test.txt; $result = readfile($prefix . $username . : . $password . @ . $url . $filename); print ($result); ? // OUTPUT 0 if I use anythign other than the ftp:// for a prefix (like http. or https) I get an error. Cheers. Chris Shiflett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] --- Thomas [EMAIL PROTECTED] wrote: readfile(ftp://username:[EMAIL PROTECTED]/test.txt); It doesn't have any errors and comes up blank. If I put: $result = readfile(ftp://username:[EMAIL PROTECTED]/test.txt); print ($result); it ends up showing a '0' by iteself. The readfile() functions outputs the contents of the file and returns the size of the file in bytes. So, when you assigned $result to the return value, you demonstrated that readfile() output 0 bytes (which explains why you didn't see anything). I'm pretty sure your php.ini is set to allow this, otherwise you would receive an error. I'm doubting whether that URL actually contains any content. How have you tested to be sure it does? Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- 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] Settings problem?
* Thus wrote Ryan A ([EMAIL PROTECTED]): [...] if(isset($_SESSION['my_user']) isset($_SESSION['my_ccno'])) { ^~~~ this never gets closed. I love vi and '%', has prevented headaches like this so meny times... Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] /n not working
Hi there. I got a question from someone why the following (from the manual) will not bring the desired output: ?php /* if I open the following txt file and in explorer*/ $text = The quick brown fox jumped over the lazy dog.; $newtext = wordwrap($text, 20); echo $newtext\n; /*my output is the following The quick brown fox jumped over the lazy dog. */ /*this should however have the following output according to the php manual The quick brown fox jumped over the lazy dog. */ ? Is this a php.ini setting? Thomas -- +++ GMX - Mail, Messaging more http://www.gmx.net +++ Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /n not working
Thomas Hochstetter wrote: Hi there. I got a question from someone why the following (from the manual) will not bring the desired output: ?php /* if I open the following txt file and in explorer*/ $text = The quick brown fox jumped over the lazy dog.; $newtext = wordwrap($text, 20); echo $newtext\n; /*my output is the following The quick brown fox jumped over the lazy dog. */ /*this should however have the following output according to the php manual The quick brown fox jumped over the lazy dog. */ ? Is this a php.ini setting? HTML does not render newlines. You need to use br /. View the source of this code in your browser and you'll see everything is on it's own line. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Configure vpopmail with php
the detail in not enough in the FM :) Haseeb ---Original Message--- From: Curt Zirzow Date: Saturday, July 26, 2003 09:48:19 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Configure vpopmail with php * Thus wrote Haseeb ([EMAIL PROTECTED]): how can i configure php with vpopmail on linux 7.3 please reply ASAP RTFM Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php IncrediMail - Email has finally evolved - Click Here
Re: [PHP] /n not working
* Thus wrote John W. Holmes ([EMAIL PROTECTED]): Thomas Hochstetter wrote: $text = The quick brown fox jumped over the lazy dog.; $newtext = wordwrap($text, 20); echo $newtext\n; [...] HTML does not render newlines. You need to use br /. View the source of this code in your browser and you'll see everything is on it's own line. Yes the documentation is a little misleading. I'm in the process of getting that changed in the documentation. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Configure vpopmail with php
* Thus wrote Haseeb ([EMAIL PROTECTED]): the detail in not enough in the FM :) Haseeb Just curious how this line isn't enough: In PHP 4, these functions are only available if PHP was configured with --with-vpopmail[=DIR]. HTH, Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Email use alternate SMTP
www.phpclasses.org/mimemessage it contains a class that can send directly to SMTP server Tom Vogel wrote: Hi, i'm trying to set up an email form on my website. When I originally ran the server from windows I could simply set SMTP = mailhost.ucalgary.ca and it would work. After moving the server to Mac OS X, I can't get it to work. I've read a bunch of FAQ's but they all seem to insist that I set up my own mail server using sendmail. All I need to do is send however, and I would prefer to do that through the network mail servers. It looks like sendmail sends out to 0.0.0.0 looking for an smtp server, but on the bio.ucalgary.ca domain that I am on, there is no mail server. Getting to the point (pardon my deranged yabbering...), all I need to do is send messages through mailhost.ucalgary.ca from my server groningen.bio.ucalgary.ca under OS X.2. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading a file from another server
* Thus wrote Thomas ([EMAIL PROTECTED]): I know the url is good, cause I can go on to this domain and look at all my files. I guess I should explain a little further... This server is a game server for Counter-Strike. I'm trying to read a file on there called mapcycle.txt. This server is a secure server, so I would need to use a username and password to get on. I I've tried a bunch of different things, and now I find that it has a problem connecting to secure servers. DO you know of a different way to connect to a secure server anhd get information other than the way I have been trying? I wouldn't use the term 'secure', rather password protected. A plain text username and password is far from being secure. This is what I'm usuing right now: ?php $prefix = ftp://;; $username = myUsername; $password = **; $url = server.username.gameserver.com/; $filename = test.txt; $result = readfile($prefix . $username . : . $password . @ . $url . $filename); print ($result); ? // OUTPUT 0 This can be expected output pending a few settings from a phpinfo result: error_reporting: safe_mode: allow_url_fopen: if I use anythign other than the ftp:// for a prefix (like http. or https) I get an error. what are the errors? Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Are left joins more efficient?
Dennis-- You might get a more authoritative answer from the mysql general discussion list at: http://lists.mysql.com --John On Monday 25 August 2003 12:59 pm, [EMAIL PROTECTED] wrote: Hello, I program for a website that gets massive loads of traffic. Optimisation has become an important issue lately. At the moment, all queries on the website follow the same format when joining tables: SELECT * FROM table1,table2 WHERE table1.id=table2.id; My question is, would this format be more efficient? SELECT * FROM table1 LEFT JOIN table2 ON table1.id=table2.id; Over the last couple of years I have read and heard two different answers. Years ago it was said that doing Left Joins are faster and more efficient. But with recent updates to MySQL I have read that both queries are broken down and optimised the same way by MySQL. Any thoughts? I havn't come across any comparisons on the web, so any answers would be appreciated. (couldn't find any mysql specific groups so i'm posting in the next best thing!) Thanks -Dennis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Half solved...............what the @#%# is PHPSESSID?
Hi, Ok, have half solved why my scripts all of a sudden stopped working. This is how my scripts are setup: There is a form(login.php) where the user puts in his user/pass, then this is authenticated(auth.php) by the database and a few other sessions are created (email,cust_number) and also username,password sessions are created. Then i am using a header(Location) to send it to details.php, details.php will check and make sure that the following sessions have been created username,password,email,cust_number, if any are not valid it will kick ther person back to login.php...this was working before but not now. I went to my forms source and checked where it was sending my submitted form and found a hidden text box there with this data: input type=hidden name=PHPSESSID value=46081aa70da693f5edeecc069ed8a627 / so i took that PHPSESSID and its value and added it to my header(Location) like so: header(Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627) and every damn thing is working again... can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got into my login page and how do i work with it? because now I have manually put it in my file, do i need to always put it? how do i get it as a variable and finally how can i take it out of my computer and jump on it for causing me 5 hours of pain and suffering.any ways of killing it slowly too is appreciated. Even if you cant answer the first questions the last two will do, the [EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID Thanks in advance, -Ryan -- No, I dont just sound crazyI AM crazy. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail problem
Hello, On 07/26/2003 09:35 AM, Paul Marinas wrote: Hi, i have to send some e-mails with pictures, in html format, i was wondering if anyone knows where to find a php class that dose this. You may want to try using this class that does exactly what you need and more. It lets you compose HTML messages, eventually with text version alternative in the same body to prevent that it gets trapped in spam filters, and lets you include any number of picture files either embedded in the message HTML part or as attachments. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
You have cookies disabled and session.use_trans_sid is enabled in php.ini. So the session module parses your html output and adds PHPSESSID to all internal links, forms and everything else that is needed. However it does not add session id to Location header, it is your responsibility. Use header('Location: details.php?'.SID); SID is a magic constant that contains ''.session_name().'='.session_id() (thus you need ? after details.php). PHPSESSID is here so session module knows which session file to use. If you look into your /tmp (or whatever is set up) directory, a file named sess_46081aa70da693f5edeecc069ed8a627 will be sitting there with all session variables. Ryan A wrote: Hi, Ok, have half solved why my scripts all of a sudden stopped working. This is how my scripts are setup: There is a form(login.php) where the user puts in his user/pass, then this is authenticated(auth.php) by the database and a few other sessions are created (email,cust_number) and also username,password sessions are created. Then i am using a header(Location) to send it to details.php, details.php will check and make sure that the following sessions have been created username,password,email,cust_number, if any are not valid it will kick ther person back to login.php...this was working before but not now. I went to my forms source and checked where it was sending my submitted form and found a hidden text box there with this data: input type=hidden name=PHPSESSID value=46081aa70da693f5edeecc069ed8a627 / so i took that PHPSESSID and its value and added it to my header(Location) like so: header(Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627) and every damn thing is working again... can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got into my login page and how do i work with it? because now I have manually put it in my file, do i need to always put it? how do i get it as a variable and finally how can i take it out of my computer and jump on it for causing me 5 hours of pain and suffering.any ways of killing it slowly too is appreciated. Even if you cant answer the first questions the last two will do, the [EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID Thanks in advance, -Ryan -- No, I dont just sound crazyI AM crazy. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
Hey, Thanks for replying. I know you can manipulate the php.ini file via htaccess or by putting some instructions in the include file...is there any way to turn on cookies again and turn off session.use_trans_sid so i can go back to the old way it was? because I have a lot of header(location:) statements in a lot of files. This just seems a giant PITA. Cheers, -Ryan You have cookies disabled and session.use_trans_sid is enabled in php.ini. So the session module parses your html output and adds PHPSESSID to all internal links, forms and everything else that is needed. However it does not add session id to Location header, it is your responsibility. Use header('Location: details.php?'.SID); SID is a magic constant that contains ''.session_name().'='.session_id() (thus you need ? after details.php). PHPSESSID is here so session module knows which session file to use. If you look into your /tmp (or whatever is set up) directory, a file named sess_46081aa70da693f5edeecc069ed8a627 will be sitting there with all session variables. Ryan A wrote: Hi, Ok, have half solved why my scripts all of a sudden stopped working. This is how my scripts are setup: There is a form(login.php) where the user puts in his user/pass, then this is authenticated(auth.php) by the database and a few other sessions are created (email,cust_number) and also username,password sessions are created. Then i am using a header(Location) to send it to details.php, details.php will check and make sure that the following sessions have been created username,password,email,cust_number, if any are not valid it will kick ther person back to login.php...this was working before but not now. I went to my forms source and checked where it was sending my submitted form and found a hidden text box there with this data: input type=hidden name=PHPSESSID value=46081aa70da693f5edeecc069ed8a627 / so i took that PHPSESSID and its value and added it to my header(Location) like so: header(Location:details.php?PHPSESSID=46081aa70da693f5edeecc069ed8a627) and every damn thing is working again... can ANYBODY please tell me what the @#%# is that PHPSESSID, how it got into my login page and how do i work with it? because now I have manually put it in my file, do i need to always put it? how do i get it as a variable and finally how can i take it out of my computer and jump on it for causing me 5 hours of pain and suffering.any ways of killing it slowly too is appreciated. Even if you cant answer the first questions the last two will do, the [EMAIL PROTECTED]@#%@ [EMAIL PROTECTED]@# PHPSESSID Thanks in advance, -Ryan -- No, I dont just sound crazyI AM crazy. -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
Ryan A wrote: I know you can manipulate the php.ini file via htaccess or by putting some instructions in the include file...is there any way to turn on cookies again and turn off session.use_trans_sid so i can go back to the old way it was? because I have a lot of header(location:) statements in a lot of files. Your browser is not accepting the cookies... Or, your session module has been told not to use cookies. To enable cookies for the session module, use: php.ini: session.use_cookies = 1 .htaccess: php_value session.use_cookies 1 If the value is already 1 or ON, then it's your browser causing the trouble. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP - Flash problem
Hello everyone, I'm trying to pass some info into Flash. this worked fine with another funciton call instead of Players(); But for some reason it will only pass the first name into flash..that's it. however, when I check it just in a browser, it works fine. I'm not sure why this one won't specifically work. this is what I have. // Includes etc... // Create new Class $server = new Rcon(); // Connect Retrieve Info if($server-Connect($config_server_ip, $config_server_port, $config_server_password)) { $player_results = $server-Players(); $server-Disconnect(); } // Output to Flash $player_info = Array(); for ($i=1; $i=count($player_results); $i++) { $player_info[($i-1)] = implode(,, $player_results[$i]); } $player_info2 = implode(|, $player_info); print ($player_info2); This works to browser, but not to Flash. it really doesn't make sense. Any help? Cheers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
Hey John, I dont think its the browser because I have tried this with opera 6,opera 7, IE and NN with the same results... But when i checked the phpinfo() it says that cookies are enabledDo you think its worth it to search and replace each Location header with .SID? Thanks, -Ryan - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Ryan A [EMAIL PROTECTED] Cc: Marek Kilimajer [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 9:15 PM Subject: Re: [PHP] Half solved...what the @#%# is PHPSESSID? Ryan A wrote: I know you can manipulate the php.ini file via htaccess or by putting some instructions in the include file...is there any way to turn on cookies again and turn off session.use_trans_sid so i can go back to the old way it was? because I have a lot of header(location:) statements in a lot of files. Your browser is not accepting the cookies... Or, your session module has been told not to use cookies. To enable cookies for the session module, use: php.ini: session.use_cookies = 1 .htaccess: php_value session.use_cookies 1 If the value is already 1 or ON, then it's your browser causing the trouble. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
Personally, I would do a search-and-replace for header() and replace it with your own custom header() function. Then you would only have to change one location. Jim Lucas - Original Message - From: Ryan A [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 1:16 PM Subject: Re: [PHP] Half solved...what the @#%# is PHPSESSID? Hey John, I dont think its the browser because I have tried this with opera 6,opera 7, IE and NN with the same results... But when i checked the phpinfo() it says that cookies are enabledDo you think its worth it to search and replace each Location header with .SID? Thanks, -Ryan - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Ryan A [EMAIL PROTECTED] Cc: Marek Kilimajer [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 9:15 PM Subject: Re: [PHP] Half solved...what the @#%# is PHPSESSID? Ryan A wrote: I know you can manipulate the php.ini file via htaccess or by putting some instructions in the include file...is there any way to turn on cookies again and turn off session.use_trans_sid so i can go back to the old way it was? because I have a lot of header(location:) statements in a lot of files. Your browser is not accepting the cookies... Or, your session module has been told not to use cookies. To enable cookies for the session module, use: php.ini: session.use_cookies = 1 .htaccess: php_value session.use_cookies 1 If the value is already 1 or ON, then it's your browser causing the trouble. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- 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] Best way to transfer session IDs
Chris Shiflett wrote: --- Matthew A. Blasinski [EMAIL PROTECTED] wrote: So, I'm thinking a plausible session id could be made by hashing their identification (to make it useful to the rightful owner only) with a private key (to make it hard to get and guess). I think the identification could be their IP, user agent, and maybe one or two more constant headers. The private key, of course, could be anything unguessable and kept secure. A few comments... This session ID doesn't have to be generated from any user data. It can be a completely random and unique string that you generate for any user who arrives at your site without an active session. Even though it is probably very difficult to reverse or guess a valid ID from your method above, the extra risk isn't necessary. Also, the IP address isn't a very good piece of data to use, because it is not necessarily consistent. So, while it might make things harder for the bad guys (to spoof the good guy's IP), it could also can make things hard for the good guys (they are AOL users, lose their modem connection, etc.). Thanks for everyone's responses. I was thinking the IP would be usable for tracking users, and a lot of people have pointed out that's not the case. So, I'll probably go with passing it in the URL. Thanks again, -- Matt Blasinski (mbv) Internet Infrastructure Applications Technology Division of Information Technology 3121 Computer Science and Statistics 1210 West Dayton Street Madison WI 53706 Work (608) 262-2286 Cell (608) 206-4098 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 26 Jul 2003 20:56:44 -0000 Issue 2199
php-general Digest 26 Jul 2003 20:56:44 - Issue 2199 Topics (messages 156986 through 157031): Re: unique id 156986 by: Tom Rogers 156999 by: Curt Zirzow Type safety 156987 by: Nikhil G. Daddikar 157000 by: Curt Zirzow [security] NOT the path of the script in case of error 156988 by: thierry lhomme Want to join PHP open source projects, but who wants me? 156989 by: Pietuka Krustiòð 157009 by: Chris Shiflett Which templates to use?? 156990 by: Binay Agarwal 156997 by: John W. Holmes Re: funny output 156991 by: Comex 156995 by: Ryan A 156998 by: Curt Zirzow 157001 by: Ryan A Re: php5 + php4 on same server 156992 by: Comex 156994 by: Alexandru N. Barloiu mail problem 156993 by: Paul Marinas 156996 by: J. Cox 157024 by: Manuel Lemos Configure vpopmail with php 157002 by: Haseeb 157003 by: Curt Zirzow 157017 by: Haseeb 157019 by: Curt Zirzow XML error: junk after document element 157004 by: Robert Fitzpatrick how do I get a remote db connection? 157005 by: Irvin Amoraal 157006 by: John W. Holmes 157007 by: Curt Zirzow Thanks! 157008 by: Irvin Amoraal Re: list admins 157010 by: Curt Zirzow Settings problem? 157011 by: Ryan A 157014 by: Curt Zirzow Re: Reading a file from another server 157012 by: Thomas 157013 by: CDitty 157021 by: Curt Zirzow /n not working 157015 by: Thomas Hochstetter 157016 by: John W. Holmes 157018 by: Curt Zirzow Re: PHP Email use alternate SMTP 157020 by: Marek Kilimajer Re: Are left joins more efficient? 157022 by: John Hicks Half solved...what the @#%# is PHPSESSID? 157023 by: Ryan A 157025 by: Marek Kilimajer 157026 by: Ryan A 157027 by: John W. Holmes 157029 by: Ryan A 157030 by: Jim Lucas PHP - Flash problem 157028 by: Thomas Re: Best way to transfer session IDs 157031 by: Matthew A. Blasinski 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] -- ---BeginMessage--- Hi, Saturday, July 26, 2003, 5:58:41 PM, you wrote: j Hi there! j What's the best way to create uids (unique ids) even when runnig at j exactly same time (microseconds)? j is this enough ??? j $r = mt_rand(); j $uid = uniqid(getmypid() . $r); j thanks j Jan I use: $id = md5(uniqid(rand(),1)); -- regards, Tom ---End Message--- ---BeginMessage--- * Thus wrote jan ([EMAIL PROTECTED]): Hi there! What's the best way to create uids (unique ids) even when runnig at exactly same time (microseconds)? is this enough ??? $r = mt_rand(); $uid = uniqid(getmypid() . $r); If you're running a cluster of machines I would include information on the machine that is generating the uid. $uid = uniqid(getmypid() . $r . '_MACHINE_NAME_'); Curt -- I used to think I was indecisive, but now I'm not so sure. ---End Message--- ---BeginMessage--- We all know PHP is great and flexible but, I have this problem... I had a function that took an object as parameter, someone went ahead and changed that to accept object's id (integer), because there is no compilation, some of the code broke. Is there any way to alleviate these kinds of problems that happen w/ scripting? Thanks. ---End Message--- ---BeginMessage--- * Thus wrote Nikhil G. Daddikar ([EMAIL PROTECTED]): We all know PHP is great and flexible but, I have this problem... I had a function that took an object as parameter, someone went ahead and changed that to accept object's id (integer), because there is no compilation, some of the code broke. Is there any way to alleviate these kinds of problems that happen w/ scripting? http://us3.php.net/is_object Curt -- I used to think I was indecisive, but now I'm not so sure. ---End Message--- ---BeginMessage--- Hello ! I have a problem with security found no satisfying solution yet : at home, when an error occurs in my script I got something like this : Warning: unlink() failed (No such file or directory) in c:\program files\easyphp\www\page_perso_free\php_scripts\ultra_php.php on line 356 texte.txt n'est pas supprimé... but my provider in the same case delivers this : Warning: unlink() failed (No such file or directory) in ultra_php.php on line 347 texte.txt n'est pas supprimé... that's much better !! My question is : How do they do that ?? My provider runs PHP 4.2.2 Thanx a lot !! ps. to this : ?php echo $_SERVER [SERVER_SOFTWARE] ? my provider returns : Apache/1.3.26 (Unix) Debian GNU/Linux mod_fastcgi/2.2.12 mod_perl/1.26 pps. sorry if I have not sent this message the right
[PHP] Is their a flash and php mailing list?
Is their a flash and php mailing list? or PHP for Flash mailing list?
Re: [PHP] Half solved...............what the @#%# is PHPSESSID?
Ryan A wrote: Hey John, I dont think its the browser because I have tried this with opera 6,opera 7, IE and NN with the same results... But when i checked the phpinfo() it says that cookies are enabledDo you think its worth it to search and replace each Location header with .SID? Well, if SID has a value, that means the session cookie could not be set. Plain and simple. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing Bytes to KB, to megs, to gigs.
My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. ? $inputbox = 414478244; // PROCESS DATA $kbs = $inputbox/1024; $megs = $kbs/1024; $gigs = $megs/1024; // CALC COST OF MEGS cost = $megs * 0.05; // OUT PUT DATA. echob$inputbox bytes = /bbr$kbs kb.br$megs meg @ $0.05c per Meg = \$$costbr$gigs gig.brbr; ? This is what I get outputted. 414478244 bytes = 404763.910156 kb. 395.277256012 meg @ $0.05c per Meg = $19.7638628006 0.386012945324 gig. Questions? 1. Should I be dividing by 1024 or 1000? This was passed to me by word of mouth ... 2. Any way of rounding to 2 or 3 digests after the decimal point. 3. to remove any , from the inputted string. / Josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing Bytes to KB, to megs, to gigs.
Philip J. Newman wrote: My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. snip Questions? 1. Should I be dividing by 1024 or 1000? This was passed to me by word of mouth ... 2. Any way of rounding to 2 or 3 digests after the decimal point. 3. to remove any , from the inputted string. 1) 1024 is more correct, so, use it unless what you're given was (incorrectly) calculated with 1000. 2) round($number, 2) - http://us4.php.net/manual/en/function.round.php 3) Use a search and replace (regular expression) to replace commas with empty strings. ereg_replace(, , $string) - http://us4.php.net/manual/en/function.ereg-replace.php HTH, -- Matt Blasinski (mbv) Internet Infrastructure Applications Technology Division of Information Technology 3121 Computer Science and Statistics 1210 West Dayton Street Madison WI 53706 Work (608) 262-2286 Cell (608) 206-4098 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing Bytes to KB, to megs, to gigs.
* Thus wrote Philip J. Newman ([EMAIL PROTECTED]): My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. ? $inputbox = 414478244; // PROCESS DATA $kbs = $inputbox/1024; $megs = $kbs/1024; $gigs = $megs/1024; // CALC COST OF MEGS cost = $megs * 0.05; // OUT PUT DATA. echob$inputbox bytes = /bbr$kbs kb.br$megs meg @ $0.05c per Meg = \$$costbr$gigs gig.brbr; ? This is what I get outputted. 414478244 bytes = 404763.910156 kb. 395.277256012 meg @ $0.05c per Meg = $19.7638628006 0.386012945324 gig. Questions? 1. Should I be dividing by 1024 or 1000? This was passed to me by word of mouth ... Use 1024, only marketers seem to be able to get away with using 1000. 2. Any way of rounding to 2 or 3 digests after the decimal point. see round() and number_format() in the manual. 3. to remove any , from the inputted string. see str_replace() Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing Bytes to KB, to megs, to gigs.
* Thus wrote Matthew A. Blasinski ([EMAIL PROTECTED]): Philip J. Newman wrote: My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. [...] 3) Use a search and replace (regular expression) to replace commas with empty strings. ereg_replace(, , $string) - http://us4.php.net/manual/en/function.ereg-replace.php to go further with this you could make sure they enter a valid number: $string = ereg_replace([^0-9.], , $string); Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP - Can't build data connection
Hi I am writing a FTP application. When I upload a file I am getting following error, Warning: ftp_put(): Can't build data connection: Connection refused. There is no error for connection/login to ftp site. can any one help? Thanks, Suhas _ Encrypt your PHP code for FREE at http://encphp.sspsoft.com _
[PHP] Re: Is their a flash and php mailing list?
forums.macromedia.com - zerof - Is their a flash and php mailing list? or PHP for Flash mailing list? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP - Can't build data connection
This would happen when a incoming or a outgoing port 20 (FTP Data) connection can't be made. I don't know how PHP ftp functions work but normally the FTP client makes a outgoing connection on port 21, and then the FTP Server makes a incoming connection from port 20 when any kind of data is sent (ie directory listings, or files) So I'm guessing that the web server that you are running ftp_put on doesn't allow incoming connections... You can try getting around this by setting PHP to use Passive mode, which makes the FTP client connection out to port 20 on the FTP server. A quick look at the manual says that you should use ftp_pasv to make that happen. Hope this helps Andrew - Original Message - From: Suhas Pharkute [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 26, 2003 11:29 PM Subject: [PHP] FTP - Can't build data connection Hi I am writing a FTP application. When I upload a file I am getting following error, Warning: ftp_put(): Can't build data connection: Connection refused. There is no error for connection/login to ftp site. can any one help? Thanks, Suhas _ Encrypt your PHP code for FREE at http://encphp.sspsoft.com _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Apache
I finally set up an Apache Web Server. I didn't realize you needed that to run php until now. Now, I have another question. I have it installed, but when I run a PHP script, it says it can't be found. Even when I am running the apache server. And the apache server seems to be running fine.
Re: [PHP] Help with Apache
* Thus wrote Corey Edwards @ Dreamstar Computer Software ([EMAIL PROTECTED]): I finally set up an Apache Web Server. I didn't realize you needed that to run php until now. Now, I have another question. I have it installed, but when I run a PHP script, it says it can't be found. Even when I am running the apache server. And the apache server seems to be running fine. No one is going to be able to help you since you have provided not enough information. Did you read the installation for your paticular setup: http://php.net/installation Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing Bytes to KB, to megs, to gigs.
Thanks, that seems to work very well (o; / Josh - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Sunday, July 27, 2003 10:17 AM Subject: Re: [PHP] Changing Bytes to KB, to megs, to gigs. * Thus wrote Matthew A. Blasinski ([EMAIL PROTECTED]): Philip J. Newman wrote: My goal is to input the amount of Bytes used by a user as $inputbox and calculate how many kbs,megs,gigs along with $cost for the price per meg. [...] 3) Use a search and replace (regular expression) to replace commas with empty strings. ereg_replace(, , $string) - http://us4.php.net/manual/en/function.ereg-replace.php to go further with this you could make sure they enter a valid number: $string = ereg_replace([^0-9.], , $string); Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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] Help with Apache
-Original Message- From: Corey Edwards @ Dreamstar Computer Software I finally set up an Apache Web Server. I didn't realize you needed that to run php until now. That's only true if you need to serve Web pages; php runs fine from the command line ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /n not working
I must suggest to just add like header(Content-Type: text/plain); // Don't use HTML To the top of examples like that... -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] Curt Zirzow [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] * Thus wrote John W. Holmes ([EMAIL PROTECTED]): Thomas Hochstetter wrote: $text = The quick brown fox jumped over the lazy dog.; $newtext = wordwrap($text, 20); echo $newtext\n; [...] HTML does not render newlines. You need to use br /. View the source of this code in your browser and you'll see everything is on it's own line. Yes the documentation is a little misleading. I'm in the process of getting that changed in the documentation. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OOP, PHP4 PHP5
I've been using PHP for a few years now and I'm quite familiar and comfortable with it. I'd like to start to seriously do some OOP coding and take things to the next level. But as I understand it, PHP5 is going to make quite a few changes/improvements to PHP4's current handling of OOP. Given that the PHP5 beta has been out for approx. 1 month, do you think it makes sense to try to get into OOP with PHP4 right now when things could change in a fairly short while (not sure how long it'll be until PHP5 is released) and then have to re-learn certain aspects of OOP after getting comfortable with it? Or do you think that the change from 4 to 5 won't really be that big of a deal? I know that many people ask OOP-related questions a lot on the board, but I was just wondering what everyone thought of the jump from 4 to 5 and about trying to start learning OOP *right now*. Thanks -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OOP, PHP4 PHP5
Hi Mike, The short answer: Yes. The long answer: PHP 5 only adds functionality to PHP 4, it is backwards compatible, so start with PHP 4, and PHP 5 will be easy. Greg Mike Brum wrote: I've been using PHP for a few years now and I'm quite familiar and comfortable with it. I'd like to start to seriously do some OOP coding and take things to the next level. But as I understand it, PHP5 is going to make quite a few changes/improvements to PHP4's current handling of OOP. Given that the PHP5 beta has been out for approx. 1 month, do you think it makes sense to try to get into OOP with PHP4 right now when things could change in a fairly short while (not sure how long it'll be until PHP5 is released) and then have to re-learn certain aspects of OOP after getting comfortable with it? Or do you think that the change from 4 to 5 won't really be that big of a deal? I know that many people ask OOP-related questions a lot on the board, but I was just wondering what everyone thought of the jump from 4 to 5 and about trying to start learning OOP *right now*. Thanks -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP, PHP4 PHP5
Mike Brum wrote: I'd like to start to seriously do some OOP coding and take things to the next level. But as I understand it, PHP5 is going to make quite a few changes/improvements to PHP4's current handling of OOP. Given that the PHP5 beta has been out for approx. 1 month, do you think it makes sense to try to get into OOP with PHP4 right now when things could change in a fairly short while (not sure how long it'll be until PHP5 is released) and then have to re-learn certain aspects of OOP after getting comfortable with it? Or do you think that the change from 4 to 5 won't really be that big of a deal? I know that many people ask OOP-related questions a lot on the board, but I was just wondering what everyone thought of the jump from 4 to 5 and about trying to start learning OOP *right now*. I'd say get a good book on OO thinking/methodology and read that. Do a little practicing in PHP4, but I'd wait until PHP5 to really get into it. PHP5 is supposed to have a lot more OO features. My $0.02, of course. I just got The Object Oriented Though Process by SAMS from someone through Amazon. Looks to be a good book. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to make a global scope array
Thank you very much! David Nicholson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, This is a reply to an e-mail that you wrote on Sat, 26 Jul 2003 at 00:50, lines prefixed by '' were originally written by you. Ouch! Sometimes I wish global didn't exist Yes, it can be better to pass in a variable (by reference if you need to write to it from within a function and not have it as the value that you return), e.g. function doSomething($a){ $a = 20; return true; // to signify success } $a = 10; doSomething($a); echo $a; // prints 20 -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Read values from Text Area Box
Hi, there. (B (BI'm trying to find out how to get multiple values from text area box (Btextarea/textarea. (B (B (BValues are like this. (B (Baaa\n (Bbbb\n (Bccc\n (Bddd\n (Beee\n (B (BI need to take "\n" from each value and put all the values to array. (B (B (BPlease advise me if anyone knows about this. (B (B (BSincerely, (B (B (BKEN