Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = coun
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's "getMonth" function? Its index may begin at 0, making
"day 0" the "first day" of the year.
HTH,
Todd Boyd
Web Programmer
Hmm, though I know us programmers love to start counting at zero, why
would something as static as a da
Richard Heyes wrote:
yup..
Warning: func_get_args(): Called from the global scope - no
function context
Doesn't the name of the function give you a clue as to its use? You
need to call it inside a function.
He was answering Nathan's question regarding what would happen IF you
called
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it by reference.
- Craige
Can you do that? I assume it would look like this
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started programmin
Jochem Maas wrote:
must . resist
"I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?"
dang it, failed. ;-)
Haha! 'high' was just my 'h' key not pressing, and college is just one
of those words I have trouble with.
Jochem Maas wrote:
just for laughs .. given the 'dabble' thread "Cleeder" is phonetically
very very close to a dutch word meaning 'messing around' .. rather in the way
a 2yo might mess around with a bowl of yogurt.
Haha, now that does make me laugh. Out of curiosity, what is the actual
word f
Hi Alain,
In short, you can't. It's the users computer that remembers what headers
it sent last time, and when you refresh, it WILL ask them to send those
headers again.
The way this is typically handled from a programming perspective is to
do all your processing on one page, and then jump a
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Terion Miller wrote:
I have read the whole forum at php.net on implode and I still don't get why
this one does not work
if (isset($_POST['BannerSize'])){$BannerSize =
implode($_POST['BannerSize'],',');} else {$BannerSize = "";}
someone please help
Is $_POST['BannerSize'] an array?
e.g. IS
Can we see the form, please?
As well, try using print_r on the array and see what it outputs.
- Craige
Terion Miller wrote:
yes there is , the selections are coming from a form (which isn't
working because its not inserting into the db---ah another post later
I imagine)
do you think a mis use
Holografix wrote:
Hi
I tried PHPDesigner some time ago. It's not bad but now I'm using Netbeans
and it's a good editor: http://www.netbeans.org/ (it's free!)
Best regards,
Holo
I never knew Netbeans had a PHP IDE. I'll have to try it
- Craige
--
PHP General Mailing List (http://www.php.n
Micah Gersten wrote:
I'd rather all the engines follow the W3C standards so that you just
have to make sure your web page is compliant.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Though I always script to W3 Standards, I could care less if browsers
f
Hi Guys,
So after somebody mentioned that NetBeans supports PHP development, I
decided to give it a try. I'm liking it thus far, but I have a question
if anybody happens to know the answer.
I have created a project group containing two projects (One for the site
framework, one for the site f
Gishaust wrote:
Are using linux as an os because if you are I am having trouble with getting
xdebug to talk to netbeans
Nope, sorry. Vista
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Alain Roger wrote:
Hi,
how can i do to test if the row number (record number) sent by
mysql_fetch_object is odd or even ?
i mean that:
while ($row = mysql_fetch_object($result))
{
if($row%2 == 1)
{
...
}
}
the $row doesn't return a value... like 1, 2 or 6 for exampl
Thiago H. Pojda wrote:
Guys,
I have to access a WS that uses HTTP auth directly with PHP.
I've tried using the usual http://user:[EMAIL PROTECTED]/ but I couldn't get it
working. I believe it has something to do with the password containing a #
(can't change it) and the browser thinks it's an a
Rene Fournier wrote:
So my question is, why does fread wait if there is nothing more to
read? Shouldn't it return immediately? (That's what I want.) And as
for the delay, it's there so that if the incoming data is a little
slow, it has time to catch up with fread. Thanks.
...Rene
I do belie
As Daniel mentioned, I would recomed building it upon an existing
system. I've seen whole sites custom built around PHPBB.
This might be something you want to look into. Google for PHPBB
programming tutorials; it's pretty well documented. I think it's your
best bet if you don't want to spend f
Hi Nathan,
Are you fluent with OOP concepts?
I'm working on a framework called Ember, and wouldn't mind some help. I
literally JUST started the re-code though
- Craige
Nathan Rixham wrote:
Evening All,
I'm feeling the need to either start or contribute to something
opensource and in PHP.
idan72 wrote:
I would like to write code where the user will input directory name.
I want it to be able to browse to directory and choose it.
With HTML if can only choose file.
Can I do that in PHP ?
Thanks
I have to say I have NO idea what you just said besides you want to
build a file
Stan wrote:
If $basePicture = "../pictures/2008 west coast trip/2008-06-10 first week at
Chris'/DSC_0011.jpg"
and the file actually is "../pictures/2008 west coast trip/2008-06-10 first
week at Chris'/DSC_0011.JPG"
(uppercase extension) the following snippet of code
--
Hey guys,
So, I was working on my framework today, and noticed unfortunately that
PHP does not allow using the magic method __get for static variables.
There is a patch available, but I'm not sure how long it will be before
it makes it into the stable PHP release.
Anyway, my question is abou
Yeti wrote:
I think PHP's string functions are pretty fast and even with large
documents we are talking about a couple of extra microseconds on a
modern machine. I once saw someone do pretty much the same as you are
trying to do with strtr() [1], but I don't know if that function is
faster than s
Daniel P. Brown wrote:
Any/All:
For those of you who were asking about the PHP Text-To-Speech
system I had running, it's back online now. If you have a few free
seconds, please take a look at http://www.pilotpig.net/txt2wav.php and
let me know if it's working for sure in your browser an
Hey guys,
I'm trying to write a regular expression to match a tag for my
frameworks template engine. I seem to be having some trouble. The
expression should match:
{:seg 'segname':}
{:seg 'segname' cache:}
What I have is...
$fSegRegEx = "#\{:seg \'[a-z0-9\-\_]{3,}\'( cache)?:\}#i";
Which
Thanks!
That's a big help.
- Craige
Jim Lucas wrote:
Craige Leeder wrote:
Hey guys,
I'm trying to write a regular expression to match a tag for my
frameworks template engine. I seem to be having some trouble. The
expression should match:
{:seg 'segname':}
{:seg
While yes $_POST is a supergloabal, even a superglobal has it's own
scope. The scope of $_POST is to the call of the user to the web server.
Therefor, no User A's information will not be overwritten by User B's
information.
Hope this helps. Let me know if you want any further clarification. Th
I'm not sure I agree with NEVER using else. Sometimes else is a very
logical way to organize code. However, it should not be used for data
validation IE:
function myValidatorFunc($data) {
if (empty(data)) {
return false;
} else {
if (!is_numeric($data)) {
return fals
PHP Mailing List Listeners,
My question to you is about PHP 5's exception handling. I have looked
at it for a while, but never REALLY used it.
The question is: How much is too much. Should I use Exceptions to
handle all of my error reporting/triggering? How about catching them?
I mean, if I'm us
You could do a hackish work around and write a small server program
that is hosted off your computer, maybe on a friend's host/server.
Then, you could have your application on your local machine open some
other port to connect to the off-site server, and have it send the
email data to that server,
Thanks.
Does anybody else have any input? Not to be pushy, but I'm in the
middle of programming a framework for a site.
- Craige
On 1/5/07, Paul Scott <[EMAIL PROTECTED]> wrote:
On Fri, 2007-01-05 at 00:44 -0500, Craige Leeder wrote:
> The question is: How much is too much
As someone else already stated, my best guess according to that error
is that $user_id has a null, or inappropriate value. The error occurs
at the last character of the query, so it has to be something like
hat. Echo the query and let us know what it outputs.
- Craige
On 1/28/07, Francisco M. Ma
atleast this part: $user_id = mysql_real_escape_string((int)
$_GET['user_id']);
I'm not sure who put this in there, but you don't need to use
mysql_real_escape_string() on that value if you're type casting it. If
you are forcing it to be an integer, there is nothing to escape.
Integers are perfe
As has been said: It all depends on the developer. A skilled developer
is not restrained by how "secure" the particular language is. A
skilled developer will know the pitfalls of that language, and be able
to avoid them.
With php as an example, you have register_globals. Now,
register_globals is
Eric,
PHP is fine for commercial environments. Many people are just afraid
of it due to the fact it is known to break some poorly written PHP 4
scripts, and the fact that many people don't think it's new features
are "necessary". It is perfectly fine to use it in a commercial
environment however.
On 2/5/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
If you want to avoid the overhead of include_once, it's a pretty
common practice (borrowed from C .h files) to do:
Just out of curiosity, how much additional overhead are we talking about?
--
PHP General Mailing List (http://www.php.net/)
To
Ditto. There's really no reason it can't go here.
- Craige
On 2/5/07, benifactor <[EMAIL PROTECTED]> wrote:
I agree.
> hey.
>
> for my $0.02 worth.. these kinds of questions are not exactly only php.
> however, i still see them as being valuable, and belonging to the php
> list,
> as they get
Mike,
Talk to the client, and explain the situation. I'm sure that you will
be able to work out some sort of agreement. It may not be for all the
hours, but that's not unreasonable considering the fact that this was
not explained before you went ahead with your research.
If nothing else, you com
How many book reviews do you suppose Manuel has written in his life time?
- Craige
On 2/5/07, Tim <[EMAIL PROTECTED]> wrote:
> -Message d'origine-
> De: tedd [mailto:[EMAIL PROTECTED]
> Envoyé: lundi 5 février 2007 17:10
> À: Manuel Lemos; php-general@lists.php.net
> Objet: Re: [PHP]
Yeni,
On Linux, it is necessary to compile php with the --enable-sockets
flag to be able to use php's socket functions.
Hope this helps,
- Craige
On 2/5/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Sat, February 3, 2007 10:18 am, Yeni Setiawan wrote:
> Hi there,
> I'm currently writing an I
On 2/5/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
Unless it's PHP 4, and it's already in, or PHP 5 and it's in PECL or...
It's just not that simple.
Sorry.
Ah, I didn't realize they stopped bundling it with PHP as of PHP
5.3.0. That sucks. It used to be that simple.
- Craige
--
PHP Genera
I like it, but it's pretty image intensive.
- Craige
On 2/23/07, Daevid Vincent <[EMAIL PROTECTED]> wrote:
Very nice - sorta.
It doesn't work for me in IE6, but does work in FF2.
> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 23, 2007 2:0
While I'm not 100% sure, I'd say something's wrong with this line:
system("pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50
>$imgfile");
I would say that Linux is not writing the output to the location
stored in $imgfile, and thus there is no file there to delete.
However, I can not really
Rob,
This has to be a browser problem. I cannot see it being anything else.
For arguments sake however, would you mind showing us your code. While
I'm sure it is a browser issue, it may have something to do with what
PHP is returning to the browser.
- Craige
On 8/22/07, Rob Adams <[EMAIL PROTEC
Are you *running* a shared hosting environment? If so, what is to stop
you from adding the exec() function to the list in php.ini?
- Craige
> > Don't think so. The code just needs to handle it better. I do it like
> > this:
> >
> > $disabled_functions = explode(',', str_replace(' ', '',
> > ini_g
Oh, okay. He simply wants to ignore them without raising any flags to
say it has been done. I get what he wants. However, as you stated,
there is no way to do this (to the best of my knowledge).
- Craige
On 8/23/07, Chris <[EMAIL PROTECTED]> wrote:
> Craige Leeder wrote:
> > Are
Hi Jason,
If you have a lengthy script with several queries throughout it, it is
possible you could end up with a scrambled database. However, with
short scripts, there is not much of a threat of this. Generally, your
scripts will probable execute in < 2 seconds (and 2 seconds is
lengthy), with an
You can't overwrite PHP's built-in functions, nor any function that
has been defined for that matter.
- Craige
On 8/23/07, Samuel Vogel <[EMAIL PROTECTED]> wrote:
> That'd be at least some kind of a solution.
> I'm thinking of overwriting the functions I want to block with one, that
> just return
I think Peter is probably right. In the case he is not however, can
you post a print_r of $multiArray.
- Craige
On Fri, May 2, 2008 at 7:24 AM, Peter Ford <[EMAIL PROTECTED]> wrote:
>
> Richard Kurth wrote:
>
> > Way does my for loop not complete the task if there are 4 emails it only
>
Hi Heysem,
So what you want is an ajax script that will call a php page every
minute, and check for a result (assuming boolean) of 1 or 0? That
shouldn't be too hard. First, I need to know more information about
the page, such as the id tag of the element you want updated, and how
severe the
I beleive you can also do
set_error_handler(array('classname', 'myMethod'));
for static methods.
- Craige
On Fri, May 2, 2008 at 2:26 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:
>
> > Is there any way to use a class to handle errors? I've tried some stuff
> like
> > set_error_handler("Error_Han
Hello Philip
First thing first: design patterns are your friend. A good reference
for which, is:
http://www.fluffycat.com/PHP-Design-Patterns/
Second of all. What is the situation in which you are trying to do
this? I can't really think of one where you would do such a thing.
- Craige
On Fri,
ons here) as a simple example something like this
>
> class B {
> //...
> function doSomething() {
> return $this->c->doSomething();
> }
> }
>
> which allows you this in A instances
>
> $this->b->doSomething();
>
> this is the preferred approach, since A and C instances are loosely
On Fri, May 2, 2008 at 7:27 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
> Why are you using OOP? That's insane.
>
> -Shawn
I believe that's a matter of opinion. Some people like OOP, others
don't. Why criticize the man because he likes to use it? I like to use
it as well.
Regards,
- Craige
html_entities()
http://ca.php.net/manual/en/function.htmlentities.php
Hope this helps
- Craige
On Sat, May 3, 2008 at 12:13 AM, It Maq <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a page that displays data entered by the user. There is one user that
> entered the character "&" inside the text h
Why exactly are you doing this? While variable-variables can be of use
at times, I don't think this is one of them. How do you use this newly
created variable.
- Craige
On Sat, May 3, 2008 at 1:20 PM, cyaugin <[EMAIL PROTECTED]> wrote:
> I have this line of code:
>
> $q = "This is the string tha
Well, you're missing a semi-colin after the exec() statement, and the echo.
If it wasn't the syntax error, make sure the program exists with file_exists();
- Craige
On Sat, May 3, 2008 at 11:28 PM, <[EMAIL PROTECTED]> wrote:
>
> Hi all
>
>
> I try write a code to execute service in my server
Hey Paragasu,
Sounds like fun, though not really that difficult. It is a very
horrible site, but it shouldnt' take that much to create the script
for. They do not, in-fact, use Javascript to pull the movie times from
the database. They reload the page with the added querystring
variables (for
Hi Ron,
This code should work:
$quantity)
{
echo "" . $product_name . " - " . $quantity .
"\r\n";
}
?>
Though I'm not sure about $cart[$product_id]. Where is that coming
from?. It makes no sense here. Perhaps you want to do a
tri-demensional array in $_session, so you will have a
> You've even had to resort to using classes and other strange stuff to
> program. Clearly signs of mental fatigue. :-)
:o. I think mental fatigue might be evident by one not using it. But
that's just me ;)
- Craige
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http:/
I can't see PHP sessions slowing down your site by that amount. As
someone said, it should be no more than a split second. If you are
having that much of a problem with them, then I would say it is either
your implementation, or another determining factor.
I would not, personally, stray away from
On 7/14/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
If somebody wants the next Web 2.0 killer app, build a
meta-social-networking site that lets the user manage all the big
social networking sites through a single central interface. :-)
Is it sad that I thought of that while reading this topic
1. Don't modify $_POST
2. You controll the name of the array keys with the form. Why is there
any need to change them form PHP's side of things?
3. I'm not sure Roberts solution would work. I think it might result
in an endless loop, and timeout your script.
- Craige
--
PHP General Mailing List
I have been working with PHP5 since it's release, and until a few
months ago, have never experienced the problem I am about to describe
to you. I am not sure weather it has been discovered previously or
not, nor do I know exactly how to replicate it, but I would like to
know if you have encountere
You would need to use Java or Flash to load the video and check the
loaded size against the total size.
- Craige
On 12/9/06, Beauford <[EMAIL PROTECTED]> wrote:
Not sure if this can be done with PHP, or if I would need to use a java
script or something. If anyone has any ideas it would be appre
Merry Christmas everyone. I hope you have/had a great one. Enjoy your
turkey feasts this weekend, they comes only a few times a year.
On 12/25/06, Miles Thompson <[EMAIL PROTECTED]> wrote:
At 07:20 AM 12/25/2006, Robert Cummings wrote:
>WhoooOO! Hope you all have a great Chr
PHP General Mailing List,
I have a few questions when it comes to installation of PHP, and a PHP
extension I have been eyeing
The first question involves Installation of PHP-GTK with PHP 5, from
zip. Although I follow the simple instructions included in the zip,
No, I'm not. I didn't even know it was in Beta until this email.
I probably wont download it until final release. I'm not the biggest MS
fan, and pretty much the only reason I use IE is for cross-browser testing.
- Craige.
Richard Heyes wrote:
Hi,
Anyone using it?
--
PHP General Maili
Can we see your parsing code, please?
BTW, are you parsing for and , because you have given both as
an example here.
- Craige
VamVan wrote:
hello,
i have html tags in the bod of text like:
$body = "helloierhellohello";
print $body;
Some how it does not render html properly in a html pag
The only concern I would have is that you are using a third party
software/applet to do these uploads. I'm not a fan of MAKING users have
a piece of software enabled to allow them basic web-standard
functionality on a site.
It is however, an interesting concept. It would really come in handy f
Hi Guys,
So here's what I'm looking for as a result(ex):
array ('html' => array('iOutput' => array('iIO' => array() )),
'xml'=> array('iInput' => array('iIO' => array() )),
'database' => array('iData',
'aMySQL',
I forgot to mention, the calls to setPreReq() would occur in each file
in place of an include() to get prerequisite components. IE:
html.php :
Ember::setPrereq( array('iOutput' => Ember::mciInterface) );
class html implements iOutput {
...
}
iOutput.php:
Ember::setPrereq( array('iIO' => Ember
No can do. The files are stored in separate directories based on their
usage/type. They're not all just in one directory.
Regards,
- Craige
Jochem Maas wrote:
try autoload()ing. what your trying to do is reinvent a wheel ...
and chances are yours will be less round.
--
PHP General Maili
Richard Lynch wrote:
So set up include_path to have all those directories and call it done.
The problem I see with with this is what if there is are two files of
two different types (thus in different directories) which have the same
file name?
Forgive me, I'm just trying to shoot out sce
Hi Guys,
Quick question: can a static method in PHP be recursive, or is there
some sort of weird law against this? Ihave my method setPrereq that can
essentially call itself (well, it includes a file which may call the
setPrereq method, so essentially it is recursive).
I've done some tests,
--- Begin Message ---
Hi Guys,
I found the problem. I was using the error suppression operator on my
include, and thus I could not see the syntatic error on the page.
Problem Solved,
- Craige
Yeti wrote:
Some code would be quite helpful here. But your scenario should not
make any problem.
So, I have this class which contains a method LoadIO. I was doing some
debugging as to why a condition wouldn't pass like I thought it would,
and It's starting to piss me off.
The three echo's near the bottom are not printing what it should. The
middle echo is not even printing static text.
Micah Gersten wrote:
I think you meant this:
echo "-" & $fpType & "- is equal to " & self::mciInput & "";
to be
echo "-" . $fpType . "- is equal to " . self::mciInput . "";
And this is how you know you've been doing too much ASP, lol
Thanks Micah!
--
PHP General Mailing List (http://www.ph
79 matches
Mail list logo