[PHP] Re: Why use XML?
Just i am curious to know how do you feel while using Smarty template engine. Is it worth to use for seperating User interface and programming logic? Most definately; I find the alternative to using a templates (ie embedding php in html) to be messy even with smaller sites. Template engines, amongst other things, allow one to write cleaner more modifiable code (both php and HTML) as one does not obscure the other. Of the template engines I have used, Smarty is the most sophisticated in terms of features and is easiest to use - a winning combination!! (It also comes with the very comprehensive manual and an active, well supported email list) If you have more knowledge regarding XML+XSL then it not a great deal a this stage, but they are clearly worth looking into. - Original Message - From: Hardik Doshi [EMAIL PROTECTED] To: David Eisenhart [EMAIL PROTECTED] Sent: Wednesday, February 12, 2003 1:00 AM Subject: Re: [PHP] Re: Why use XML? Hi David, It's nice to read your comments. I will definately buy the book you suggested. It's good you are using Smarty template engine. Currently i am testing Smarty on development server and soon i will start using it for actual applications. Just i am curious to know how do you feel while using Smarty template engine. Is it worth to use for seperating User interface and programming logic? I am still looking for option like XML+XSL. If you have more knowledge regarding XML+XSL then it would be nice if you can give me detail idea. Thanks and waiting for your answer. Hardik Doshi --- David Eisenhart [EMAIL PROTECTED] wrote: big issues!! I'd recommend that you check out the book 'XML and PHP' by Vikram Vaswani, New Riders. Its well written and concise - should answer your queries and more. (BTW, like you I also use Smarty to separate application logic and presentation; for my purps and circumstances this is preferable to using xml stylesheets) David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File not rewritable - why? Help needed.
thank you for the reply Chmod was just a try from my side to get it work. I tried CHMOD 0777, and everything else, too. Didn't work. Could it be that the server doesn't allow writings at all? As you see, I am a newbie in these things. Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. How do I give those permissions? What I try next, is the same PHP in a couple of another servers... Yours, Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
try CHMOD 777 - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 12, 2003 9:22 AM Subject: [PHP] Re: File not rewritable - why? Help needed. thank you for the reply Chmod was just a try from my side to get it work. I tried CHMOD 0777, and everything else, too. Didn't work. Could it be that the server doesn't allow writings at all? As you see, I am a newbie in these things. Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. How do I give those permissions? What I try next, is the same PHP in a couple of another servers... Yours, Paul Dunkel -- [EMAIL PROTECTED] -- 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] curl strange error
hi all i use latest apache (1.3.27) with php 4.3.0 + curl 7.10.3 i use php curl function to connect to a remote SSL-ed web server. the code is as follow: code $ch = curl_init(); $url = 'https://www.example.com/cgi.ext'; curl_setopt ($ch, CURLOPT_URL, $url); echo 'pre'; curl_exec ($ch); echo '/pre'; if (curl_error($ch)) printf(Error %s: %s, curl_errno($ch), curl_error($ch)); curl_close ($ch); /code the output is: Error 35: SSL: error:14090086:lib(20):func(144):reason(134) error 35 is (from php manual): CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ but i don't know how to futher debug it. any hint? is that a bug? bye, stain. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] restricting access to files using PHP
Hi, i've written a secure PHP login script which will allow users to login to a directory such as this: smezone.com/members/index.php however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser), such as: smezone.com/members/document1.html ? Since its a regular HTML files (and we have lots), I can't check whether the user has a valid session as I would do in a PHP file. Thanks for any help! Shams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting access to files using PHP
On Wednesday 12 February 2003 17:46, Shams wrote: Hi, i've written a secure PHP login script which will allow users to login to a directory such as this: smezone.com/members/index.php however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser), such as: smezone.com/members/document1.html ? Since its a regular HTML files (and we have lots), I can't check whether the user has a valid session as I would do in a PHP file. Search the archives. This question gets asked almost every week. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The surest way to corrupt a youth is to instruct him to hold in higher esteem those who think alike than those who think differently. -- Nietzsche */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] restricting access to files using PHP
i've written a secure PHP login script which will allow users to login to a directory such as this: smezone.com/members/index.php however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser), such as: smezone.com/members/document1.html ? Since its a regular HTML files (and we have lots), I can't check whether the user has a valid session as I would do in a PHP file. Well, you're certainly persistent, I'll give you that - seen you ask this question a number of times now... I can't think of any easy way to do this using session-based user authentication. I suspect that the only effective way to do what you are asking without changing your html files would be to use .htaccess/.htpasswd files to do your authentication in the required directories. Having said that, if you've written your php authentication properly it should work as a php script block that you could add to the start of each html file. If you have shell access to the directory you could do some relatively simple shell scripting that would do something like this: this is metacode read directory contents foreach file in directory - start loop - cat php_auth_code and html file to new file with .php extension delete old file with .html extension - end loop - end metacode This would just add your php auth stuff to the start of each html file and rename it to .php instead of .html so it would be handled by php properly. Of course, if you don't have shell access you could ftp all the relevant files somewhere that you _do_ have shell access and do the same before uploading them again. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Issue saving php that includes constant---
You need to make it a string, so echo 'To ._LOGIN. click the login link below;'; still I'm not sure this is what you want Shawn McKenzie wrote: I collect some PHP code in an HTML form (textarea) I then save this in an array in a file using export_var(). If the code entered in the textarea is this: echo To ._LOGIN. click the login link below; And the constant _LOGIN happens to be defined in the current script that generates the form (maybe _LOGIN = Login ), then the result after my var_export() to the file is this: $var = 'To Login click the login link below;'; Any ideas on how to keep the text of the constant definition in the string instead of it being evaluated??? TIA, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: PHP-based SMS solution
I use an international mail-to-sms service provider. I generate emails and they send them as sms messages internationally for a fee per message which I record in a database and charge the customer as value added service. Denis - Original Message - From: YC Nyon [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Wednesday, February 12, 2003 9:50 PM Subject: [PHP] RE: PHP-based SMS solution I am developing a web-based GPS vehicle tracking solution using php. I'm looking on how php can communicate with a SMSC using Smpp to issue AT commands. Development platform is windows 2000. Thanks Nyon --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003 -- 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: PHP-based SMS solution
On Wed, Feb 12, 2003 at 09:50:38PM +0800, YC Nyon wrote: I am developing a web-based GPS vehicle tracking solution using php. I'm looking on how php can communicate with a SMSC using Smpp to issue AT commands. Neat idea. If you've got free SMS and a computer built in to the car already, then why the heck not? I was going to do this once I got my Empeg Car unit (ARM CPU and Linux), but never got around to it. If the SMSC is available via IP, then the way to do this in PHP is probably to use an existing SMPP daemon with which PHP communicates using fsockopen(). It should be trivially easy to implement SNPP things and issue AT commands. If you're actually going to have to initiate telephone calls, then you probably want to use PHP only to wrap an existing SNPP client, like Qpage (1), or Hylafax's sendpage (2). Development platform is windows 2000. Of course, I'd do it in some flavour of unix, probably FreeBSD. I wouldn't dream of implementing something like this on a gaming OS. Next, we'll be running SQL servers on our Playstations ;) (1) http://www.freebsd.org/cgi/man.cgi?manpath=portsquery=qpage (2) http://www.freebsd.org/cgi/man.cgi?manpath=portsquery=sendpage -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Also make sure server has read permission to directories. [EMAIL PROTECTED] wrote: thank you for the reply Chmod was just a try from my side to get it work. I tried CHMOD 0777, and everything else, too. Didn't work. Could it be that the server doesn't allow writings at all? As you see, I am a newbie in these things. Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. How do I give those permissions? What I try next, is the same PHP in a couple of another servers... Yours, Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] concurrent fopen fwrite fclose
Frederick L. Steinkopf wrote: Hi, How does php handle multiple concurrent fopen fwrite fclose calls? I have a website that gets 7 million page views a month and we have created a custom log file using fopen fwrite and fclose. When running this concurrently with the apache log we notice significantly lower page hits with the php logger. My guess is that we're losing data when the requests come in concurrently. Any advice would be appreciated. Fred Steinkopf It sounds as though its the multiple file updates problem. Only one process should be allowed to edit the file at any one time. I suggest you look at flock in the filesystem functions as a means of controlling exclusive access. Other processes need to wait their turn. With page hits averaging nearly 3 per second, depending upon what you log and what reporting you want from the logs, might a database be considered? HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3 on win 2k
Hi All, I get a Invalid access to memory location. error when I install php 4.3 on win2k as a isapi module. I've tried to install it as a cgi but I keep on getting cgi.force_redirect error and when I change cgi.force_redirect it still appears. PHP 4.2 runs well without any problems. Could someone help me out. Joe Njeru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] curl strange error
i answer myself, hth someone else. i use SSL just to use a crypted session to a target server. since target server certificate is not really verified, i need to add these curl options: curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); in order to disable SSL certificate verification. otherwise, before choosing a partner for a specific service, i suggest you to find one that has a verificable certificate ;-) bye, stain. Il mer, 2003-02-12 alle 10:57, Stain ha scritto: hi all i use latest apache (1.3.27) with php 4.3.0 + curl 7.10.3 i use php curl function to connect to a remote SSL-ed web server. the code is as follow: code $ch = curl_init(); $url = 'https://www.example.com/cgi.ext'; curl_setopt ($ch, CURLOPT_URL, $url); echo 'pre'; curl_exec ($ch); echo '/pre'; if (curl_error($ch)) printf(Error %s: %s, curl_errno($ch), curl_error($ch)); curl_close ($ch); /code the output is: Error 35: SSL: error:14090086:lib(20):func(144):reason(134) error 35 is (from php manual): CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ but i don't know how to futher debug it. any hint? is that a bug? bye, stain. -- 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] Echo # problem
I am writing an application in which I need to redirect to an url using the Header function. This redirection must include the # character so that the user is taken to the relevant part of the following page. PHP sees the # as a comment no matter what I do and therefore the redirection doesn't work as I would like. Does anyone know how you can use PHP to echo the # character? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Echo # problem
Two ways: a) echo blabla # $blabla; or b) echo 'blabla # '.$blabla; The # character must just be inside the echo's quotes. On Wed, 2003-02-12 at 13:36, Paul McQ wrote: I am writing an application in which I need to redirect to an url using the Header function. This redirection must include the # character so that the user is taken to the relevant part of the following page. PHP sees the # as a comment no matter what I do and therefore the redirection doesn't work as I would like. Does anyone know how you can use PHP to echo the # character? -- 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] restricting access to files using PHP
Assuming Apache: 1. use index.php or login.php as a log-in file, just as you are 2. if you have your heart set on naming the files .html instead of .php, then create a .htaccess file in the dir which forces .html files thru php for that directory 3. create a php file called access_control.php with (psuedo code) the following contents: --- ? if(the user isn't valid) { header(Location: login.php); exit; } ? --- 4. add ? include('access_control.php'); ? at the top of any html or php file you wish to protect... if the user isn't valid, they will be redirected to the login page. if they are valid, they'll see the file. If you have lots of these HTML files to add the line to, consider a batch process, which you can do with PHP and most text editors. I get the feeling you could also auto-prepend access_control.php to ALL scripts, and add a little more logic to the code: --- ? if( (the user isn't valid) AND (eregi('.html$',$_SERVER['PHP_SELF'])) ) { header(Location: login.php); exit; } ? --- -- which should only impose the access control on *.html pages, but i'm not good with regexp at all!! Justin French on 12/02/03 8:46 PM, Shams ([EMAIL PROTECTED]) wrote: Hi, i've written a secure PHP login script which will allow users to login to a directory such as this: smezone.com/members/index.php however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser), such as: smezone.com/members/document1.html ? Since its a regular HTML files (and we have lots), I can't check whether the user has a valid session as I would do in a PHP file. Thanks for any help! Shams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failed opening
Hi can someone explain to me what is this and how to fix it:- Warning: Failed opening '../language/english/admin.php' for inclusion (include_path='.;c:\apache\php\pear') in c:\apache\htdocs\exoops\modules\sitemap\admin\admin_header.php on line 19 Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Awlad Hussain wrote: try CHMOD 777 I tried that. It didn't help. I also tried in two other servers with no result. I'm definetly doing something wrong :-( More ideas? Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Marek Kilimajer wrote: Also make sure server has read permission to directories. I'm pretty sure that is the problem. How should I check that? I've now tried my PHP in two other servers with no result. I'm definetly doing something wrong :-( Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Classes, global objects, and pointers
John Hughes wrote: In this example which parallels a problem I am having in my real life script. I would like to have a global object, in this case $tester. I would then like to be able to store local references to this global object right inside the class. These are assigned byref in the classes constructor. This script should, by my understanding work, only it craps out in test2's constructor: $o = $tester;. Any help would be greatly appreciated. (Please cc me on your replies) John Hughes ?php class test { var $a; function test() { $this-a = 10; } function doit() { $this-a = 20; } } you don't need to make it global here in global scope global $tester; $tester = new test(); class test2 { var $o; function test2() { but here $o = $tester; } function mod() { $o-doit(); } } echo $tester-a . \n; // Should be 10 $newtest = new test2(); $newtest-mod(); echo $tester-a . \n; // Should be 20 ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] restricting access to files using PHP
Shams -- ...and then Shams said... % % Hi, Hi! % ... % however, how do I restrict people from accessing HTML files in that You've seen the suggestions from others to change your .html files. You may or may not want to do that. If you don't want to do that, then you need a .htaccess file. You don't necessarily, however, need a .htpasswd file as well; just make your php script the authenticator: AuthName AccessYourDirectory AuthType Basic AuthExternal /path/to/your/script order allow,deny allow from all require valid-user This is untested code, but you get the idea. You may have to define your external auth script with some name and then call it; our version of this uses NickName instead of /path/to/your/script and in the httpd.conf file we have AddExternalAuth NickName /path/to/script SetExternalAuthMethod NickName pipe and I dunno if 1) adding and nicknaming is necessary or 2) you can do it in a .htaccess file instead of having to put it in the http.conf file. HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg96652/pgp0.pgp Description: PGP signature
RE: [PHP] Echo # problem
At 13:46 12-2-03, you wrote: The code I am trying to get working is shown below however, as the # is interpreted as a comment the header function is only redirecting to ./itemadmin.php3?submittedby=$submittedbycat=$cat $head = ./itemadmin.php3?submittedby=$submittedbycat=$cat#$edit; header (Location:$head); I think the problem may be that the #zzz should be before the ?x=1y=2 If i am right it means that # was not considered a comment by PHP but that the browser cannot find it.Does the url in the browser show with the #edit part? In that case try $head = ./itemadmin.php3#$edit?submittedby=$submittedbycat=$cat; or maybe $head = './itemadmin.php3#'.$edit.'?submittedby='.$submittedby.'cat='.$cat; PS ./ ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
use chmod 755 directory on each directory that is in the way to your file [EMAIL PROTECTED] wrote: Marek Kilimajer wrote: Also make sure server has read permission to directories. I'm pretty sure that is the problem. How should I check that? I've now tried my PHP in two other servers with no result. I'm definetly doing something wrong :-( Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Echo # problem
-Original Message- From: Chris Hayes [mailto:[EMAIL PROTECTED]] Sent: 12 February 2003 13:02 At 13:46 12-2-03, you wrote: The code I am trying to get working is shown below however, as the # is interpreted as a comment the header function is only redirecting to ./itemadmin.php3?submittedby=$submittedbycat=$cat $head = ./itemadmin.php3?submittedby=$submittedbycat=$cat#$edit; header (Location:$head); I think the problem may be that the #zzz should be before the ?x=1y=2 No that's wrong -- the #anchor part must always be the last thing in the URL. A couple of things occur: - make sure $edit has something valid in it (by temporarily echo-ing it just before the header call, if necessary); - rewrite your Location: header to be technically valid: (a) there should be a space between Location: and the URL, and (b) it really should contain an absolute URL, not a relative one, so: header(Location: http://www.example.com/path/to/itemadmin.php3?etc,etc;). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] msession users
Any information would definitely be interesting. On Wed, 12 Feb 2003, Tom Rogers wrote: Hi, Wednesday, February 12, 2003, 4:01:28 PM, you wrote: RM Are there any msession users here, if so please share your experiences. RM I am considering using msession for a multiple server environment for RM handling session data. I have been using it as a general session manager for about a year without ever having any problems. I have a class to replace the normal php session handler if you would like to take a look at it. -- Robin Mordasiewicz 416-207-7012 UNIX System Developer Primus Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Login Setup not working with PHP
I've installed a bundle from ( www.fireworks.com.au ) that includes PHP, MySQL and Apache all pre-configured. All is working OK, except that I'm trying to access a table in my database using the following PHP code: ?php $dbServer = localhost; $dbName = siteStats; $dbUser = username; $dbPass = password; ? The problem is that I don't know what my USERNAME or PASSWORD for MyDQL are. How do I find this information out? I thought it was in the 'my.ini' file, but with this installation there doesn't seem to be one. Alternatively, does anyone know of a very simple tutorial that explains STEP-BY-STEP of how to install Apache, PHP and MySQL to run on a local machine.. that even I can understand. Thanks Tim Burgan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] msession users
Hi, Wednesday, February 12, 2003, 11:32:54 PM, you wrote: RM Any information would definitely be interesting. here it is: ?php class msession_class{ var $ses; //session on flag var $sessionname; //current name of session var $message; //error message holder var $modulename;//type of module, should be user var $sessionid; // var $sessionlife; //how long inactive before the session should time out var $host; //client host var $Username; //username function msession_class($sessionname=,$lifetime=,$maxgc=,$sessionid=''){ global $class_ref; //a reference array for access by buried functions $class_ref[msession_class] = $this; ini_set( session.save_handler, user ); function open($save_path, $session_name) { return msession_connect('localhost','8086'); } function close() { msession_disconnect(); return true; } function read($key) { $sessiondata = ; $x = msession_ctl($key,'TTL'); if(!empty($x) $x 0): msession_destroy($key); //session timed out so nuke else: $sessiondata = msession_get_data($key); endif; return $sessiondata; } function write($key, $val) { global $class_ref; msession_set_data($key,$val); msession_timeout($key, $class_ref['msession_class']-sessionlife); return true; } function destroy($key) { global $class_ref; $result = msession_destroy($key); $class_ref[msession_class]-ses = 0; $class_ref[msession_class]-sessionid = ; return $result; } function gc($maxlifetime) { return true; } session_set_save_handler(open, close, read, write, destroy, gc); //set up some defaults $this-sessionname = $sessionname; $this-sessionlife = $lifetime; if($this-sessionname == ): $this-sessionname = PHPSESSID; endif; session_name($this-sessionname); if($lifetime == ): $this-sessionlife = get_cfg_var(session.gc_maxlifetime); endif; if(!empty($sessionid)){ session_id($sessionid); } //ok go for it session_start(); $this-modulename = session_module_name(); $this-sessionid = session_id(); $this-ses = 1; } //oddball functions function session_restart(){ session_destroy(); $url = http://.$_SERVER[HTTP_HOST];//.$_SERVER[PHP_SELF;]; header(Location: $url); exit; } function addmessage($mess){ $this-message .= $mess; } function getmessage(){ return $this-message; } function getmodulename(){ return $this-modulename; } function getid(){ return $this-sessionid; } function getlifetime(){ return $this-sessionlife; } function setuser($host,$user){ $this-host = $host; $this-Username = $user; } function getuser($type = ){ if($type == u): return $this-Username; elseif($type == h): return $this-host; else: return $this-host. .$this-Username; endif; } } ? usage $session = new msession_class('SESSION_NAME'); It could be pruned down (get rid of junk functions :) and put into an auto prepend file with the correct host info for connecting, that way it would be transparent to your users. I did my own class as the standard session stuff does not check for expired data and msession has a simple method for checking this. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help to make tables please.
Hello friends. I want the output of my quesry to be formatted such that afdter every 7th output, the 8th one should start on a new row in ythe tabel. I have written the following code but does not work. Can someone please help? Quote : ?php while($row=mysql_fetch_array($result)){ $i=$i+1; if ($i==7){ Print /trtr; Printtd width=\150\ w; Print a href=\findbycategory.php?.CategoryId=.$row[CategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; }else{ Print tr; Printtd width=\150\ w; Print a href=\findbycategory.php?.CategoryId=.$row[CategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; if ($i==6){ Print /tr; }} } ? Unquote Thanks Denis
Re: [PHP] RSA implementation
El mar, 11-02-2003 a las 18:49, Chris Hewitt escribió: Have you considered using on one-way MD5 hash instead? That's how I'm doing it now, but I would like to allow the user to change it's password, and I want to encrypt it, of course ;-) The procedure here will be to: -Encrypt the new password with javascript on the client's browser using RSA and the public key -Decode the entered password on the server using the private key Any idea? Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help with a table please - sorry
Hello friends. Sorry I sent the wrong code in my last mail. Here is my correct code. I want the output of my query to be formatted such that after every 7th output, the 8th one should start on a new row in the table. I have written the following code but does not work. Can someone please help? Quote : table width=800 border=0 cellspacing=0 cellpadding=3 tr ?php $i=0; while($row=mysql_fetch_array($result)){ $i=$i+1; if ($i==7){ Print /trtr; Printtd width=\150\ ; Print a href=\findbycategory.php?.CategoryId=.$row[CategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; }else{ Print tr; Printtd width=\150\ ; Print a href=\findbycategory.php?.CategoryId=.$row[CategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; if ($i==6){ Print /tr; }} } ? div align=centernbsp;/div/td /tr /table Unquote. Thanks very much. Denis
Re: [PHP] need help with a table please - sorry
- Original Message - From: Denis L. Menezes [EMAIL PROTECTED] Sent: Wednesday, February 12, 2003 9:43 AM Subject: [PHP] need help with a table please - sorry Sorry I sent the wrong code in my last mail. Here is my correct code. I want the output of my query to be formatted such that after every 7th output, the 8th one should start on a new row in the table. I have written the following code but does not work. Can someone please help? Untested, but I think will do what you want: table width=800 border=0 cellspacing=0 cellpadding=3 tr ?php $i=0; while($row=mysql_fetch_array($result)){ $i=$i+1; // if this is the 8th item in this row, end current row, start another if (0 == ($i %8)){ Print /tr\ntr; } Printtd width=\150\ ; Print a href=\findbycategory.php?.CategoryId=.$rowCategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; } // ?fill out last row if don't have 7 items? if (0 != ($i %8)){ ? tddiv align=centernbsp;/div/td ?php } ? /tr /table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help with a table please - sorry
At 15:43 12-2-03, you wrote: Hello friends. Sorry I sent the wrong code in my last mail. Here is my correct code. I want the output of my query to be formatted such that after every 7th output, the 8th one should start on a new row in the table. I have written the following code but does not work. Can someone please help? Quote : If you imagine to walk through your code, with every step $i increases. If you start the second row, Besides, your second print 'tr' for every cell, which will break your table, and possibly other tables on your page. table width=800 border=0 cellspacing=0 cellpadding=3 tr ?php $i=0; while($row=mysql_fetch_array($result)){ $i=$i+1; if ($i==7){ Print /trtr; Printtd width=\150\ ; Print a href=\findbycategory.php?.CategoryId=.$row[CategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; }else{ Print tr; Printtd width=\150\ ; Print a href=\findbycategory.php?.CategoryId=.$row[CategoryId] .\font color=\#40\ size=\2\$row[CategoryName]/font/a. ; Print /td; if ($i==6){ Print /tr; }} } ? div align=centernbsp;/div/td /tr /table Trying to keep as much from your code as possible: (not tested) table width=800 border=0 cellspacing=0 cellpadding=3 tr ?php $i=1; while($row=mysql_fetch_array($result)) { $i=$i+1; if ($i7){ Print '/trtr'; $i=1} Print 'td width=150 ' 'a href=findbycategory.php?CategoryId='.$row['CategoryId'] .'' .'font color=#40 size=2' .$row[CategoryName] .'/font' .'/a' .'/td'; } // div align=centernbsp;/div/td // what was this for? //extra code to finish the row if total # of results is not dividible by 7 for (;$i=7;$i++){echo 'tdnbsp;/td';} ? /tr /table Note that i replaces double quotes with single quotes when possible. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help with a table please - sorry
woops i did not finish that line: If you imagine to walk through your code, with every step $i increases. If you start the second row, then the counter is at 8 and will never be 7 again. And some bad english: Besides, your second print 'tr' for every cell, which will break your table, and possibly other tables on your page. i mean to say that the second clause prints tr for every cell. by the way, my proposal has less tests than the other solution you got, so i guess it is an itsy bit faster :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RSA implementation
José León Serna wrote: El mar, 11-02-2003 a las 18:49, Chris Hewitt escribió: Have you considered using on one-way MD5 hash instead? That's how I'm doing it now, but I would like to allow the user to change it's password, and I want to encrypt it, of course ;-) Yes. The procedure here will be to: -Encrypt the new password with javascript on the client's browser using RSA and the public key Or it could be an MD5 hash. -Decode the entered password on the server using the private key Current password hash compared with what is in the database, if OK then store new password hash. I'm just suggesting that its possible to use MD5 and not a two-way encryption/decryption. I have no experience of using RSA, I'd have to leave it to others to help. Regards Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Learning PHP
Could anyone recommend a fast track for learning php for an experienced ColdFusion developer? I'm working my way through the tutorials on php.net and free2code.net, but they seem pretty kindergarten. Any advice?
Re: [PHP] Failed opening
php interpreter wants to include this file, check if it is there - one directory up from SCRIPT_FILENAME, then laguage\english\admin.php thkiat wrote: Hi can someone explain to me what is this and how to fix it:- Warning: Failed opening '../language/english/admin.php' for inclusion (include_path='.;c:\apache\php\pear') in c:\apache\htdocs\exoops\modules\sitemap\admin\admin_header.php on line 19 Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Learning PHP
On Wednesday 12 February 2003 10:14 am, Greg Luce wrote: Could anyone recommend a fast track for learning php for an experienced ColdFusion developer? I'm working my way through the tutorials on php.net and free2code.net, but they seem pretty kindergarten. Any advice? I think with your experience, the best way to learn is just to start building projects, and pick up what you need as you go along. Maybe start with smaller project that uses a database backend of somekind. Especially if you're saying that the tutorial is kindergarten, than you should have no trouble to just start coding. I had about the same experience when I started to learn php, and that's the way I learned, BTW. RDB -- - /\ ASCII Ribbon Campaign against HTML \ / email and proprietary format X attachments. / \ - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Learning PHP
Greg -- ...and then Greg Luce said... % % Could anyone recommend a fast track for learning php for an experienced % ColdFusion developer? I'm working my way through the tutorials on % php.net and free2code.net, but they seem pretty kindergarten. Any % advice? I had extensive perl experience as well as lots of other programming and scripting experience when I started to look at PHP. I got the PHP Developer's Cookbook from SAMS by Sterling Hughes and worked through the examples in there; by the time I had finished the book I had a working knowledge of PHP and was coding away. Have you checked the list archives? I know that what book? has come up at least a couple of times recently... HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg96669/pgp0.pgp Description: PGP signature
[PHP] Print_r bug?
I think I've found a print_r bug with reference recursion. The following example script runs forever: ?php $GLOBALS['foo'] = $GLOBALS; print_r($GLOBALS); ? Am I correct in thinking this is a bug that should be reported? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Print_r bug?
On Wednesday 12 February 2003 16:53, Leif K-Brooks wrote: I think I've found a print_r bug with reference recursion. The following example script runs forever: ?php $GLOBALS['foo'] = $GLOBALS; print_r($GLOBALS); ? Am I correct in thinking this is a bug that should be reported? No, thats no bug. $GLOBALS includes $GLOBALS which include $GLOBALS Use var_dump for $GLOBALS instead ;-) johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Print_r bug?
But according to the manual: Note: Prior to PHP 4.0.4, print_r() will continue forever if given an array http://www.php.net/manual/en/language.types.array.php or object http://www.php.net/manual/en/language.types.object.php that contains a direct or indirect reference to itself. An example is print_r($GLOBALS) because $GLOBALS is itself a global variable that contains a reference to itself. IMHO, it should do the same for a variable that contains a reference to a reference to itself (does that make sense?). Johannes Schlueter wrote: On Wednesday 12 February 2003 16:53, Leif K-Brooks wrote: I think I've found a print_r bug with reference recursion. The following example script runs forever: ?php $GLOBALS['foo'] = $GLOBALS; print_r($GLOBALS); ? Am I correct in thinking this is a bug that should be reported? No, thats no bug. $GLOBALS includes $GLOBALS which include $GLOBALS Use var_dump for $GLOBALS instead ;-) johannes -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
[PHP] Fwd: Re: Guest book
I have a problem. My guestbook should log the time and date when someone write the book. It does now, but not in my language (norwegian). I have tried some of the hint's at your page, but it wont work. This is my script: ?php $date = date (l d. F Y H:i:s); if(empty($navn)){ echo Du har ikke skrevet inn navnet ditt. Trykk på tilbake-knappen på browseren din.; exit(); } if(empty($mld)){ echo Du har ikke skrevet inn en komentar. Trykk på tilbake-knappen på browseren din.; exit(); } $fil=fopen(meldinger.txt, r); $ip = getenv(REMOTE_ADDR); $host = gethostbyaddr($REMOTE_ADDR); $oldmld=fread($fil, filesize(meldinger.txt)); fclose($fil); $fil = fopen (meldinger.txt, w); fwrite ($fil, br bSendt:/b $datebr bNavn:/b a href=\mailto:$epost\; b$navn/abr Hjemmeside:/b a href=\$page\ target=\_blank\$page/abr IP: $ipbr bHost: $hostbr Melding:/bbr br $mldbrbr br $oldmld); fclose ($fil); ? hr width=50% Din melding er lagt til,br Takk for kommentaren din.br braquo;/b a href=gbook.phpTilbake/a Do you know what to do? Thanks for your great site!! I did send this to wemaster at php.net, but he gave me this adress. Can you answer? Please. \\\ l /// \\ - - // ( @ @ ) ---oOOo-(_)-oOOo-- Alexander Verlo Norway -Oooo- oooO ( ) ( ) ) / \ ( (_/ \_) _ MSN Messenger http://www.msn.no/messenger - Den korteste veien mellom deg og dine venner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fwd: Re: Guest book
Try setlocale (LC_ALL, 'no_NO'); at the beginnig of your script (I'm not sure no_NO is right) Alexander Verlo wrote: I have a problem. My guestbook should log the time and date when someone write the book. It does now, but not in my language (norwegian). I have tried some of the hint's at your page, but it wont work. This is my script: ?php $date = date (l d. F Y H:i:s); if(empty($navn)){ echo Du har ikke skrevet inn navnet ditt. Trykk på tilbake-knappen på browseren din.; exit(); } if(empty($mld)){ echo Du har ikke skrevet inn en komentar. Trykk på tilbake-knappen på browseren din.; exit(); } $fil=fopen(meldinger.txt, r); $ip = getenv(REMOTE_ADDR); $host = gethostbyaddr($REMOTE_ADDR); $oldmld=fread($fil, filesize(meldinger.txt)); fclose($fil); $fil = fopen (meldinger.txt, w); fwrite ($fil, br bSendt:/b $datebr bNavn:/b a href=\mailto:$epost\; b$navn/abr Hjemmeside:/b a href=\$page\ target=\_blank\$page/abr IP: $ipbr bHost: $hostbr Melding:/bbr br $mldbrbr br $oldmld); fclose ($fil); ? hr width=50% Din melding er lagt til,br Takk for kommentaren din.br braquo;/b a href=gbook.phpTilbake/a Do you know what to do? Thanks for your great site!! I did send this to wemaster at php.net, but he gave me this adress. Can you answer? Please. \\\ l /// \\ - - // ( @ @ ) ---oOOo-(_)-oOOo-- Alexander Verlo Norway -Oooo- oooO ( ) ( ) ) / \ ( (_/ \_) _ MSN Messenger http://www.msn.no/messenger - Den korteste veien mellom deg og dine venner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fwd: Re: Guest book
Also forgot you should use *strftime()* instead of date() ( http://www.php.net/strftime ) Marek Kilimajer wrote: Try setlocale (LC_ALL, 'no_NO'); at the beginnig of your script (I'm not sure no_NO is right) Alexander Verlo wrote: I have a problem. My guestbook should log the time and date when someone write the book. It does now, but not in my language (norwegian). I have tried some of the hint's at your page, but it wont work. This is my script: ?php $date = date (l d. F Y H:i:s); if(empty($navn)){ echo Du har ikke skrevet inn navnet ditt. Trykk på tilbake-knappen på browseren din.; exit(); } if(empty($mld)){ echo Du har ikke skrevet inn en komentar. Trykk på tilbake-knappen på browseren din.; exit(); } $fil=fopen(meldinger.txt, r); $ip = getenv(REMOTE_ADDR); $host = gethostbyaddr($REMOTE_ADDR); $oldmld=fread($fil, filesize(meldinger.txt)); fclose($fil); $fil = fopen (meldinger.txt, w); fwrite ($fil, br bSendt:/b $datebr bNavn:/b a href=\mailto:$epost\; b$navn/abr Hjemmeside:/b a href=\$page\ target=\_blank\$page/abr IP: $ipbr bHost: $hostbr Melding:/bbr br $mldbrbr br $oldmld); fclose ($fil); ? hr width=50% Din melding er lagt til,br Takk for kommentaren din.br braquo;/b a href=gbook.phpTilbake/a Do you know what to do? Thanks for your great site!! I did send this to wemaster at php.net, but he gave me this adress. Can you answer? Please. \\\ l /// \\ - - // ( @ @ ) ---oOOo-(_)-oOOo-- Alexander Verlo Norway -Oooo- oooO ( ) ( ) ) / \ ( (_/ \_) _ MSN Messenger http://www.msn.no/messenger - Den korteste veien mellom deg og dine venner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question form validation
I must be missing something, but I am doing some very simple validation of a form. So if it is incorrect I need to redisplay the form. Normally what I do is I just include the form back in. This one I have tried to include the form back in, but I need to keep an id number. That seems to blow up my include. Any thoughts? if ($coll_id==) { $invalid=1; $error[] = Please include a group to associate with this store.; } if ($invalid==1) { $included=1; include(add_store.php?id=.$id.); } _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sorting multi-dimensional array where array elements are structs [simple class]
Okay. For some reason, usort messes things up when you have a multi-dimensional array (or at least mine). When I commented out the call to usort, the information printed, but out of order. When I called the usort, Im not sure what happened, but all of the elements in my array were blank. What I had to do is copy each row to a temporary array, perform the usort, then I just printed from there - I didn't even store it back into the original multi-dimensional array (although I'm sure I could do that if it were necessary). At any rate, things are working as I need them to. Thanks again. -Original Message- From: Michael Sims [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 7:19 PM To: [EMAIL PROTECTED] Cc: Erin Fry Subject: Re: [PHP] sorting multi-dimensional array where array elements are structs [simple class] On Tue, 11 Feb 2003 08:27:57 -0600, you wrote: Thanks for the reply. I had already tried usort previously. For some reason, there is no data for the array fields at all in the cmp function - not sure why. Does anyone know? All help is appreciated! Thanks. Can you post a short code sample which illustrates your problem? --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
On Thursday 13 February 2003 00:47, Didier McGillis wrote: I must be missing something, but I am doing some very simple validation of a form. So if it is incorrect I need to redisplay the form. Normally what I do is I just include the form back in. This one I have tried to include the form back in, but I need to keep an id number. That seems to blow up my include. Any thoughts? if ($coll_id==) { $invalid=1; $error[] = Please include a group to associate with this store.; } if ($invalid==1) { $included=1; include(add_store.php?id=.$id.); } Please RTFM on the correct use of include(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I don't want to achieve immortality through my work. I want to achieve immortality through not dying. -- Woody Allen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Browser displays binary data
I've been searching and not really sure what I should be searching for. I just got a note from a reader who says that they are unable to read an article on our website (from the screenshot it looks like browser is getting binary data). This article is php generated html with proper doctype, html, and header tags. The trouble is that the same script is generating articles that this person can read. I'm guessing that this has something to do with the browser getting gzipped content and not knowing it. My script does not gzip and my php setting are as follows, so I don't think this is happening on the fly. ZLib Support enabled Compiled Version 1.1.3 Linked Version 1.1.3 zlib.output_compression Off Off zlib.output_compression_level -1 -1 zlib.output_handler no value no value Any ideas? Thanks much, olinux __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing PostgreSQL resource
Hi.. i'm new at this mailing list and you can say that i'm a newbie in Php programming :) i dont know how to pass a connection to a database between pages. I want to show the results in multiple pages with a unique connection. can anyone help me? Thanks in advance. Lucas -- Lucas Lain [EMAIL PROTECTED] Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Search metatag script
I'm pretty new to PHP and have no programming background, so I wanted to ask what would be the best way to approach this script. A client will develop a set of keywords which we will post on a Keyword Index page (probably 50+). He will then designate which of 25 product pages to apply these keywords to, and the relevant ones will be placed in the keywords metatag (no other words will be included there). The script I want to write will search only the keywords metatag and will return a list of links to the relevant pages. Sounds simple enough, right? I tried some free scripts that would search the whole site, but customizing them for this function seemed like reinventing the wheel (and a rather complex wheel at that). Does this sound like something a newbie could do? If so, any general guidelines/advice would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Learning PHP
Normally I don't recommend a SAMS book since I often find them lacking depth. But I picked upPHP and MySQL Web Devlopment and actually thought it very helpful. By chapter two you're reading and writing files and by page 150 (of and 800+ page book) you're into object oriented programming. It covers most everything you would want to do from creating graphics on the fly, to making a forum and ecommerce. It also has a few chapters on security, which is a very good thing. The one area that did bother me was that only one chapter was dedicated to creating an ecommerce site and one other chapter to ecommerce security issues. Personally, I think ecommerce could have it's own book and shouldn't haven't been included. But I guess if you are experienced in creating ecommerce sites it's good to have an overview of it. On Wednesday, February 12, 2003, at 10:14 AM, Greg Luce wrote: Could anyone recommend a fast track for learning php for an experienced ColdFusion developer? I'm working my way through the tutorials on php.net and free2code.net, but they seem pretty kindergarten. Any advice? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
Is there a way that I can redirect and keep the id. From: Jason Wong [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] quick question form validation Date: Thu, 13 Feb 2003 00:55:59 +0800 On Thursday 13 February 2003 00:47, Didier McGillis wrote: I must be missing something, but I am doing some very simple validation of a form. So if it is incorrect I need to redisplay the form. Normally what I do is I just include the form back in. This one I have tried to include the form back in, but I need to keep an id number. That seems to blow up my include. Any thoughts? if ($coll_id==) { $invalid=1; $error[] = Please include a group to associate with this store.; } if ($invalid==1) { $included=1; include(add_store.php?id=.$id.); } Please RTFM on the correct use of include(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I don't want to achieve immortality through my work. I want to achieve immortality through not dying. -- Woody Allen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
On Thursday 13 February 2003 01:26, Didier McGillis wrote: Is there a way that I can redirect and keep the id. If you want to _redirect_ use header(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* It's a dog-eat-dog world out there, and I'm wearing Milkbone underware. -- Norm, from _Cheers_ */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP 4.3 on win 2k
What server are you using? Mike Joe Njeru [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, I get a Invalid access to memory location. error when I install php 4.3 on win2k as a isapi module. I've tried to install it as a cgi but I keep on getting cgi.force_redirect error and when I change cgi.force_redirect it still appears. PHP 4.2 runs well without any problems. Could someone help me out. Joe Njeru -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
I get this. Warning: Cannot add header information - headers already sent by (output started header.php:7) in add_store.php on line 186 From: Jason Wong [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] quick question form validation Date: Thu, 13 Feb 2003 01:32:59 +0800 On Thursday 13 February 2003 01:26, Didier McGillis wrote: Is there a way that I can redirect and keep the id. If you want to _redirect_ use header(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* It's a dog-eat-dog world out there, and I'm wearing Milkbone underware. -- Norm, from _Cheers_ */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] setcookie on PHP??
I need to set a cookie within a document in PHP? setcookie didn't work. I guess it works only in PHP3 PHP4 Any good ideas?? Thanks Rave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Login Setup not working with PHP
Try user = 'root', password = ''. It's a security breach, so you would want to change it ASAP. Look for the SQL GRANT and REVOKE commands. -- Un gran saludo/Big regards... Arturo Barajas, IT/Systems PPG MX (SJDR) (427) 271-9918, x448 -Original Message- From: Tim Burgan [mailto:[EMAIL PROTECTED]] Sent: Miércoles, 12 de Febrero de 2003 07:32 a.m. To: [EMAIL PROTECTED] Subject: [PHP] MySQL Login Setup not working with PHP I've installed a bundle from ( www.fireworks.com.au ) that includes PHP, MySQL and Apache all pre-configured. All is working OK, except that I'm trying to access a table in my database using the following PHP code: ?php $dbServer = localhost; $dbName = siteStats; $dbUser = username; $dbPass = password; ? The problem is that I don't know what my USERNAME or PASSWORD for MyDQL are. How do I find this information out? I thought it was in the 'my.ini' file, but with this installation there doesn't seem to be one. Alternatively, does anyone know of a very simple tutorial that explains STEP-BY-STEP of how to install Apache, PHP and MySQL to run on a local machine.. that even I can understand. Thanks Tim Burgan -- 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] RSA implementation
Why not try this: Store the plaintext password in your DB, or hash with a permanent key (same key for all users) Send a well-salted key to the browser @ your login page, each time the user logs in Have the user enter the password, have javascript hash it and send it to you (if you're storing a hash in your DB it will need to be hashed twice), as well as the salted key used (or store the key on your server using sessions) (covers encrypted transmission). Have your verification script use the same key to hash the plaintext password in your database, if the result matches the hashed value sent by the user as a password, then the user is authenticated. In this way the user can easily change their password, as well you get (seemingly) random authentication encryption. Or just try SSL. Matt - Original Message - From: Chris Hewitt [EMAIL PROTECTED] To: José León Serna [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 12, 2003 10:27 AM Subject: Re: [PHP] RSA implementation José León Serna wrote: El mar, 11-02-2003 a las 18:49, Chris Hewitt escribió: Have you considered using on one-way MD5 hash instead? That's how I'm doing it now, but I would like to allow the user to change it's password, and I want to encrypt it, of course ;-) Yes. The procedure here will be to: -Encrypt the new password with javascript on the client's browser using RSA and the public key Or it could be an MD5 hash. -Decode the entered password on the server using the private key Current password hash compared with what is in the database, if OK then store new password hash. I'm just suggesting that its possible to use MD5 and not a two-way encryption/decryption. I have no experience of using RSA, I'd have to leave it to others to help. Regards Chris -- 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] Using function fsockopen() under proxy
Hi, everyone... Why to use the function fsockopen() under proxy?? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
On Thursday 13 February 2003 01:40, Didier McGillis wrote: I get this. Warning: Cannot add header information - headers already sent by (output started header.php:7) in add_store.php on line 186 OK, did you search the archives? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Would you *__really* want to get on a non-stop flight? -- George Carlin */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] buildconf: Your version of autoconf likely contains buggy cache code
when I run buildconf I get this message. Everything seems to work ok but Can someone explain this warning. buildconf: autoconf version 2.53 (ok) buildconf: Your version of autoconf likely contains buggy cache code. Running cvsclean for you. To avoid this, install autoconf-2.13 and automake-1.5. buildconf: automake version 1.6.3 (ok) buildconf: libtool version 1.4.2 (ok) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing PostgreSQL resource
This is how i handle this concept: 1. Determine the number of rows from the query. 2. Set up limits on how many rows to display per page. 3. Then do multiple queries with those limits. Postgresql allows for queries with limits. That should get you started... Ray On Wed, 2003-02-12 at 09:58, Lucas Lain wrote: Hi.. i'm new at this mailing list and you can say that i'm a newbie in Php programming :) i dont know how to pass a connection to a database between pages. I want to show the results in multiple pages with a unique connection. can anyone help me? Thanks in advance. Lucas -- Lucas Lain [EMAIL PROTECTED] Argentina -- 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] Learning PHP
You may want to wait a few days on this book. The 2nd edition is due out tomorrow. Search on 0-672-32525-X -Original Message- From: Brent Baisley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 9:19 AM To: Greg Luce Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Learning PHP Normally I don't recommend a SAMS book since I often find them lacking depth. But I picked upPHP and MySQL Web Devlopment and actually thought it very helpful. By chapter two you're reading and writing files and by page 150 (of and 800+ page book) you're into object oriented programming. It covers most everything you would want to do from creating graphics on the fly, to making a forum and ecommerce. It also has a few chapters on security, which is a very good thing. The one area that did bother me was that only one chapter was dedicated to creating an ecommerce site and one other chapter to ecommerce security issues. Personally, I think ecommerce could have it's own book and shouldn't haven't been included. But I guess if you are experienced in creating ecommerce sites it's good to have an overview of it. On Wednesday, February 12, 2003, at 10:14 AM, Greg Luce wrote: Could anyone recommend a fast track for learning php for an experienced ColdFusion developer? I'm working my way through the tutorials on php.net and free2code.net, but they seem pretty kindergarten. Any advice? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- 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] Passing PostgreSQL resource
Try this function... it's one part of a php class I've been thinking about making open-source. Give it any sql statement and a page (0 based for the page) and a number of records for a page and you are set. I've only tested this on postgresql. function pageSql( $sql, $page, $recs_per_page ) { $this-isString( '$sql', $sql ); $this-isInt( '$page', $page ); $this-isInt( '$recs_per_page', $recs_per_page ); $sql = trim( $sql ); $sql = substr( $sql, strlen( SELECT ) ); if ( $sql[strlen($sql)-1] != ; ) { $sql .= ;; } $sql = sprintf( CREATE TEMP SEQUENCE temp_sequence;\n . CREATE TEMP TABLE temp_table AS\n . SELECT nextval( 'temp_sequence' ) AS temporary_idASDF, %s\n . SELECT ( SELECT COUNT(*) FROM temp_table\n . WHERE temporary_idASDF %d ) AS recs_remaining, \n . * FROM temp_table\n . WHERE temporary_idASDF %d\n . AND temporary_idASDF %d\n . ORDER BY temporary_idASDF; , $sql , ( $page + 1 ) * $recs_per_page + 1 , $page * $recs_per_page , ( $page + 1 ) * $recs_per_page + 1 ); return $sql; } On February 12, 2003 11:58 am, Lucas Lain wrote: Hi.. i'm new at this mailing list and you can say that i'm a newbie in Php programming :) i dont know how to pass a connection to a database between pages. I want to show the results in multiple pages with a unique connection. can anyone help me? Thanks in advance. Lucas -- Lucas Lain [EMAIL PROTECTED] Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP JavaScript
I have a problem with 2 select multiple boxes in my PHP pages. In order for PHP to pass multiple values to a page that it is posted to, the name of the select box must have [] at the end of it. My problem is that when I do that for select1[] in my page that breaks the syntax of the JavaScript code that performs operations on it. Is there any way around this? I'm looking for either a PHP or a JavaScript solution. Thanks, Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing PostgreSQL resource
i will use it for the moment but i was thinking in a light solution ... i dont like the idea of creating a temp table for each page... Joshua Moore-Oliva wrote: Try this function... it's one part of a php class I've been thinking about making open-source. Give it any sql statement and a page (0 based for the page) and a number of records for a page and you are set. I've only tested this on postgresql. function pageSql( $sql, $page, $recs_per_page ) { $this-isString( '$sql', $sql ); $this-isInt( '$page', $page ); $this-isInt( '$recs_per_page', $recs_per_page ); $sql = trim( $sql ); $sql = substr( $sql, strlen( SELECT ) ); if ( $sql[strlen($sql)-1] != ; ) { $sql .= ;; } $sql = sprintf( CREATE TEMP SEQUENCE temp_sequence;\n . CREATE TEMP TABLE temp_table AS\n . SELECT nextval( 'temp_sequence' ) AS temporary_idASDF, %s\n . SELECT ( SELECT COUNT(*) FROM temp_table\n . WHERE temporary_idASDF %d ) AS recs_remaining, \n . * FROM temp_table\n . WHERE temporary_idASDF %d\n . AND temporary_idASDF %d\n . ORDER BY temporary_idASDF; , $sql , ( $page + 1 ) * $recs_per_page + 1 , $page * $recs_per_page , ( $page + 1 ) * $recs_per_page + 1 ); return $sql; } On February 12, 2003 11:58 am, Lucas Lain wrote: Hi.. i'm new at this mailing list and you can say that i'm a newbie in Php programming :) i dont know how to pass a connection to a database between pages. I want to show the results in multiple pages with a unique connection. can anyone help me? Thanks in advance. Lucas -- Lucas Lain [EMAIL PROTECTED] Argentina -- Lucas Lain [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] var_export() strips slashes
Seems that var_export() strips slashes from my array keys even though the docs say that it returns valid PHP code. This is bad if I want to use $b below to define another array, gives a parse error on the single quote in the key. $a = array('it\'s here' = 'single, \' double '); $b = var_export($a, TRUE); echo $b; Displays: array ( 'it's here' = 'single, \' double ', ) And: $c = eval($b); generates a parse error in the eval'ed code. Any help??? TIA, -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP JavaScript
document.forms[0].elements['select1[]'] Assuming the form is your first form on the page, reference the element in JavaScript as above. Greg wrote: I have a problem with 2 select multiple boxes in my PHP pages. In order for PHP to pass multiple values to a page that it is posted to, the name of the select box must have [] at the end of it. My problem is that when I do that for select1[] in my page that breaks the syntax of the JavaScript code that performs operations on it. Is there any way around this? I'm looking for either a PHP or a JavaScript solution. Thanks, Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing PostgreSQL resource
There's really no other way to do it... You can't serialize a connection or resultset since they are both resources... If you really wanted you could turn a recordset into an array and store that as a serialised object and pass it around... but a) Depending on how much data a recordset returned it could be quite a slowdown on page viewing. b) It could be a security breach in case there was data int he recordset you never show to the public btu you need for calculations. c) Changes made to the database since the last retrieval would not display. A server is meant to store and serve data.. There really is no other way about it =). Josh. On February 12, 2003 01:52 pm, Lucas Lain wrote: i will use it for the moment but i was thinking in a light solution ... i dont like the idea of creating a temp table for each page... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing PostgreSQL resource
Oh btw, you will have to remove those isString and isint functions.. they are other parts of my library that just check the type of a variable... and log a message through an error handling system I've set up.. I'd have the library up now but it's not that well commented.. Josh. On February 12, 2003 01:30 pm, Joshua Moore-Oliva wrote: Try this function... it's one part of a php class I've been thinking about making open-source. Give it any sql statement and a page (0 based for the page) and a number of records for a page and you are set. I've only tested this on postgresql. function pageSql( $sql, $page, $recs_per_page ) { $this-isString( '$sql', $sql ); $this-isInt( '$page', $page ); $this-isInt( '$recs_per_page', $recs_per_page ); $sql = trim( $sql ); $sql = substr( $sql, strlen( SELECT ) ); if ( $sql[strlen($sql)-1] != ; ) { $sql .= ;; } $sql = sprintf( CREATE TEMP SEQUENCE temp_sequence;\n . CREATE TEMP TABLE temp_table AS\n . SELECT nextval( 'temp_sequence' ) AS temporary_idASDF, %s\n . SELECT ( SELECT COUNT(*) FROM temp_table\n . WHERE temporary_idASDF %d ) AS recs_remaining, \n .* FROM temp_table\n . WHERE temporary_idASDF %d\n . AND temporary_idASDF %d\n . ORDER BY temporary_idASDF; , $sql , ( $page + 1 ) * $recs_per_page + 1 , $page * $recs_per_page , ( $page + 1 ) * $recs_per_page + 1 ); return $sql; } On February 12, 2003 11:58 am, Lucas Lain wrote: Hi.. i'm new at this mailing list and you can say that i'm a newbie in Php programming :) i dont know how to pass a connection to a database between pages. I want to show the results in multiple pages with a unique connection. can anyone help me? Thanks in advance. Lucas -- Lucas Lain [EMAIL PROTECTED] Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php javascript drop down menu???
thanks Jason, between this the other suggestions I was emailed I believe I can make this all work like I need to. Jeff Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Wednesday 12 February 2003 08:47, Jeff Bluemel wrote: OK... I have a dynamic menu system, and I have to maintain a dynamic menu. however, the amount of content I need in my menu is going to be rapidly outgrown. I believe my only solution is to deploy a javascript drop down menu (users have to be javascript compatible anyway for some other issues in my pages). however, it seems like anytime I try to integrate php javascript I run into a total nightmare. the php javascript do not need to integrate at the client level, but just on the server side to actually deploy the menu to the user. (have if then statements of info from a database that will determine if the item is displayed to the user or not, so should be pretty easy to accomodate) does anybody have any sample code of a javascript menu across the top of the page that will have menu, and submenu's they are deploying with php echo statements? Try this: http://phplayersmenu.sourceforge.net/ -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The difference between this place and yogurt is that yogurt has a live culture. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] setcookie on PHP??
Send some pieces of code. Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Balaravi, Bala (Ravi), ALABS [mailto:[EMAIL PROTECTED]] Enviado el: miércoles, 12 de febrero de 2003 12:41 Para: [EMAIL PROTECTED] Asunto: [PHP] setcookie on PHP?? I need to set a cookie within a document in PHP? setcookie didn't work. I guess it works only in PHP3 PHP4 Any good ideas?? Thanks Rave -- 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] string to array
What is the best method to convert a string to an array I need to able to loop through each letter of the string not just use $string[47] Is there a definitive method to do this? Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Announcement: Smarty template engine 2.4.2 released
Hello! Smarty 2.4.2 now supports the ability to access objects within the templates, a long awaited feature. Two methods are available, one which closely follows Smartys existing syntax conventions, and another that follows more traditional object syntax for those familiar with PHP. The regex parsing was rewritten to be more strict, secure and maintainable. Config files are now compiled instead of parsed. Assigned variables are no longer extracted to PHP namespace saving extract() calls. There is now support for applying modifiers to static values and functions. You can now access constants with $smarty.const.VAR. If you use the security features of Smarty be sure to upgrade, the previous not-so-strict parser opened the possibility of executing PHP in the templates. Other misc things are in the change log. Have fun! -Monte Homepage: http://smarty.php.net/ Release Notes: http://smarty.php.net/misc/RELEASE_NOTES ChangeLog: http://smarty.php.net/misc/NEWS Download: http://smarty.php.net/download.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string to array
There's no built-in function, but try this (copied from manual): $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); Kevin Waterson wrote: What is the best method to convert a string to an array I need to able to loop through each letter of the string not just use $string[47] Is there a definitive method to do this? Kevin -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string to array
Kevin Waterson [EMAIL PROTECTED] wrote: What is the best method to convert a string to an array I need to able to loop through each letter of the string not just use $string[47] You can find out how long it is using strlen(), then loop through it using your favorite looping construct. You could also easily convert it to an array at that point, but unless you need each character as an array element for a later operation it doesn't seem very efficient. I don't think explode() will let you use a separator of '', but you might look at that as well. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do you... get a text stream into IMAP parsing...
Is there any way to send an email message which is already in PHP (in a string, array, or I/O stream) through the IMAP parser without putting it into a file first? Thanks in advance, -- Les Barstow | System Administrator | A society of sheep must in time beget Jaleco Entertainment | a government of wolves. http://www.jaleco.com | -- Bertrand de Jouvenel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] when is OOP a good choice?
I've just started to read about - and will soon try to write - object oriented code. I think I've got the basics both from the PHP-books I have, and from various sources on the web. But nowhere have I read a good explanation to two of my questions: 1. What are the main benefits from OOP? 2. When is OOP a good choice for a PHP script, and when is ordinary functions a better call? -- anders thoresson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP JavaScript
Thank you so much, that worked perfectly...I know it's off topic, but do you know how to automatically select all elements of a select multiple box and then submit the form using a submit button? Thanks! -Greg John Nichel [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... document.forms[0].elements['select1[]'] Assuming the form is your first form on the page, reference the element in JavaScript as above. Greg wrote: I have a problem with 2 select multiple boxes in my PHP pages. In order for PHP to pass multiple values to a page that it is posted to, the name of the select box must have [] at the end of it. My problem is that when I do that for select1[] in my page that breaks the syntax of the JavaScript code that performs operations on it. Is there any way around this? I'm looking for either a PHP or a JavaScript solution. Thanks, Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Failed opening
At 13:14 12.02.2003, thkiat said: [snip] Hi can someone explain to me what is this and how to fix it:- Warning: Failed opening '../language/english/admin.php' for inclusion (include_path='.;c:\apache\php\pear') in c:\apache\htdocs\exoops\modules\sitemap\admin\admin_header.php on line 19 [snip] Well... I am almost sure that PHP is unable to open the file '../language/english/admin.php' for inclusion. This file gets included in c:\apache\htdocs\exoops\modules\sitemap\admin\admin_header.php on line 19. Pretty cool, hm? -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PGP and PHP together???
Is it possible to use php and pgp together? Are there any good tutorials out there? -- Mike Yrabedra President 323 Enterprises Home of The MacDock and The MacSurfshop [http://macdock.com] : [http://macsurfshop.com] VOICE: 770.382.1195 iChat/AIM: ichatmacdock ___ in all your ways acknowledge Him and He will direct your paths. Proverbs 3:6 NIV {{{ -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined function - crypt()
Using MS Win98 / PHP /Apache I'm getting a undefined function error - crypt() The following scripts were taken from Larry Ullman's book on PHP on page 60-61. Any advice would be helpful. Thank you. Tony Ritter .. //ullmanform.html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEADTITLEHTML Form/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1252 META content=MSHTML 5.50.4807.2300 name=GENERATOR/HEAD BODY FORM action=ullmanpassword2.php method=postFirst Name INPUT name=FirstNameBRLast Name INPUT size=40 name=LastNameBR E-mail Address INPUT size=60 name=EmailBR Comments TEXTAREA name=Comments rows=5 cols=40 /TEXTAREABR INPUT type=submit value=Submit! name=SUBMIT /FORM/BODY/HTML // ullmanpassword2.php HTML HEAD TITLE Form Results/Using Strings/TITLE /HEAD BODY ?php /* This page receives and handles the data generated by ullmanform.html. */ $FirstName = trim($FirstName); $LastName = trim($LastName); $Email = trim($Email); $Comments = trim($Comments); $Name = $FirstName . . $LastName; print (Your name is $Name.BR\n); print (Your E-mail address is $Email.BR\n); print (This is what you had to say:BR\n $CommentsBR\n); $CryptName = crypt($Name); print (PThis is the crypt() version of your name: $CryptName\n); ? /BODY /HTML .. Fatal error: Call to undefined function: crypt() in c:\program files\apache group\apache\htdocs\ullmanpassword2.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: undefined function - crypt()
I believe you need to have mcrypt installed. -Greg Anthony Ritter [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Using MS Win98 / PHP /Apache I'm getting a undefined function error - crypt() The following scripts were taken from Larry Ullman's book on PHP on page 60-61. Any advice would be helpful. Thank you. Tony Ritter .. //ullmanform.html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEADTITLEHTML Form/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1252 META content=MSHTML 5.50.4807.2300 name=GENERATOR/HEAD BODY FORM action=ullmanpassword2.php method=postFirst Name INPUT name=FirstNameBRLast Name INPUT size=40 name=LastNameBR E-mail Address INPUT size=60 name=EmailBR Comments TEXTAREA name=Comments rows=5 cols=40 /TEXTAREABR INPUT type=submit value=Submit! name=SUBMIT /FORM/BODY/HTML // ullmanpassword2.php HTML HEAD TITLE Form Results/Using Strings/TITLE /HEAD BODY ?php /* This page receives and handles the data generated by ullmanform.html. */ $FirstName = trim($FirstName); $LastName = trim($LastName); $Email = trim($Email); $Comments = trim($Comments); $Name = $FirstName . . $LastName; print (Your name is $Name.BR\n); print (Your E-mail address is $Email.BR\n); print (This is what you had to say:BR\n $CommentsBR\n); $CryptName = crypt($Name); print (PThis is the crypt() version of your name: $CryptName\n); ? /BODY /HTML .. Fatal error: Call to undefined function: crypt() in c:\program files\apache group\apache\htdocs\ullmanpassword2.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] undefined function - crypt()
Tony, You have to compile PHP with the crypt option, I don't remember the exact syntax (--enable-crypt? --with-crypt=/path?) Something along those lines... -- Un gran saludo/Big regards... Arturo Barajas, IT/Systems PPG MX (SJDR) (427) 271-9918, x448 -Original Message- From: Anthony Ritter [mailto:[EMAIL PROTECTED]] Sent: Miercoles, 12 de Febrero de 2003 03:00 p.m. To: [EMAIL PROTECTED] Subject: [PHP] undefined function - crypt() Using MS Win98 / PHP /Apache I'm getting a undefined function error - crypt() The following scripts were taken from Larry Ullman's book on PHP on page 60-61. Any advice would be helpful. Thank you. Tony Ritter .. //ullmanform.html !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEADTITLEHTML Form/TITLE META http-equiv=Content-Type content=text/html; charset=windows-1252 META content=MSHTML 5.50.4807.2300 name=GENERATOR/HEAD BODY FORM action=ullmanpassword2.php method=postFirst Name INPUT name=FirstNameBRLast Name INPUT size=40 name=LastNameBR E-mail Address INPUT size=60 name=EmailBR Comments TEXTAREA name=Comments rows=5 cols=40 /TEXTAREABR INPUT type=submit value=Submit! name=SUBMIT /FORM/BODY/HTML // ullmanpassword2.php HTML HEAD TITLE Form Results/Using Strings/TITLE /HEAD BODY ?php /* This page receives and handles the data generated by ullmanform.html. */ $FirstName = trim($FirstName); $LastName = trim($LastName); $Email = trim($Email); $Comments = trim($Comments); $Name = $FirstName . . $LastName; print (Your name is $Name.BR\n); print (Your E-mail address is $Email.BR\n); print (This is what you had to say:BR\n $CommentsBR\n); $CryptName = crypt($Name); print (PThis is the crypt() version of your name: $CryptName\n); ? /BODY /HTML .. Fatal error: Call to undefined function: crypt() in c:\program files\apache group\apache\htdocs\ullmanpassword2.php -- 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] restricting access to files using PHP
At 10:46 12.02.2003, Shams said: [snip] i've written a secure PHP login script which will allow users to login to a directory such as this: smezone.com/members/index.php however, how do I restrict people from accessing HTML files in that directory (which they can easily do so by typing the URL into their browser), such as: smezone.com/members/document1.html ? Since its a regular HTML files (and we have lots), I can't check whether the user has a valid session as I would do in a PHP file. [snip] If you have access to the servers directory structure (and either shell access or a helpful admin) you could also consider a different approach by moving the files outside the webservers path and including them in your access script. BEFORE (assumed) /~shams /~shams/www /~shams/www/members now, do cd /~shams mkdir www.members mv -r www/members/* www.members # and make sure that the http process has read permission on files, # and read/execute permission on directories and subdirs so we have AFTER /~shams /~shams/www.members -- not accessible via http /~shams/www -- webserver root folder In your login script, you would then (after a valid login check) $file = '../www.members/' . $_REQUEST['file']; $hf = fopen($file); if ($hf) { echo fread($hf, filesize($file)); fclose($hf); } else die 'cannot open file ' . $_REQUEST['file']; assuming you pass the requested filename via a file parameter, which you could easily accomplish by using either ErrorDocument or mod_rewrite in your apache config. HTH, -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: undefined function - crypt()
Greg wrote in message: I believe you need to have mcrypt installed. -Greg . Not sure what mcrypt is. Please advise. In Ullman's textbook, it says that decrypt() and encrypt(0 fuctions will not work if PHP is not installed as a module. However, in his example in the book, it was with crypt(). It does seem to work by calling the md5() function. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Login Setup not working with PHP
At 14:31 12.02.2003, Tim Burgan said: [snip] The problem is that I don't know what my USERNAME or PASSWORD for MyDQL are. How do I find this information out? [snip] You need to ask your SysAdmin... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] when is OOP a good choice?
Object oriented programming in php has better logic thus is more suitable for more complex jobs. It also makes maintenance easier, although you have to write a bit more code -Original Message- From: anders thoresson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 3:50 PM To: [EMAIL PROTECTED] Subject: [PHP] when is OOP a good choice? I've just started to read about - and will soon try to write - object oriented code. I think I've got the basics both from the PHP-books I have, and from various sources on the web. But nowhere have I read a good explanation to two of my questions: 1. What are the main benefits from OOP? 2. When is OOP a good choice for a PHP script, and when is ordinary functions a better call? -- anders thoresson -- 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] Learning PHP
At 16:14 12.02.2003, Greg Luce said: [snip] Could anyone recommend a fast track for learning php for an experienced ColdFusion developer? I'm working my way through the tutorials on php.net and free2code.net, but they seem pretty kindergarten. Any advice? [snip] Well, when I made my move to PHP (coming from Tango you probably know, being a CF guy) I was successful by simply eating the online docs. They have good value (not perfect, but...) and sometimes very interesting user comments. When I found some snippets I liked I simply tried them out and played around with the code. Got up and running in less than a week. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: when is OOP a good choice?
if you work in comand its good thing. Anders Thoresson [EMAIL PROTECTED] ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've just started to read about - and will soon try to write - object oriented code. I think I've got the basics both from the PHP-books I have, and from various sources on the web. But nowhere have I read a good explanation to two of my questions: 1. What are the main benefits from OOP? 2. When is OOP a good choice for a PHP script, and when is ordinary functions a better call? -- anders thoresson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IS PEAR Secure?
I am looking into installing PEAR on my production server running 4.3. Are there any PEAR security issues to be concerned about? -- Mike Yrabedra President 323 Enterprises Home of The MacDock and The MacSurfshop [http://macdock.com] : [http://macsurfshop.com] VOICE: 770.382.1195 iChat/AIM: ichatmacdock ___ in all your ways acknowledge Him and He will direct your paths. Proverbs 3:6 NIV {{{ -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: var_export() strips slashes
Is this a real bug, or am I just doing something stupid? :-) Thanks! Shawn Seems that var_export() strips slashes from my array keys even though the docs say that it returns valid PHP code. This is bad if I want to use $b below to define another array, gives a parse error on the single quote in the key. $a = array('it\'s here' = 'single, \' double '); $b = var_export($a, TRUE); echo $b; Displays: array ( 'it's here' = 'single, \' double ', ) And: $c = eval($b); generates a parse error in the eval'ed code. Any help??? TIA, -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Database problem - works in Windows - not Linux
Hi there, I'm moving an application from Windows - Linux, and am having a problem with the database. I have the following script to test my database connection (Linux): -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $connection = mysql_connect(localhost,,) or die (Couldn't connect.); $dbs = mysql_list_dbs($connection) or die(Couldn't list databases.); $db_list = ul; $i = 0; while ($i mysql_num_rows($dbs)) { $db_names[$i] = mysql_tablename($dbs,$i); $db_list .= li$db_names[$i]/li; $i++; } $db_list .= /ul; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= This works fine and displays: * mysql * sasdap * test * testDB However, the code that I developed under Windows doesn't work in Linux: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function db_connect() { // the connection string (host, user, password) $result = mysql_pconnect(localhost, , ); if (!$result) return false; if (!mysql_select_db(sasdap)) return false; // false is returned! return $result; } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Which is called like so: // connect to db $conn = db_connect(); if (!$conn) return 0; Any thoughts on why this is happening? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp_get()
I am trying to ftp_get($con,/tmp/download.tmp,/remote/file dir/file.txt,FTP_ASCII). I am getting errors because of the space in the remote filename. I tried using /remote/file\ dir/file.txt as the filename, but that also fails. I also tried to ftp_chdir() to the directory first and get file.txt to no avail. Does anyone have any ideas on how to GET a file that is in a directory with a space in it? -Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_get()
Chris, Wouldn't work if you urlencode the path to the file? Something like: ftp_get($con,/tmp/download.tmp, urlencode(/remote/file dir/file.txt), FTP_ASCII) THT -- Un gran saludo/Big regards... Arturo Barajas, IT/Systems PPG MX (SJDR) (427) 271-9918, x448 -Original Message- From: Muti [mailto:[EMAIL PROTECTED]] Sent: Miércoles, 12 de Febrero de 2003 05:17 p.m. To: [EMAIL PROTECTED] Subject: [PHP] ftp_get() I am trying to ftp_get($con,/tmp/download.tmp,/remote/file dir/file.txt,FTP_ASCII). I am getting errors because of the space in the remote filename. I tried using /remote/file\ dir/file.txt as the filename, but that also fails. I also tried to ftp_chdir() to the directory first and get file.txt to no avail. Does anyone have any ideas on how to GET a file that is in a directory with a space in it? -Chris -- 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] Pspell
Hi guys, Having a problem here getting php4.3 to compile with pspell. I have the new aspell (aspell-0.50.2) installed, and according to the aspell site, aspell and pspell are now one. Php configures fine, but durning make, I get these errors -lcrypt -lresolv -lm -ldl -lnsl -lcrypt -o sapi/cli/php ext/mysql/libmysql/my_tempnam.o: In function `my_tempnam': /usr/local/src/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:103: the use of `tempnam' is dangerous, better use `mkstemp' ext/pspell/pspell.o: In function `zif_pspell_new': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:129: undefined reference to `new_pspell_config' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:131: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:136: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:143: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:150: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:165: undefined reference to `pspell_config_replace' ext/pspell/pspell.o:/usr/local/src/php-4.3.0/ext/pspell/pspell.c:170: more undefined references to `pspell_config_replace' follow ext/pspell/pspell.o: In function `zif_pspell_new': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:174: undefined reference to `new_pspell_manager' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:175: undefined reference to `delete_pspell_config' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:177: undefined reference to `pspell_error_number' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:178: undefined reference to `pspell_error_message' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:182: undefined reference to `to_pspell_manager' ext/pspell/pspell.o: In function `zif_pspell_new_personal': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:206: undefined reference to `new_pspell_config' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:209: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:210: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:213: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:218: undefined reference to `pspell_config_replace' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:225: undefined reference to `pspell_config_replace' ext/pspell/pspell.o:/usr/local/src/php-4.3.0/ext/pspell/pspell.c:232: more undefined references to `pspell_config_replace' follow ext/pspell/pspell.o: In function `zif_pspell_new_personal': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:256: undefined reference to `new_pspell_manager' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:257: undefined reference to `delete_pspell_config' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:259: undefined reference to `pspell_error_number' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:260: undefined reference to `pspell_error_message' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:264: undefined reference to `to_pspell_manager' ext/pspell/pspell.o: In function `zif_pspell_new_config': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:291: undefined reference to `new_pspell_manager' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:293: undefined reference to `pspell_error_number' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:294: undefined reference to `pspell_error_message' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:298: undefined reference to `to_pspell_manager' ext/pspell/pspell.o: In function `zif_pspell_check': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:326: undefined reference to `pspell_manager_check' ext/pspell/pspell.o: In function `zif_pspell_suggest': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:362: undefined reference to `pspell_manager_suggest' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:364: undefined reference to `pspell_word_list_elements' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:367: undefined reference to `pspell_string_emulation_next' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:368: undefined reference to `delete_pspell_string_emulation' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:370: undefined reference to `pspell_manager_error_message' ext/pspell/pspell.o: In function `zif_pspell_store_replacement': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:399: undefined reference to `pspell_manager_store_replacement' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:400: undefined reference to `pspell_manager_error_number' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:403: undefined reference to `pspell_manager_error_message' ext/pspell/pspell.o: In function `zif_pspell_add_to_personal': /usr/local/src/php-4.3.0/ext/pspell/pspell.c:436: undefined reference to `pspell_manager_add_to_personal' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:437: undefined reference to `pspell_manager_error_number' /usr/local/src/php-4.3.0/ext/pspell/pspell.c:440: undefined reference to
Re: [PHP] Database problem - works in Windows - not Linux
Lee P. Reilly wrote: Hi there, I'm moving an application from Windows - Linux, and am having a problem with the database. I have the following script to test my database connection (Linux): -=-=-=-=-=-=-=-=-=-=-=-=-=- snip =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= I'd put in a mysql_error() and see what the error message is. The username/password could be different. There were some posts here a while ago about problems with mysql_pconnect(), I don't know if they may be relevant but you could have a look through the archives and see. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Output Compression stops working after a while
I enabled output comression in php.ini with zlib.output_compression = On zlib.output_compression_level = -1 also, I loaded the gzip module in httpd.conf with LoadModule gzip_module modules/mod_gzip-1.3.19.1a.so Now, when I restart Apache, I get compressed output. But after an hour or so Apache stops compressing the output and sends it uncompressed. I check compression with phpinfo() and also by plain browsing the difference in speed is obvious. Any ideas what could cause this??? Any input appreciated! -Zavier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $$ Variable?
I'm trying to piece apart someone's code to see exactly what it is they're trying to do - This code was written for PHP 3.x, so it's not quite as nice as 4 (with $_POST, $_GET, $_SESSION, etc). There's this one part in particular that I have no idea what's trying to be done: if (isset ($cookie)) { while (list ($name, $value) = each ($cookie)) { $$name = $value; } } I'm assuming the $cookie array has cookie info stored in it, and it's trying to pull the data out of the array. The 2 parts of this I don't really understand are lines 2 and 3, 3 in particular. I'm guessing it's assigning $name the index, $value the element - What's really stumping me here though is the $$name = $value. What is a variable with $$ in front of it signify, and what is this trying to do? Any thoughts on this one? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php