[PHP] strip tags not working - any ideas ?
Hello all I am trying to strip all HTML and other tags from a document, I have read the docs and written a 4 line script that should do the job (from my point of view ! ). However it seems to have literally no effect. Heres the script : http://namx.co.uk/webstats/";); if (!($string = strip_tags($file))) print " error ! "; $strings = strtolower($string); print "strings: $strings"; ?> It doesnt lower case anything and it no strips no tags at , bascially its still the same source as it was unchanged. Obviously theres something I am missing here, but what ? Thanks for your thoughts Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip tags not working - any ideas ?
Jason Wong wrote: On Wednesday 18 June 2003 18:27, Neil wrote: I am trying to strip all HTML and other tags from a document, I have read the docs and written a 4 line script that should do the job (from my point of view ! ). However it seems to have literally no effect. Heres the script : http://namx.co.uk/webstats/";); $file is an array ... if (!($string = strip_tags($file))) print " error ! "; $strings = strtolower($string); .. you're trying to perform string ops on an array. Normally if you to to print() an array, you get "Array" returned. This is not the case, I know that file() returns arrays, but i think readfile() returns a string. any other ideas ? Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip tags not working - any ideas ?
John W. Holmes wrote: Jason Wong wrote: On Wednesday 18 June 2003 18:27, Neil wrote: I am trying to strip all HTML and other tags from a document, I have read the docs and written a 4 line script that should do the job (from my point of view ! ). However it seems to have literally no effect. Heres the script : http://namx.co.uk/webstats/";); $file is an array ... Actually, it's an integer telling how many bytes was read by readfile(). us2.php.net/readfile if (!($string = strip_tags($file))) print " error ! "; $strings = strtolower($string); .. you're trying to perform string ops on an array. you mean an integer... Use fopen() or file() to actually read the file data into a variable. Indeed fopen and fread works fine. Thanks for the heads up Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Add new loadable module in php
Skon Lapamnuaypol wrote: We use PHP 4.3.1 on Apache 1.3.27 (RedHat 7.3). We got a binary PHP rpm package from rpmfind.com. The problem occurred on v-webmail from phpguru.org. I already copied imap.so into /usr/lib/php4 and add an extension of imap.so on /etc/php.ini, then restart httpd. But, the application still can't see the imap module. I wonder that in the extension of php.ini, all of extension (.dll - windows platform) was commmented only mysql.so and imap.so were added. But, phpinfo command show a lot of loadable module. Just curious that where does phpinfo get the information from. - Original Message - From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "Skon Lapamnuaypol" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, June 18, 2003 4:43 PM Subject: Re: [PHP] Add new loadable module in php What platform are you running, where did you get php, do you have imap.so in the extension directory, did you restart webserver after changing its configuration? Skon Lapamnuaypol wrote: Hi, I'm newbie in PHP and tried to install webmail appliction on PHP engine. That webmail require a module IMAP,but my engine haven't have it yet. I tried to put a "extenstion = imap.so" in php.ini. But, the application still can't detect this module. Can I add php module without recompile PHP source. Thanks in advance, Skon L. Hello Where modules are concerned , you will need to stop and then start apache , as a reload/restart does not check for modules changes . I am not 100% sure of my explanation, but i know in pratice this is the case. Cheers Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Synchronize MYSQL
Khuram Noman wrote: Dear Members How to Synchronize two MYSQL databases in php Thanks khuram noman __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com Hello as usual there are a few ways to do tackle this job. My preference is to stop mysql and use rsync to transfer the data , then restart it. Mysql4+ supports clustering also. If you do not stop mysql while u do the sync you risk a corruption of copied data. See man rsync and mysql.com for details of each way. The clustering seems like allot of work to me , it depends how up to date you need to keep Cheers Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse_str () problems. using on the command line args ( argv[1]) - problem with php-4.2.2 ??
Hello All I am trying to use parse_str in my script , passing a variable. I have old code, working with php 4.1.2 working with the following script : [root@zion kickstart]# cat make-kickstart.php #!/usr/local/bin/php -q for some reason tho , under 4.2.2 it is not parsing the argument/s [root@zion kickstart]# ./make-kickstart.php name=lxmode NAME: Does any one know if anything changed in 4.2.2 , I swear it works under 4.1.2 or older. Thanks for any advice or info in advance !! Cheers Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Very easy question
Yes in Flash 5, basic variables for the input text fields and the correct script in the .php file, I just don't know what it could be at the moment. "Justin French" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Do you mean when POSTing a form? > > Justin French > > > on 26/09/02 10:14 PM, Neil Laker ([EMAIL PROTECTED]) wrote: > > > Have installed PHP v4 on IIS 5 server, all the connectivity works fine as > > for the sending but the main text variables will not come through. I think > > there must be a setting I have missed somewhere? I have checked the > > permissions and are set ok for the IGA can anyone help? > > > > Thanks in advance > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Flash and PHP?
Does anyone use this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Flash and PHP?
Thanks for the links, what I'm looking for is a simple form that communicates with a .php file on IIS 5 and then emails back to a e-mail address. Any help? (I have created the form with variables just need help with the .php) Thanks again "Joseph Szobody" <[EMAIL PROTECTED]> wrote in message news:20021029151802.85671.qmail@;pb1.pair.com... http://www.macromedia.com/desdev/mx/flash/articles/flashmx_php.html http://www.phpbuilder.com/columns/hill20011214.php3 "Neil" <[EMAIL PROTECTED]> wrote in message news:20021029140955.29707.qmail@;pb1.pair.com... > Does anyone use this? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Flash and PHP?
The entire site is flash. "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message news:001801c27f63$3a40a480$8102a8c0@;000347D72515... > [snip] > Thanks for the links, what I'm looking for is a simple form that > communicates with a .php file on IIS 5 and then emails back to a e-mail > address. Any help? (I have created the form with variables just need help > with the .php) > [/snip] > > Let me understand, you want a Flash form that submits variables to a PHP > page which will then e-mail something to an e-mail address? And Flash is > needed why? > > Jay > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Linux / PHP and passwords -( md5 function)
Hello all I am trying to generate a MD5 string equal to a known passwords MD5 string , with no luck in order to make a new password file i have tried use php's : $value = md5($string); and $value = crypt($string,$salt); the passwds in my systems /etc/shadow all start with $1 which i believe is standard for MD5 passwords of 32 length any one have any ideas ? Thanks in advance Neil M
[PHP] using eregi - what regular expression rules does it use ? works in linux ( grep ) but not PHP - help needed
There not much documentation in the online manual about eregi. Apart from the usage I need to know more about what regx it uses, in the linux shell , using grep i got it right for my needs .. I want to find and reject content with email address .. [desiredating@opie desiredating]$ echo "[EMAIL PROTECTED]" | grep "@*\." [EMAIL PROTECTED] [desiredating@opie desiredating]$ echo "meet me @ 8" | grep "@*\." --- the above is correct and fine , but see below , it doesnt work in php ( the same regular expression doesnt ) if (eregi("@.\.",$about_me)) { include "error_msg/error_email_in_profile.php"; $error =1 ; } What regular expression do i neep to use , is there any reference out there to tell me ? Urls / info is greatly appreciatted. Thanks in advance !! Neil -- Totally FREE dating site. FREE all-inclusive lifetime membership when you join today Meet and date new people. Thousands of members looking for someone like you == http://www.desiredating.com = Join FREE today, you have nothing to lose -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] A bit stuck with $$
Not sure if its me or the configuration of PHP I am trying to get the value of a variable, a variable variable ie // From Form $name = "My Name"; --- // from a list of values in a file $var="name"; $value=$$var; i// I thought I could do something as simple as this to get the correct value "My Name" into $value. print " $value "; // should print "My Name", I zip. I have played around with this bit of code from operators part of the manual and this does not appear to work, well for me at least. $foo = "test"; $$bar = "this is"; echo "${$bar} $foo"; // prints "this is test" Note: it is the same as echo "$test $foo"; // * for me it only prints out "test" Any Ideas Cheers Neil Regards Chester Cairns - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A bit stuck with $$
For me echo "$test -- $foo"; results in avalue -- Neil At 02:56 PM 27/08/2004, Curt Zirzow wrote: * Thus wrote Neil: > > > Not sure if its me or the configuration of PHP variable variables are rather standard and dont have any configuration settings. > > I have played around with this bit of code from operators part of the > manual and this does not appear to work, well for me at least. > > $foo = "test"; > $$bar = "this is"; > > echo "${$bar} $foo"; // prints "this is test" Everything is working so far as expected > Note: it is the same as > echo "$test $foo"; // * for me it only prints out "test" You are throwing me here.. the problem seems to be that $test hasn't been assign. By using your examples I can make $test actually be a value by doing this with the variable variable: $$foo = 'avalue'; // $test is assinge 'avalue' Is equivalent as doing: $test = 'avalue'; // $test is assinge 'avalue' And thus, without the actual $test assignment: echo "$test $foo"; will result in: "avalue test" HTH, Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Regards Chester Cairns - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading files with a single quote in the filename
Hi When uploading files using a type=file in a form, if a file is uploaded with a single quote the file gets truncated to whatever is after the quote eg. blah'sblah.txt will be uploaded as sblah.txt Is this a magic quotes issue? What is the best way to deal with it? Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files with a single quote in the filename
Thanks some answers: turning magic quotes on and off seemed to make no difference 1. single quotes aren't important to me but this application allows users to upload photos which often use descriptive filenames which sometimes have single quotes eg. "my mum's car.jpg". I replace the spaces with underscores but I can't get to the filename before the single quote and the text before it have been stripped. 2. the original filename is only important insofar as it often has descriptive information in it. 3. I can't really answer this question very well except to say that it happens in my development environment (IE6 on win2k with apache on win2k) as well as on my hosting server (IE6 on win2k and apache on linux). "Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: > Hi > When uploading files using a type=file in a form, if a file is uploaded with > a single quote the file gets truncated to whatever is after the quote > eg. > blah'sblah.txt > > will be uploaded as > sblah.txt > > Is this a magic quotes issue? I don't think so, test it by turning it on/off. > > What is the best way to deal with it? couple of questions: 1. are single quotes really necessary in filenames? 2. is the original filename really that important to you? 3. does this happen on just one browser/[client]platform? it could be a browser bug (i.e. it gets stripped on the clientside which would means thats its nothing to do with a PHP bug/setting/feature/misunderstanding/etc) > > Neil > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files with a single quote in the filename
Thanks Bret I have tried turning all reporting on - error_reporting(E_ALL); but that doesn't reveal anything significant I have looked in the logs but there is nothing significant there. Because the type is file in the form it is not handled like a post - the values go into an array called $_FILES There seems to be no way to intercept this before the filename gets truncated Thanks again Neil "Bret Hughes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, 2005-02-23 at 06:49, [EMAIL PROTECTED] wrote: > Hi > When uploading files using a type=file in a form, if a file is uploaded with > a single quote the file gets truncated to whatever is after the quote > eg. > blah'sblah.txt > > will be uploaded as > sblah.txt > > Is this a magic quotes issue? > > What is the best way to deal with it? I ran into a similar deal with a textbox and " a while back but I think the issue was sending it back to the browser after the browser sent it up. In the absence of direct help, I would first look to see where the truncation is occurring ie; what is the browser sending? can you post the value and see what your browser is sending it as? is there anything in the logs with error_reporting set to E_ALL? I found trouble shooting the upload process cumbersome since it would fail without any messages but that was before I started setting the error_reporting to also log messages. Not much help but all I got. Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files with a single quote in the filename
Hi Brett My form is effectively identical to yours Upload a file: No the first part of the file name is just dropped and the file with the truncated name is saved in the correct place. But with it escaping the quote do you mean that you end up with a file with \ in it? That would be an illegal filename. Neil "Bret Hughes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, 2005-02-23 at 16:40, [EMAIL PROTECTED] wrote: > Thanks Bret > > I have tried turning all reporting on - error_reporting(E_ALL); > but that doesn't reveal anything significant > > I have looked in the logs but there is nothing significant there. > > Because the type is file in the form it is not handled like a post - the > values go into an array called $_FILES > > There seems to be no way to intercept this before the filename gets > truncated > Well for another data point when I uploaded a file using our upload form the ' gets escaped on both IE6 (win98 running in win4lin) and galeon. test's qoutes.jpg becomes test\'s quotes.jpg on a fedora server with apache and php of course. I don't suppose the file gets put into a directory named with the first portion of the file? FWIW here is what my form tag looks like and the filechooser Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending Pictures to Cell Phones
On Wednesday 14 November 2007 18:47, Daniel Brown wrote: | On Nov 14, 2007 1:27 PM, <[EMAIL PROTECTED]> wrote: | > Hey list, | > | > I'm doing some R&D for a project at my job and my boss wants the | > ability to send pictures to cell phones. I was wondering if | > anyone had any experience with this or could point me in the | > right direction to get started. | > | > Thanks, | > Jeremy Hi Jeremy Delivering MMS can be done, but the ease with which it can be done with PHP depends on how well defined your target audience is. If they all use a specific phone, it will be easier than if you are aiming at handsets of indeterminate screen size and display capability. There are plenty of avenues to explore for getting multimedia messages to mobiles. -- Neil Bellamy (( aql.com )) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] V4 Vs V5 Issue
Hi First Post here, I hope this is the right place for this post. This is probably not a php problem, I think it may a configuration issue, but sorry I just dont know where to look I have a V4 site the calls an on line editor and part of the process is by window.onload. If I had to explain how it all works I could'nt JS is not my thing and this is a fairly old piece of code. anyways -- Have a bit of code that looks like this . . onResize="blockDefault();"> content; include($settings['app_dir'].'/js/core_js.php'); echo << window.onload=initEditor height="100%" class="framed"> . . . -- Under My V4 Sever it works fine .the Java script loads and an all is fine. On my V5 Sever I get the following Errors Line: 68 Char: 21 Error: Syntax error Code: 0 URL: .. and then Line: 600 Char: 11 Error 'initEditor' is undefined Code 0 URL Now the thing is, when I view source code in IE off both servers the the core_js.php is being read and is visible, the initEditor function is there for all the world to see. If I rename the initEditor function on the V5 version and add a new empty function I still get the same error messages. I dont have much hair and I am tearing out the rest as we speak :).I have no idea where to look so I am just hoping someone can point me in the right direction. Like I said in the beginning I think it must be a configuration issue but I just dont know what or where. Anyways TIA Cheers Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V4 Vs V5 Issue
Thanks Wolf I have replied to all, I hope that is the correct way here. A configuration issue on the PHP V5 Server . thats my problem, I dont know where I should be looking. The source code, php and JS is absolutely identical on both machines. Cheers Neil At 01:36 AM 2/07/2008, Wolf wrote: Neil <[EMAIL PROTECTED]> wrote: > Hi > > First Post here, I hope this is the right place for this post. > > This is probably not a php problem, I think it may a configuration > issue, but sorry I just dont know where to look Configuration issue of what? > I have a V4 site the calls an on line editor and part of the process > is by window.onload. If I had to explain how it all works I could'nt > JS is not my thing and this is a fairly old piece of code. > > anyways > Line: 68 > Char: 21 > Error: Syntax error > Code: 0 It's probably all JS, but if this is a PHP page that you've actually cut/pasted from, look at lines 67 and 68 and check to make sure you have a ; at the end of line 67. Or a ) or a } or some other closing brace that you could be using previously. Otherwise, check with a javascript list to see what the javascript errors are. HTH, Wolf -- 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] V4 Vs V5 Issue
Hi Thanks I have tested the path, that works fine. I set up a dummy file on the same path just to check that, it found that and printed out some echo'd text from that file. I can see the content of core_js.php file in the the IE view source view. At 01:43 AM 2/07/2008, Eric Butera wrote: On Tue, Jul 1, 2008 at 11:27 AM, Neil <[EMAIL PROTECTED]> wrote: > Hi > > First Post here, I hope this is the right place for this post. > > This is probably not a php problem, I think it may a configuration issue, > but sorry I just dont know where to look > > I have a V4 site the calls an on line editor and part of the process is by > window.onload. If I had to explain how it all works I could'nt JS is not my > thing and this is a fairly old piece of code. > > anyways > > -- Have a bit of code that looks like this > > . > . > onResize="blockDefault();"> > content; > > include($settings['app_dir'].'/js/core_js.php'); > > echo << > window.onload=initEditor > > > height="100%" > class="framed"> > . > . > . > -- > > Under My V4 Sever it works fine .the Java script loads and an all is > fine. > > On my V5 Sever > > I get the following Errors > > Line: 68 > Char: 21 > Error: Syntax error > Code: 0 > URL: .. > and then > > Line: 600 > Char: 11 > Error 'initEditor' is undefined > Code 0 > URL > > Now the thing is, when I view source code in IE off both servers the the > core_js.php is being read and is visible, the initEditor function is there > for all the world to see. > > If I rename the initEditor function on the V5 version and add a new empty > function I still get the same error messages. > > I dont have much hair and I am tearing out the rest as we speak :).I > have no idea where to look so I am just hoping someone can point me in the > right direction. > > Like I said in the beginning I think it must be a configuration issue but I > just dont know what or where. > > Anyways TIA > > Cheers > > Neil > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Compare your rendered output from the v4 and the v5. You might see something in the php5 version that has some sort of error displaying to screen that causes a parse error inside your JS block that wasn't there before. Something might have changed about the way your settings variable works too. Do a var_dump($settings['app_dir'].'/js/core_js.php') and see if it actually prints out a real path to a file that exists. -- 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] Re: V4 Vs V5 Issue
Hi Unfortunately this editor does not run in any other browsers. however I do not believe that it is the java script that is the problem because it runs and works and has done so for years on the current and earlier V4 servers. Cheers Neil At 07:10 AM 2/07/2008, Jon Drukman wrote: Neil wrote: Hi Thanks I have tested the path, that works fine. I set up a dummy file on the same path just to check that, it found that and printed out some echo'd text from that file. I can see the content of core_js.php file in the the IE view source view. debugging javascript in IE is about as much fun as slamming your head in a car door. try it in firefox with firebug installed, it should give you much better feedback about what is going on. -jsd- -- 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] V4 Vs V5 Issue
Thanks Jim Two things come to mind. 1) Is their any PHP inside you javascript file that needs to be parsed? And if so, is the new V5 install configured in such a way that it parses/processes javascript files? where the old install was processing javascript files. This would be a configuration issue from the actual web server POV. i.e. Apache, lighttpd, etc... Once reconfigured, make sure you restart your web server. Yes there is PHP inside the javascript that is being passed. As an exorcise I was just looking at deleting it all out of the code and seeing what happens, however it is everywhere. The Webserver with the V5 PHP is Apache 2.2.4, but I can not really see where I would make the changes you are suggesting. The older server with V4 is Apache 1.34.4 2) Is your code using short tags in php? This allows the programmer to use enable short tags in the new version of PHP. I think php 5 comes with short tags disabled and version 4 had it enabled by default. This setting would be found in your php.ini file on the server. If you need to change the setting, make sure you restart your httpd server before testing. Short tags is enabled and working most of the application is short tagged. Cheers Neil Just a couple of thoughts -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] V4 Vs V5 Issue
Thanks Jim Will add some more to this. The PHP that is parsed inside this file and the JS is I think working correctly because the values are populated in the JavaScript output that is being displayed in the IE source viewer. For instance there is a stack of variable that are defined up front, these get information from PHP, these have the same information as the V4 server and I can therefore only presume the correct information. Cheers N Two things come to mind. 1) Is their any PHP inside you javascript file that needs to be parsed? And if so, is the new V5 install configured in such a way that it parses/processes javascript files? where the old install was processing javascript files. This would be a configuration issue from the actual web server POV. i.e. Apache, lighttpd, etc... Once reconfigured, make sure you restart your web server. Yes there is PHP inside the javascript that is being passed. As an exorcise I was just looking at deleting it all out of the code and seeing what happens, however it is everywhere. The Webserver with the V5 PHP is Apache 2.2.4, but I can not really see where I would make the changes you are suggesting. The older server with V4 is Apache 1.34.4 2) Is your code using short tags in php? This allows the programmer to use enable short tags in the new version of PHP. I think php 5 comes with short tags disabled and version 4 had it enabled by default. This setting would be found in your php.ini file on the server. If you need to change the setting, make sure you restart your httpd server before testing. Short tags is enabled and working most of the application is short tagged. Cheers Neil Just a couple of thoughts -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare -- 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] V4 Vs V5 Issue
Hi Thanks to those who got back to me on this. Turns out the issue was HTTP_POST_VARS..GET, SERVER being so depreciated that they no longer worked at all. Changed all to _POST..._GET, _SERVER etc and all worked fine. I guess they will make a programmer of me yet...hmmm one day maybe. Anyway thanks again Cheers Neil At 01:27 AM 2/07/2008, Neil wrote: Hi First Post here, I hope this is the right place for this post. This is probably not a php problem, I think it may a configuration issue, but sorry I just dont know where to look I have a V4 site the calls an on line editor and part of the process is by window.onload. If I had to explain how it all works I could'nt JS is not my thing and this is a fairly old piece of code. anyways -- Have a bit of code that looks like this . . onResize="blockDefault();"> content; include($settings['app_dir'].'/js/core_js.php'); echo << window.onload=initEditor height="100%" class="framed"> . . . -- Under My V4 Sever it works fine .the Java script loads and an all is fine. On my V5 Sever I get the following Errors Line: 68 Char: 21 Error: Syntax error Code: 0 URL: .. and then Line: 600 Char: 11 Error 'initEditor' is undefined Code 0 URL Now the thing is, when I view source code in IE off both servers the the core_js.php is being read and is visible, the initEditor function is there for all the world to see. If I rename the initEditor function on the V5 version and add a new empty function I still get the same error messages. I dont have much hair and I am tearing out the rest as we speak :).I have no idea where to look so I am just hoping someone can point me in the right direction. Like I said in the beginning I think it must be a configuration issue but I just dont know what or where. Anyways TIA Cheers Neil -- 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] does //commenting reduce performance?
Adam, > I have always had the opinion that the more comments you put into php > scripts, the slower they will run because there is more data to be read... > Can someone tell me if there is any truth in this or whether commenting has > absolutely 'no' impact on the performance of a script? An answer proposed that there was little impact, but then suggested comments not be used within loops (one presumes from this, the concern is that even a little impact can mount up when repeated many times). Why don't you run a microtime testbench to time a commented and an uncommented loop, settle your mind, and report back with REAL information!? Computer programming is the embodiment of 'write once, run many' manta. Comments are no use at all during execution, but should be intended to be of considerable assistance during the writing/maintaining phases. Never give anyone an excuse for not writing (meaningful) comments - enough energy already goes into creative excuses for that - and you may be the next to suffer from some predecessor's arrogance! There are routines available which take in a developer's script and output a comment-less, stripped-down for maximum slipstream, dense code, version - ready for execution. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] does //commenting reduce performance?
Neatly done Ernest! Also in showing how these questions are best answered with five minutes on the PC, than a msg to the list... > At 12:58 24.11.2002, DL Neil said: > [snip] > >Why don't you run a microtime testbench to time a commented and an > >uncommented loop, settle your mind, and report back with REAL information!? > [snip] > > Some time ago I've made myself a framework for such tests and have run it > against a commented loop. This test was run on a dual PIII/1000 Dell server. > > $hpr = _fwx_profile_start('Loop with end-of-line comment', true); > for ($i = 0; $i < 100; ++$i) { > $a += 1;// this is an end-of-line comment > } > _fwx_profile_end($hpr, $i); > Average time per loop: 0.059 msec > > $hpr = _fwx_profile_start('Loop with inline comment', true); > for ($i = 0; $i < 100; ++$i) { > /* this is an inline comment */ $a += 1; > } > _fwx_profile_end($hpr, $i); > Average time per loop: 0.059 msec > > $hpr = _fwx_profile_start('Loop without comment', true); > for ($i = 0; $i < 100; ++$i) { > $a += 1; > } > _fwx_profile_end($hpr, $i); > Average time per loop: 0.059 msec > > Conclusio: I didn't find any measurable difference in these loops, be it an > end-of-line comment, an inline comment, or no comment. > > > -- >>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] does //commenting reduce performance?
Ernest, > Some time ago I've made myself a framework for such tests and have run it > against a commented loop. This test was run on a dual PIII/1000 Dell server. > > $hpr = _fwx_profile_start('Loop with end-of-line comment', true); > for ($i = 0; $i < 100; ++$i) { > $a += 1;// this is an end-of-line comment > } > _fwx_profile_end($hpr, $i); > Average time per loop: 0.059 msec > > $hpr = _fwx_profile_start('Loop with inline comment', true); > for ($i = 0; $i < 100; ++$i) { > /* this is an inline comment */ $a += 1; > } > _fwx_profile_end($hpr, $i); > Average time per loop: 0.059 msec > > $hpr = _fwx_profile_start('Loop without comment', true); > for ($i = 0; $i < 100; ++$i) { > $a += 1; > } > _fwx_profile_end($hpr, $i); > Average time per loop: 0.059 msec > > Conclusio: I didn't find any measurable difference in these loops, be it an > end-of-line comment, an inline comment, or no comment. =Apologies: I hit 'Send' on the preceding msg, even before signing off... Duh! =I have a similar test bench/frame, but which only puts out microtime differences. My personal/dev PC is an Armada portable with 266MHz processor and so is considerably more modest than your own beastie. =I find that because the wee beastie is running PHP, Apache server, MySQL server, etc, etc; that multiple runs of the same code can yield considerable differences in execution time - see also warnings in manual, eg 'caching'. Accordingly I run six cycles and record the last three: =Herewith: End of line comment: 4.3118, 4.415713, 4.342078 Inline comment: 4.331843, 4.403446, 4.339082 Loop without comment: 4.415728, 4.399776, 4.420114 =however a quick analysis shows that the fastest-slowest differences are: .104, .072, and .021 (secs, resp) =the differences between test types run to: slow end: .012, and .017 fast end: .020 and .068 =In other words, apart from the first set of tests, any and all differences are insignificant/disappear into 'noise'. However, if the "Loop without comment" results make sense to you - you're a better man than I, Gunga Din! =Concur completely with your own analysis, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] security of stand alone script
Hi gamin, >Running Red Hat 7.2, PHP 4.0.6. Is there any way of knowing if a certain > PHP script was run from the command line, shell script or through the > webserver (Apache). May be i could check the user calling the script and > find out but how would i do that ? There is a difference in the way argc and argv are managed - see manual. Also (do two phpinfo() runs to check - one under Apache and one from the command line) depending upon the web server (Apache in our cases) there are whole sections of the 'standard output' that do not have relevance from the command line (because there is no web server!), eg SERVER_SOFTWARE and SERVER_SIGNATURE. Should you figure out something better than this, please let me know too! Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
Excuse me breaking in...somewhat similar problem: Have set up a client recently, preaching security persuaded them into updating so that could run Register_Globals=Off. Now they want to install a 'wiki' which requires (to my horror) Register_Globals=On. Short of two Apache/PHP servers, what is a logical way to structure things so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more securely? Please advise, =dn > You cannot do it inside a script as the register_globals magic happens > before the script starts executing, so toggling the setting at runtime is > too late. > > -Rasmus > > On Mon, 25 Nov 2002, Tariq Murtaza wrote: > > > Dear All, > > > > I am wondering if anyone shed some light. > > i am thinking of setting value for php.ini variables like > > register_globals = ON/OFF at runtime (within our php script). > > Is there any function built-in in php?, or can we do it ourselves. > > > > Looking forward, > > Thanks > > > > Tariq > > > > > > > > -- > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting values of php.ini file at runtime
Justin, Neat! Don't limit thoughts to PHP when can solve it in Apache - thank you, =dn > a .htaccess file in the directory you want RG OFF (ie /wiki/) should do the > trick: > > > php_flag register_globals on > > > This seems to work for me... > > > on 25/11/02 10:37 PM, DL Neil ([EMAIL PROTECTED]) wrote: > > > Excuse me breaking in...somewhat similar problem: > > > > Have set up a client recently, preaching security persuaded them into > > updating so that could run Register_Globals=Off. Now they want to install a > > 'wiki' which requires (to my horror) Register_Globals=On. > > > > Short of two Apache/PHP servers, what is a logical way to structure things > > so that the 'wiki' runs 'insecure' but other/'my' PHP work runs more > > securely? > > > > Please advise, > > =dn > > > > > >> You cannot do it inside a script as the register_globals magic happens > >> before the script starts executing, so toggling the setting at runtime is > >> too late. > >> > >> -Rasmus > >> > >> On Mon, 25 Nov 2002, Tariq Murtaza wrote: > >> > >>> Dear All, > >>> > >>> I am wondering if anyone shed some light. > >>> i am thinking of setting value for php.ini variables like > >>> register_globals = ON/OFF at runtime (within our php script). > >>> Is there any function built-in in php?, or can we do it ourselves. > >>> > >>> Looking forward, > >>> Thanks > >>> > >>> Tariq > >>> > >>> > >>> > >>> -- > >>> 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 > >> > >> > > > > Justin French > > http://Indent.com.au > Web Development & > Graphic Design > > > > -- > 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] does //commenting reduce performance?
Jason, ad infinitum, ad nauseum However it was your recent post that (sig file) quoted the Freudian: ontogency recapitulates phylogeny We should make them become more like us - even if we kill them in the process! =dn > On Sunday 24 November 2002 22:58, DL Neil wrote: > > Neatly done Ernest! > > Also in showing how these questions are best answered with five minutes on > > the PC, than a msg to the list... > > ... until someone else comes along and asks a similar question and you have to > show them again how it's best answered with five minutes on the PC, than a > msg to the list ... ad infinitum > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Who's on first? > */ > > > -- > 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] array manipulations
Mattia, > Can anyone suggest an ELEGANT way to find out if an array is made of empty > strings or not? > example > $a = Array( '' , '' , '' ); //ok > $b = Array( '' , '' , 'error' ); // not ok > $c = Array( 'error' , '' , 'error' ); // not ok implode() then check for nullstring/count characters. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If statement w/ multiple conditions
Ed, Assuming there will be a response from the db-tbl, here is another choice: if ( $lineone . $linetwo . $linethree . $linefour > "" ) { //show it to the user and ask if they want to change it } else { //prompt for information } Do you mean that the db-tbl will have a row of data even if the four fields are empty, or if there is no data (in those fields) will that imply that there is no row (and thus different code needed)? =dn > All four must be an empty string. I will be pulling the values from a > MySQL database. If these fields are empty I'll be prompting for > information. If any one of them contain anything I'll be showing it to > the user and asking if they want to change it. > > Thanks, > > Ed > > > On Tue, 26 Nov 2002, Ernest E Vogelsinger wrote: > > > At 13:50 26.11.2002, [EMAIL PROTECTED] said: > > [snip] > > > I'll be trying to use a routine that checks 4 seperate variables for > > >content and need to know the easiest method to do so. The function works > > >on 2 conditions; either all the variables are empty and I do something or > > >I do something else. > > > > > >$lineone > > >$linetwo > > >$linethree > > >$linefour > > > > > > Would you use > > > > > >if ($lineone && $linetwo && $linethree && $linefour = "") > > [snip] > > > > Your expression yields true if 1-3 are not-empty AND four is an empty > > string. Not sure if that's what you want. > > > > All empty: > > !($lineone || $linetwo || $linethree || $linefour) > > --or-- > > !$lineone && !$linetwo && !$linethree && !$linefour > > > > All set: > > $lineone && $linetwo && $linethree && $linefour > > > > > > -- > >>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 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] Getting the script path of a commandline script
Ryan, > Anyone know how to get the script path (not the current working directory, > but the actual path of the executing script) of a commandline script? > > I've dug through the docs and can't find this anywhere. None of the > typical $_SERVER variables return the script path (although several of > them return the filename, hooray for redundancy). The docs say several > times that getcwd() will NOT return the path of the executing script, but > they don't mention how to get it. _SERVER["argv"] [ 0 ] gives the full path to the script (including the script's name and filetype) =dn PS if you want to know more, run the standard PHPINFO() through the command line, piping to an output.HTML file, then drop that into your browser! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Invalid Charactors in a string.
Gidday Philip, Full answer: http://www.oreilly.com/catalog/regex/ Short answer: PHPBuilder etc have articles introducing the use of RegExes (Regular Expressions) for this sort of thing. (but please not the Arthurian "how do I validate an email address"...) Regards, =dn > Where should i start, tips wanted. > > I would like to check a username string for valid charactors before the name > is processed. > > Someone point me in the right direction please > > --- > Philip J. Newman. > Head Developer. > PhilipNZ.com New Zealand Ltd. > http://www.philipnz.com/ > [EMAIL PROTECTED] > > Mob: +64 (25) 6144012. > Tele: +64 (9) 5769491. > > VitalKiwi Site: > Philip J. Newman > Internet Developer > http://www.newman.net.nz/ > [EMAIL PROTECTED] > > * > Friends are like Stars, > You can't always see them, > But you know they are there. > > * > > ICQ#: 20482482 > MSN ID: [EMAIL PROTECTED] > Yahoo: [EMAIL PROTECTED] > AIM: newmanpjkiwi > > > > -- > 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] php/mysql report builder
Hi Mike; > sorry for posting this mysql question again. im searching for a report > builder for mysql specifically for creating reports for > invoice/receipt..etc. > just like crystal reports and oracle report builder. or is there any > suggestion to do it in PHP . On my travels (FWIW) I have seen nothing as sophisticated as Crystal/Oracle*Reports (and certainly not open/free) - however I have been v.pleased not to be asked to provide such (well I was once, but he was such an Excel 'expert', I gave him the data and let him while away many 'happy' hours...) You have reminded me that before I was dragged away onto another project/product set, I had started to play with JaneBuilder (www.seejanecode.com/). Which is really simple but seems to do a heap of basic 'grunt work' of turning table schema into display/data-entry forms, etc. May be a start!? Please let us know your findings, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IPs comparing
Hi Jesús, > I have several subnets in my network and want to show different webs > depending on the subnet the user was. > > I know how to get the IP but not how to compare two IPs numeracally, I mean: > > > If ((USER-IP > 192.168.0.1) && (USER-IP < 192.168.0.255)) > Else if ((USER-IP > 192.168.1.1) && (USER-IP < 192.168.1.255)) > ... > > What do you suggest me? I suggest treating them as strings, and use (IF) equality/switch statements to deliver the appropriate web... Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detecting email bounces sent by the mail function?
Hello Ade, > Is it possible to detect with PHP whether an email sent using the PHP > 'mail' function has bounced back or has not been delivered? > > I currently all ready check the email address using the 'ereg' function > before the mail function is called, but this only checks the format is > valid beforehand. Yes, and No! If you use the ReturnPath header SOME/most email servers will bounce msgs that they can't deliver to an actual mailbox back to you (others drop such msgs onto an Admin somewhere, lose them in the ether (the msgs not the Admins...) etc, etc). Accordingly, use a distinct address for this/email filing rules. Opt-in email schemes which send a welcome/confirm email to new customers do so for this reason - the only way to verify an email address is to use it (and get some feedback from the addressee). Of course, once you have 'located' a new user, you still have to cope with those who close email accounts without advising you... It's a wonderful world! =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
Hello Martin, > I start a console app with > > php myscript.php4 (just prints "ok"). > > How can I give parameters to it? I tried: > php myscript.php4 myparameter > php myscript.php4?myparameter > php myscript.php4?param=myparameter > > But always php just returns without doing nothing (not even giving an > error or printing "Ok"!) I'm using PHP 4.2.3. on Windows2000). I'm using the same version/platform and things work fine (for me). Manual: Chapter 23. Using PHP from the command line You are correct the first time. What do argv and argc tell you? Is the php.ini file set up so that these variables are shown/valid? Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to give parameters to a console php-script?
Martin, Ah yes, the famous 'read the upgrade notes - gotcha'! Well done, you figured it out... =dn > ll I found a > register_argc_argv = On > > in my php.ini, which should work then. But I also found, that I have to use > > print "Ok: ".$_SERVER["argv"][1]; > > instead of > print "Ok: ".$argv[1]; > > Martin > > > > -- > 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] Test links?
Beth, > When fopen successfully opens a file it populates an array > $http_response_header, which you can examine to see if the link works or > not - I don't believe you can actually get the file itself, but since > that's not what we're after that's not a problem! I noticed this reference to "$http_response_header" and straightaway quizzed the manual, only to find that the only references to it (eg file open) lead nowhere. Have gone through a few other pages, looking to see if I might happen upon some detail, but failed. Sadly you don't refer to it in the code snippet provided (below). Any code I've attempted blindly has failed/reported errors. Please point me in the right direction (otherwise I guess it'll be time to download the new v4.3.0-RC and risk the bleeding edge - which according to the manual does something different anyway...) =dn > Having said that, fopen produces a very annoying error if it doesn't > find the page, but I found the following works: > > > $SQL = "SELECT linkurl, linkID FROM links"; > $result = mysql_query($SQL); > > while($linkdata = mysql_fetch_array($result)){ > > $fp = fopen($linkdata['linkurl'],"r"); > if($fp) > { > echo "".$linkdata['linkurl']." is still valid."; > > }else{ > > echo "".$linkdata['linkurl']." is invalid. Updating > database... "; > > $SQL = "UPDATE links SET status = 0 WHERE linkID = > '".$linkdata['linkID']."'"; > $result2 = mysql_query($SQL); > if($result2) > { > echo "Database updated"; > } > } > > } > ?> > > Rather than deleting the link, it's probably better to set a flag to > show it was invalid last time you checked, but check it again next time. > Or you could keep a count of the number of failed attempts, and delete > if it goes beyond 3 or so. > > Not sure how to supress the warning message that PHP automatically does > when you haven't got a valid URL though. > > Hope this works for you! > > Beth Gore > -- > http://bethanoia.dyndns.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test links?
Rob/Beth, The code should also consider: 1 updating the db if the link is 'valid', ie if previously it had been 'down'! 2 putting an @ to prevent any errors causing a hard-stop at the fopen line 3 that the url/database must contain protocol information, ie http://www.nytimes.com not www.nytimes.com. Thanks for the discussion, =dn > Rob Packer wrote: > > >Okay, I'm confused... file, fopen, and fsockopen seem to say not found on > >alot valid URLs... does this look to be correct usage? > >$url = $row[0]; // just get the url from the db > >$fp = implode ('', file ($url)); > > if (!$fp) {echo "Unable to access file"; } > > else { fclose($fp); echo "The link is working!"; } > > > >It seems I always get this warning... > > > >Warning: Supplied argument is not a valid File-Handle resource in > >/web/home/nrc.net/www/robert/links4.php on line 11 > > > >If someone can tell me what I'm doing wrong, I'd appreciate it. > > > >Thanks, > >Robert > > > > > > > > > > > When fopen successfully opens a file it populates an array > $http_response_header, which you can examine to see if the link works or > not - I don't believe you can actually get the file itself, but since > that's not what we're after that's not a problem! > > Having said that, fopen produces a very annoying error if it doesn't > find the page, but I found the following works: > > > $SQL = "SELECT linkurl, linkID FROM links"; > $result = mysql_query($SQL); > > while($linkdata = mysql_fetch_array($result)){ > > $fp = fopen($linkdata['linkurl'],"r"); > if($fp) > { > echo "".$linkdata['linkurl']." is still valid."; > > }else{ > > echo "".$linkdata['linkurl']." is invalid. Updating > database... "; > > $SQL = "UPDATE links SET status = 0 WHERE linkID = > '".$linkdata['linkID']."'"; > $result2 = mysql_query($SQL); > if($result2) > { > echo "Database updated"; > } > } > > } > ?> > > Rather than deleting the link, it's probably better to set a flag to > show it was invalid last time you checked, but check it again next time. > Or you could keep a count of the number of failed attempts, and delete > if it goes beyond 3 or so. > > Not sure how to supress the warning message that PHP automatically does > when you haven't got a valid URL though. > > Hope this works for you! > > Beth Gore > -- > http://bethanoia.dyndns.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Triggering a PHP Script
Ryan, > My Problem: > I've got a PHP script (running on Apache) that can take several hours > to complete. The script sends out a newsletter to those who have > requested it. When calling this script from a web browser, the browser > hangs until the script has fully executed. If the user hits "Stop" > while the script is running, it will terminate the script. > > My Questions: > What is the best way to trigger this script? Is there a way to do it > without using a CGI script? I am basically wondering if there is a way > to create a "trigger this php page" script that will run the script on > Apache and not hang the browser. Also, are there any problems calling > MySQL from a PHP CGI script? First: trust that you are only sending to opted-in clients!? (we're kind of sensitive about spammers around here!) The manual is your friend: Chapter 23. Using PHP from the command line. Add code to prevent PHP from timing-out (see another current thread) and that takes care of your program. It will now run, outside the browser, in the background, and you/your user can carry on using the browser... As far as "trigger" goes, you can type the command into the command line, or run some sort of 'job', or set it up to run off a scheduler, eg CRON or AT/Scheduled Tasks. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date
Hi Shaun, > please could someone tell me how i can return a month in text from an int ie > getMonth(12) > returns Decmber. Is this possible? No. If you want to stick with this, write your own function to look up a text array. If the "12" is part of more data coming in from a form or db (for example), then give us the wider picture and a 'built-in' solution may become possible. =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] My first post
Hi Victor, Welcome to the wonderful world of PHP! > I'm new in PHP. Could you point me where can i download a sample script > about how can i paginate some results? PHP essentially exists to output HTML. You cannot paginate in HTML (although there is some fancy CSS that could be employed). Sorry, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expresion Work on IP address
Hello Dev, > Now I am continuing on with the same script and I need to check for valid > IP address form. > Currently I have: > > $ip="255.255.255.0"; > if (preg_match ("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $ip)) { > print "Good Ip"; > } else { > print "Bad Ip"; > } > > This does work kinda. It checks to see if the 4 sets of numbers are well > there and numbers. > The problem I am having is that it does not check to see if the IP is in a > proper range ie less than 255.255.255.255 > So you could enter 256.256.256.999 and it will say that it is a good IP. > > Any clue how I would change it to check for that I'm reading my way through Friedl's, "Mastering Regular Expressions", O'Reilly, 2002. This is discussed in pp187-9, but I haven't had a chance to 'play' with it yet (!) and indeed he comments that it is one of those topics that you can attempt to refine and refine, but may be equally well off by sticking with what you have (surround the individual octet values with parentheses and then perform the semantic checking in PHP - as you discuss). What he comes up with observes the shorter range of digits for the first two digit positions of a (possible) three digit octet expression (in decimal), eg the first digit is either 0, 1, or 2 or not present at all. So if the first digit is a 1, then the next digits can be anything. If the first digit is a 0 or a space/non-existent then... However if the first digit is a 2, then the next digit may not exceed 5 [0-5]. If it is 5 then the last digit is similarly constrained, but if the second digit is less than 5, the third can be any digit. NB the 0.0.0.0 and 255.255.255.255 issues remain Thus the main component (handling each octet) is the basic code: ([01]?\d\d?|2[0-4]\d|25[0-5])\. which in English comes out as something like: a zero and a one may be present and followed by a digit and possibly another digit, or a two will be present, followed by a digit in the range 0 through 4, followed by another digit, or a two and a five will be present followed by a digit in the range 0 through 5, and then a dot/separator. This turns the whole shebang into: ^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2 [0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$ I'm sorry, but that's going to be diabolic to read after the email has had at it. The ^ and $, begin/end are necessary to ensure that there aren't over-running digits afore or aft of the IP addr. NB this is NOT tested (by me). I'm not sure if this code (the options in particular), as it is written, can be pasted straight into PHP's version of PCRE. YMMV! If you try it, please send feedback, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expresion Work on IP address
John, > I think it'd be hard to verify the range with a regex. ip2long and long2ip > do not validate. So, an option would be to write your own little function > that splits the $ip on the period, verifies there are 4 parts, then checks > that each part is between 1 and 255 inclusive. My other post on the subject notwithstanding, I agree. When I get time/when I get a round tuit, I'd like to do a performance test on the (short) IP RegEx against what you have outlined: explode against "." run resultant array through 0-255 validation function - and still have the semantic issues of 0.0.0.0, etc... Meantime, will sit here whistling and quietly muttering into my beard (and dreaming of tuits), =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expresion Work on IP address
Dev, Nice work! Thanks for implementing the book's algorithm/proving it in PHP-PCRE, and I do like your extension into an internal/external function. I've not implemented your code (bookmarked for later) but some initial comments: - don't forget some of the other 'funnies' in the IP addressing scheme, most notably 127.0.0.1 = localhost (which is also an 'internal' address) - I'd need to read/remind myself of others... - in the $parts[0]>=255 type of construct, remember that the > is superfluous - or the RegEx is overly specific (hence the discussion point earlier) - also the $parts[0] is a string, so "255" will be (marginally) faster - similarly you could make $ip_state="0"; into a boolean expression (and function return value) which might enable the function call to read more smoothly - regardless, $ip_state is currently sometimes treated as a string and once as an integer. - I don't know your IP allocations but in net_check() shouldn't all the if() logical ops be ANDs? Any thoughts of extending it to work with IPng addresses (or whatever they're calling it these days)? Great stuff, keep it coming! (and when you've finished perhaps you could submit it to one of the script libraries/improve on what they might already have?) =dn > Well after reading John'ss and DL Neil's replys i came up with 2 functions. > The first is to check to see if the entry is a valid IP address and the > Next is to determine if it is a Private Network IP or not!. > > You can see this in action at: > http://www.my-tangled-web.net/codebank/code/ip_check.php > and the sorce for that page is at: > http://www.my-tangled-web.net/codebank/getsource.php?dir=&file=ip_check.php > > Please if you test it and find a problem let me know! > > Thanks > > > function ipcheck($ip_chk){ > $parts=explode(".",$ip_chk); > if (preg_match > ("/^([01]?\d\d?|2[0-4]\d|25[0-4])\.([01]?\d\d?|2[0-4]\d|25[0-4])\.([01]?\d\d ?|2[0-4]\d|25[0-4])\.([01]?\d\d?|2[0-4]\d|25[0-4])$/", > $ip_chk)) > { > if($parts[0]==0 || $parts[0]>=255 ||$parts[1]>=255 || > $parts[2]>=255 || $parts[3]>=255){ > $ip_state="0"; > } > elseif($parts[0]<255 && $parts[1]<255 && $parts[2]<255 && > $parts[3]<255){ > $ip_state="1"; > } > } > else { > $ip_state=0; > } > $this="that"; > return $ip_state; > } > > function net_check($ip_2_chk){ > $parts=explode(".",$ip_2_chk); > if($parts[0]==10){ > $network="internal"; > } > elseif($parts[0]==172 && $parts[1]>=16 || $parts[1]<=31){ > $network="internal"; > } > elseif($parts[0]==192 && $parts[1]==168){ > $network="internal"; > } > else { > $network="external"; > } > return $network; > }; > > At 07:47 PM 12/4/2002 +, DL Neil wrote: > >John, > > > > > I think it'd be hard to verify the range with a regex. ip2long and long2ip > > > do not validate. So, an option would be to write your own little function > > > that splits the $ip on the period, verifies there are 4 parts, then checks > > > that each part is between 1 and 255 inclusive. > > > > > >My other post on the subject notwithstanding, I agree. > > > >When I get time/when I get a round tuit, I'd like to do a performance test > >on the (short) IP RegEx against what you have outlined: > > > >explode against "." > >run resultant array through 0-255 validation function > >- and still have the semantic issues of 0.0.0.0, etc... > > > >Meantime, will sit here whistling and quietly muttering into my beard (and > >dreaming of tuits), > >=dn > > > > > >-- > >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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] empty string parameters to backslashes?
Hey Andy, > I'm trying to track down a problem with someone else's > code. Our hosting service changed PHP versions on us > (up to 4.0.6), and everything broke. I think I have > tracked down at least part of the problem. We have a >... Ascertain differences by printing out a phpinfo() report for the new config and comparing with previous (obvious logic flaw noted!). It is as important for developers (as for installers) to read the ChangeLog (http://www.php.net/ChangeLog-4.php) to see what's new/different between versions. > But the output of the print statement looks like this: > funA START: file: productBrief, name: \, alt: \, size: 177\ > So where did the darned backslashes come from? Any ideas? Magic_quotes will do this. Check out manual: LXXIX. PHP Options&Information - the hosting service may have changed the setting on you. Follow links to learn how to SET and GET from within scripts. Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking for Overlapping Dates
Hi Thomas, > SELECT * from $DB_TBLName WHERE > (Trim(WorkerEmail)='$userReplacementEmail') > AND AND OR OR OR OR OR This is all a bit complicated, and a simple boy like me gets lost too easily. KISS principle: Keep it simple... You have two employees: A, so named because he Already has Annual leave Approved, and B, so named because he is Begging to Be allowed to Break out. Let's imagine we're playing with a wall-chart/wall-planner to assess requests prior to granting approval. So we mark off which days A will be away and then view which days B would like to go against existing requests. Month A Month BMonth C Month etc A <---> B <> Assuming the email/fonts haven't mucked-up my sketch, you can see that B's request should be denied, because A has already booked the time-out. Now let's use the diagram to build an algorithm. How many ways are there that A and B could overlap? (hint: four) Not overlap? (hint: two) Which is the easiest to implement in code? Now you can ask, which language should I code in? Answer: stay as close to the source as possible, ie use SQL (or in this case pseudo-SQL(!)). SELECT a AS Colleague, CONCAT( astart - afinish ) AS PermissionDenied FROM tbl WHERE bstart < afinish OR bfinish > astart; Before this will work, you will need to add another WHERE clause to establish who is the employee's "replacement". The above lists a reason for rejection - you can reverse the logic, at your peril. Trust this assists, =dn PS The complicating question I wanted to ask from the word "go" is: what if one person can have more than one other employee act as his/her "replacement"? > Background: > > > I've created a vacation-request application for our company's intranet. > When an employee requests a vacation, he has to list the name of another > employee who will 'fill in' for him while he is gone. > > Before a vacation request can be saved in MySQL, I need to check to make > sure that the person listed as the employee's replacement during this time > has not already requested a vacation during the same time period...to > check to be sure that the two vacation periods do not overlap. > > Date Ranges: > > > I have fields saved in MySQL called unixStartDate & unixEndDate that are > unix timestamps for the first day of the employee's vacation and the last > day of the emplosyee's vacation. > > I have tried to do a check using purely SQL, but this doesn't account for > all possibilities of overlapping dates: > > (unixStartDate is the unix timestamp for the replacement, whereas the PHP > var $unixStartDate is the unix timestamp for the employee who wants to > post a new vacation request) > > $checkSQL = "SELECT * from $DB_TBLName WHERE > (Trim(WorkerEmail)='$userReplacementEmail') > AND (Status < 40) > AND > ( > ( > ($unixStartDate = unixStartDate) > ) > OR > ( > ($unixEndDate = unixEndDate) > ) > OR > ( > ($unixStartDate = unixEndDate) > ) > OR > ( > ($unixEndDate = unixStartDate) > ) > OR > ( > (unixStartDate < $unixStartDate) && (unixEndDate > $unixEndDate) > ) > OR > ( > (unixStartDate > $unixStartDate) && (unixEndDate < $unixEndDate) > ) > ) > "; > > So I think what I instead need to do is use PHP code instead of SQL to > check for overlapping dates in the 2 date ranges I have. > My two ranges would be like this: > > Replacement's Date Range: > > $unixStartDateReplacementVacation > ...to... > $unixEndDateReplacementVacation > > Employee's Date Range: > > $unixStartDateEmployeeVacation > ...to.. > $unixEndDateEmployeeVacation > > > > > ...so i need to check that none of the dates occuring in the first date > range listed above appear in the second date range. > unfortunately, i have no basic idea of how i should go about doing > this...should i use arrays of dates, for-loops, or what? > thanks a whole lot in advance, > > Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Checking for Overlapping Dates
Thomas (and list), The solution, as previously posted, is flawed/incomplete - mea culpa. Excuse: I was interrupted three times from typing the word SELECT until pressing Send, and then rushing to get on to the next call on my time... >WHERE bstart < afinish > OR bfinish > astart; Check back with the diagram and you will see that a bstart clause needs to also check that bstart >= astart to trigger rejection - if the leave starts AND finishes before the 'replacement's' leave, then all is well - similarly for second clause. Now, if you prefer to inform a positive response, eg "leave may be granted", then when you turn things around, pay special attention to the relationship and changing ORs and ANDs. Better if we change the whole logic around and say "when can we grant annual leave?" because then the answer becomes: if bfinish < astart or fstart > afinish. This has the additional advantage of 'scaling', if the employee has more than one potential 'replacement'! In all approaches beware the special case: that the 'replacement' has no outstanding request for leave! Again apologies, =dn > > SELECT * from $DB_TBLName WHERE > > (Trim(WorkerEmail)='$userReplacementEmail') > > AND AND OR OR OR OR OR > > This is all a bit complicated, and a simple boy like me gets lost too > easily. KISS principle: Keep it simple... > > You have two employees: > A, so named because he Already has Annual leave Approved, and > B, so named because he is Begging to Be allowed to Break out. > > Let's imagine we're playing with a wall-chart/wall-planner to assess > requests prior to granting approval. So we mark off which days A will be > away and then view which days B would like to go against existing requests. > > Month A Month BMonth C Month etc > A <---> > B <> > > Assuming the email/fonts haven't mucked-up my sketch, you can see that B's > request should be denied, because A has already booked the time-out. > > Now let's use the diagram to build an algorithm. How many ways are there > that A and B could overlap? (hint: four) Not overlap? (hint: two) Which is > the easiest to implement in code? > > Now you can ask, which language should I code in? Answer: stay as close to > the source as possible, ie use SQL (or in this case pseudo-SQL(!)). > > SELECT a AS Colleague, CONCAT( astart - afinish ) AS PermissionDenied >FROM tbl >WHERE bstart < afinish > OR bfinish > astart; > > Before this will work, you will need to add another WHERE clause to > establish who is the employee's "replacement". The above lists a reason for > rejection - you can reverse the logic, at your peril. > > Trust this assists, > =dn > > PS The complicating question I wanted to ask from the word "go" is: what if > one person can have more than one other employee act as his/her > "replacement"? > > > > > > Background: > > > > > > I've created a vacation-request application for our company's intranet. > > When an employee requests a vacation, he has to list the name of another > > employee who will 'fill in' for him while he is gone. > > > > Before a vacation request can be saved in MySQL, I need to check to make > > sure that the person listed as the employee's replacement during this time > > has not already requested a vacation during the same time period...to > > check to be sure that the two vacation periods do not overlap. > > > > Date Ranges: > > > > > > I have fields saved in MySQL called unixStartDate & unixEndDate that are > > unix timestamps for the first day of the employee's vacation and the last > > day of the emplosyee's vacation. > > > > I have tried to do a check using purely SQL, but this doesn't account for > > all possibilities of overlapping dates: > > > > (unixStartDate is the unix timestamp for the replacement, whereas the PHP > > var $unixStartDate is the unix timestamp for the employee who wants to > > post a new vacation request) > > > > $checkSQL = "SELECT * from $DB_TBLName WHERE > > (Trim(WorkerEmail)='$userReplacementEmail') > > AND (Status < 40) > > AND > > ( > > ( > > ($unixStartDate = unixStartDate) > > ) > > OR > > ( > > ($unixEndDate = unixEndDate) > > ) > > OR > > ( > > ($unixStartDate = unixEndDate) > > ) > > OR > > ( > > ($unixEndDate = unixStartDate) > > ) > > OR > > ( > > (unixStartDate < $unixStartDate) && (unixEndDate > $unixEndDate) > > ) > > OR > > ( > > (unixStartDate > $unixStartDate) && (unixEndDate < $unixEndDate) > > ) > > ) > > "; > > > > So I think what I instead need to do is use PHP code instead of SQL to > > check for overlapping dates in the 2 date ranges I have. > > My two ranges would be like this: > > > > Replacement's Date Range: > > > > $unixStartDateReplacementVacation > > ...to... > > $unixEndDateReplacementVacation > > > > Employee's Date Range: > > > > $unixStartDateEmployeeVacation > > ...to.. > > $unixEndD
Re: [PHP] mail function() with MS
Hi Anthony, > I'm using MS Win 98 and my ISP has PHP installed on a MS server. > I'd like to display a HTML form box on my site for users to type in a > message utilizing the PHP mail() function. > > I've tested this using Apache on my drive with a html form and a php script > to receive the data and it works fine - but when the site goes live it will > be hosted with an ISP with a MS server - not Apache. > Is it possible to utilize the PHP mail function under these conditions? > > I was led to believe that I could change the configurations in my php.ini > file from: > SMTP: localhost > to > SMTP: mail.yourisp.com I use Win2000Prof with Apache, and have Win2000Svr with IIS. In each case I use a separate and external SMTP server. This is the relevant section of PHP.INI: [mail function] ; For Win32 only. SMTP=smtp.ISPs.domain ; For Win32 only. sendmail_from=MyAddress@MyDomain When you use PHP provided by a service, you will need to establish what they have set up as SMTP server, and if it is not acceptable to you (for whatever reason that might be) work out how to override it. I use a script/class from PHPguru.org, and I can't say for sure that it even looks at the PHP.INI settings because I set them directly/again within the mail function's code. Highly recommended! Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function() with MS
Hi Anthony > Qusetion: 1: > What would happen if I changed the php.ini settings to: > SMTP=mail.yourisp.com > sendmail_from=MyAddress@MyDomain > as opposed to: > >SMTP=smtp.ISPs.domain =as long as the SMTP server is accessible and you have access rights, then it can be anyone's/anywhere... > > When you use PHP provided by a service, you will need to establish what > they > > have set up as SMTP server, and if it is not acceptable to you (for > whatever > > reason that might be) work out how to override it. > I'm not sure why I would not think it is not "acceptable". Please advise. =Some web-hosts only have the one PHP.INI. That means you would have to use what they define as SMTP server. I don't know (a) what the host may define, (b) what you will find acceptable... ie it may or may not result in an issue/be relevant to you. > Also...let's say I'm developing another site with a mail form box using > Win98 and Apache > Do I then have to reconfigure the php.ini files back to localhost from: > SMTP=mail.yourisp.com =each PHP/web server has its own PHP.INI file. Thus each defines its own (default) SMTP server. =it may not be necessary to move SMTP servers: remember that your FROM: address can be [EMAIL PROTECTED] even though the PHP-defined SMTP server is smtp.isp.domain. =if you use a good script/class, each application you build can define its own SMTP parameters and have its own domain/From address, etc. > Thank you. =a pleasure. =did I understand the intent of the question correctly? =dn > TR > > > > I use a script/class from PHPguru.org, and I can't say for sure that it > even > > looks at the PHP.INI settings because I set them directly/again within the > > mail function's code. Highly recommended! > > > > > > --- > [This E-mail scanned for viruses by gonefishingguideservice.com] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problems...
Anthony, Do you have an SMTP server on your Win98 localhost? Recommend you change the PHP.INI SMTP= to say the same as your email package's server definitions. =dn > I'm using MS Win98 and Apache and getting the following after submitting the > mail form: > .. > Warning: Failed to Connect in c:\program files\apache > group\apache\htdocs\send_simpleform.php on line 14 > > > The html and php scripts follow along with my php.ini settings. > > Any help would be appreciated. > > Thank you. > Tony Ritter > > The following e-mail has been sent: > Your Name: > Linda > > Your E-Mail Address: > [EMAIL PROTECTED] > > Message: > Test > . > > > //this is the html form > > > > Simple Feedback Form > > > > > > > Your Name: > > > Your E-Mail Address: > > > Message: > > > > > > > > > .. > //this is the php script > if (($sender_name == "") && ($sender_email == "") && ($message == "")) { > header("Location: http://localhost/simple_form.html";); > exit; > } > $msg = "E-MAIL SENT FROM WWW SITE\n"; > $msg .= "Sender's Name:$sender_name\n"; > $msg .= "Sender's E-Mail: $sender_email\n"; > $msg .= "Message: $message\n\n"; > $to = "[EMAIL PROTECTED]"; > $subject = "Web Site Feedback"; > $mailheaders = "From: My Web Site <> \n"; > $mailheaders .= "Reply-To: $sender_email\n\n"; > mail($to, $subject, $msg, $mailheaders); > ?> > > > Simple Feedback Form Sent > > > The following e-mail has been sent: > Your Name: > > Your E-Mail Address: > > Message: > > > > > My php.ini settings are: > > [mail function] > SMTP = localhost ;for win32 only > sendmail_from = [EMAIL PROTECTED] ;for win32 only > ;sendmail_path = ;for unix only, > may supply arguments as well (default is sendmail -t) > > > > > > -- > 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] mail() problems...
Anthony, > I'm not sure I understand. =that makes one more! This feature is a bit of a minefield - but once you get a handle on it, its too useful to be without... > I had this working a few months ago by changing the php.ini settings to: > SMTP = localhost ;for win32 only > sendmail_from = [EMAIL PROTECTED] ;for win32 only > and I was able to run that script on my box and get an e-mail returned to > me. > Now, I getting a "failed to connect". > I'm using MS OE5. =this can only work if: a) there is an SMTP server on the localhost (and the DNS finds it), or b) the code wrapped around mail() specifies a valid and reachable SMTP server, or c) the code sidesteps the PHP mail facility completely by doing something else, or d) its not a Win box (and needs a completely different approach) =if it was working, it was working; I'm not sure what has been updated/replaced since - but let's not even go down that track. =I assume that the Win98 machine has outbound email working from some MTA, eg Outlook [Express]. Check its definition for an SMTP server. Cut-and-paste from there into PHP.INI. =also (because I'm a simple boy), forget all the optional headers etc, just use a stripped down/simple email stub-script for testing/proving. =If PHP's mail() can be persuaded to work, thereafter it (and any scripts) can be 'tweaked'/made better - or we can look back and compare... =dn > - Original Message - > From: "DL Neil" <[EMAIL PROTECTED]> > To: "Anthony Ritter" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Friday, December 06, 2002 10:37 AM > Subject: Re: [PHP] mail() problems... > > > > Anthony, > > > > Do you have an SMTP server on your Win98 localhost? > > Recommend you change the PHP.INI SMTP= to say the same as your email > > package's server definitions. > > > > =dn > > > > > > > > > I'm using MS Win98 and Apache and getting the following after submitting > > the > > > mail form: > > > .. > > > Warning: Failed to Connect in c:\program files\apache > > > group\apache\htdocs\send_simpleform.php on line 14 > > > > > > > > > The html and php scripts follow along with my php.ini settings. > > > > > > Any help would be appreciated. > > > > > > Thank you. > > > Tony Ritter > > > > > > The following e-mail has been sent: > > > Your Name: > > > Linda > > > > > > Your E-Mail Address: > > > [EMAIL PROTECTED] > > > > > > Message: > > > Test > > > . > > > > > > > > > //this is the html form > > > > > > > > > > > > Simple Feedback Form > > > > > > > > > > > > > > > > > > > > > Your Name: > > > > > > > > > Your E-Mail Address: > > > > > > > > > Message: > > > > > > > > > > > > > > > > > > > > > > > > > > > .. > > > //this is the php script > > > > > if (($sender_name == "") && ($sender_email == "") && ($message == "")) { > > > header("Location: http://localhost/simple_form.html";); > > > exit; > > > } > > > $msg = "E-MAIL SENT FROM WWW SITE\n"; > > > $msg .= "Sender's Name:$sender_name\n"; > > > $msg .= "Sender's E-Mail: $sender_email\n"; > > > $msg .= "Message: $message\n\n"; > > > $to = "[EMAIL PROTECTED]"; > > > $subject = "Web Site Feedback"; > > > $mailheaders = "From: My Web Site <> \n"; > > > $mailheaders .= "Reply-To: $sender_email\n\n"; > > > mail($to, $subject, $msg, $mailheaders); > > > ?> > > > > > > > > > Simple Feedback Form Sent > > > > > > > > > The following e-mail has been sent: > > > Your Name: > > > > > > Your E-Mail Address: > > > > > > Message: > > > > > > > > > > > > > > > My php.ini settings are: > > > > > > [mail function] > > > SMTP = localhost ;for win32 only > > > sendmail_from = [EMAIL PROTECTED] ;for win32 only > > > ;sendmail_path = ;for unix only, > > > may supply arguments as well (default is sendmail -t) > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > --- > > [This E-mail scanned for viruses by gonefishingguideservice.com] > > > > > > --- > [This E-mail scanned for viruses by gonefishingguideservice.com] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failed to install Mod_cURL under Windows/Apache
PHP v4.2.3 with Apache 1.3.24 under Win2000 Prof SP2 Downloaded the full v4.2.3 zip package/Win binary, some weeks ago. Installation went fine. Extensions are happily included. Have had several weeks of operations. Decided to install cURL to do some URL (strangely enough) link verification-checking. Started at manual: XII. CURL, Client URL Library Functions with sent me to http://curl.haxx.se and in turn http://curl.haxx.se/libcurl/php/ Downloaded curl-7.10.2-win32-nossl which (really) only contains CURL.EXE. I cannot see any instructions telling me what to do with this/where to put it!? Moved it to the same location as PHP.EXE. It runs happily from the command line (so that's something!) Moved both the .dlls around, checked the MVC file, and uncommented the PHP.INI line - and verified it with PHPINFO(). However when a PHP script (copied straight off the PHP manual) calls curl_init () it causes Apache to crash: "Apache.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created." - restarting the Apache service and re-running results in the same error - rebooting the whole system and re-running also. - the v-server's error log shows nothing and the access log only shows the PHPINFO() mentioned - there's nothing in the Windows Event log - I can't figure out where this "error log" is created Help! I've missed something... =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Simple text editor for Windows?
Hi Tom, > >> I know the text editor question has been beat to death, but I'm looking > >> for a simple editor with syntax highlighting that can be installed in > >> Windows by a general user. It would have to be something that didn't > >> access the registry, as normal users can't do that. Does anyone know of > >> a program like this? Thanks. > > Take a look at this one it seemed to be pretty good, the closest I've seen to > homesite functionality without the bloat. > http://www.crimsoneditor.com/ Looks interesting - and no registry finagling you say! One expects that John meant PHP syntax highlighting. From where is the PHP control file made available? Please advise, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Snoopy Class
(pardon the pun) Please recommend a Snoopy tutorial, =dn PS Google has not been my friend! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Justin, Jumping in late... > >> Daylight Savings Time? > > John, I think "Daylight Saving Time" creates a difference of 1 hour and not > > 1 day :) > True... but I checked it anyway -- by adding just one and two hours to the > stamp... which made no difference... but when I added 86400 to the stamp, it > all worked. =depends upon the time of day! (its a logic 'twister', like saying even a stopped clock is correct twice per day) > > Justin, it depends how you got your "timestamp" in the first place, I > > think... > > I could be wrong again here but aren't these different? > > mktime() > > gmmktime() =absolutely! One just 'works', the other relates everything back to GMT before performing the same calcs. > Actually, they were created with strtotime(). Note, I don't believe there's > anything wrong with the stamp itself. The point is, the stamp is displaying > as two different dates using date() on two different servers, and I believe > this is not what date() is supposed to do. > Shouldn't the stamp for 12-09-2002 22:13:09 be the same on every server? =yes, no, not necessarily! > My rationale for this is that no matter where you are in the world, it is > always a certain number of seconds since 01-01-1970 00:00:00. =yes, no..., watch out for the interpretations that are applied EVERY time you call a function! > Perhaps strtotime() is NOT running off GMT, and perhaps date() is... there > has to be SOME confusion there -- either on my side, or in my choice of > functions, or SOMETHING :) =any call to system time will get you the time that has been set on the SERVER (although there is a PHP function for local-time, somewhere - have never used it). So the first question is, where is the server? The second question is, what time zone (TZ) has it been set to run within? (NB you can run a server in Sydney, but set its clock so that it 'appears' to be in Perth - if you really want to...) =now let's take a look at the UNIX Epoch. Various 'quotations' have surfaced in this email, and I don't recall that it is well discussed within the PHP manual (it being a UNIX definition after all...). The epoch 'began' 1Jan1970, sure enough (exactly as quoted). HOWEVER it is defined as beginning at Greenwich: 1Jan1970 at midnight UTC in Greenwich... =So a timestamp of 'zero' in London (UTC) would see the east coast of Australia at 39600 local (TZ of +1100 (hours)). =if at that very time I was in London and you in TZ+1100 and we waited one hour, the asked for the current timestamp: I would get 3600 and you 43200. So whereas I can subtract zero from current time and get one hour, you must subtract 39600 from 43200 to get the correct answer - in other words, don't use "zero", but 'Epoch-zero' adjusted for TZ. =as soon as you start to twist your mind around all this, you realise why Dr Who was a bit loopy about the size of telephone boxes, etc! Time travel is not for the faint-hearted (nor the mathematically-challenged/regular lottery ticket purchasers)! =PHP provides a solution in the gm*() series. The best/only solution is to find a common timebase. I've worked with American (and one Japanese) companies who (initially) insisted on time-basing everything to HEAD OFFICE (caps to demonstrate scale of self-importance, eg "this report must be in by 1700 in ..."), and usually they end up tripping themselves up, and thus provide me with the 'proof' of the illustrations/arguments I made at the design stage (that they chose not to listen to...) =The reality is that everyone works off UTC (NB "GMT" whilst widely used/terminology within PHP is not the "internationally PC term") - including the (alert) Americans - the US military refers/referred to UTC/GMT as "Zulu time" (which has more to do with the alphabet than warriors). So if I'm in Germany and I'm phoning you early/late in the day, to avoid holding our conversation in a less socially-acceptable climate I would first compare my time against UTC (+0100) and then compare your time against UTC (+1100), do the math to get a difference of +10 hours, add that to my local time, and thereafter place/delay the call... (try doing this calculation based upon something like Indian Standard Time, and add a Daylight Saving/Summer-Time adjustment into the mix, just for 'fun'!?) =In conclusion, (based upon my, cough, cough, many years of wrestling with this sort of thing) make all stored times UTC (gm*()) - the RDBMS should not 'filter' timestamps - MySQL does not (for example), and then if you want 'local' times you can 'do the math' for either the server's TZ or (if you're really masochistic (?is that the word?)) the browser-client's local time. The 'silver lining' is that you can now easily accommodate temporal input/presentations to/from anyone, anywhere in the world - it is also easy to produce code to calculate the server's local time (for example), so that the same routine works regardless of where the server is located - where next year's new 'mirror' is to be located, anywhere
Re: [PHP] Re: Snoopy Class
Hi UberGoober, Thanks for your (unique) reply. Specifically: am playing with web pages/link continuity checking and suchlike. So HTTP; as an improvement over the facilities offered by fopen(). Have worked through the readme examples, and dived into the script's code, as you would expect. Was hoping for something that explains in a little more depth, eg why this combination/sequence; to see if there is more that I can learn and/or more that I am missing/can make use of... - being ignorant allows me to pose the question, but by definition, not to define an answer for you! Any pointers to material, or advice from your experience would be most welcome, =dn > A tutorial to help you do *what* exactly? > The readme provides plenty of examples: > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/snoopy/Snoopy/README?rev=1.6&; > content-type=text/vnd.viewcvs-markup > > > > (pardon the pun) > > Please recommend a Snoopy tutorial, > > =dn > > PS Google has not been my friend! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Script not working from one computer
Hi John, You mention that it is a login script and that input is rejected. Is it rejected when it is initially typed in, or is it reported as rejected when ensuing pages are served? Please check the IE on the offending machine. Does it have security settings that forbid cookies? Check the ipconfig/all settings against other machines/check any contents of HOSTS file (and the other MS one, if used) Check execution of phpinfo() against similar on other/working machines. Regards, =dn > Tuesday, December 10, 2002, 2:31:48 AM, you wrote: > >> Have you checked: > >> > >> Browser versions? (is the browser the same type/version as on the other > >> machines) > >> Is it a laptop? If so, are you using the internal keyboard with Numlock > 1JWH> on? > >> Is the machine in question set-up on the network correctly, i.e. has it > 1JWH> got > >> domain, gateway addresses etc setup - this would only affect it if the > >> Intranet server is set-up to only allow a certain range of IP addresses or > >> doamin/hostnames etc. > > 1JWH> Browser's are the same (128bit). It's not a laptop. The web page can pull up > 1JWH> any other external web page correctly. > > 1JWH> What gets me is that the computer can pull up the log in page. It can pull > 1JWH> up another, unprotected page from that web server. But, no matter who tries > 1JWH> to log in from that machine, I get a bad username and password, even though > 1JWH> they are right. It's like the browser is sending bad data to a script that > 1JWH> works fine from every other computer. > > 1JWH> Anyone else have any other ideas? > > 1JWH> ---John Holmes... > > >> I know, PHP is executed server side, so it shouldn't matter about the > >> computer, but... > >> > >> I've got a basic log in script that takes username and password and does > 1JWH> the > >> typical SELECT to find a match. If it's good, it sets some session > 1JWH> variables > >> and redirects to a main page, otherwise redirects back to the login page > >> with an error message. > >> > >> The script works from all computers but one. The login page will come up, > >> but no matter what, it says the username and password are bad. They are > >> correct though, caps lock isn't on, etc. I've cleared the cookies and > 1JWH> cache > >> and it still does the same thing. > >> > >> The script is on an intranet. One computer that had this issue was fixed > 1JWH> by > >> using https://computername.company.army.mil instead of just > >> https://computername. But for this computer, both addresses give the same > >> result. > >> > >> So, I'm sure it's not the PHP script, so I'm looking for ideas of what I > >> should check, settings wise, on the client computer? Any help is greatly > >> appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to test php.info from command line
I agree with Jason, it seems strange to have a command line option (that can only apply to command line operation) and yet the output be in browser/non-command line format... However with PHP-CLI 'coming soon', maybe that sorts things out. Meantime may I suggest combining the two answers: php -i >/tmp/test_php.html (note file type) Thereafter chuck test_php.html into your browser for convenient viewing/to 'get rid' of the tags/static. (when I do this, the graphics don't print out, eg PHP logo at page top - which is a convenient way of differentiating between phpinfo() from the command line and from a web server!) Hope it helps, =dn > > >How to test php.info from command line: > > > > #echo "" | php > > > > to the standard output (screen) - or if you want to a file like this way: > > #echo "" | php > /tmp/test_php.txt > > > > Oliver Etzel > > > > .eu - domain are coming soon > > www.t-host.com > > Or simply > > #php -i > > It would be nice if there was a text-only version without all the HTML gunge. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Different output on two different servers
Hi Steve, Have you solved this already? If not, when you copied the code between machines was there some effort to ensure that the 'copy' points to the RDBMS/tbls on the same box/different box - or does the original box have code that points to tbls on itself, and the second box have code that runs on 'it' but (still) points to tbls on the first box (not on itself)? [make sense?] Regards, =dn PS what's the difference between "production" and "live"? (in my jargon they are synonyms) > I have set-up a production server and a live server. The problem is with > the production server. I am using PHP version 4.2.3 and MySQL 3.23.39 on > both servers. We have just configured the production server to mimick > the live server (which incidentally works fine) and the code from both > servers is identical. I dumped all the data into the production MySQL > database then copied the code from the live server to our production one > and there didn't seem to be any problems. However today my boss asked > for a new category to go into our webshop with a new product. I went > into MySQL and updated the database fine then when I went to check the > section of the site to see if the extra category and product are there I > get my own PHP encoded error 'No categories currently available'. It > fails on the first function: > function display_categories($cat_array) > > { > //display all categories in the array passed in > if (!is_array($cat_array)) > { > echo "No categories currently available."; > } > else > { > //create table > echo " background='images/shopbg.gif'>"; > etc. > > Now it works superbly on my live server and did work fine until I tried > adding another field to the database on the production server. Where > should I start looking to de-bug this? > > Steve Jackson > Web Developer > Viola Systems Ltd. > http://www.violasystems.com > [EMAIL PROTECTED] > Mobile +358 50 343 5159 > > > -- > 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: Re[2]: [PHP] Script not working from one computer
John, > > > You mention that it is a login script and that input is rejected. Is > it > > > rejected when it is initially typed in, or is it reported as > rejected > > when > > > ensuing pages are served? > When it's initially typed in. =do you have multiple 'environments' (eg VHosts or even physical servers) on your PHP/web server? If you run the errant machine against a copy of the script in another 'environment' does the same happen? =can you put a DEBUG line into the code and have the data displayed prior to it leaving the PC/form, and as the login 'result' is being processed/returned to the user? Where does it 'break'? =is there anything silly about the person's login/pswd? Is it just the one person's login that's at issue, or everybody's when they use that particular PC-client? > > > Please check the IE on the offending machine. Does it have security > > > settings that forbid cookies? > No, it's a default install of IE6. I have a check that'll put up an > error if cookies are turned off and that's not the error I get. I get > the error saying that the username or password didn't match anything in > the database. =not something dopey like a zero-oh transliteration error, eg passw0rd instead of password? > > > Check the ipconfig/all settings against other machines/check any > > contents > > > of HOSTS file (and the other MS one, if used) > > > > > > Check execution of phpinfo() against similar on other/working > machines. > > > > Is it a plain old login script, or is it one which uses javascript to > MD5 > > the > > password? If the latter, you may want to check you've enabled > javascript. > > It's just a plain log in script. > > I'm going to troubleshoot it more today and throw in some tracing to the > functions to see where everything is going and what the login/password > values are all the time. I just haven't had a chance to make it over to > that computer yet. > > I have a feeling it's going to work out to be something stupidly > simple... like these problems always do. :) =embarrassingly so! If you're taking this all off a user's say-so, then it sounds like an eyeball job to me... =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
> > =now let's take a look at the UNIX Epoch. Various > > 'quotations' have surfaced > > in this email, and I don't recall that it is well discussed > > within the PHP > > manual (it being a UNIX definition after all...). The epoch 'began' > > 1Jan1970, sure enough (exactly as quoted). HOWEVER it is defined as > > beginning at Greenwich: 1Jan1970 at midnight UTC in Greenwich... > > > > =So a timestamp of 'zero' in London (UTC) would see the east coast of > > Australia at 39600 local (TZ of +1100 (hours)). > > Er -- no, I think you've got that backwards. Unix timestamps are, as you > rightly say, seconds since 00:00 1-Jan-1970 GMT, so, at any instant, the > Unix timestamp is the same at every point on the globe. It's only the > *local* *times* (on the server, of course) that change. So, the Unix > timestamp of 0 represents: > >00:00 1-Jan-1970 GMT >19:00 31-Dec-1969 on the east coast of Canada/USA > (5 hours behind GMT) >09:30 1-Jan-1970 in Australia's Northern Territory > (9.5 hour ahead of GMT -- I know this > one 'cos my sister lives there!) > > From this, you can see why the same time stamp might give you different > dates if your servers are in different timezones -- espacially ones as > widely different as Australia and Canada! =which is about where we came in, IIRC > > =if at that very time I was in London and you in TZ+1100 and > > we waited one > > hour, the asked for the current timestamp: I would get 3600 > > and you 43200. > > Again, no: if I, at 01:00 local in GMT, and he at 12:00 local in a GMT+1100 > timezone -- that is, the very same instant -- both asked for the current > UNIX timestamp, we would both get the same answer. =uh-oh. I may misunderstand UNIX timestamps then - perhaps I am assuming too much similarity to date()? =Date() is local-TZ aware, so I appear to have assumed that a timestamp is also. What you are saying is that a timestamp is always GMT (regardless of machine/opsys TZ) and only when passed to date() or somesuch is the 'time' value manipulated (as well as its format) to become local. Correct? I thought timestamps were set at the time on the local clock, and thus would be different across TZs - date() is... =as a Windows user I struggle to cope with some of these UNIX concepts, so I hit Google - with no joy, and ripped through the SuSE manuals (I'm a closet Linux user - will become one, just as soon as I can find the necessary spare machine (and time!) - till then, the box of manuals, CD-ROMs etc lives in the closet!) Would you believe, none appear to clarify this (maybe I'm using the wrong terminology/barking up the wrong trees...). =Like you (Mike), I'm living in Zulu-TZ (although unlike you, I'm not always 'here'), where it's not so easy to test for myself (and I'm not prepared to jump onto client machines to 'play', at this moment). - I double-checked with Asia this morning and things work exactly as they should (at the application level) so I'm (relieved) confident that all is well with the code. =So as far as any processing goes, whatever I understood was the 'model' was good enough to get the job done, however my 'model' of the way UNIX/PHP works is slightly shaken, so I'm not a happy bunny... =With relief that I didn't mislead Justin: the fact remains/we are completely agreed - if you want to have a consistent database (for example) with temporal data arriving from/going to different TZs, then the gm*() functions are the ones that will offer the required international consistency to convert timestamps to readable dates and v-v... > > =The reality is that everyone works off UTC (NB "GMT" whilst widely > > used/terminology within PHP is not the "internationally PC term") - > > including the (alert) Americans - the US military > > refers/referred to UTC/GMT > > as "Zulu time" (which has more to do with the alphabet than > > warriors). So if > > I'm in Germany and I'm phoning you early/late in the day, to > > avoid holding > > our conversation in a less socially-acceptable climate I > > would first compare > > my time against UTC (+0100) and then compare your time > > against UTC (+1100), > > do the math to get a difference of +10 hours, add that to my > > local time, and > > thereafter place/delay the call... (try doing this > > calculation based upon > > something like Indian Standard Time, and add a Daylight > > Saving/Summer-Time > > adjustment into the mix, just for 'fun'!?) > Well, the time/date functions provided in PHP can do all this for you. =and do so, very nicely, thank you! > > =In conclusion, (based upon my, cough, cough, many years of > > wrestling with > > this sort of thing) make all stored times UTC (gm*()) > Yes -- as the Unix timestamp is an *absolute*, always expressed in GMT > regardless of where you are (or, rather, where your server is!), this is the > one to use as your base. > > - the > > RDBMS should not > > 'filter' timestamps - MySQL does not (
Re: [PHP] Problem relating to images in email
Hello khuram, > Iam new at this mailing list . =welcome to our happy band! I have a problem in php > is that i want to store the images on local hard disk > that are in email (pop3 account) by runing a php file. > how can i do that. please help me asap. =there are a number of classes available that you can absorb into your project. I use email classes from PHPguru.org. =In this case it seems that you will require the ability to first read msgs off the POP server (also check out PHP's IMAP functions), then split them into components, then identify the MIME encoded graphics and store them away. Haven't done all of that myself, but it sounds 'easy' enough... =Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fgetcsv Help
Richard, > I am parsing a csv file with fgetcsv and the fields are surrounding by > double quotes, now I am running into a problem periodically that when there > are quotes within the value it is treating it like another value instead of > the same value. > Any ideas on how to get around that? > > I am thinking I might have to convert all quotes to " and then turn all > "," back into quotes and then the first " in the file and > then last one since obviously they will not have a comma in between them. > This seems like a while lot of work.. > Ideas? The first idea is that the system that outputs a .CSV with quotes within a quoted field is broken big-time and that's the part that needs fixing! I'm on the same wavelength as you describe: you can't use any automated csv function on such a file. Quotes <> only appear in pairs. The closing quote must therefore appear immediately prior to a field separator (eg comma) - whitespace not withstanding, unless it is the last field on a line, in which case it will appear immediately prior to a record separator. One possibility is to write a 'filter' script to do this - and thus leave your existing code intact. The filter could take in the file, explode on quotes, and then cycle through the resultant array looking at the first non-whitespace data in every second element, clean/recode where necessary, and then implode and output. Alternatively could join/unset consecutive array elements which have been split inappropriately (by 'internal' quotes), and then implode using the other style of quotes/another separator, if this can be made to work later in the process... What a palaver! =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Script not working from one computer
> > > I have a feeling it's going to work out to be something stupidly > > > simple... like these problems always do. :) > > =embarrassingly so! If you're taking this all off a user's say-so, > then it > > sounds like an eyeball job to me... > I never did solve it, but it came down to a weird cookie problem. The > Session cookie was being set and accepted correctly, but regular cookies > would never set. Other web sites could set cookies, but none from this > web site were ever written. I don't know if it's because of SSL or what. > It's one of those things that worked fine yesterday and now doesn't work > and the user "didn't do anything." Oh well... IE allows quite a bit of control over the handling of cookies. Most admins would probably focus on the "Security" tab and the possibilities it offers. However there is also a vicious back-hander under the "Privacy" tab (that you can't see/get no warning about, under normal operation) and with a simple command one can ban cookies from any nominated web site(s) - hence everything works fine for accessing (eg) the NYTimes but blows up in your face (sorry SeaBee humor) when you access the nominated site. Could be done by FOBCAK, user brilliance=ignorance, or deliberate sabotage/cynical Admin baiting! Couldn't access various online purchasing sites from a hardened laptop, so if they didn't say that they required cookies and I called their HelpDesk, much going round-and-round resulted... Herewith another argument for keeping sessions/controls exclusively server-side! =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filter vulger / controversial words - need word source
Hi Jon, I think we've seen this discussion on the list before (so Christopher, check the archives!) > > I'm wondering if someone has a great source for a master-list > > of controversial and vulger words that I can use on my site. > > I would like to pattern match input text against this master-list > > in order to prevent vulger and controversial words from appearing > > on my site. > Once you've got the routine working, post it here, because there are many > people who would like to know how to do this properly. > The problems that others have experienced in the past are: > - what happens with "mis"spellings, e.g. "fsck"? > - what happens with dodgy formatting, e.g "f s c k"? > - what happens with words like "Scunthorpe"? Problem 1: add likely/popular mis-spellings to the list of vulger/vulgar language Problem 2: (contrived) very few single-letter words exist so remove intervening white space prior to analysis Problem 2a: (the more popular f*ck - someone suffering the misapprehension that (s)he is somehow NOT guilty of using bad language/being offensive when (s)he plainly is not only doing so but attempting to be deceptive as well...) see response to Problem 1 (the probably habit would be to replace/remove vowels) Problem 3: Scunthorpe contains an unfortunate series of letters (amongst the town's many disadvantages) however the critical four are not a word in and of their own right so employ whitespace (\s) in the RegEx or token analysis. > May I suggest, rather than picking your way through this minefield, you > provide a "report abusive comment" link instead? Most sensible! The employment of a technological solution to a social problem is somewhat shooting the messenger. However some countries are now legislating responsibility that ISPs/employers must discharge (shooting the person who shoes the horses that the Pony Express messenger is riding!?) In this case perhaps one could analyse the incoming text and place an embargo on its publication on the web site until it has been reviewed by a human editor? If we were talking about filtering incoming email, then perhaps the original message could be forwarded/wrapped with a message from the EmailAdmin/System pointing out that a message has arrived from xyz (etc) and has been flagged for a stated reason (but that there is room for interpretation within the mechanical observation) and that the message should not be opened by anyone fearing offence. (this similar to 'security' gateways that don't allow msgs with attachments unless the 'employee' first authorises a 'pass-through') Euro 0.02's worth? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Mike, No complaints about explanations in PHP manual - I often say that it IS a cut-above the average. However it does NOT explain the underlying concepts of "timestamps", (quite rightly) expecting that we pick up such from other/more appropriate sources. Hence my comments are refering to such sources/attempting to find such sources... Like you, when I re-read that entry in the PHP manual (after your informative reply) I 'saw' the logic and discovered that I had to move the 'location' in my mind-map where I had framed the GMT/TZ adjustment. Fortunately it didn't nullify any design decisions I've made/relied upon. Unfortunately *NIX sources thus far consulted don't seem to feel it necessary to do the same/print anything confirming (and many of them most careless in your "GMT" point) - and hence the discomfort. It is always difficult to learn new things, and if not more so, can be v.awkward trying to adapt from one philosophy to another, eg Windows to *NIX. Getting the terminology straight is one thing, getting the model worked out another. I don't doubt what you say/am happy to be shown to be wrong, but would sure like to 'prove' it. As I say, am probably just barking up the wrong (Christmas) tree(s). No worries - it's familiar territory! Thanks for your help, =dn > > -Original Message- > > From: DL Neil [mailto:[EMAIL PROTECTED]] > > Sent: 10 December 2002 19:52 > > > > =as a Windows user I struggle to cope with some of these UNIX > > concepts, so I > > hit Google - with no joy, and ripped through the SuSE manuals > > (I'm a closet > > Linux user - will become one, just as soon as I can find the > > necessary spare > > machine (and time!) - till then, the box of manuals, CD-ROMs > > etc lives in > > the closet!) Would you believe, none appear to clarify this > > (maybe I'm using > > the wrong terminology/barking up the wrong trees...). > > Well, I think the PHP manual is pretty good about this -- all the pages I've > looked at are careful to add the GMT timezone indicator when referring to > the base date of the Unix epoch, which is pretty much what tipped me off to > the correct interpretation. (If you find a reference there that doesn't > include the GMT indicator, I reckon that would be worth a bug report in the > Documentation problem category.) > > 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] Filter vulger / controversial words - need word source
> > if you want a partial list of offensive terms - try looking > > at the meta keywords on a few porn sites ... > > Excellent idea! > Unfortunately I'd have to explain that to my boss... "No, really, I'm doing > some research..." =guess monopolising the color printer for a whole afternoon would give you away, huh? =but won't your gateway/web server's filter prevent access to such sites anyway? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filter vulger / controversial words - need word source
Jason, > > there simply is no definitive list of words > The fact is content filtering does not work without a heavy dose of human > intervention. > It is quite shocking that large numbers of well known corporations deploy > misconfigured content-filtering software which rejects perfectly innocent > email. Earlier contributions highlight this admirably. I was at an "Information" show last week where a stand displayed the good work of the EU organisation in the field. I spoke to a Brussels(*) wonk/weenie/suit about such legislation (proposed and awaiting national enactment). I suggested that it would be unfair to 'bring to justice' anyone for apparently offending some employee/user's sensitivities without first defining WHAT would cause offence (eg the requested list of "vulgar words"). Otherwise the first you might know about it is when a court decides (against you) that is unacceptable in polite company. Accordingly I suggested that his department publish such a list (in all of the languages/cultures of the EU???), but observed that he would have a serious problem being able to distribute it without his own office prosecuting itself! As is to be expected, he failed to see the humor (and failed to see the sense/requirement to do so)... The joke is on our Indian friends @upv.pertamina.co.id whose 'filter' simply bounces messages containing "Dirty Words", because as you say there is no human involvement so they can't even benefit from Jon's observations. This policy means that every contact/contract with Sc*nthorp that they lose, is deservedly so, and an unfortunate advertisement not to use that country for out-sourcing if the culture-gap is so great!? Summary attitude: hey I'll code it if you want it/pay me to do so, but what are you going to do when you meet the rest of society as soon as you come off the email system? NB it has 'always' been illegal to use such language in (British, and many others) phone conversations, but who does that stop/what filters are in place there? =dn *for the benefit of more distant members: Brussels is the home of many European Union (EU) offices, and the source of much bureaucratic 'stupidity' such as the legislation mentioned earlier. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem
i setting php.ini [mail function] ;For Win32 only SMTP = hermes.ica.gov.co sendmail_from = [EMAIL PROTECTED] =it is impressive to see that the Greeks' messenger has made it all the way over to Colombia! Wasn't he also held responsible for dealing with people who were guilty of indiscreet speech - good name for an email server... =I'm immediately suspicious of the sub-domain address for the SMTP server. What do you have for server identification in your email package? Make the two definitions the same. =Whereas this might be the name of your MS-Exchange box, what happens if you remove the "hermes." and just go with the domain name? =Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Proposal: New list etiquette/rule
Spam Arrest Sender VerificationYesterday we held an amusing discussion which highlighted the futility of using (badly implemented) technological 'solutions' to a social problem... Herewith I attach a response received pursuant to a list contribution. Does this 'gentleman' seriously expect every list contributor to provide him with a personal service requesting permission to be allowed to post to him? What happens if dozens of his colleagues join up? BTW I will, happily, for my hourly fee (minimum charge four hours)! Suggest that the list 'rules' be updated to point out that such requirements are unlikely to be received favorably, so if he wants to join the community he needs to do 'join' us (not vice-versa). NB I know that technically I've broken my/the list's rules by reproducing this in HTML, and have done so that those who can, are able to see the stupidity in its full glory/know which service NOT to use... Regards, =dn - Original Message - From: Kadir To: [EMAIL PROTECTED] Sent: Thursday, December 12, 2002 11:51 AM Subject: RE: Re: [PHP-DB] Formatting txt from a database (verification) Kadir here, I'm protecting myself from receiving junk mail. Just this once, click the link below so I can receive your emails. You won't have to do this again. http://spamarrest.com/a?33905301:611961 You are receiving this message in response to your email to Kadir, a Spam Arrest customer. Spam Arrest requests that senders verify themselves before their email is delivered. When you click the above link, you will be taken to a page with a graphic on it. Simply read the word in the graphic, type it into the form, and you're verified. You will only need to do this once per Spam Arrest customer.
Re: [PHP] ExpertRating launches PHP Certification Exam
I must be a suspicious character, but I haven't come across Expert Rating before, nor do I know what Pete's connection with Expert Rating is, so I went and looked at the PHP web site (where we are led to believe that we would expect to find "a lot of excitement") but a site-wide search fails to yield a single hit. Ok I'll go straight to the horse's mouth and look at their own web site, where I get to thinking about a certification body in the UK (based in Bristol) that has its prices set in USD. Question: who has achieved this distinction and how many employers have commented that the Expert Rating evaluation was the MAJOR selling point? =dn > Good news for the PHP developer community- > http://www.expertrating.com";>ExpertRating, the global > skills assessment provider has launched an online PHP Certification > exam. Candidates who pass the exam will be mailed a hardcopy certificate > of > accomplishment. The launch of this exam has generated a lot of excitement > in the PHP developer community. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Difference between 2 Dates
Colin, > I have a similar problem. I am trying to figure out which of two dates > is greater. Both are in the -mm-dd format. Is there any easy > function that allows this sort of comparison or am I missing something? Treat the dates as strings not numbers: $DateOne = "2002-12-13"; $DateTwo = "2001-11-12"; if ( $DateOne <= $DateTwo ) echo "DateOne comes first"; You can do comparisons like this but don't try any 'arithmetic'! Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Errors
Andy, > I am a PHP beginner so this error may be a stupid one. Anyway, I'm > trying to write a simple addition script. The client enters two numbers, > then my script (adder.php) adds them. However, when the script is run, I > get "Parse Error On Line 3" I have no idea exactly what I have done wrong. > Here is the script. > > print ("Your first number is:$firstnumber\n") > print ("Your second number is:$secondnumber\n") > $answer=$firstnumber+$second number > echo ("The answer is: $answer\n") > ?> > > Any help would be greatly appreciated. Thank you. PHP code lines must end with a semi-colon (;). Also, HTML newlines are (not \n) Some PHPs won't like the short tags, recommend: http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SERVER['DOCUMENT_ROOT'] on localhost
Rolf, > > the document_root just doesn't show up in my phpinfo(); > > > > do windows machines have one anyway? > > I have used this var before, just not testing it locally. > > > > It normally shows up when I use phpifno on the server. Please check/compare the entries for doc_root = in the two PHP.INI files. Are they the same/given a value. NB: ; The root of the PHP pages, used only if nonempty. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server (other than IIS) ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below ;doc_root =;; Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Editors
Take a look at Maguma Studio Light (www.maguma.com) Neil Nilza Lafayette wrote: ** This Message Was Virus Checked With : SAVI 3.61 September 2002 Last Updated 2nd January 2003 ** I'm running Apache 2.0 as a service and PHP (like a module) onto a Windows Advanced Server. I´m looking for a good and free Editor to use with PHP (With debugging features). Can anyone with experience guide me? Thanks. Janine. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions 'funny' and Zone Alarm Pro 3
Hi, I've started developing a shopping cart and was just testing and found that I get strange results when Zone Alarm's Cookie Control is set to anything other than "Off". If anything, I would expect the shopping cart to forget its contents between pages but instead I am getting weird results. (I have many other files/classes being called from this test.php file) test.php add_item( $f_id, $f_qty, $f_desc, $f_price, '' ); } elseif ( $f_act == 'remove' ) { $_SESSION[ 'cart' ] -> remove_item( $f_id ); } elseif ( $f_act == 'update' ) { $_SESSION[ 'cart' ] -> update_item( $f_id, $f_qty, $f_price, false ); } else { echo ''; print_r ($_SESSION); echo ''; } ?> Product = CD Qty: '; print_r ($_SESSION); echo ''; ?> -- This script obviously calls itself (not sure if that is part of the problem?) Scenario (with ZA cookie control set to Medium) --- Leave the quantity set to 1 and click add, the session then shows that there is one item in the cart. Click add again and there are 3 items in the cart. Click again and there are 5 items. If I now change the quantity to say 10, there will be 16 items (the 5 that were there a minute ago plus the 10 plus what appears to be the value that quantity was previously set to i.e. 1. Thus if I then go and set the quantity to 5, it will take the previous value (10) plus the new value (5) and add it to the cart (16), giving 31. Turning ZA OFF and all works as expected. Since my cart is a serious of objects/arrays, I changed the following to try and track down the problem. Changed: session_start(); if ( !isset( $_SESSION[ 'cart' ] ) ) { $_SESSION[ 'cart' ] = new Cart(); } ?> To: --- session_start(); if ( !isset( $_SESSION[ 'cart' ] ) ) { $_SESSION[ 'cart' ] = new Cart(); $_SESSION[ 'count' ] = 0; } $_SESSION[ 'count' ]++; echo $_SESSION[ 'count' ]; ?> The count variable was also going up in the same fashion as the cart items which makes me think that the page itself is being called several times before being displayed. I'm tearing my hair out here and I can't leave it as is and the cart has to go into production and I can't have people buying 31 items when they wanted 3 :) Anyone any suggestions at all. Regards, Neil Stiron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions 'funny' and Zone Alarm Pro 3
> It does sound like you're right. Like ZA is perhaps allowing the user's > request to go twice. This is akin to people who double click on links > because that's what they're used to doing on windows icons. However, it > seems a bit odd how it selects to do it. It seems that if it did it twice > on every call, one would expect the count to go immediately to 2 rather than > start at one. Or does the session only begin after that first item is > clicked? The strange thing is that it is not necessarily twice. Say I buy 2 items and then I buy 5 items, it will take 7 (2+5) and add that onto the first purchase of 2 giving me 9 items (when I should only have 7). As you can imagine, the more you buy the more this problem escalates. > Have you tested this on several machines? No I haven't I'm afraid. > Mike Another thing I have noticed is that the problem only occurs if I use ONE PHP script to do everything (i.e. display and add to the cart) If I split the code accross different scripts I then get nothing added to the cart at all (even though the SID automatically gets inserted inside each form, everytime I sumbit and look at the code the SID changes). I think this is probably to do with the fact that I have used the Rewrite rule in an .htaccess file and the SID (if in the URL) is not getting passed on to the script - not sure about that though. Hmm, still scratching my head although I have the items being correctly added to the cart when no ZA and now I have them not being added at all when Privacy is on. This is after having split the code into multiple files. Don't know why it should make a difference over multiple files though? Thanks Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $header = "Location:........" being ignored!
Looks like you're missing a closing bracket on the IF statement as well. Neil Shams wrote: ** This Message Was Virus Checked With : SAVI 3.61 September 2002 Last Updated 17th January 2003 ** Hi Group, I basically have some simple code such as: == if ( $_POST['passwd'] != $db['password'] {header("Location: loginfailed.html"); } //else $header = "Location: success.html"; == however, when I run this code, using a to submit password, username, etc.. if the passwords do not match, the page is forwarded to success.html ! Is there anything obvious that I am doing wrong? Thanks, Shams p.s. I don't want to use else{} because I have lots of if() checks! -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie Questions
Have a look on devshed.com Bryan Cassidy wrote: Could someone point me to a VERY good doc for learning PHP for a NEWBIE!!! Something I can understand from the beginning to the end. YES I am willing to put my time into learning and reading docs as long as they are clear and made for what they say they are made for. I wont waste my time with something for a second if it isn't clear to me and easy to understand. Thanks in advance. -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: textarea new line
Adi wrote: i want to add in textarea a string with new line tag in it. how to do that? my try: $string="-line1n\ -line2 n\-line3"; echo "$string"; but i see a single line instead of: -line1 -line2 -line3 tx in advance for any help Hello For a new line in a text area you cant use html 's You need to use either \n OR \r\n Thanks Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Removing the #!/usr... from cgi output?
Colin McDonald wrote: Did you try it without that line at all? I'm pretty sure you can setup apache (you are using apache right?) to use /usr/.../bin/php for all files with the extension .php colin David Brannlund wrote: Example: #!/usr/local/bin/php becomes #!/usr/local/bin/php foo Hi there yes , the shebang ( the #!/usr/local/bin/php ) is not needed for use with dynamic webpages wether they be perl , php or whatever Shebangs are used only with shell based scripts. Your webserver should be configured to know what to do with the file by extension, e.g. .php files should be processed by php in apache This link describes how to configure a webserver to do this http://www.php.net/manual/en/install.unix.php ( a unix server , but its nearly the same for windows ) Thanks Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File upload problem
John M wrote: Hello, I have the code below. It's a simple file upload. But it doesn't work. Before the line if(isset( $Submit )) is an echo which can I read. But after choosing a file and press a submit nothing happens. Why is if(isset( $Submit )) always false? Maybe my apache or php config is wrong? I use WinXp Prof, Apache 2.0.43, PHP 4.2.3, safe_mode is on , upload_tmp_dir is "c:\tmp\" and upload_max_filesize is 2M in PHP config file. try a double \\ in windows paths Thanks! Untitled Document you will need to put a form action url in above line , like action="http://www.domain-name.com/script.php"; \n"; if(isset( $Submit )) { echo "After submit \n"; if ($_FILES['imagefile']['type'] == "image/gif"){ copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name']) or die ("Could not copy"); echo "Name: ".$_FILES['imagefile']['name'].""; } else { echo ""; echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")"; } } ?> Thanks Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getallheaders() in PHP 4.2.3
I believe getallheaders() has been supported since v4.0.0 Ananth Kesari wrote: *** This Email Has Been Virus Swept *** Hi, For some reason, getallheaders() is not working with the NetWare port of PHP 4.2.3 even while we have not modified the related code for NetWare as such. So, I am just wondering if getallheaders() is implemented for PHP 4.2.3? The document doesn't mention from which PHP version this supported. But it does mention that in PHP 4.3.0 and above, getallheaders() is aliased to apache_request_headers(). Thanks, Ananth. -- -- www.curvedvision.com -- This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd. *** This Email Has Been Virus Checked *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open Source Software Survey
Dear PHP Contributors, I am studying for a Master's degree with Henley Management College in the UK, and in the past have used a variety of Open Source Software. As part of my course I am conducting a survey in an attempt to identify the critical success factors for Open Source projects. If you are a user or developer for PHP, I would be very grateful if you could spare 2 or 3 minutes to fill in my questionnaire at the following URL: http://surveys.ideoconcepts.com/surveyor/index.php?sid=4&projectid=PHP This survey is completely confidential. Please accept my apologies if this is regarded as an off-topic posting. Thank you very much for your help, Neil Hambleton Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Old version of PHP
eding edge, nothing would ever work right. Hope this gives you some realistic perspective on why your ISP seems stubborn about upgrading and changing settings. Cut them some slack! It is for your own good (and the good of others). Though painful, it is an unfortunate fact of life. Switching ISP's generally will get you the latest version, for the moment... That honeymoon doesn't last very long. The first time you pressure them into an upgrade that breaks 20 other customers, they will be wiser and you won't get much help from them anymore. Most likely, your current ISP has been here. thx, Neil "behaviour is caused, and the causes are many" - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Dan Phiffer" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, August 07, 2003 9:43 PM Subject: Re: [PHP] Old version of PHP > On Friday, August 8, 2003, at 09:21 AM, Dan Phiffer wrote: > > > I'm working on an ongoing project that depends on a shared webserver > > running > > an old version of PHP (4.1.2 I believe). Is there any good reason to > > stick > > with an older version of PHP, or might it be a valid suggestion to > > have it > > upgraded to something a bit more recent? I have a notion that upgrade > > attempts may have been snubbed out by the way things like > > register_globals > > are now handled by default, the perception being that newer versions > > of PHP > > are incompatible with older code. > > the register globals "event" happened on 4.1 (from memory), so any > install over that should be straight forward. in any case, it's just > one simple directive that needs to be changed in the php.ini file... > can't see how this should be an issue. > > i think the best reason to keep up-to-date on the versions is that each > new release is "better, more stable, etc etc"... i haven't ever heard > anyone on this list say "i prefer 4.2.3 over 4.2.4" :) > > as a programmer, i hate it how some hosts refuse to keep on top of the > upgrades... really useful functions in newer versions aren't available. > > > > Mainly I'm concerned that code I test on our in-house server running > > version-current PHP will depend on function calls and language > > constructs > > that the production server's vintage PHP interpreter lacks. > > exactly... there isn't a HUGE number of differences between the current > release and what they've got on the live server, but there are > exceptions... i was making good use of file_get_contents() on my LAN, > but had to write a user-function to replicate it when running on the > live server which is stuck at 4.2.3 for the moment. > > it's almost a case of "don't upgrade your LAN until the production > server upgrades", but I prefer "convince you host to upgrade, or move > host" :) > > > Justin > > > -- > 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] RE: [newbie] embed php in html file
Take a look at auto_prepend_file within php.ini Bobby Rahman wrote: *** This Message Was Virus Checked With : SAVI 3.66 February 2003 Last Updated 2nd April 2003 *** Hiya I need advice for an optimum solution to display the username that is logged in on every html form page of my application. I have a header.php : session_start(); echo "Logged in as: ".$_SESSION['curr_user'].""; ?> Now I have many html forms which user's see What I want to know is how to include the header.php into every html form page. One way is to rename the html file with extension .php then This seems a bit wasteful for one line of php to change all the forms to .php. Is there any other ways of embedding the header.php file in html forms.The reason I am so keen on keeping html and php files seperate is thus to make debugging easier and maintain a kinda three tier design. Any suggestions will be much appreciated Bob _ Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setlocale() changes?
Try removing the double quotes around LC_TIME Neil Mike At Spy wrote: *** This Message Was Virus Checked With : SAVI 3.69 May 2003 Last Updated/Checked 2nd June 2003 *** I've been getting a warning on one of my scripts since I upgraded from 4.1.2 to the most recent version of PHP. The warning is: Warning: setlocale(): Passing locale category name as string is deprecated. Use the LC_* -constants instead The script at the line that is failing sez: setlocale ("LC_TIME", "$locale"); This script isn't mine off hand - what do I look for? I'm not sure I understand the error message. :\ Thanks! -Mike -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header() and mozilla - HELP!
Ensure that you have a die; after the Header() line. Neil deno vichas wrote: *** This Message Was Virus Checked With : SAVI 3.70 June 2003 Last Updated/Checked 12th June 2003 *** i'm runnig into a random problem of having all the headers being displayed instead on the actual web page in mozilla, Ie doesn't seem to suffer from this, when using header("location: www.url.com"); this is happening randomly. has anybody seen this or have a fix? -deno i'm running: php 4.3.2 apache 1.3.27 redhat 8.0 php is configed with: './configure' '--prefix=/usr/local' '--with-apache=/home/deno/Apachetoolbox-1.5.66/apache_1.3.27' '--enable-exif' '--enable-track-vars' '--with-calendar=shared' '--enable-magic-quotes' '--enable-trans-sid' '--enable-wddx' '--enable-ftp' '--enable-inline-optimization' '--enable-memory-limit' '--with-mcrypt=/usr/local' '--with-pdflib=/usr/local' '--with-tiff-dir=/usr' '--with-jpeg-dir=/usr' '--with-zlib-dir=/usr' '--with-openssl=/usr/local/ssl' '--with-curl=/usr' '--with-dom=/usr' '--with-zlib-dir=/usr' '--with-pgsql' '--with-ldap' -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I replace browser history using Header()?
Hi, I am using Header("Location:http://www.mysite.com/mypage.php";); to do a browser redirect. This works fine. The problem though is that doing this adds a page to the browser's window.self.history() collection. Is there any way that I can do a PHP Header() statement that does the equivalent of JavaScript's window.self.location.replace("http://www.mysite.com/mypage.php";)? In other words I would like to use PHP's Header statement to replace the current page in the brower's history, not just add another location onto the collection. Any help much appreciated. Neil -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I replace browser history using Header()?
Hmmm. As I thought. Thanks anyway Mark. Neil Mark Charette wrote: *** This Message Was Virus Checked With : SAVI 3.70 June 2003 Last Updated/Checked 12th June 2003 *** -Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED] Is there any way that I can do a PHP Header() statement that does the equivalent of JavaScript's window.self.location.replace("http://www.mysite.com/mypage.php";)? No. JavaScript (if turned on) is your only choice. -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Empty session directory
IVáN DíAz wrote: Hi everyone! I would like to know if I need to empty from time to time the directory where the session files are stored. I'm running windows nt4.0 and Apache. Thanks in advance. Hi Ivan That would probably be a good idea yes. On linux and unix based OS's sessions are usually stored in /tmp which gets periodically cleaned of old junk files. Depending on how your windows machine is set up, you might need to clean the dir every now and again, i dont remember anything that did this in the NT4 OS, but its been a long time since I used it. That said if you have allot of space it could probably go without cleaning for years :) Cheers Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: [webdevelopersjournal-discuss] php vuln.
>From another list [EMAIL PROTECTED] --- "Life must be lived as play." - Plato (427 - 347 BC) - Original Message - From: "John Best" <[EMAIL PROTECTED]> To: "Web Developer's Journal - Discuss" <[EMAIL PROTECTED]> Sent: Tuesday, July 23, 2002 12:01 PM Subject: [webdevelopersjournal-discuss] php vuln. Have you all heard about the new vulnerability in PHP's reading of POST'd forms. http://www.theregister.co.uk/content/55/26316.html Thought it might be important for some of you. JB. (there is a patch or something out, the workaround is to switch of the parsing of POST'd forms, which is probably not an option for some people) -Original Message- From: Ian C. Purdie [mailto:[EMAIL PROTECTED]] Sent: 23 July 2002 08:58 To: Web Developer's Journal - Discuss Subject: [webdevelopersjournal-discuss] Re: Nigerian Bank Scams Scott Merker wrote: > So He's off scot free and they can't even complain about him because of > libel/slander laws. and we wonder how we ended up with crooked CEO's Yep, this is at "chicken little" level but your views still hold. This is TRUE... a club which was formed around 1946 and, with interests toward 'returned servicemen'. Actaully became a very successful club by 1960 and motored on in a big way... A lifetime of effort (including my Dad's) to be destroyed by... As Scott said... > So He's off scot free and they can't even complain about him because of > libel/slander laws. and we wonder how we ended up with crooked CEO's > Ian Like this list? Check out our online Web Development Discussion Group, which lets you browse past posts. http://forums.internet.com/WebX?13@%5e37571@.ee7b24b You are currently subscribed to webdevelopersjournal-discuss as: [EMAIL PROTECTED] To unsubscribe send a blank email to %%email.unsub%% The contents of this e-mail are confidential to the ordinary user of the e-mail address to which it was addressed, or in the case of an incorrectly addressed e-mail message, the intended recipient. No-one else may copy, use, disseminate or forward all or any part of it in any form. Although this email, including any attachments, is believed to be free of any virus, or other defect which might affect any computer or IT system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free, and no responsibility is accepted for any loss or damage arising in any way from its use. The views expressed in this e-mail are those of the sender and not necessarily the employees company. If you receive this e-mail in error please accept our apology. If this is the case we would be obliged if you would contact the sender and then delete the e-mail. Like this list? Check out our online Web Development Discussion Group, which lets you browse past posts. http://forums.internet.com/WebX?13@%5e37571@.ee7b24b You are currently subscribed to webdevelopersjournal-discuss as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie needs help
mysql_db_query has been depreciated since PHP 4.0.6 ctan wrote: > ** > This Message Was Virus Checked With : SAVI 3.59 May 2002 > Last Updated 8th July 2002 > ** > > Whats the difference between 'mysql_db_query' and 'mysql_query'? > -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Coding PHP with register_globals off
Seeing as a question concerning register_globals seems to be posted every day - I thought this link might be useful to some: http://www.zend.com/zend/art/art-sweat4.php Neil -- -- www.curvedvision.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php