Hi All,
While watching one of Jeffrey Way's CodeIgniter tutorials, I was
gobsmacked when he noted that it was best practice not to have closing
PHP tags as closing tags might introduce whitespace issues. So I tried
syntax checking a few simple pages and, to my surprise, the syntax
checkers accepte
On Friday, July 22, 2011, Floyd Resler wrote:
> I did a fresh install of PHP on a new server. I had gotten used to
> PHP automatically adding a backslash before single quotes when form
> data is submitted. It seems that is shut off in my new install.
> How do I turn it back on?
Check the manual
On Wednesday, July 6, 2011, Dave Wilson wrote:
> OK. We all know that constants cannot be accessed directly via their
> name in double-quoted or heredoc strings.
FWIW, this looked like it might be a right royal PITA for me ATM.
However, I've got a work-around.
With about a dozen scripts written
On Thursday, June 30, 2011, Jasper Mulder wrote:
> Personally, I think that incorrect spelling is far more annoying
> than the quoting; that is, if it does not originate from
> incapability due to English (whether it be British or American)
> being not the native language, as opposed to spelling e
On Thursday, June 30, 2011, Md Ashickur Rahman Noor wrote:
> I want to use POST when redirect via PHP Header function. Is it
> possible?
AFAICT, it isn't. You can use GET variables by passing them on the
querystring. These can then be accessed via $_REQUEST, which is an
amalgamation of $_POST, $
On Thursday, June 23, 2011, Ashley Sheridan wrote:
> I've not yet seen any evidence yet that pretty URLs actually benefit
> SEO. I regularly search for answers to problems online, and mostly I
> get forums as the results, all of which have URLs like
> showthread.php?t=1234567
Anecdotal perhaps, b
On Wednesday, June 22, 2011, Daniel Brown wrote:
>> RewriteEngine on RewriteRule ^theme([0-9]+).php$
>> /index.php?theme=$1 [L]
> That's neither nginx nor PHP, so it's not really relevant to the
> OP's questions.
I guess that the answer should be that you can rewrite outside of PHP
and then
On Saturday, June 18, 2011, Ron Piggott wrote:
> I am not getting anything. Is there a correct way of passing a
> variable through an image? The value in this above example is the
> auto_increment value of the product. From this I could remove the
> item from the shopping cart.
An image causes
On Tuesday, June 7, 2011, Richard Quadling wrote:
> But the surprising issue is that your 5.1.6 returns bool(false). So
> far, that's the only report I've got that shows inconsistent
> behaviour for PHP5+
I too was surprised, which is why I took the time to report. AFAICT,
I've got the standard L
On Tuesday, June 7, 2011, Richard Quadling wrote:
> What do you get for ...
> php -r "var_dump(realpath(null));"
PHP 5.3.5-1ubuntu7.2 on Ubuntu 11.04 kernel 2.6.18 returns the same
value as __DIR__
However, PHP 5.1.6 on CentOS 5.6 kernel 2.6.18 returns bool(false).
Doing php -r "var_dump(__DIR_
I'm posting here for completeness as I've now rolled my own date
validator (code follows my sig). It allows almost all valid 'English'
formats except ordinal day values (1st, 3rd, etc.) Because I'm in UK
and writing for a UK audience, I've parsed ambiguous dates as d/m/y.
Those writing for places w
On Friday, May 20, 2011, João Cândido de Souza Neto wrote:
> What about using regular expression to validate so using DateTime
> object to parse it if it?s a valid date?
Again, thanks.
For info, I only need to know that it's a valid representation of a
date on this occasion as I intend to use
On Friday, May 20, 2011, Peter Lind wrote:
> Try:
> $date = new DateTime($date_string_to_validate);
> echo $date->format('Y-m-d');
Many thanks. Unfortunately, as I mentioned in my OP, the DateTime
class seems to be 'broken' for my purposes because it uses strtotime()
to convert input strings to
On Friday, May 20, 2011, Peter Lind wrote:
>> This is pretty much as expected except that the second call to
>> date() - i.e. date('d M Y', $date) - outputs nothing.
> date() takes an int as second parameter - a timestamp. Not an object.
> And from a quick test it doesn't look like DateTime has
On Friday, May 20, 2011, João Cândido de Souza Neto wrote:
> What about using this:
> $date = DateTime::createFromFormat("Y-m-d", "2011-05-20");
Hi João, and thanks for your help.
FWIW, I thought about that but it didn't work for me. On further
investigation, I'm now completely confused and
s cannot properly handle string input values.
This seems to be such a common requirement that I suspect I've missed
something basic. I'd thus be grateful for any pointers as to how to
properly validate user-input string representation of dates.
Cheers,
--
Geoff Lane
--
PHP Gene
Hi All,
I'm scratching my head a bit here. I have a form handling script that
branches dependent on whether a user has admin privileges over the
application. Here's the function that tests this:
function isAdmin($user){
global $chan;
$query = "SELECT isadmin FROM csw_user WHERE username =
On Saturday, April 30, 2011, Simon J Welsh wrote:
> I would use something simple like:
> if(date('Y') == '2011') {
> echo '2011';
> } else {
> echo '2011-', date('Y');
> }
... or in one line:
echo (date('Y') != '2011' ? '2011-' : '') . date('Y');
However, you might want to chang
On Friday, April 29, 2011, ad...@buskirkgraphics.com wrote:
> Personally I would use the javascript page navigation is senseless if they
> miss click.
> Javascript: Small and simple javascript.
> onclick="return confirm('Are you sure you want to delete?')"
Personally, I'd use Javascript and al
On Thursday, April 28, 2011, Jim Giner wrote:
> Arrays - using a silly construct that probably still takes as much
> time to evaluate machine-wise as anything else. And as far as
> readability goes, it is even sillier. IMO.
I don't know so much about that ...
I'll use a global array to def
On Thursday, April 28, 2011, Ashley Sheridan wrote:
> I'm not sure if my earlier reply got through, but here it is again (or
> at least the general gist of it)
Many thanks. I got your info the first time around but didn't respond
directly to you as Tedd made similar comments and I'd responded to
On Thursday, April 28, 2011, Sean Greenslade wrote:
> On Wed, Apr 27, 2011 at 8:52 PM, Rick Dwyer
> wrote:
>> The following did the trick... is there any reason I should not use it?
>>
>> $name="mysession";
>> setcookie($name);
>>
>> --Rick
> Only if you're OCD, since the cookie is still tech
On Thursday, April 28, 2011, tedd wrote:
> To answer your question in a new thread.
> No, the $_SERVER super-global isn't going to give you anything nor is
> anything else like it.
> You see, PHP has a difficult time detecting IF Javascript is turned
> ON in the client's browser because PHP
On Wednesday, April 27, 2011, Ashley Sheridan wrote:
> Firstly, please do not hijack a thread, if you have a question, start
> your own. We won't bite if you create new threads, whereas we might a
> little if you hijack ;)
Ouch! My apologies - Hijacking was not intended and I've changed the
subj
On Wednesday, April 27, 2011, Jason Pruim wrote:
> It's time for the next generation to start picking up the slack and
> helping out and asking questions :)
To be honest, I've started three or four cries for help in the last
few days. However, on each occasion I've spotted the answer before
actua
On Monday, April 4, 2011, Jim Giner wrote:
> Actually - I can't seem to find a mysql newsgroup anywhere. The
> ones that come up in google search are all dead and buried.
You could try http://forums.mysql.com/ or have a look around Yahoo
groups (e.g. php_my...@yahoogroups.com).
HTH,
--
Geof
On Monday, March 28, 2011, Negin Nickparsa wrote:
> ... i want every user to have his/her own files in their account. (i
> used session for them) n now i want them to have their specific
> files then i think i must have db that store the files n user can
> retrieve his/hers not just details if i j
On Friday, March 25, 2011, Grega Leskovek wrote:
> Do I have to use target="_new" - I can not do this - I am working
> this for my University seminar and it has to be valid HTML5.
I guess that this is an HTML issue rather than PHP. However:
Despite what the W3C validator might claim, I understa
browser is
'obligingly' making sense of the 'bad formatting' and this is why
you're getting characters.
BTW, an alternative to your for construct would be to use a while loop
to iterate through a data table. e.g. in your case, I'd have used:
$q = 'select *
Hi Kirk,
On Saturday, March 12, 2011, 4:09:24 AM, you wrote:
> On 3/11/2011 2:43 PM, Geoff Lane wrote:
> [snip]
>> You could use foreach to iterate through the post variables until you
>> encounter a match:
>>
>> foreach ($_POST as $key => $value){
>>
les until you
encounter a match:
foreach ($_POST as $key => $value){
if (substr($key, 0, 6) == "radio_") {
$buttonName = $key;
$buttonValue = 4value;
break 2;
}
}
I haven't tried the above code, but I hope someone will correct my
efforts if I'm wro
31 matches
Mail list logo