Larry Garfield wrote:
[snip]
Donovan
Most major projects at this point leave it off, and their coding
standards say to as well. The official PHP docs are generally
non-commital by design, but outside of those I think it's pretty
well-established to just leave it off and be happy.
--Larry Garfi
Robert Cummings wrote:
[snip]
Could using ob_start and ob_end_flush eliminate the ambiguity of whether
or not to use '?>'?
In the generally recommended case of don't use them at the end of your
file... where's the ambiguity?
http://www.php.net/manual/en/function.include.php
http://www.php.n
Stuart Dallas wrote:
[snip]
Usually when setting headers after such a script has been included when output
buffering is turned off. Personally I never put the closing ?> in if it's at
the end of the file because it's unnecessary and can cause issues if it's present,
but it's personal preferen
Stuart Dallas wrote:
[snip] so $GLOBALS['GLOBALS']['GLOBALS']['GLOBALS']['_SERVER'] is a perfectly
valid, if daft, way of accessing $_SERVER.
-Stuart
Now this is becoming educational! ;-)
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http:/
Savetheinternet wrote:
[snip] Securimage (phpcaptcha.org) looks relatively okay.[snip]
..a final follow up with my experience implementing securimage (in the
case that others go searching).
This turned out to be a good solution for my purposes. It fit nicely
with my form checks that were alr
Ashley Sheridan wrote:
[snip]
Well, if the answer doesn't matter, another could just pick anything and run
with it couldn't they?
Thanks,
Ash
For the favorite color thing? The idea would be to require one (but not
all) of the word options in the list (so answer does matter)... most
bots w
Donovan Brooke wrote:
[snip]
Hi Michael, this looked promising.. however, requires some GD support it
appears I don't have.[snip]
Hi, well, just did the test on the live server and it *does* support it
there.. so I guess I use it.. just won't work in the development enviro.
Than
Savetheinternet wrote:
[snip]
There are plenty of free PHP captcha scripts out there. Just google
"captcha PHP". Securimage (phpcaptcha.org) looks relatively okay.
Thanks,
Michael
Hi Michael, this looked promising.. however, requires some GD support it
appears I don't have.. here is the re
Thanks for all the input. Yes, there are a lot of ways and means and
issues that can be considered (thanks Simon), but this project will use
a simple captcha, mostly because it is familiar to users and "fits" with
the project. Yes, I've found some options via google, but was more
inquiring to s
Hello,
Does anyone know of a basic (open source or freeware) form captcha
system for PHP?
TIA,
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Elbert F wrote:
SCRIPT_NAME is a server side path, try REQUEST_URI. This includes the query
string but it's easy to remove.
Elbert
http://swiftlet.org
Hi, I thought I should say that server side SCRIPT_NAME seems to be fine
for me in this case. Thanks for the input.
Donovan
--
D Brooke
Hello,
What is the best way to get the /somedir/ values in the request URI?
I tried
$t_pathinfo = $_SERVER['PATH_INFO'];
but was given an error of undefined index. After looking at the docs, it
appears the error derives from something I may have to do in the .ini file.
However, is there a st
Donovan Brooke wrote:
if (!strpos($t_product,$t_p)) {print "checked";}
Nevermind.. bad syntax I guess.. this works:
(strpos($t_product,$t_p) !== false)
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi guys,
if (!strpos($t_product,$t_p)) {print "checked";}
Would strpos be munged if $t_p contains commas?.. ie ",234,"
Thanks,
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Mari Masuda wrote:
[snip]
For a concrete example of responsive design in action, point your browser to
http://www.sasquatchfestival.com/ and then slowly make the window
wider/skinnier to see how the design adapts to different viewport sizes.
Very nice... makes for an easy display to a wide r
Paul M Foster wrote:
[snip]
How about this: those of you with iPhones, Androids and the like, point
your phones at a page which reports $_SERVER['HTTP_USER_AGENT'] (like a
page which runs the phpinfo() function), and post what you get back from
that exercise and what device made the query. I'd li
Stuart Dallas wrote:
On 6 Feb 2012, at 21:12, Marc Guay wrote:
the way your site renders should be purely based upon the size of the display.
Although I mostly agree with this statement, it ignores the most
interesting aspects of mobile technology, such as being able to ask
the user for their
Ashley Sheridan wrote:
[snip]
Keeping a PHP angle to this, have you looked at using an up-to-date
browscap.ini file with PHP? Basically, you can use that to read in the
raw user agent string from the browser, and it then finds a matching
entry in the ini file and gives you back some values about
Paul M Foster wrote:
This is sort of obliquely related to PHP.
I don't have a smart phone, but I need to know a couple of things:
1) Do smart phones use the same browsers as the desktop, or do they have
their own stripped down versions of browsers?
2) When a browser broadcasts its header telli
Daniel Brown wrote:
On Mon, Jan 23, 2012 at 15:59, Donovan Brooke wrote:
Good!, thought I went insane there for a moment and couldn't remember any of
the PHP functions... (as nothing was coming up in the search) ;-)
Can't it be both? ;-P
Purple cucumbers are automobile.
Daniel Brown wrote:
2012/1/23 Alex Nikitin:
Rasmus confirmed that they are having issues with php.net:
You can use the sk.php.net mirror while they fix their problems, as
well as docs.php.net.
We had a primary system failure at the same time as a migration
was underway, which led to comp
Hi, is anyone else having problems with PHP.net today?
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David Savage wrote:
OK...I admit I'm new at thisI have this html file:
Generate pdf file of LD, Toll Free, and Directory Assistance calls
Account Number:
Year (4 digit):
Month (2 digit):
to which I would input an account number, 4 digit year, then 2 digit month.
Then click Su
Jim Lucas wrote:
[snip]
if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) {
print "$key = $value";
}
[snip]
I would change the above the the following:
if ( empty($pmatch) || ( strpos($key, $pmatch) === 0 ) ) {
print "$key = $value";
}
it would be slightly faster
love th
Just to share, a Mr. Harkness forwarded me a consolidated version of my
code.. basically substituting the innards for:
if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) {
print "$key = $value";
}
Cheers,
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.ne
Hello!,
I work in another language mostly and often develop while displaying
variables (post,get,and defined) and their values at the bottom of the
page or in specific places. So, I thought I'd forward my PHP version as
an effort of good Karma to the list perhaps! ;-)
Below is 2 simple functi
Simon J Welsh wrote:
[snip]
function list_formvars($pmatch=null) {...
http://php.net/manual/en/functions.arguments.php#functions.arguments.default
Thanks!.. missed that doc somehow.
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.ph
function list_formvars($pmatch="value") {... }
thanks to Tolga.
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello,
I have a simple function that contains an argument that is not required, ie:
function list_formvars($pmatch) {...
However, if I call the function without the argument, I get a warning
(I'm having the app show all warnings for development):
"Warning: Missing argument 1 for list_formva
alekto wrote:
Hi,
I have implemented a "remember" me feature in my login-script, but I can't get
it to function!
If I might be so bold... then you haven't implemented the feature yet,
right? ;-)
I want to make it possible for the users to stay logged in for 30 days.
This is what I got th
Alex Nikitin wrote:
[snip]
It's never a good idea to store all your keys in code,
True, but in the system I was referring to, only the closed source
app knows how to "see" the key in the encrypted templates and there is
no way for another to know how to decrypt the encrypted templates to se
Alex Nikitin wrote:
[snip]
There is code obfuscation with PHP, and you can compile it into C++ with
HipHop for php for example...
[snip]
Of course, obfuscation is never a great security solution. Compiling it
into C++ is interesting... the question would be if the code could be
de-compiled..
Alex Nikitin wrote:
[snip]
What makes your local system any less vulnerable of a point than your
server, of anything, its more vulnerable and failure-prone, so unless i'm
not getting something, that seems like a poor design decision (i'm sorry)
[snip]
In the model I profiled, it is a system de
Alex Nikitin wrote:
[snip]
Also you shouldn't actually encrypt passwords, the proper way to store them
is hashed, so that if someone grabs your database, they dont have your
passwords, even if they have the "key".
Hello, since this thread is about "studying mcrypt"...
In another language, for
Matty Sarro wrote:
Hey everyone,
I am a super newbie..
in the spirit of the "super newbie"..
:-)
http://interrobang.jwgh.org/songs/editors.mp3
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jônatas Zechim wrote:
Hi..
You need to use $_FILES (
http://php.net/manual/pt_BR/reserved.variables.files.php)
Regards,
Jônatas Zechim
Thanks guys.
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello!,
I must not be understanding something as I would expect 'f_file'
to show up in the print_r below.:
---form--
---endform--
--index.php--
--/index.php--
The result I get is:
Array
(
[f_ap] => upload
[f_action] => doit
)
---
Can someone enli
Kirk Bailey wrote:
If I only had 1 book on php, what would it be?
I have to disagree with the php.net 'docs' being the best "book".
Though most of us will have a php.net tab open in your browser every
time we write code, it's not the same learning that comes with a good
book IMO. Reading a
Andre Polykanine wrote:
Hi everyone,
Image processing is a part of Php language completely unknown to me
:-(.
So there is my task: I need to process an uploaded image. We allow
uploading of gif, jpeg, and png images. If an image is wider than
600px, it should be proportionally resized
Brad Broerman wrote:
Essentially, they all require Flash or Java...
You are generally talking about two different sides of the client/server
relationship.. unless you are talking about Applets, right?... so I have
an issue with the statement. If jquery does one (as mentioned), it's
likely n
Jack wrote:
Hello All,
I'm having a problem with this line of code which worked fine for years:
$l_url2 = ".".$_GET[SERVER_NAME];
Here is the error:
[Wed Mar 23 13:33:49 2011] [error] [client 16.139.201.61] PHP Notice: Use
of undefined constant SERVER_NAME - assumed 'SERVER_NAME' in
/hom
Daniele Capuano wrote:
Hi,
I'm developing a web application using moodle, and I'm trying to create a
PHP object tree to be used in $SESSION. Objects are defined as
class foo {
private $module_name;
private $sub_modules = array();
}
I have a main module (object) and I use the following funct
This is probably a post better sent to the php-db list... but
Whenever you work with MySQL, it's good to retrieve the actual error
from mysql to help you troubleshoot.
I posted this php_mysql lib a while back which is what I used on my last
project.
http://www.euca.us/downloads/euca_phpmysq
Tamara Temple wrote:
On Feb 15, 2011, at 4:17 PM, Donovan Brooke wrote:
[snip]
This is what I show my students:
http://rebel.lcc.edu/sperlt/citw229/brace-styles.php
Cheers,
tedd
I didn't know there were names for bracing styles... but
Neither did I -- just the K&R style was
[snip]
This is what I show my students:
http://rebel.lcc.edu/sperlt/citw229/brace-styles.php
Cheers,
tedd
I didn't know there were names for bracing styles... but
I used the K&R Style on my last project, which I would call the Larry
Ullman style since that is where I took it from.
Howev
Hello,
Just wanted to say thanks to those that helped me get through my first
PHP project (over the last month).
As is with much of the work we server-side language people do, the
back-end (non-public) side of this site is perhaps the more interesting.
However, here is the link to the site:
Paul M Foster wrote:
[snip]
In essence, my customer is not responsible for any confidential/secure
information, which is all handled by the merchant gateway.
For whatever unknown reason, my customer has been convinced they should
go with a different merchant service company. However, this compan
Al wrote:
[snip]
You have an example of a page you'd like to control that we can see?
On the surface, it appears you may be able to control the rendering with
advanced CSS2/3 selectors. Thus, the browsers will do the work for you.
Al..
Hello, yes and no.. ;-) Right now browsers rece
Daniel Brown wrote:
[snip]
Absolutely. Look into employing TinyMCE or CKEditor (or the older
FCKEditor) so you don't have to do so much server-side processing.
This will only apply to pages moving forward, mind you, not for
displaying existing table data. You'll need to make the determinat
Hello,
I have CMS form that allows HTML for the body of a site.
To keep the form somewhat WYSIWYG, I am using the
nl2br() function for displaying:
nl2br($t_body)
This works great for normal stuff.. but for pages with tables
etc.. it creates a lot of extra "'s" :-).
I thought about doing an if
Marc Guay wrote:
1.) Saving strings to a database
One thing I always forget to remember is to send tge "SET NAMES utf8"
command to MySQL after making a connection. This will save you 1000
headaches if you're working with non-latin characters. I can't count
the number of times I've thrown html
Oops, sorry, this was suppose to go to the PHP-DB list!
Ignore!
thx,
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello,
to respond to some of the comments/questions..
No, it wasn't parsing anything... and yes, I put
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
at the top of the page.
(as well as there is a custom built PHP management app that
allows to turn on the display_errors.. whi
Ethan Rosenberg wrote:
Dear list -
I have a program with the following statement: $out = system('ls -l',
$retval); The output is a string. How do I format the output to be in
the Linux format, that is in columns. I cannot think of a way to use
explode to do it.
Advice and comments, please.
Tha
Hello,
I don't yet have a complete understanding of string encodings for the
various environments they may need to pass through or be in. I have
found bits and pieces within Larry's book, the online docs, and by
googling... and
my app seems to be working fine, but I don't yet feel confident on
[snip]
YAY! it worked!!
so then i tried this:
';
print_r($_SESSION);
echo '';
?>
and it doesn't preserve the older session information... so I must be
doing something wrong. I can assume that because the name is being
regenerated new each time, that the old "previous" session is destroyed
(
Govinda wrote:
[snip]
Hi D :-)
I was following along.. also felt pleased to be introduced to filter_var ...
and then happened to see this:
http://us3.php.net/manual/en/function.filter-var.php
[snip]
"Note that FILTER_VALIDATE_EMAIL used in isolation is not enough for most (if
not all) web
Donovan Brooke wrote:
[snip]
if ($t_ok) {
}
Small correction.. with my established naming convention.. the above
ideally would be:
> if ($b_ok) {
>
> }
D
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Paul M Foster wrote:
[snip]
Shawn, I don't know if I have a good reason, other than I rather like
working with string vars instead of array vars from $_REQUEST for
(sticky forms and conditionals). I can check/verify them as well in the
process.
You should probably get used to dealing with the a
Gary wrote:
[snip]
In fact I'm wondering why the OP doesn't just do what every other site
seems to do - accept the registering user's input as valid, and ask them
to validate it by sending them an email address to that address.
Assuming an email address is even really required for operation of th
Tommy Pham wrote:
[snip]
foreach ($_REQUEST as $key => $value) $$key = $value;
short-circuited one-liners :)
Regards,
Tommy
akk... wrong clicked before I had a chance to fix the code. anyway,
foreach ($_GET as $key => $value) if (substr($key, 0, 2) == 'f_')
${'t_'.substr($key, 2)} = $valu
Hello again!
I'm trying to find a good way to convert array key/value's to
variable name values... but with the caveat of the name being
slightly different than the original key
(to fit my naming conventions).
first, I (tediously) did this:
---
if (isset($_GET['f_action'])) {
$t_action =
Nilesh Govindarajan wrote:
On 01/20/2011 09:44 AM, Donovan Brooke wrote:
Hi Guys,
I'm waddling my way through database interaction and thought someone on
the list may already have a simple email checker that they'd like to
share...
you know, looking for the @ char and dots etc.
Peter Lind wrote:
[snip]
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "Bad user! Bad user!";
}
Regards
Peter
thanks peter... wish I would have known about filter_var before
writing the other checkers. ;-)
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
Hi Guys,
I'm waddling my way through database interaction and thought someone on
the list may already have a simple email checker that they'd like to
share...
you know, looking for the @ char and dots etc..
I did a quick search of the archives and found a couple elaborate
things.. but
I'm
Why not use one of the countless, not to mention secure and stable cookie
management systems available? If it's an exercise cool, I misunderstood.
I'm not one to normally shun people rolling their own code, lord knows I've
done it more then once or twice, but there are some things I wouldn't to
--
D Brooke
I just died a bit on the inside.
Why would you build that from scratch?
Regards,
-Josh
Alright, I'll bite (since I affected you that much) ;-),
do tell...
Why not? Would you rather I use PHP's session_start()?
Donovan
--
D Brooke
--
PHP General Mailing List (http://www
Thanks.
I had initialized $t_mssg as an empty string further up the chain out of
old habit.. removed that, and now it works... just built my first
basic cookie-based PHP/MySQL log-in script from scratch! ;-)
Fun stuff,
Donovan
--
D Brooke
--
PHP General Mailing List (http://www.php.net/)
T
Hello,
I must not understand PHP's switch/case..
The case '0' below fires when $t_mssg = "" apparently.
Is this how it's suppose to work? I would think
it would only fire if it equaled "0".
--
print "-$t_mssg- ";
if (isset($t_mssg)) {
switch ($t_mssg) {
case 0:
Daniel Brown wrote:
On Tue, Jan 18, 2011 at 12:49, Donovan Brooke wrote:
Hello,
I warned the list that I may have questions! ;-)
...building a simple cookie-based log-in system, and have
narrowed an error to this below: (sorry for email line breaks, if any)
---Start---
if ($_post['f_a
Simon J Welsh wrote:
[snip]
---Start---
$query = "SELECT u_id FROM cms_users WHERE u_name = $_post['f_user'] AND u_pass
= $_post['f_pass']";
Array indices either need to be accessed without quotes for the key, or by
enclosing the variable in curly braces.
---
Simon Welsh
Admin of http://s
Hello,
I warned the list that I may have questions! ;-)
...building a simple cookie-based log-in system, and have
narrowed an error to this below: (sorry for email line breaks, if any)
---Start---
if ($_post['f_action']=='login') {
// connect to database (custom function)
$r = dbconnect();
Moses wrote:
Hi Everyone,
I am creating a file in PHP script which takes a value from a form and
writes it
to a file. However, i don't have the mode permission for the file instead it
is owned
by www-data.What can i do to ensure that the file is owned by me.
drwxr-xr-x 2 www-data www-data 4096
sono...@fannullone.us wrote:
I'd like to make a suggestion for a change, or possibly an addition, to the PHP
language.
I'm learning PHP and have been very excited with what it can do in relation to
HTML. But when I got to the part about arrays, I was disappointed to see that
they are designa
tedd wrote:
At 1:54 PM -0500 1/7/11, Joshua Kehn wrote:
Why should someone stop learning ever?
Because my head fills up.
I have to wait until I forget something before I can learn something new.
The up-side is that I'm learning something new almost every day now.
Cheers,
tedd
lol.. I ju
Hello!, .. will try to keep this short!
I've been a long time lurker but minimal poster. I made it a new years
resolution to finally take on PHP jobs and now have my first one (with a
completion date in a couple weeks!).
I've been scripting in another language for many years and do know a
thi
Daniel Brown wrote:
On Sun, Jan 9, 2011 at 11:58, tedd wrote:
For example --
http://xn--19g.com
-- is square-root dot com. In all browsers except Safari, PUNYCODE is shown
in the address bar, but in Safari it's shown as ˆ.com
Not sure if that's a typo or an issue in translation while
k...@bitflop.com wrote:
On Tue, 28 Dec 2010 23:25:57 -0600
Donovan Brooke wrote:
and btw, I found that Billy Hoffman article
to be inaccurate in many of his assertions.
Would you mind sharing in what ways you found his assertions inaccurate?
Kind regards,
Kim
Cheers,
Donovan
--
D Brooke
k...@bitflop.com wrote:
Hi.
I am currently looking into improving a system that (like many systems)
generate static content at runtime.
I have always been against generating static content at runtime and
believe static content should be generated by a cronjob or manually at
some idle time (if p
Ashley Sheridan wrote:
[snip]
I don't think PHP really has anything good for higher level editing of
PDF's. Simple stuff only really. You could maybe look at doing some
command line stuff on a system using a later version of OpenOffice which
has just now got some very good PDF editing features.
Hello!,
Longtime member, rare poster here.
I am browsing around right now regarding the subject line, and have
looked at the HTML_toPDF project
http://www.rustyparts.com/pdf.php
that also includes a PDFEncryptor
system in it.. but I thought I'd post to the list to see
if anyone has any recomme
81 matches
Mail list logo