Re: [PHP] Quick Question
The address to subscribe to the javascript list is http://lists.evolt.org/mailman/listinfo/javascript There is a link there to the archives. -- Malka Cymbalista Webmaster, Weizmann Institute of Science malki.cymbali...@weizmann.ac.il 08-934-3036 On 6/15/2010 at 12:16 AM, in message 513c9a13-7e3a-44e5-a3b3-1e15bb467...@designdrumm.com, Karl DeSaulniers k...@designdrumm.com wrote: Thanks Malka, I was wondering if you had a web page I could go to before I sign up to see some discussions that have taken place. I tried using the lists.evolt.org, but it did not show the javascript section. TIA, Karl On Jun 14, 2010, at 3:20 AM, Malka Cymbalista wrote: javascr...@lists.evolt.org -- Malka Cymbalista Webmaster, Weizmann Institute of Science malki.cymbali...@weizmann.ac.il 08-934-3036 On 6/14/2010 at 2:06 AM, in message 26040320-88f0-4cf3-84ca-2ff81891b...@designdrumm.com, Karl DeSaulniers k...@designdrumm.com wrote: Hello List, I may have asked this before, but can not find any emails about it. Does anyone know of a general-javascript email list like this php list? Hoping someone here can point me in the right direction. TIA Karl DeSaulniers Design Drumm http://designdrumm.com Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick Question
Thanks Malka, I was wondering if you had a web page I could go to before I sign up to see some discussions that have taken place. I tried using the lists.evolt.org, but it did not show the javascript section. TIA, Karl On Jun 14, 2010, at 3:20 AM, Malka Cymbalista wrote: javascr...@lists.evolt.org -- Malka Cymbalista Webmaster, Weizmann Institute of Science malki.cymbali...@weizmann.ac.il 08-934-3036 On 6/14/2010 at 2:06 AM, in message 26040320-88f0-4cf3-84ca-2ff81891b...@designdrumm.com, Karl DeSaulniers k...@designdrumm.com wrote: Hello List, I may have asked this before, but can not find any emails about it. Does anyone know of a general-javascript email list like this php list? Hoping someone here can point me in the right direction. TIA Karl DeSaulniers Design Drumm http://designdrumm.com Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick Question
On Jun 14, 2010, at 3:45 PM, Paul M Foster wrote: On Sun, Jun 13, 2010 at 06:06:16PM -0500, Karl DeSaulniers wrote: Hello List, I may have asked this before, but can not find any emails about it. Does anyone know of a general-javascript email list like this php list? Hoping someone here can point me in the right direction. TIA Listen, Karl, if you find something like this, let me know. I've been looking for a javascript list as well. Thanks, Paul -- Paul M. Foster Hi Paul, I will post my results here when I find something. Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick Question
On Mon, Jun 14, 2010 at 4:36 AM, Karl DeSaulniers k...@designdrumm.com wrote: Hello List, I may have asked this before, but can not find any emails about it. Does anyone know of a general-javascript email list like this php list? Hoping someone here can point me in the right direction. TIA Karl DeSaulniers Design Drumm http://designdrumm.com I don't know about MLs, but you can look for some user groups on google and yahoo. -- Nilesh Govindarajan Facebook: nilesh.gr Twitter: nileshgr Website: www.itech7.com Cheap and Reliable VPS Hosting: http://j.mp/arHk5e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question - need a site i can more or less copy from
bruce schreef: Hi... Working on a test app, and I need a web interface to test/view the underlying information. Looking for (hopefully) quick pointers/suggestions. I'm dealing with a number of cli web crawling apps that return data. I'm trying to find a quick app that I can modify the db schema, as well as some of the underlying logic to display my data. my returned data consists of: university school dept class classname classID classdescription classA classB faculty The above is a represenation of the levels of data. I'm looking to have multiple tbls, each of which links to the child tbl... I'm not a web dev, and i'm looking for some sort of web app that i might rip apart/modify so i can start to be able to view this data on a web app.. i'm currently looking through sourceforge/freshmeat/etc... if all you really want is just to view/hack the data at a very raw level, try phpmyadmin (i'm assuming your using mysql) thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question - need a site i can more or less copy from
Hi... Working on a test app, and I need a web interface to test/view the underlying information. Looking for (hopefully) quick pointers/suggestions. I'm dealing with a number of cli web crawling apps that return data. I'm trying to find a quick app that I can modify the db schema, as well as some of the underlying logic to display my data. my returned data consists of: university school dept class classname classID classdescription classA classB faculty The above is a represenation of the levels of data. I'm looking to have multiple tbls, each of which links to the child tbl... I'm not a web dev, and i'm looking for some sort of web app that i might rip apart/modify so i can start to be able to view this data on a web app.. i'm currently looking through sourceforge/freshmeat/etc... thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding debugging and PHP structure.
Ashley Sheridan wrote: On Wed, 2008-12-31 at 20:41 +, Ólafur Waage wrote: Short: Is it possible to see the PHP code that is going to be processed in whole? Long: I love to see things visually, and while programming i create all kinds of debugging variables i keep on the side for each page/request. I know this is possibly not possible since this has to be done from either the Zend Engine or PHP itself, but if i could see a complete output of all the code within my project that is used for a certain execution. Example: I call index.php?page=10 index.php includes functions.php and classes.php classes.php include page_classes.php if there is a $_GET[page] variable set and product_classes.php if there is a $_GET[product] variable set What i would like to see is the linear output of what code is included (so the data of functions.php, classes.php, then page_classes.php, and then index.php (not product_classes.php since its not included within this request) This is most likely possible with some PHP code but I'm thinking of trying to make sense of an old project i didn't create quickly and if this is possible it would help a lot. Have you looked at PHPDebug? It offers something similar to what has been offered by ASP, ColdFusion, and .Net in terms of debugging output, and could help you? Ash www.ashleysheridan.co.uk you can also just use eclipse+pdt, stick it in debug mode and step through every line of code exploring all the variables and such like every step of the way -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question regarding debugging and PHP structure.
Short: Is it possible to see the PHP code that is going to be processed in whole? Long: I love to see things visually, and while programming i create all kinds of debugging variables i keep on the side for each page/request. I know this is possibly not possible since this has to be done from either the Zend Engine or PHP itself, but if i could see a complete output of all the code within my project that is used for a certain execution. Example: I call index.php?page=10 index.php includes functions.php and classes.php classes.php include page_classes.php if there is a $_GET[page] variable set and product_classes.php if there is a $_GET[product] variable set What i would like to see is the linear output of what code is included (so the data of functions.php, classes.php, then page_classes.php, and then index.php (not product_classes.php since its not included within this request) This is most likely possible with some PHP code but I'm thinking of trying to make sense of an old project i didn't create quickly and if this is possible it would help a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding debugging and PHP structure.
On Wed, 2008-12-31 at 20:41 +, Ólafur Waage wrote: Short: Is it possible to see the PHP code that is going to be processed in whole? Long: I love to see things visually, and while programming i create all kinds of debugging variables i keep on the side for each page/request. I know this is possibly not possible since this has to be done from either the Zend Engine or PHP itself, but if i could see a complete output of all the code within my project that is used for a certain execution. Example: I call index.php?page=10 index.php includes functions.php and classes.php classes.php include page_classes.php if there is a $_GET[page] variable set and product_classes.php if there is a $_GET[product] variable set What i would like to see is the linear output of what code is included (so the data of functions.php, classes.php, then page_classes.php, and then index.php (not product_classes.php since its not included within this request) This is most likely possible with some PHP code but I'm thinking of trying to make sense of an old project i didn't create quickly and if this is possible it would help a lot. Have you looked at PHPDebug? It offers something similar to what has been offered by ASP, ColdFusion, and .Net in terms of debugging output, and could help you? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question regarding $_SESSION and header()
I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding $_SESSION and header()
On Thu, Dec 11, 2008 at 2:01 PM, Ólafur Waage olaf...@gmail.com wrote: I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yep, what bug are you running into? Remember you have session_start() on the next page for it to be there. -- -Dan Joseph www.canishosting.com - Plans start @ $1.99/month. Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life.
Re: [PHP] Quick question regarding $_SESSION and header()
On Thu, Dec 11, 2008 at 14:01, Ólafur Waage olaf...@gmail.com wrote: I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. This isn't a bug in PHP, it's actually in adherance with HTTP standards (and current browser standards). Prior to doing a header() redirect, you have to force the cookie to be written with session_write_close(). -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-QA] Re: [PHP] Quick question regarding $_SESSION and header()
(Forwarding back to PHP General for the archives.) On Thu, Dec 11, 2008 at 14:31, Ólafur Waage olaf...@gmail.com wrote: Its fixed, thanks guys :) On Thu, Dec 11, 2008 at 7:16 PM, Daniel Brown danbr...@php.net wrote: On Thu, Dec 11, 2008 at 14:01, Ólafur Waage olaf...@gmail.com wrote: I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. This isn't a bug in PHP, it's actually in adherance with HTTP standards (and current browser standards). Prior to doing a header() redirect, you have to force the cookie to be written with session_write_close(). -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP Quality Assurance Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-QA] Re: [PHP] Quick question regarding $_SESSION and header()
Whoops, sent the thanks to the wrong list :P On Thu, Dec 11, 2008 at 7:33 PM, Daniel Brown danbr...@php.net wrote: (Forwarding back to PHP General for the archives.) On Thu, Dec 11, 2008 at 14:31, Ólafur Waage olaf...@gmail.com wrote: Its fixed, thanks guys :) On Thu, Dec 11, 2008 at 7:16 PM, Daniel Brown danbr...@php.net wrote: On Thu, Dec 11, 2008 at 14:01, Ólafur Waage olaf...@gmail.com wrote: I should be able to set a session var and then do a header redirect right? Small bug regarding that and i just need to be sure. This isn't a bug in PHP, it's actually in adherance with HTTP standards (and current browser standards). Prior to doing a header() redirect, you have to force the cookie to be written with session_write_close(). -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP Quality Assurance Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
I said AFAIK. I was under the impression the DirectoryIndex did a redirect. I just tested it and it does not, so you are correct Jochem. He has everything he needs. He'll need the document root and $_SERVER['REQUEST_URI'] to do this. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jochem Maas wrote: Micah Gersten schreef: What is the point of figuring that out? If we knew that, we might be able to help you with a solution. As it stands what you want is not possible AFAIK. you know wrong. he has all the info needed. 1. the document root of the site (/var/www/example.com) 2. the requested URL (http://www.example.com/foo/bar) extract the path from the URL and stick into to the document root, problem sorted. No? do this: var_dump($_SERVER, $_REQUEST); read the output it contains, it should have everything you need although you will have to do some munging. for more esoteric setups you will have to test the code for completeness and possible expand it's capability to be able to tackle those situations. take it a step at a time. me thinks I made it sound more complicated than it is for most scenarios ... reading your last post it seems the answer is (for now) quite straight forward. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I am within a certain directory of the server via the browser. Example: http://www.example.com/foo/bar would be /var/www/example.com/foo/bar And Apache's DirectoryIndex feature is opening a index.php file that is located at /var/www/example.com/test/index.php And from that file i need to figure out the full local path of /foo/bar (which would be /var/www/example.com/foo/bar ) or any other directory i browse too. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
I am pretty certain that this isnt possible under current code. But i just wanted a confirmation on this, since i worked on the code for a while trying to get to the end point. And yes Jochem, i am looking for a magical location :P Well, thanks guys :) Ólafur Waage 2008/8/24 Micah Gersten [EMAIL PROTECTED]: What is the point of figuring that out? If we knew that, we might be able to help you with a solution. As it stands what you want is not possible AFAIK. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I am within a certain directory of the server via the browser. Example: http://www.example.com/foo/bar would be /var/www/example.com/foo/bar And Apache's DirectoryIndex feature is opening a index.php file that is located at /var/www/example.com/test/index.php And from that file i need to figure out the full local path of /foo/bar (which would be /var/www/example.com/foo/bar ) or any other directory i browse too. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Micah Gersten schreef: What is the point of figuring that out? If we knew that, we might be able to help you with a solution. As it stands what you want is not possible AFAIK. you know wrong. he has all the info needed. 1. the document root of the site (/var/www/example.com) 2. the requested URL (http://www.example.com/foo/bar) extract the path from the URL and stick into to the document root, problem sorted. No? do this: var_dump($_SERVER, $_REQUEST); read the output it contains, it should have everything you need although you will have to do some munging. for more esoteric setups you will have to test the code for completeness and possible expand it's capability to be able to tackle those situations. take it a step at a time. me thinks I made it sound more complicated than it is for most scenarios ... reading your last post it seems the answer is (for now) quite straight forward. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I am within a certain directory of the server via the browser. Example: http://www.example.com/foo/bar would be /var/www/example.com/foo/bar And Apache's DirectoryIndex feature is opening a index.php file that is located at /var/www/example.com/test/index.php And from that file i need to figure out the full local path of /foo/bar (which would be /var/www/example.com/foo/bar ) or any other directory i browse too. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results Ólafur Waage 2008/8/23 Robert Cummings [EMAIL PROTECTED]: On Fri, 2008-08-22 at 22:13 -0400, Eric Butera wrote: On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Maybe dirname(__FILE__) will help. When I'm looking for candidates to determine stuff like this I usually do print_r( $_SERVER ) and see what's what. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Luke, i am looking for local directory info. Not URL info as i said before. And Ashley, as i said in the original mail. I had tried $_SERVER. Thanks for the reply though. Ólafur Waage 2008/8/23 Luke [EMAIL PROTECTED]: $_REQUEST? Luke Slater Lead Developer NuVoo On 23 Aug 2008, at 12:53, Ólafur Waage [EMAIL PROTECTED] wrote: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results Ólafur Waage 2008/8/23 Robert Cummings [EMAIL PROTECTED]: On Fri, 2008-08-22 at 22:13 -0400, Eric Butera wrote: On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Maybe dirname(__FILE__) will help. When I'm looking for candidates to determine stuff like this I usually do print_r( $_SERVER ) and see what's what. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for 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] Quick question regarding getcwd() and directory location.
2008/8/23 Ólafur Waage [EMAIL PROTECTED]: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results If checking the output of phpinfo() doesn't help (and it looks like it won't), I'd suggest starting with REQUEST_URI, then, if you know where your webroot is, you should be able to calculate the path to the target directory (/var/www/example/../test/ in your original example) by gluing bits of path together. Hardly an ideal solution as it needs configuration, but it would work. I think this is really a mod_rewrite problem, as by the time PHP takes over you've lost the information you need. You may have better luck in a forum devoted to mod_rewrite, but I'm not optimistic that it has a what file would have handled this request if mod_rewrite hadn't run parameter. I think you're going to have to build your directory path from the information in the original request and some configuration glue. Good luck (BTW, I initially thought there might be something in mod_autoindex to run a custom script, but it doesn't look like there is.) -- http://www.otton.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Thanks for this David, i was using REQUEST_URI and other $_SERVER info and mixed that together. It worked in some situations but on hosted servers (like GoDaddy and others like that where they use a complicated directory setup) it does not work. Olafur Waage 2008/8/23 David Otton [EMAIL PROTECTED]: 2008/8/23 Ólafur Waage [EMAIL PROTECTED]: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results If checking the output of phpinfo() doesn't help (and it looks like it won't), I'd suggest starting with REQUEST_URI, then, if you know where your webroot is, you should be able to calculate the path to the target directory (/var/www/example/../test/ in your original example) by gluing bits of path together. Hardly an ideal solution as it needs configuration, but it would work. I think this is really a mod_rewrite problem, as by the time PHP takes over you've lost the information you need. You may have better luck in a forum devoted to mod_rewrite, but I'm not optimistic that it has a what file would have handled this request if mod_rewrite hadn't run parameter. I think you're going to have to build your directory path from the information in the original request and some configuration glue. Good luck (BTW, I initially thought there might be something in mod_autoindex to run a custom script, but it doesn't look like there is.) -- http://www.otton.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Ólafur Waage schreef: Robert, thanks for the reply but i had tried __FILE__ and __DIR__ (which is dirname(__FILE__)) but it doesnt work. __DIR__ only came into existence very recently IIRC, realpath(dirname(__FILE__)); will tell you what directory the *current script* is actually living in ... anything $_SERVER won't help you as is, although it might seem to under certain conditions. your looking to determine what the directory is of the script that was originally called by the webserver, after any magic URL rewriting, etc has taken place ... this is actually a PITA to do under certain situations, and by the sounds of it your trying to build something that will work regardless. I run into this stuff before and ended up have to generate the information myself based on various values like $_SERVER[DOCUMENT_ROOT], $_SERVER[PATH_INFO] and $_SERVER[REQUEST_URI]. to be clear, your not looking for 'the current directory' but rather something more vague i.e. 'the local absolute path to the directory that maps to the URL that the user requested' (the code to determine that will probably be as annoying to grok as that last sentence ;-) And thanks for the reply also Ashley but as i said in my first post, i had tried $_SERVER with limited results Ólafur Waage 2008/8/23 Robert Cummings [EMAIL PROTECTED]: On Fri, 2008-08-22 at 22:13 -0400, Eric Butera wrote: On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Maybe dirname(__FILE__) will help. When I'm looking for candidates to determine stuff like this I usually do print_r( $_SERVER ) and see what's what. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
What is the point of figuring that out? If we knew that, we might be able to help you with a solution. As it stands what you want is not possible AFAIK. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I am within a certain directory of the server via the browser. Example: http://www.example.com/foo/bar would be /var/www/example.com/foo/bar And Apache's DirectoryIndex feature is opening a index.php file that is located at /var/www/example.com/test/index.php And from that file i need to figure out the full local path of /foo/bar (which would be /var/www/example.com/foo/bar ) or any other directory i browse too. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
How are you browsing to it from within PHP? Depending on how you are doing it, the way to get the cwd is different Ash www.ashleysheridan.co.uk ---BeginMessage--- I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Thanks for the reply Micah but i have no interest in the URL. I am looking for the servers local path to the directory. (example: /var/www/directory/ or C:\apache\htdocs\directory\) Also the HTTP_REFERER is empty unless you are linked in from another location. And then it gives you the URL you came from. Ólafur Waage. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
You might want to try a Redirect Rule or rewrite which would tell you the HTTP PATH. AFAIK, there is no way to know which directory they tried to access unless you write your own index.php and store it in a session variable. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: Thanks for the reply Micah but i have no interest in the URL. I am looking for the servers local path to the directory. (example: /var/www/directory/ or C:\apache\htdocs\directory\) Also the HTTP_REFERER is empty unless you are linked in from another location. And then it gives you the URL you came from. Ólafur Waage. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
That is the brick wall i faced. There is no way to know where exactly you are (via DirectoryIndex) locally on the machine. Thanks though. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: You might want to try a Redirect Rule or rewrite which would tell you the HTTP PATH. AFAIK, there is no way to know which directory they tried to access unless you write your own index.php and store it in a session variable. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: Thanks for the reply Micah but i have no interest in the URL. I am looking for the servers local path to the directory. (example: /var/www/directory/ or C:\apache\htdocs\directory\) Also the HTTP_REFERER is empty unless you are linked in from another location. And then it gives you the URL you came from. Ólafur Waage. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
On Fri, 2008-08-22 at 21:56 +, Ólafur Waage wrote: That is the brick wall i faced. There is no way to know where exactly you are (via DirectoryIndex) locally on the machine. Thanks though. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: You might want to try a Redirect Rule or rewrite which would tell you the HTTP PATH. AFAIK, there is no way to know which directory they tried to access unless you write your own index.php and store it in a session variable. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: Thanks for the reply Micah but i have no interest in the URL. I am looking for the servers local path to the directory. (example: /var/www/directory/ or C:\apache\htdocs\directory\) Also the HTTP_REFERER is empty unless you are linked in from another location. And then it gives you the URL you came from. Ólafur Waage. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage Are you just trying to find the current working directory, or are you navigating to a directory with PHP and want to know where you've ended up? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
I am within a certain directory of the server via the browser. Example: http://www.example.com/foo/bar would be /var/www/example.com/foo/bar And Apache's DirectoryIndex feature is opening a index.php file that is located at /var/www/example.com/test/index.php And from that file i need to figure out the full local path of /foo/bar (which would be /var/www/example.com/foo/bar ) or any other directory i browse too. Ólafur Waage 2008/8/22 Ashley Sheridan [EMAIL PROTECTED]: On Fri, 2008-08-22 at 21:56 +, Ólafur Waage wrote: That is the brick wall i faced. There is no way to know where exactly you are (via DirectoryIndex) locally on the machine. Thanks though. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: You might want to try a Redirect Rule or rewrite which would tell you the HTTP PATH. AFAIK, there is no way to know which directory they tried to access unless you write your own index.php and store it in a session variable. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: Thanks for the reply Micah but i have no interest in the URL. I am looking for the servers local path to the directory. (example: /var/www/directory/ or C:\apache\htdocs\directory\) Also the HTTP_REFERER is empty unless you are linked in from another location. And then it gives you the URL you came from. Ólafur Waage. 2008/8/22 Micah Gersten [EMAIL PROTECTED]: Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage Are you just trying to find the current working directory, or are you navigating to a directory with PHP and want to know where you've ended up? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Maybe dirname(__FILE__) will help.
Re: [PHP] Quick question regarding getcwd() and directory location.
On Fri, 2008-08-22 at 22:13 -0400, Eric Butera wrote: On Thu, Aug 21, 2008 at 8:50 PM, Ólafur Waage [EMAIL PROTECTED] wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Maybe dirname(__FILE__) will help. When I'm looking for candidates to determine stuff like this I usually do print_r( $_SERVER ) and see what's what. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question regarding getcwd() and directory location.
I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question regarding getcwd() and directory location.
Once you tell apache to load /example/index.php, that's where you are. You might try looking at the $_SERVER['HTTP_REFERER']. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Ólafur Waage wrote: I'll throw out an example here. I have a directory structure of: /var/www/example/ And in that i have a file: index.php That file echo's getcwd() and returns: /var/www/example/ Now i tell Apache or Lighty that if a directory does not have an index.php file, that it should use /example/index.php (for example via DirectoryIndex of Apache) Then i make a new directory: /var/www/test/ And browse to it and it echo's /var/www/example/ since its running that file via DirectoryIndex This is true for all directories i make. Both for Windows and Linux based servers. To my question. I am trying to get the full path of the current directory i am in. Not from where the file is executing. How is that possible so it displays a full path to that directory (regardless to the server setup)? I have tried a variation of things and have gotten mixed results. Using $_SERVER[SCRIPT_FILENAME] gives me the index file and the full path to that. $_SERVER[DOCUMENT_ROOT] gets me part of the way but on a hosted server with multiple domains it only gives me a partial path (rough example: /var/www/ when the directory is /var/www/domain.com/test/) And __FILE__ gives me the index.php's path. I have also tried realpath(.); And server(pwd); with no luck. Any help would be appreciated. Ólafur Waage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question
Hi Ho to read date from HTML form - How to read $_POST['date']=dd/mm/ string variable as a date? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question
Ho to read date from HTML form - How to read $_POST['date']=dd/mm/ string variable as a date? If you want a unix timestamp then try investigating strtotime(). -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] quick question
What do you mean read a string as a date, a date object? Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: Merca, Ansta Ltd [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 9 de maio de 2008 06:36 Para: php-general@lists.php.net Assunto: [PHP] quick question Hi Ho to read date from HTML form - How to read $_POST['date']=dd/mm/ string variable as a date? -- 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] quick question
Well, when I try date('d/m/y', strtotime($_POST('date')) - it seems mixing day and month, I tried setlocale(LC_ALL, 'en_GB'); but it didn't strtotime() returns a unix timestamp (ie number of seconds since 1970ish. Nothing to do with the date object. -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question
Well, when I try date('d/m/y', strtotime($_POST('date')) - it seems mixing day and month, I tried setlocale(LC_ALL, 'en_GB'); but it didn't If you're sure that's the format of the date, this will do it... list($day, $month, $year) = explode('/', $thedate); $thetimestamp = mktime(0, 0, 0, $month, $day, $year); -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question on data formatting
At 12:30 AM -0500 11/29/07, Robert Cummings wrote: On Wed, 2007-11-28 at 22:19 -0700, Jon Westcot wrote: $123,456.78 becomes 123456.78 $24,680 becomes 24680 1234B becomes 1234 $number = ereg_replace( '[^[:digit:].]', '' ); Cheers, Rob. Sweet. Another one of those staple functions we all should have (or at least me). Thanks, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question on data formatting
Hi all: Since I'm relatively new to PHP, I'm not familiar with all of the shortcuts and efficient ways one could write a routine that handles converting data from one format into another, so I thought I'd ask here for recommendations on how to solve one particular issue I've got. I'm viewing this as a learning experience for me. I've got some text fields coming in that need to be added to a table as numeric fields. In particular, I've got to process dollar amounts that appear with dollar signs and commas into their strictly numeric forms. For example: $123,456.78 becomes 123456.78 $24,680 becomes 24680 1234B becomes 1234 (That last example is an actual example of something I saw in the data file; I can only assume that the user wanted 1234, as that's the closest value I can assume from what was typed in.) What is the fastest, most efficient way to perform these conversions? I'm coming at PHP from old school experience where I'd normally read through the text character by character and return a value built from only the characters I have declared as acceptable (i.e., 0-9 and . and possibly a -), but I've got to believe that there's some technique -- or possibly a deeply buried function -- available to me now that would be faster and easier to implement. Any help you can provide will, as always, be greatly appreciated! Thanks, Jon
Re: [PHP] Quick question on data formatting
On Wed, 2007-11-28 at 22:19 -0700, Jon Westcot wrote: Hi all: Since I'm relatively new to PHP, I'm not familiar with all of the shortcuts and efficient ways one could write a routine that handles converting data from one format into another, so I thought I'd ask here for recommendations on how to solve one particular issue I've got. I'm viewing this as a learning experience for me. I've got some text fields coming in that need to be added to a table as numeric fields. In particular, I've got to process dollar amounts that appear with dollar signs and commas into their strictly numeric forms. For example: $123,456.78 becomes 123456.78 $24,680 becomes 24680 1234B becomes 1234 $number = ereg_replace( '[^[:digit:].]', '' ); Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question on data formatting [SOLVED]
Thanks, Rob! I can see that it's going to be important for me to get familiar with the POSIX regular expressions. Jon - Original Message - On Wed, 2007-11-28 at 22:19 -0700, Jon Westcot wrote: Hi all: Since I'm relatively new to PHP, I'm not familiar with all of the shortcuts and efficient ways one could write a routine that handles converting data from one format into another, so I thought I'd ask here for recommendations on how to solve one particular issue I've got. I'm viewing this as a learning experience for me. I've got some text fields coming in that need to be added to a table as numeric fields. In particular, I've got to process dollar amounts that appear with dollar signs and commas into their strictly numeric forms. For example: $123,456.78 becomes 123456.78 $24,680 becomes 24680 1234B becomes 1234 $number = ereg_replace( '[^[:digit:].]', '' ); Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question on data formatting [SOLVED]
On Wed, 2007-11-28 at 22:47 -0700, Jon Westcot wrote: Thanks, Rob! I can see that it's going to be important for me to get familiar with the POSIX regular expressions. You can use the perl versions too. I just got used to the posix versions a long time ago :). BTW, if you didn't notice I forgot the third parameter :) Cheers, Rob. - Original Message - On Wed, 2007-11-28 at 22:19 -0700, Jon Westcot wrote: Hi all: Since I'm relatively new to PHP, I'm not familiar with all of the shortcuts and efficient ways one could write a routine that handles converting data from one format into another, so I thought I'd ask here for recommendations on how to solve one particular issue I've got. I'm viewing this as a learning experience for me. I've got some text fields coming in that need to be added to a table as numeric fields. In particular, I've got to process dollar amounts that appear with dollar signs and commas into their strictly numeric forms. For example: $123,456.78 becomes 123456.78 $24,680 becomes 24680 1234B becomes 1234 $number = ereg_replace( '[^[:digit:].]', '' ); -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question, a little 0T i guess... BASIC_AUTH or forms
Hey all! Quick question, one of our sites already uses BASIC_AUTH to take the username and pass from clients, we were thinking of instead doing it via a login form (so we can also add a CAPTCHA later...if needed) what I would like to know is, by using a login form instead of a BASIC_AUTH are we comprimising security in any way (for example if someone is using a sniffer) or does BASIC_AUTH have some kind of extra inbuilt security that forms dont have that I am not aware of? Thanks! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends.
Re: [PHP] Quick question, a little 0T i guess... BASIC_AUTH or forms
Ryan A wrote: Quick question, one of our sites already uses BASIC_AUTH to take the username and pass from clients, we were thinking of instead doing it via a login form (so we can also add a CAPTCHA later...if needed) what I would like to know is, by using a login form instead of a BASIC_AUTH are we comprimising security in any way (for example if someone is using a sniffer) or does BASIC_AUTH have some kind of extra inbuilt security that forms dont have that I am not aware of? Basic authentication offers no more security than a form - the login details are sent as plain text using both methods. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question, a little 0T i guess... BASIC_AUTH or forms
I think you meant to send this to the OP not me. And please also include the list in your replies. Tijnema ! wrote: The best way is using a HTML form, and then adding a javascript ,that runs before submitting, that encrypts the password with md5. This offers little more security than plain text. Your encryption mechanism is visible to the bad guys, so all you've done is added an extra no-brainer hurdle for them to get over. At the end of the day the best way to secure data being transferred from client to server is to use SSL. -Stut On 3/4/07, *Stut* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Ryan A wrote: Quick question, one of our sites already uses BASIC_AUTH to take the username and pass from clients, we were thinking of instead doing it via a login form (so we can also add a CAPTCHA later...if needed) what I would like to know is, by using a login form instead of a BASIC_AUTH are we comprimising security in any way (for example if someone is using a sniffer) or does BASIC_AUTH have some kind of extra inbuilt security that forms dont have that I am not aware of? Basic authentication offers no more security than a form - the login details are sent as plain text using both methods. -Stut -- PHP General Mailing List (http://www.php.net/ 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] Quick question, a little 0T i guess... BASIC_AUTH or forms
Hi guys, Thank you for your responses and your input. At the end of the day the best way to secure data being transferred from client to server is to use SSL. THAT I know ;) was just wondering from a normal http page... and you answered that question perfectly...so thanks again! Would someone mind sending me that javascript in question, I dont think I will be using it but I would like to have a look at it. Cheers! R Stut [EMAIL PROTECTED] wrote: I think you meant to send this to the OP not me. And please also include the list in your replies. Tijnema ! wrote: The best way is using a HTML form, and then adding a javascript ,that runs before submitting, that encrypts the password with md5. This offers little more security than plain text. Your encryption mechanism is visible to the bad guys, so all you've done is added an extra no-brainer hurdle for them to get over. At the end of the day the best way to secure data being transferred from client to server is to use SSL. -Stut On 3/4/07, *Stut* wrote: Ryan A wrote: Quick question, one of our sites already uses BASIC_AUTH to take the username and pass from clients, we were thinking of instead doing it via a login form (so we can also add a CAPTCHA later...if needed) what I would like to know is, by using a login form instead of a BASIC_AUTH are we comprimising security in any way (for example if someone is using a sniffer) or does BASIC_AUTH have some kind of extra inbuilt security that forms dont have that I am not aware of? Basic authentication offers no more security than a form - the login details are sent as plain text using both methods. -Stut -- 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 -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Don't get soaked. Take a quick peak at the forecast with theYahoo! Search weather shortcut.
Re: [PHP] quick question about preg_replace
On Thu, 05 Oct 2006 09:29:46 +0800, Penthexquadium wrote: On Wed, 4 Oct 2006 23:19:58 +0200, Martin Bach Nielsen [EMAIL PROTECTED] wrote: Hi all. I have written a guestbook (I know, there's a ton out there), which until recently did not get any spam, so now I'm trying to remove the spam-ad by using preg_replace: $melding = preg_replace('/(a href=\http:\/\/[^^]+)/i', This message is temporarily cut-off due to spam-suspicion., $melding); However, this only makes the problem half-solved, since I also want any text before the link to be replaced with a message as stated above. The above line removes anything after 'a href=//'. Is there any way to make the above line to include anything before the a href=// ? I have tried different options, and yes, I have read the php manual on preg_replace, but I might not have properly identified how to get the text in front modified. Thankful for any hints, tips, links, anything that helps :-) Regards, Martin Bach Nielsen If you only want to replace the line including url(s) by a message, a simple regular expression is enough. ?php $melding = This is a spam.\n . This is a a href=\http://www.example.com/\;example/a line.\n . Another line.\n . a href=\http://www.e.com/ads/show?n=123\;123/a (456)\n . End Line.\n; $melding = preg_replace(/.*?a href=\http:\/\/.+/i, This line is temporarily cut-off due to spam-suspicion., $melding); echo $melding; ? The script above will output: This is a spam. This line is temporarily cut-off due to spam-suspicion. Another line. This line is temporarily cut-off due to spam-suspicion. End Line. If you use this code, be sure to use lt; in stead of and gt; in stead of or else the spam messages won't be shown. Otherwise, if you want the entire message changed, it's quicker to do: if (preg_match('/(a href=\http:\/\/[^^]+)/i', $melding)) { $melding = 'This message is temporarily cut-off due to spam-suspicion.'; } Just an idea... Ivo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question about preg_replace
Hi all. I have written a guestbook (I know, there's a ton out there), which until recently did not get any spam, so now I'm trying to remove the spam-ad by using preg_replace: $melding = preg_replace('/(a href=\http:\/\/[^^]+)/i', This message is temporarily cut-off due to spam-suspicion., $melding); However, this only makes the problem half-solved, since I also want any text before the link to be replaced with a message as stated above. The above line removes anything after 'a href=//'. Is there any way to make the above line to include anything before the a href=// ? I have tried different options, and yes, I have read the php manual on preg_replace, but I might not have properly identified how to get the text in front modified. Thankful for any hints, tips, links, anything that helps :-) Regards, Martin Bach Nielsen
Re: [PHP] quick question about preg_replace
On Wed, 4 Oct 2006 23:19:58 +0200, Martin Bach Nielsen [EMAIL PROTECTED] wrote: Hi all. I have written a guestbook (I know, there's a ton out there), which until recently did not get any spam, so now I'm trying to remove the spam-ad by using preg_replace: $melding = preg_replace('/(a href=\http:\/\/[^^]+)/i', This message is temporarily cut-off due to spam-suspicion., $melding); However, this only makes the problem half-solved, since I also want any text before the link to be replaced with a message as stated above. The above line removes anything after 'a href=//'. Is there any way to make the above line to include anything before the a href=// ? I have tried different options, and yes, I have read the php manual on preg_replace, but I might not have properly identified how to get the text in front modified. Thankful for any hints, tips, links, anything that helps :-) Regards, Martin Bach Nielsen If you only want to replace the line including url(s) by a message, a simple regular expression is enough. ?php $melding = This is a spam.\n . This is a a href=\http://www.example.com/\;example/a line.\n . Another line.\n . a href=\http://www.e.com/ads/show?n=123\;123/a (456)\n . End Line.\n; $melding = preg_replace(/.*?a href=\http:\/\/.+/i, This line is temporarily cut-off due to spam-suspicion., $melding); echo $melding; ? The script above will output: This is a spam. This line is temporarily cut-off due to spam-suspicion. Another line. This line is temporarily cut-off due to spam-suspicion. End Line. -- Sorry for my poor English. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[Fwd: RE: [PHP] Quick Question re: Windows/Linux PHP]
but what would I do with my life once I 'got it'? Original Message It would be nice if you read some of my other threads regarding PHP5 before opening your mouth and saying something stupid. People like you are the reason why I don't post very often to these lists. I would rather struggle for days with it than listen to some halfwit like you who's got nothing better to do. Get a life moron. -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: July 1, 2006 6:41 AM To: Beauford Cc: php-general@lists.php.net Subject: Re: [PHP] Quick Question re: Windows/Linux PHP Beauford wrote: Hi, I'm just curious, because I come across this from time to time. Why does the code below work on Windows and not on Linux. PHP is 5.0 on Linux and 4.4 on Windows (still can't get 5 on Windows). The code at the what stops you from installing php5 on windows? - it's not like it's very difficult. very bottom is how I got it to work on Linux. Also, why is it with the same ah yes good of you to point out which line(s) you changed. setup I can't call a function within a function in Linux, but can in Windows. Sorry I don't have the error, but something about calling a static if your too lazy to run the code one more time to copy and paste the error then why should anyone help you? function. Would this be a difference between OS's or with the different versions of PHP? it's something to do with fact that OO in php4 is a world away from OO in php5. Thanks B --- if (empty($subemail)) { $form-setError($field, emailnotentered); } else { $regex = ^[_+a-z0-9-]+(\.[_+a-z0-9-]+)* .@[a-z0-9-]+(\.[a-z0-9-]{1,})* .\.([a-z]{2,}){1}$; if(!eregi($regex,$subemail)){ $form-setError($field, emailinvalid); } $subemail = stripslashes($subemail); } elseif(in_array(strtolower($a), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($b), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($c), $language)) $form-setError($field, profanity); else { $query = SELECT * FROM users WHERE $subemail = 'email'; $result = mysql_query($query)or $mysqlerror = mysql_error(); if ($mysqlerror) { $form-setError($field, tberror); } else { $numrows = mysql_fetch_row($result); if($numrows = mysql_num_rows($result)) { $form-setError($field, duplicatepassword); } } } --- $field = email; list ($a, $b, $c) = split ('[EMAIL PROTECTED]', $subemail); $regex = ^[_+a-z0-9-]+(\.[_+a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]{1,})*\.([a-z]{2 ,}){1} $; if (empty($subemail)) { $form-setError($field, emailnotentered); } elseif(!eregi($regex,$subemail)){ $form-setError($field, emailinvalid); } elseif(in_array(strtolower($a), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($b), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($c), $language)) $form-setError($field, profanity); else { $query = SELECT * FROM users WHERE $subemail = 'email'; $result = mysql_query($query)or $mysqlerror = mysql_error(); if ($mysqlerror) { $form-setError($field, tberror); } else { $numrows = mysql_fetch_row($result); if($numrows = mysql_num_rows($result)) { $form-setError($field, duplicatepassword); } } } -- 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] Quick Question re: Windows/Linux PHP
On 7/1/06, Beauford [EMAIL PROTECTED] wrote: Hi, I'm just curious, because I come across this from time to time. Why does the code below work on Windows and not on Linux. PHP is 5.0 on Linux and 4.4 on Windows (still can't get 5 on Windows). The code at the very bottom is how I got it to work on Linux. Also, why is it with the same setup I can't call a function within a function in Linux, but can in Windows. Sorry I don't have the error, but something about calling a static function. Would this be a difference between OS's or with the different versions of PHP? You'll have to narrow down what you're having issues with before anyone will take a look. Is it the regex? Is it lines x - y? Of course you can call a function within a function in linux. We can't help debug that without at least the code and the error. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick Question re: Windows/Linux PHP
Beauford wrote: Hi, I'm just curious, because I come across this from time to time. Why does the code below work on Windows and not on Linux. PHP is 5.0 on Linux and 4.4 on Windows (still can't get 5 on Windows). The code at the what stops you from installing php5 on windows? - it's not like it's very difficult. very bottom is how I got it to work on Linux. Also, why is it with the same ah yes good of you to point out which line(s) you changed. setup I can't call a function within a function in Linux, but can in Windows. Sorry I don't have the error, but something about calling a static if your too lazy to run the code one more time to copy and paste the error then why should anyone help you? function. Would this be a difference between OS's or with the different versions of PHP? it's something to do with fact that OO in php4 is a world away from OO in php5. Thanks B --- if (empty($subemail)) { $form-setError($field, emailnotentered); } else { $regex = ^[_+a-z0-9-]+(\.[_+a-z0-9-]+)* .@[a-z0-9-]+(\.[a-z0-9-]{1,})* .\.([a-z]{2,}){1}$; if(!eregi($regex,$subemail)){ $form-setError($field, emailinvalid); } $subemail = stripslashes($subemail); } elseif(in_array(strtolower($a), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($b), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($c), $language)) $form-setError($field, profanity); else { $query = SELECT * FROM users WHERE $subemail = 'email'; $result = mysql_query($query)or $mysqlerror = mysql_error(); if ($mysqlerror) { $form-setError($field, tberror); } else { $numrows = mysql_fetch_row($result); if($numrows = mysql_num_rows($result)) { $form-setError($field, duplicatepassword); } } } --- $field = email; list ($a, $b, $c) = split ('[EMAIL PROTECTED]', $subemail); $regex = ^[_+a-z0-9-]+(\.[_+a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]{1,})*\.([a-z]{2,}){1} $; if (empty($subemail)) { $form-setError($field, emailnotentered); } elseif(!eregi($regex,$subemail)){ $form-setError($field, emailinvalid); } elseif(in_array(strtolower($a), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($b), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($c), $language)) $form-setError($field, profanity); else { $query = SELECT * FROM users WHERE $subemail = 'email'; $result = mysql_query($query)or $mysqlerror = mysql_error(); if ($mysqlerror) { $form-setError($field, tberror); } else { $numrows = mysql_fetch_row($result); if($numrows = mysql_num_rows($result)) { $form-setError($field, duplicatepassword); } } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick Question re: Windows/Linux PHP
Hi, I'm just curious, because I come across this from time to time. Why does the code below work on Windows and not on Linux. PHP is 5.0 on Linux and 4.4 on Windows (still can't get 5 on Windows). The code at the very bottom is how I got it to work on Linux. Also, why is it with the same setup I can't call a function within a function in Linux, but can in Windows. Sorry I don't have the error, but something about calling a static function. Would this be a difference between OS's or with the different versions of PHP? Thanks B --- if (empty($subemail)) { $form-setError($field, emailnotentered); } else { $regex = ^[_+a-z0-9-]+(\.[_+a-z0-9-]+)* .@[a-z0-9-]+(\.[a-z0-9-]{1,})* .\.([a-z]{2,}){1}$; if(!eregi($regex,$subemail)){ $form-setError($field, emailinvalid); } $subemail = stripslashes($subemail); } elseif(in_array(strtolower($a), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($b), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($c), $language)) $form-setError($field, profanity); else { $query = SELECT * FROM users WHERE $subemail = 'email'; $result = mysql_query($query)or $mysqlerror = mysql_error(); if ($mysqlerror) { $form-setError($field, tberror); } else { $numrows = mysql_fetch_row($result); if($numrows = mysql_num_rows($result)) { $form-setError($field, duplicatepassword); } } } --- $field = email; list ($a, $b, $c) = split ('[EMAIL PROTECTED]', $subemail); $regex = ^[_+a-z0-9-]+(\.[_+a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]{1,})*\.([a-z]{2,}){1} $; if (empty($subemail)) { $form-setError($field, emailnotentered); } elseif(!eregi($regex,$subemail)){ $form-setError($field, emailinvalid); } elseif(in_array(strtolower($a), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($b), $language)) $form-setError($field, profanity); elseif(in_array(strtolower($c), $language)) $form-setError($field, profanity); else { $query = SELECT * FROM users WHERE $subemail = 'email'; $result = mysql_query($query)or $mysqlerror = mysql_error(); if ($mysqlerror) { $form-setError($field, tberror); } else { $numrows = mysql_fetch_row($result); if($numrows = mysql_num_rows($result)) { $form-setError($field, duplicatepassword); } } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
Dotan Cohen wrote: On 7/26/05, Jochem Maas [EMAIL PROTECTED] wrote: ...somebody beat me with a virtual stick if I am wrong! Why? I'd rather just throw the php.net/manual at you! harddrive or memory stick? just /home/dotan/myfiles/docs/php-manual/ but seriously did I err? Not that I see. But don't forget that to err is human. To really fuck things up we invented computers. no sh*t :-) I recieved you last email (to me) 4 times! :-/ Dotan http://lyricslist.com/lyrics/artist_albums/27/alice_in_chains.php Alice In Chains Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
On 7/27/05, Jochem Maas [EMAIL PROTECTED] wrote: Dotan Cohen wrote: On 7/26/05, Jochem Maas [EMAIL PROTECTED] wrote: ...somebody beat me with a virtual stick if I am wrong! Why? I'd rather just throw the php.net/manual at you! harddrive or memory stick? just /home/dotan/myfiles/docs/php-manual/ but seriously did I err? Not that I see. But don't forget that to err is human. To really fuck things up we invented computers. no sh*t :-) I recieved you last email (to me) 4 times! :-/ As if we needed proof! I got a letter from mail admin that the original message couldn't be delivered because of profanity. I wasn't sure if it was from the php server or one of the subscribers, so I changed a naughty little word to a nicer one: two messages. Times two for you, pal, you're in the CC field! (not anymore) Dotan http://lyricslist.com/lyrics/artist_albums/159/dido.php Dido Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
On 7/25/05, Jochem Maas [EMAIL PROTECTED] wrote: ...somebody beat me with a virtual stick if I am wrong! Why? I'd rather just throw the php.net/manual at you! Dotan http://lyricslist.com/lyrics/artist_albums/23/aguilera_christina.php Aguilera, Christina Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
Dotan Cohen wrote: On 7/25/05, Jochem Maas [EMAIL PROTECTED] wrote: ...somebody beat me with a virtual stick if I am wrong! Why? I'd rather just throw the php.net/manual at you! harddrive or memory stick? but seriously did I err? Dotan http://lyricslist.com/lyrics/artist_albums/23/aguilera_christina.php Aguilera, Christina Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
On 7/26/05, Jochem Maas [EMAIL PROTECTED] wrote: ...somebody beat me with a virtual stick if I am wrong! Why? I'd rather just throw the php.net/manual at you! harddrive or memory stick? just /home/dotan/myfiles/docs/php-manual/ but seriously did I err? Not that I see. But don't forget that to err is human. To really fuck things up we invented computers. Dotan http://lyricslist.com/lyrics/artist_albums/27/alice_in_chains.php Alice In Chains Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
On 7/26/05, Jochem Maas [EMAIL PROTECTED] wrote: ...somebody beat me with a virtual stick if I am wrong! Why? I'd rather just throw the php.net/manual at you! harddrive or memory stick? just /home/dotan/myfiles/docs/php-manual/ but seriously did I err? Not that I see. But don't forget that to err is human. To really mess things up we invented computers. Dotan http://lyricslist.com/lyrics/artist_albums/27/alice_in_chains.php Alice In Chains Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
Richard Lynch wrote: On Sun, July 24, 2005 11:39 am, Dotan Cohen said: On 7/24/05, Bruce Gilbert [EMAIL PROTECTED] wrote: I am well versed in coding with xhtml which requires all lower case and am pretty much a newbie at PHP so that is why I am asking this question. is this acceptible if ($_post [sender_email] == ) or does at have to be if ($_POST [sender_email] == ) in short, do uppercase and lowercase always have the same meaning. thx, PHP is case-sensitive. UppERCase is NOT the same as uppercase. HTML is not case sensitive only because browsers are forgiving. PHP variables are case-sensitive. PHP FUNCTIONS are not. You're on your own figuring out if class names/methods are/aren't case-sensitive this week. :-v 1. classname are case-insensitive (at least in all the builds I have running) but since 5.0.1 (IIRC) the engine honors your case when using get_class(), in the past the class name was always returned lowercase. so: php -r 'class Test {} $t = new Test; if ($t instanceof test) { echo yeah!\n; } echo get_class($t),\n;' will echo: yeah! Test 2. methodnames are the same as functionname with regard to case-sensitivity 3. constants (and class constants) are case sensitive. ...somebody beat me with a virtual stick if I am wrong! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question about using capital letters coding w/ PHP
Hello, I am well versed in coding with xhtml which requires all lower case and am pretty much a newbie at PHP so that is why I am asking this question. is this acceptible if ($_post [sender_email] == ) or does at have to be if ($_POST [sender_email] == ) in short, do uppercase and lowercase always have the same meaning. thx, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
On 7/24/05, Bruce Gilbert [EMAIL PROTECTED] wrote: Hello, I am well versed in coding with xhtml which requires all lower case and am pretty much a newbie at PHP so that is why I am asking this question. is this acceptible if ($_post [sender_email] == ) or does at have to be if ($_POST [sender_email] == ) in short, do uppercase and lowercase always have the same meaning. thx, PHP is case-sensitive. UppERCase is NOT the same as uppercase. HTML is not case sensitive only because browsers are forgiving. Dotan http://lyricslist.com/lyrics/artist_albums/282/john_elton.php John, Elton Song Lyrics -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
Bruce Gilbert wrote: is this acceptible if ($_post [sender_email] == ) or does at have to be if ($_POST [sender_email] == ) As a friendly suggestion, you should always try before you ask. You could answer your own question with a few seconds of effort. Typically, such extreme laziness is not rewarded here. Consider yourself lucky this time. :-) If you had instead asked whether you should use $_POST[sender_email] or $_POST['sender_email'], at least we could give you the benefit of the doubt and assume that you actually tried them both. Chris -- Chris Shiflett Brain Bulb, The PHP Consultancy http://brainbulb.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question about using capital letters coding w/ PHP
On Sun, July 24, 2005 11:39 am, Dotan Cohen said: On 7/24/05, Bruce Gilbert [EMAIL PROTECTED] wrote: I am well versed in coding with xhtml which requires all lower case and am pretty much a newbie at PHP so that is why I am asking this question. is this acceptible if ($_post [sender_email] == ) or does at have to be if ($_POST [sender_email] == ) in short, do uppercase and lowercase always have the same meaning. thx, PHP is case-sensitive. UppERCase is NOT the same as uppercase. HTML is not case sensitive only because browsers are forgiving. PHP variables are case-sensitive. PHP FUNCTIONS are not. You're on your own figuring out if class names/methods are/aren't case-sensitive this week. :-v -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick Question re: Input
Hi! This is what I want to do: When the user presses the submit button, run a function along the lines of: form method=post name=form1 action=?php echo addrecord(); ? The addrecord function basically runs an SQL insert. This seems as though it should be uncomplicated. All the code that I look at has the page calling itself again and running code that wasn't used the first time based on some switch. Does anyone know if there is some other kind of solution? This seems so messy to me. I would prefer to keep the function in the page. I am learning php, so please be kind! Thanks for any and all advice! Monique. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Quick Question re: Input
[snip] form method=post name=form1 action=?php echo addrecord(); ? [/snip] Unfortunately you cannot do it like this, you either have to reload the page or send the processing to another namespace. But you can do different buttons... form method=post name=form1 action=processStuff.php input type=submit name=action value=Add Record input type=submit name=action value=Delete Record In processStuff.php ?php switch ($_POST['action']){ case Add Record: ...do stuff... ..redirect back to original page... break; case Delete Record: ...do stuff... ..redirect back to original page... break; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question
how do you set a system path to the top level, i allredy tried '/' but it ignores the last '. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question: PHP user?
Hi, Just a quick question... What user does php run as on linux? Is it the Apache user? Is there some way to tell? I need to be able to set a directory so that only PHP can access it. Thanks, Grant -- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 Iders Incorporated: Confidential Note: This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, Email or facsimile. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question: PHP user?
Just a quick question... What user does php run as on linux? It all depends on how PHP is set up. Do something like: $fff = fopen (./temp,w); fwrite($fff,testing); fclose($fff); in a directory chmod 777. Look at the user id. (For what it's worth on my system its UID 518). -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question: PHP user?
As an apache module it runs as the apache user. On Friday 10 October 2003 17:44, Grant Rutherford wrote: Hi, Just a quick question... What user does php run as on linux? Is it the Apache user? Is there some way to tell? I need to be able to set a directory so that only PHP can access it. Thanks, Grant -- Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net == A computer scientist is someone who fixes things that aren't broken --Unknown -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question - Warnings
From: Ryan A [EMAIL PROTECTED] I know how to suppress warnings in my file locally but i want to suppress warnings and notices in one whole directory using a .htaccess, i cant seem to find my old file that does that, can someone refresh my memory please? This is how i do it in my local file when i want all ON: error_reporting (E_ALL); I need to do the opposite by shuting off all warnings notices in the directory? php_value error_reporting 0 ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick question - Warnings
Hi, I know how to suppress warnings in my file locally but i want to suppress warnings and notices in one whole directory using a .htaccess, i cant seem to find my old file that does that, can someone refresh my memory please? This is how i do it in my local file when i want all ON: error_reporting (E_ALL); I need to do the opposite by shuting off all warnings notices in the directory? Thanks in advance, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question - Warnings
Try using in your PHP page: error_reporting (E_ALL ^ E_NOTICE); Ryan A wrote: Hi John, Thanks for replying, I already tried that and thought i might be mistaken because i am still getting stuff like this: Notice: Undefined index: facility24 in /home/bestweb/public_html/add_co_location.php on line 12 Plenty of notices I tried: php_value error_reporting 0 (and) php_value error_reporting 0; but am still getting those damn notices any other ideas? Thanks, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question
I'm sending credit card info to a 3rd party credit card processing site. I would like to keep the inputted values and, after the approval, have them appear in the value part of the form so that they don't have to re-input the same values they had just put in for the credit card. how can i do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question
You should look at E-xact (http://www.e-xact.com). They have a solution they call tagged transactions that actually replaces the credit card numbers with tags that are only meaningful in the context of your merchant account. That way, you can let your customers make repeat purchases without actually having to store CC numbers on your site. Cheers, Marco -- php|architect - The Magazine for PHP Professionals Get your free copy today at http://www.phparch.com On Mon, 2003-03-10 at 11:46, Doug Parker wrote: I'm sending credit card info to a 3rd party credit card processing site. I would like to keep the inputted values and, after the approval, have them appear in the value part of the form so that they don't have to re-input the same values they had just put in for the credit card. how can i do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question
I'm sending credit card info to a 3rd party credit card processing site. I would like to keep the inputted values and, after the approval, have them appear in the value part of the form so that they don't have to re-input the same values they had just put in for the credit card. how can i do this? So put the value in the value attribute of your text box. input type=text name=cc_number value=?=$_POST['cc_number']? substitute $_POST['cc_number'] with whatever you send to the processing site. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question
Right - but the problem is, the form is submitting to another site, so i don't have a way to store the variables. I could put them in session variables, but I would have to create another script and then forward the form submission to the outside side. This isn't working because the outside site requires the variables to be submitted via a form, or POST i guess. I don't even know if I'm going about this the right way - I just need to somehow store variables on my site that are submitted for processing to another site, so that when the user is sent back from that other site, i can put the values in the form fields of a new page. Cpt John W. Holmes wrote: I'm sending credit card info to a 3rd party credit card processing site. I would like to keep the inputted values and, after the approval, have them appear in the value part of the form so that they don't have to re-input the same values they had just put in for the credit card. how can i do this? So put the value in the value attribute of your text box. input type=text name=cc_number value=?=$_POST['cc_number']? substitute $_POST['cc_number'] with whatever you send to the processing site. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] quick question
I'm sending credit card info to a 3rd party credit card processing site. I would like to keep the inputted values and, after the approval, have them appear in the value part of the form so that they don't have to re-input the same values they had just put in for the credit card. how can i do this? So put the value in the value attribute of your text box. input type=text name=cc_number value=?=$_POST['cc_number']? substitute $_POST['cc_number'] with whatever you send to the processing site. Right - but the problem is, the form is submitting to another site, so i don't have a way to store the variables. I could put them in session variables, but I would have to create another script and then forward the form submission to the outside side. This isn't working because the outside site requires the variables to be submitted via a form, or POST i guess. I don't even know if I'm going about this the right way - I just need to somehow store variables on my site that are submitted for processing to another site, so that when the user is sent back from that other site, i can put the values in the form fields of a new page. Well, if the site doesn't return the number back to you, then you can't do it with the method you're using. You could use sockets or cURL to POST the info yourself from within a script and then you'd still maintain all of the $_POST information when you get the result back... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question form validation
I must be missing something, but I am doing some very simple validation of a form. So if it is incorrect I need to redisplay the form. Normally what I do is I just include the form back in. This one I have tried to include the form back in, but I need to keep an id number. That seems to blow up my include. Any thoughts? if ($coll_id==) { $invalid=1; $error[] = Please include a group to associate with this store.; } if ($invalid==1) { $included=1; include(add_store.php?id=.$id.); } _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
On Thursday 13 February 2003 00:47, Didier McGillis wrote: I must be missing something, but I am doing some very simple validation of a form. So if it is incorrect I need to redisplay the form. Normally what I do is I just include the form back in. This one I have tried to include the form back in, but I need to keep an id number. That seems to blow up my include. Any thoughts? if ($coll_id==) { $invalid=1; $error[] = Please include a group to associate with this store.; } if ($invalid==1) { $included=1; include(add_store.php?id=.$id.); } Please RTFM on the correct use of include(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I don't want to achieve immortality through my work. I want to achieve immortality through not dying. -- Woody Allen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
Is there a way that I can redirect and keep the id. From: Jason Wong [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] quick question form validation Date: Thu, 13 Feb 2003 00:55:59 +0800 On Thursday 13 February 2003 00:47, Didier McGillis wrote: I must be missing something, but I am doing some very simple validation of a form. So if it is incorrect I need to redisplay the form. Normally what I do is I just include the form back in. This one I have tried to include the form back in, but I need to keep an id number. That seems to blow up my include. Any thoughts? if ($coll_id==) { $invalid=1; $error[] = Please include a group to associate with this store.; } if ($invalid==1) { $included=1; include(add_store.php?id=.$id.); } Please RTFM on the correct use of include(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I don't want to achieve immortality through my work. I want to achieve immortality through not dying. -- Woody Allen */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
On Thursday 13 February 2003 01:26, Didier McGillis wrote: Is there a way that I can redirect and keep the id. If you want to _redirect_ use header(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* It's a dog-eat-dog world out there, and I'm wearing Milkbone underware. -- Norm, from _Cheers_ */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
I get this. Warning: Cannot add header information - headers already sent by (output started header.php:7) in add_store.php on line 186 From: Jason Wong [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: [PHP] quick question form validation Date: Thu, 13 Feb 2003 01:32:59 +0800 On Thursday 13 February 2003 01:26, Didier McGillis wrote: Is there a way that I can redirect and keep the id. If you want to _redirect_ use header(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* It's a dog-eat-dog world out there, and I'm wearing Milkbone underware. -- Norm, from _Cheers_ */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question form validation
On Thursday 13 February 2003 01:40, Didier McGillis wrote: I get this. Warning: Cannot add header information - headers already sent by (output started header.php:7) in add_store.php on line 186 OK, did you search the archives? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Would you *__really* want to get on a non-stop flight? -- George Carlin */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] quick question
I need to specify a absolute path to a file on my harddrive, but you can't use backslashes in php. Right? Thanks, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] quick question
At 10:25 30.01.2003, Dale said: [snip] I need to specify a absolute path to a file on my harddrive, but you can't use backslashes in php. Right? [snip] Oh yes, you can. Just pay attention that the backslash is an escape character telling PHP to take the next character literally. So if you want a backslash you need to type 2 of them: C:\Program Files\php == C:\\Program Files\\php -- 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] quick question
On Thursday 30 January 2003 17:25, Dale wrote: I need to specify a absolute path to a file on my harddrive, but you can't use backslashes in php. Right? Please use a descriptive subject. You escape an intended literal backslash with a backslash. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* World War Three can be averted by adherence to a strictly enforced dress code! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] quick question
I need to specify a absolute path to a file on my harddrive, but you can't use backslashes in php. Right? You can also use forward slashes just as effectively. C:/path/to/your/file.php Or, if the file is on the C drive, you can use /path/to/your/file.php without even using the c: part. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Quick Question about Template Parsers
In general, how do most template parsers work? do they read the file into a variable and do something to the effect of preg_replace() to element that is found? and if so, could you replace the step of reading the file into a variable with getting the template data out of a database? WARNING... more questions to come... Jim
Re: [PHP] Quick Question about Template Parsers
Sure, you could do it any way you want. One way or another you need to get it into a variable, so how you get the template there doesn't really have any affect on your replace function. I'm using the file based template so it's easy for users to modify. I read the template file into the output buffer, then store the buffer into a variable and clear the buffer: ob_start(); include(templateFile.tpl); $tpl_content = ob_get_contents(); ob_end_clean(); The template is now stored in the $tpl_content variable. You could just as easily pull the template from a database. For the template file I place data tags in it that I do a search and replace on. Some common tags I use: {::PageTitle::}, {::MainData::},{::NavBar::} You should try to use str_replace instead of ereg_replace since it's faster. Both support arrays for the search and replace part, so you can use one line of code to do 30, 40 or whatever replaces. I create an array of my data tags and another array of the matching data, then do: str_replace($tagArray,$dataArray,$formTemplate); I can then provide a user who knows HTML a list of data tags (the contract) that they can place in a template anyway they want. The whole idea is to separate your data from your code from you presentation. Hope that helps. On Wednesday, January 22, 2003, at 01:06 PM, Jim Lucas wrote: In general, how do most template parsers work? do they read the file into a variable and do something to the effect of preg_replace() to element that is found? and if so, could you replace the step of reading the file into a variable with getting the template data out of a database? WARNING... more questions to come... Jim -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Quick question
-Original Message- From: Martin Towell [mailto:martin.towell;world.net] Sent: 08 November 2002 06:23 what is the technical difference between using else if Well, technically this starts a new block structure level... and elseif ... and this doesn't. But to all intents and purposes it probably doesn't make any real difference. 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
[PHP] Quick question
what is the technical difference between using else if and elseif ?? Are they interpretted the same internally? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question
Realistically, there is no difference. It is *slightly* quicker to parse, but thats about it. I think it was introduced to satisfy those that have used this type of syntax in other languages, like C and Perl (which users elsif). I usually use elseif as its a bit nicer looking (IMHO) Todd. - Original Message - From: Martin Towell [EMAIL PROTECTED] To: Php-General@Lists. Php. Net [EMAIL PROTECTED] Sent: Friday, November 08, 2002 4:23 PM Subject: [PHP] Quick question what is the technical difference between using else if and elseif ?? Are they interpretted the same internally? -- 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] Quick question.
Hi, sorry about the delay, i have some computer problems in the last few days, all fixed now i hope. I don't know exactly what shell access is, or ssh for that matter, but in my quest to do what i was trying to do, I realised its not worth it due to the fact the file i was copying was still being accessed everytime the php file was open, and my aim was to get the particular file from the remote server, copy it onto my server 2 times a day and then the php file that im working on would access the local file instead of the remote file which its doing now, Anyways, thanx for all your help -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question.
Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Windows makes me cry... this will fix the problem... Change: $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); To: $rContents = implode( \r\n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); If that doesn't work: To: $rContents = implode( \n\r, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); I can never remember the order :) Cheers, Rob. Simon Angell wrote: i removed a / and it worked :) ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? Now the format of the content is no longer, can this be fixed? This is how it is originally. IDN10035 BUREAU OF METEOROLOGY CANBERRA METEOROLOGICAL OFFICE FORECAST FOR THE ACT Issued at 3:34pm on Tuesday the 1st of October 2002 SITUATION: AND this is how the text file writes IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST FOR THE ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION: with all through it where a new line is suppose to be. Can this be fixed, or will i just need to work around it? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Simon Angell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... i tried that ine and got this... Warning: fopen(/test/canberra.txt, w+) - No such file or directory in C:\Xitami\webpages\bomonster\test2.php on line 4 code.. ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? I think i know what the probelm is. .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) should be if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' , 'w+' )) !== false ) But, where do i put the file name and directory to write? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Hi everyone. I asked this a week or so ago but i am unsure if it got to the list, so here we go again. I am trying to get a remote file to be copied onto my own web server, I have looked at fopen() and fread() and fwrite() and get the general idea of each, but im wondering how to join the commandes to get the file i want from the remote ftp server, copied and written onto my own server. Something like the following might work (not tested AT ALL): $rContents = implode( \n, file( 'ftp://www.foo.bar/me/my/data.txt' ) ); if( ($fp = fopen( '/tmp/myFile.txt', 'w+' )) !==
Re: [PHP] Quick question.
I am the webmaster of the site, i pay for the server space, is that what you mean? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Windows makes me cry... this will fix the problem... Change: $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); To: $rContents = implode( \r\n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); If that doesn't work: To: $rContents = implode( \n\r, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); I can never remember the order :) Cheers, Rob. Simon Angell wrote: i removed a / and it worked :) ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( 'test/canberratest.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? Now the format of the content is no longer, can this be fixed? This is how it is originally. IDN10035 BUREAU OF METEOROLOGY CANBERRA METEOROLOGICAL OFFICE FORECAST FOR THE ACT Issued at 3:34pm on Tuesday the 1st of October 2002 SITUATION: AND this is how the text file writes IDN10035BUREAU OF METEOROLOGYCANBERRA METEOROLOGICAL OFFICEFORECAST FOR THE ACTIssued at 3:34pm on Tuesday the 1st of October 2002SITUATION: with all through it where a new line is suppose to be. Can this be fixed, or will i just need to work around it? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Simon Angell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... i tried that ine and got this... Warning: fopen(/test/canberra.txt, w+) - No such file or directory in C:\Xitami\webpages\bomonster\test2.php on line 4 code.. ?php $rContents = implode( \n, file( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' ) ); if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) { fputs( $fp, $rContents ); fclose( $fp ); } ? I think i know what the probelm is. .if( ($fp = fopen( '/test/canberra.txt', 'w+' )) !== false ) should be if( ($fp = fopen( 'ftp://ftp.bom.gov.au/anon/gen/fwo/IDN10035.txt' , 'w+' )) !== false ) But, where do i put the file name and directory to write? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in
Re: [PHP] Quick question.
No i mean switch to the directory in which you have th file with the code and type 'ls -al' Then look at the permissions and ownerships. Don't forget the web server runs with different permissions thatn you do at home. Cheers, Rob. Simon Angell wrote: I am the webmaster of the site, i pay for the server space, is that what you mean? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question.
i am unsure what you mean, where exactly do it type in 'ls -al' ? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... No i mean switch to the directory in which you have th file with the code and type 'ls -al' Then look at the permissions and ownerships. Don't forget the web server runs with different permissions thatn you do at home. Cheers, Rob. Simon Angell wrote: I am the webmaster of the site, i pay for the server space, is that what you mean? -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. Robert Cummings [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Simon Angell wrote: Thanks for that Robert *it works*, now i have 1 more problem, after uploading to my web server i get this... Warning: fopen(wtest.txt, wb+) - Permission denied in /home/canberra/public_html/bomonster/canberra.php on line 6 Dunno why either, the directory is not protected, can you help me with that one? What are the permissions and ownerships? Do these ownerships and permissions match up with the webserver versus your own ownership? Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Quick question.
I am the webmaster of the site, i pay for the server space, is that what you mean? First up Simon, I deleted over a hundred lines of no longer relevant content from your message including things like signatures. You should probably trim messages down when you reply to them... Next up, when you say you are the webmaster, what does that mean? What sort of access do you have to the server? Can you connect to the server using ssh? Or do you only have access to uploading files using ftp? If the former, you can check permissions (which is almost certainly where your problem is) and act from the information you find. If you don't have ssh-style access then you'll likely be stuck with work-arounds to make things like this do what you want. Do you understand the concept of users, groups and permissions? This is a *nix thing that is not as common on Windows platforms but is of critical importance when you start looking at issues like file creation, particiularly in automated scripts, on a *nix box. If you understand them then I won't bother going further, if you don't then this is probably where your starting point needs to be so that you understand why the problem is occuring and will be able to deal with it in future situations that you'll almost certainly run into. Oh, and if you have ssh-style access then the ftp thing you're trying to do in php should really be done in other ways - the BoM web servers are loaded enough without receiving a hit every time someone loads your page. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php