Re: [PHP] Howto detect the hostname of the server?

2011-11-25 Thread Mark Kelly
Hi. On Saturday 26 Nov 2011 at 00:14 Andreas wrote: how could I identify the server the script runs on? [snip] I looked into phpinfo() but haven't found anything helpful, yet. Have I overlooked something or is there another way to identify the server? Wouldn't the server IP address in

Re: [PHP] Re: Secure data management

2011-10-05 Thread Mark Kelly
Hi. On Wednesday 05 Oct 2011 at 00:04 Mark Kelly wrote: I'd be interested in any ideas folk have about these issues, or any others they can envisage with this proposal. Thank you all for joining in here - it's been a fascinating read so far. Mark -- PHP General Mailing List (http

Re: [PHP] Re: Secure data management

2011-10-04 Thread Mark Kelly
Hi. On Tuesday 04 Oct 2011 at 21:39 Stuart Dallas wrote: http://stut.net/2011/09/15/mysql-real-escape-string-is-not-enough/ Thanks. I followed this link through and read the full message (having missed it the first time round), and while I find the idea of using base64 to sanitise text

Re: [PHP] Re: dynamic copyright in page footer?

2011-04-30 Thread Mark Kelly
On Saturday 30 Apr 2011 at 14:28 Nathan Rixham wrote: echo implode(,, range(2011,date(Y))); What an elegant solution! Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Regex for extracting quoted strings

2011-03-05 Thread Mark Kelly
Hi. I'm hoping someone can help me extract text between double quotes from a string. $regex = 'some magic'; $r = preg_match($regex, $sentence, $phrases); So, if $sentence = 'Dave said This is it. Nope, that is the wrong colour she replied.'; I want $phrases to contain 'This is it' and

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Mark Kelly
Hi. Thanks for all the replies. On Saturday 05 Mar 2011 at 22:11 Simon J Welsh wrote: On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote: $regex = '/([^]+)/'; Shawn, this regex gets me two copies of each string - one with and one without the double quotes - as did the one Nathan posted

Re: [PHP] Custom function

2011-02-16 Thread Mark Kelly
Hi. On Wednesday 16 Feb 2011 at 00:49 Simon J Welsh wrote: As $z is converted to a boolean and exists, that works just the same way as !empty(). --- First I'd like to apologise for handing out bad advice, and second, to thank Simon and Andre for pointing out my mistake. I'll go back to

Re: [PHP] Custom function

2011-02-15 Thread Mark Kelly
Hi. On Tuesday 15 Feb 2011 at 23:41 Andre Polykanine wrote: Give it a default (possible empty) value: function MyFunction($x, $y, $z=) { // function goes here if (!empty($z)) { // The optional parameter is given } } Using an empty string and the empty() function in this way can lead to

Re: [PHP] NetBeans Question

2010-05-30 Thread Mark Kelly
Hi Tedd. On Sunday 30 May 2010 at 19:01 tedd wrote: I wanted to ask my questions on the NetBeans forums, but I am having trouble logging in. They seem to have a problem with my given ID, password, and email address and I haven't the time to straighten it all out -- I just want answers -- so I

Re: [PHP] NetBeans Question

2010-05-30 Thread Mark Kelly
IDE. If you want a regular text editor netbeans is the way to go. On Sun, May 30, 2010 at 8:15 PM, Mark Kelly p...@wastedtimes.net wrote: Hi Tedd. On Sunday 30 May 2010 at 19:01 tedd wrote: I wanted to ask my questions on the NetBeans forums, but I am having trouble logging

Re: [PHP] NetBeans Question

2010-05-30 Thread Mark Kelly
Hi. On Monday 31 May 2010 at 02:50 Ashley Sheridan wrote: Yeah, like I mentioned earlier, Dreamweaver is known for having issues with include files, can be slow when working on large projects with lots of files, and is only available for Mac and Windows, which limits it somewhat. Indeed. I

Re: [PHP] Need login suggestions

2010-05-02 Thread Mark Kelly
Hi. On Monday 03 May 2010 at 03:49 Ashley M. Kirchner wrote: [snip] So what if a student registers on the wrong side of the wall? Nothing happens [snip] Kids would be registering for a photo contest, parents will be registering for something completely different. You might try

Re: [PHP] Recognizing double clicks

2009-11-22 Thread Mark Kelly
Hi. On Sunday 22 Nov 2009 at 05:34 Skip Evans wrote: It just dawned on me the button may be disabled right when it's clicked to prevent a double submit? Is that doable? To mark a button as disabled after it has been clicked to prevent it being clicked twice just add some simple code in the

Re: [PHP] putting variables in a variable

2009-07-21 Thread Mark Kelly
Ross, If I understand correctly what you want to do, you're almost there... You need: $myimage1 = image1.jpg; $myimage2 = image2.jpg; $myimage3 = image3.jpg; $body .= table tr tdimg src=\$myimage1\/td /tr tr tdimg src=\$myimage2\/td /tr tr tdimg src=\$myimage3\/td /tr

Re: [PHP] Re: preg_replace problem

2009-06-14 Thread Mark Kelly
Hi. On Saturday 13 June 2009, Al wrote: I may not have been very clear. Feed it just test with the quotes. You should get back, test the same as you gave it. Instead, I get back quote;testquote; Like Shawn, I have tried your code in isolation and only get the expected results. I

Re: [PHP] Fractions

2009-05-24 Thread Mark Kelly
Hi. On Sunday 24 May 2009, Ron Piggott wrote: Is there a way to remove the trailing '0'? $width = number_format($width,2); Also is there a way to have the original fraction display (1/4), as well as have provision for 1/8 and 3/8 and 1/2, etc. display? On this one I suspect you'd have to

Re: [PHP] what to use instead of foreach

2009-04-14 Thread Mark Kelly
Hi Phil. On Monday 13 April 2009, PJ wrote: Thanks for the suggestion, Mark. I've already experimented with count; you're close, but there is still a small glitch and that's in count(); foreach doesn't give a damn about count so you can't use that - it is reset once inside the foreach loop.

Re: [PHP] what to use instead of foreach

2009-04-13 Thread Mark Kelly
Hi. On Sunday 12 April 2009, PJ wrote: foreach does not allow for different formatting for output... [snip] But how do you get result1, result2 result3 // with br at end ? $lastIndex = count($a) - 1; // Adjust for zero-indexing. $outputString = ''; foreach ($a as $index = $value) { if

Re: [PHP] $_GET

2009-04-11 Thread Mark Kelly
Hi. On Sunday 12 April 2009, Ron Piggott wrote: At the very start of my index.php I have the following lines of code: foreach($_GET as $key = $val) { $$key = $_GET[$val]; echo $_GET[$val] . br /; } Try: echo $_GET[$key] . br /; HTH Mark -- PHP General Mailing List

Re: [PHP] Search thoughts

2008-07-19 Thread Mark Kelly
Hi. Just noticed I replied direct rather than to the list last time, sorry about that. On Saturday 19 July 2008, Richard Heyes wrote: How much traffic do you have and what's your hardware? Are your queries cached and subsequently repeated? Do you pre cache common queries? I've done this kind

Re: [PHP] looping through a $_POST variable

2007-12-30 Thread Mark Kelly
Hi. On Monday 31 December 2007 00:34, Richard Kurth wrote: When I do a var_dump($_POST['emails']); it has all the emails in it string(65) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Then this simple regex should do you; just use it instead of explode: $AddressList =

Re: [PHP] From TXT to a mySQL db

2007-10-18 Thread Mark Kelly
Hi. On Thursday 18 October 2007 19:29, Marcelo Wolfgang wrote: Hi all, I need some helps/tips to know if a transition from a txt file to a sql database is viable to do. [snipped data and table descriptions] Is there a quick and simple way to convert the row string into a INSERT query ?

Re: [PHP] Thoughts about music library

2007-08-06 Thread Mark Kelly
Hi. On Monday 06 August 2007 23:13, Børge Holen wrote: As mentioned earlier, I want to make stuff myself When I did this I used Music Player Daemon (MPD - http://musicpd.org/) and wrote my own web interface in php. It offers a nice simple but powerful API, and is *very* low on resource usage

Re: [PHP] Pirate PHP books online?

2007-07-16 Thread Mark Kelly
Hi. On Monday 16 July 2007 12:42, Dotan Cohen wrote: So, suckers, I'm with you now, and I'll start pirating again. This is a real shame (not to mention a foolish thing to post to a publicly archived mailing list). As a user of open source technology you are benefiting directly from the PHP

Re: [PHP] Re: php security books

2007-07-04 Thread Mark Kelly
Hi. On Wednesday 04 July 2007 13:01, Andrew Hutchings wrote: Avoid the O'Reilly one as it is flawed. In what way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP not posting

2007-06-24 Thread Mark Kelly
On Sunday 24 June 2007 13:54, Pieter du Toit wrote: Hi I installed PHP5 on iis and i can see hello world and phpinfo. When i right click the webpage and view source, i can see the php code, and the form does not want to post the form details. Will appreciate any help. I'm not really

Re: [PHP] php/ajax question

2006-12-30 Thread Mark Kelly
On Saturday 30 December 2006 18:56, tedd wrote: Why can't the php script redirect the browser when called via ajax ? The browser will not be expecting a page back, and will ignore headers. Just some quick suggestion code, this isn't tested (except createRequest - I use that all the time)...

Re: [PHP] php/ajax question

2006-12-30 Thread Mark Kelly
On Saturday 30 December 2006 18:56, tedd wrote: Why can't the php script redirect the browser when called via ajax ? The browser will not be expecting a page back, and will ignore headers. The response must be handled by a function you define. For the sake of a quick demo, if your php accepts

[PHP] Tidy HTML source?

2006-11-27 Thread Mark Kelly
Hi. In the stuff I do almost all the HTML is generated with PHP as basically none of it is static (lots of tabular data, state-sensitive links, stuff like that). Am I crazy to make an extra effort in my code to make the generated HTML pretty? By this I mean linebreaks, indentation etc. -

Re: [PHP] Tidy HTML source?

2006-11-27 Thread Mark Kelly
On Monday 27 November 2006 17:10, Mark Kelly wrote: Am I crazy to make an extra effort in my code to make the generated HTML pretty? Thanks everyone for your thoughts on this - I'm quite relieved that I'm not the only one who sits and tweaks so that the HTML is nice and readable. It just

[PHP] Including Functions; one file or many?

2006-05-26 Thread Mark Kelly
Hi I'm writing a set of db abstraction functions for an internal app which will give us a set of simple function calls for dealing with the db, like $result = db_AddEmployee($EmployeeData); $EmployeeData = db_GetEmployee($EmployeeID); etc. There will be quite a few functions needed to deal

Re: [PHP] Including Functions; one file or many?

2006-05-26 Thread Mark Kelly
At 9:02 AM +0100 5/26/06, Mark Kelly wrote: TIA in advance for any advice, And thanks in arrears to all who responded. Since there appears to be no compelling reason to go either way, and we already have subdivided include files for functions (to a limited extent) I've decided to go

Re: [PHP] Including Functions; one file or many?

2006-05-26 Thread Mark Kelly
On Friday 26 May 2006 14:56, Matt Carlson wrote: One note on include files. Usually it's best practice to not name them .inc Name them .inc.php so that they cannot be opened by a webbrowser, thus giving more information to a potential attacker. Is this still a concern when all include files

Re: [PHP] Including Functions; one file or many?

2006-05-26 Thread Mark Kelly
On Friday 26 May 2006 16:41, Jochem Maas wrote: besides .inc.php seems to be/becoming a sort of defacto std (no need for filenaming jihad people ;-) That's certainly worth considering (particularly as the project is still at the very early stages), thank you both for mentioning it. My

Re: [PHP] redirect using php

2006-04-05 Thread Mark Kelly
On Tuesday 04 April 2006 22:27, Brady Mitchell wrote: -Original Message- In JSP I have access to a function called sendRedirect() to send a user from one page to another, usually after some processing completed. Is there a similar function in PHP? Take a look at the header()

Re: [PHP] redirect using php

2006-04-05 Thread Mark Kelly
On Wednesday 05 April 2006 13:55, Chris Shiflett wrote: Mark Kelly wrote: You can also use something like: echo meta http-equiv=\Refresh\ content=\0;url=$from_page\; There's no need to use a meta tag to mimic HTTP headers. PHP provides the header() function. I have been using

Re: [PHP] redirect using php

2006-04-05 Thread Mark Kelly
On Wednesday 05 April 2006 14:33, Chris Shiflett wrote: Mark Kelly wrote: You can also use something like: echo meta http-equiv=\Refresh\ content=\0;url=$from_page\; There's no need to use a meta tag to mimic HTTP headers. PHP provides the header() function. I have been

Re: [PHP] Creating forms dynamically

2006-03-15 Thread Mark Kelly
On Tuesday 14 March 2006 20:21, Paul Goepfert wrote: If anyone has any ideas on how to create the form when the error messages are displayed without having to code it a second time please let me know. I use an assoc. array that matches the form inputs, for example: $FormDisplayData = array(