Re: [PHP] Loss of precision in intval()

2007-08-01 Thread tg-php
Probably return "7582" instead of "7581". = = = Original message = = = On 8/1/07, Mark Summers <[EMAIL PROTECTED]> wrote: > This sort of thing really isn't helpful... > > > $a = 75.82 * 100; > > echo intval($a); > > ?> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, vis

Re: [PHP] Which PHP-Editor to use?

2007-08-02 Thread tg-php
The age old question... is it that time of the year again already? Some reviews and lists: http://www.php-editors.com/ I've used Zend Studio for years, and really like it, but lately I've gotten tired of the java virtual machine seeming to hog tons of system resources. I've also used Crimson E

Re: [PHP] javascript in or in ?

2007-08-07 Thread tg-php
Ok, you got the obligatory 'wrong list' comments. It is the wrong list, but for the sake of public completeness... how about an answer to the question. You can put it anywhere but a couple of considerations: 1. I believe if you put it AFTER where the JS functions defined in that block are call

Re: [PHP] A variable inside a variable?

2006-06-26 Thread tg-php
I've never found a use for it myself, but yes.. php provides for 'variable variables': http://us3.php.net/manual/en/language.variables.variable.php $a = 'varname'; $varname = 'test'; echo $$a; > test -TG = = = Original message = = = Thanks for your help with my other question, heres a new o

Re: [PHP] Re: A variable inside a variable?

2006-06-26 Thread tg-php
You were on the right track, but this isn't going to work.. for a couple reasons: $var = 1; # this is fine $var2 = "$var"; # $var2 == 1 at this point echo $$var2; # you're going to echo $1 Putting $var in double quotes makes PHP evaluate it before assigning it to $var2, so you won't get $var b

Re: [PHP] Calculations

2006-06-27 Thread tg-php
Try: pow($base, $exp); http://us2.php.net/manual/en/function.pow.php Not sure why PHP doesn't use the ^.. havn't looked to see if it's already used for something else. -TG = = = Original message = = = Hi there list. Thanks for your help with my other questions. I was carrying on working th

Re: [PHP] Calculations

2006-06-27 Thread tg-php
When my level of free time matches my level of curiousity, I'll have to research it further. For now, I'm ok with not knowing unless someone posts the answer here. hah -TG = = = Original message = = = At 1:45 PM -0400 6/27/06, <[EMAIL PROTECTED]> wrote: >Try: > >pow($base, $exp); > >http://us

RE: [PHP] Calculations

2006-06-27 Thread tg-php
Ahh.. thanks from the lazy programmer :) I knew I had seen it somewhere. Guess they ran out of symbols and decided XOR was more important than exponential operations. hah My vote would have been for ^ to remain for exponents and something overly complicated like |X| for xor..hah -TG = = =

Re: [PHP] Calculations and exponents in languages

2006-06-28 Thread tg-php
Huh.. thanks for the illustration Robin. Can't say that I did much with exponents when I've played around with perl or python or C.. and never worked with Java. You've expanded my view. Ok, now what languages DO use ^ for exponents? -TG = = = Original message = = = On 28/06/06, tedd <[EMAIL

Re: [PHP] Stop process when user close window browser

2006-06-30 Thread tg-php
On the other hand, you can tell the web server that the browser has been closed or the page has 'exited'. Not 100% reliable, but in theory you could use the "onUnload" (think that was it) event for a web page that does something sloppy like spawn a popup window that hits a PHP script that the

Re: [PHP] Re: Sad PHP Poem

2006-07-01 Thread tg-php
I think they call it 'futbol' in your native language tedd. Or was that 'maize'.. it was one or the other :) -TG = = = Original message = = = At 1:26 AM -0300 7/1/06, Martin Alterisio wrote: >That's all folks. Coming up next: an innovative realistic soccer simulation >game: "Fix the World Cup"

Re: [PHP] Chnage Management in PHP aka version control?

2006-07-05 Thread tg-php
By 'change management' do you mean something like version control software? CVS, Subversion, etc? We use CVS at work and tried setting up Subversion at one point. I don't know, maybe we're all a bunch of retarded monkies here or maybe both systems are just overly complicated, but I don't lik

Re: [PHP] Calculations

2006-07-06 Thread tg-php
Best "proving I'm old" line ever had to have been "I *named* dirt!".. forget where I saw that. Had to share :) -TG "Top posting is for people who remember the conversation and don't care to see it again" :) = = = Original message = = = Jochem Maas wrote: > tedd wrote: >> At 11:27 AM +0300 6

[PHP] Re: [PHP-WIN] Dynamic HTML table sort with PHP

2006-07-07 Thread tg-php
If you're only sorting by one column at a time (not adding to a column sort list) then you can do something like this: $ascdesc = ($_GET['sortcol'] == 'colA' AND $_GET['ad'] == 'ASC') ? 'DESC' : 'ASC'; echo "ColA\n"; $ascdesc = ($_GET['sortcol'] == 'colB' AND $_GET['ad'] == 'ASC') ? 'DESC' : '

Re: [PHP] Video in PHP

2006-07-07 Thread tg-php
Looks like totem supports playlists, why not just generate a playlist and pipe that into totem? And I don't see any obvious documentation without downloading Totem, but you might check to see if there's an "exit on end" option that'd return control back to PHP if a playlist isn't an option. Or

Re: [PHP] Chnage Management in PHP aka version control?

2006-07-10 Thread tg-php
Well, I had similar problems at a previous job with SourceSafe as I'm having with CVS. I totally "get" and understand the concept of these systems, but they're still overly headachey to use. Maybe I DONT really get them. hah. I understand mostly how they work and the concept but it seems like

Re: [PHP] regular expression to extract from the middle of a string

2006-07-14 Thread tg-php
I believe someone gave the regex code for it already, but if you wanted to do it the clumsy way (for those of us who are regex challenged still) here's an alternative: $str = "cn=emailadmin,ou=services,dc=domain,dc=net"; $argsarray = explode(",", $str); foreach ($argsarray as $argstr) { list

RE: [PHP] Sort Array

2006-07-18 Thread tg-php
Actually it's going to be a little more complicated than a 'ksort' here I think. ksort on the main array is going to give you: array ( "TBA0123451" => array("Country"=>"Germany","Model"=>"WS6234"), "TBA0123452" => array("Country"=>"England","Model"=>"WS1234"), "TBA0123456" => array("Coun

Re: [PHP] create multidimensional array with n depth

2006-08-09 Thread tg-php
My brain is really fried right now and I'm sure someone has a more indepth answer/opinion on this subject, but it occurs to me that you can get away from using eval() if you do some kind of recursive function using: $temp[] = array($arrval1, $arrval2,...); and $arrval1 could == array($arr2val1

Re: [PHP] USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread tg-php
We have a similar (and still non-PHP related) issue at work where we want to do the "call may be monitored for quality assurance" thing on the new phone system we just got. Our old phone system was analog and provided for this feature. The new system is a Cisco IP Phone deal which is really re

Re: [PHP] USB Question Not PHP Related, so if you don't want to read this you don't have to

2006-09-13 Thread tg-php
Sorry, misread the "splitter" comment earlier. A splitter pre-USB off of the headset or phone-unit somewhere may work too. -TG = = = Original message = = = We have a similar (and still non-PHP related) issue at work where we want to do the "call may be monitored for quality assurance" thing

Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread tg-php
Create your own "back" button that re-posts the same data back to the search page? Or have a "new search" (that takes you back without filling in the old search data) as well as a "revise search" or something that takes you back without while retaining the original search data. Or do like some

Re: [PHP] How to skip browser's Warning?

2006-09-13 Thread tg-php
Create your own "back" button that re-posts the same data back to the search page? Or have a "new search" (that takes you back without filling in the old search data) as well as a "revise search" or something that takes you back without while retaining the original search data. Or do like some

Re: [PHP] Re: Miserable escape string problem

2006-10-05 Thread tg-php
The escaping works fine for me.. using the code: $var1 = 1; $var2 = 3; echo "\$var1: $var2"; print "\$var1: $var2"; print ("\$var1: $var2"); All output: $var1: 3 as expected. Is there a way to re-define the escape character or something? I can't think of why that wouldn't escape the $ prope

Re: [PHP] Re: Miserable escape string problem

2006-10-05 Thread tg-php
Let's look at your original message: Using this string: "$var1: $var2" of course it doesn't work as some might expect. It works exactly as expected. Within double-quotes, things like variables get evaluated. In this case $var1 and $var2 will be repl

Re: [PHP] Re: Miserable escape string problem

2006-10-05 Thread tg-php
Unneeded clutter, yes.. but I owe you an apology and since the mistake was public, I'll make the apology public as well. I use a 'universal' email checker called ePrompter. It does text-only, no HTML, so it filters out HTML messages, but have never had a problem with it filtering out braces, b

Re: [PHP] Using mysql_real_escape_string

2006-10-09 Thread tg-php
mysql_real_escape_string() is a function that returns the post-processed value. So you can either do it like this: $safe_value = mysql_real_escape_string($unsafe_value); then use $safe_value in your query, or put the function right into your query: $myQY = "INSERT INTO sometable (value) values

Re: [PHP] canon jpegs

2006-10-13 Thread tg-php
Emil.. I havn't played with GD too much but I suspect it has something to do with the fact that digital cameras tend to save EXIF jpg images that have some extra headers on them with data about the camera and other stuff (some cameras even have GPS in them and will store the lat/long of where th

Re: [PHP] Re: postback for php

2006-10-18 Thread tg-php
With my brief foray into ASP.NET for a previous job, I remember "postback" being a conglomeration of junk code that it used to POST data back to the server and may have been kinda AJAXy in nature. The forms in ASP.NET tended to do stuff like convert from a static text string to a INPUT field wh

Re: [PHP] Comment management

2006-10-23 Thread tg-php
Think he's looking for something that'll manage comments.. not bugs. As he says, so people can post comments (like in the online PHP docs where there are user comments for differnent entries with their own code samples and notes). -TG = = = Original message = = = Maybe you mean a bug tracker?

Re: [PHP] Is there a function can decrypt md5 ??

2006-10-24 Thread tg-php
There is no practical way to 'decrypt' an MD5 hash. It is meant to be a one-way encoding of data to produce a (mostly) unique ID. It does a lot better job than some of it's predecessors like CRC32, in producing a unique ID, but apparently it still has a very slim possibility of generating the

Re: [PHP] Microsoft Partners With Zend

2006-11-01 Thread tg-php
http://www.winbinder.com much better than GTK if you work on Windows platforms and want standalone PHP apps :) And I can't find it now, but a few years ago when I was dipping my toe into the ASP.NET world to try to be compliant with "Existing standards" in a company I worked for (before aband

Re: [PHP] WAP?

2006-11-02 Thread tg-php
WAP is just a sort of XML specific to creating 'cards' and content for cell phones. I did some stuff a few years ago, was even in line to teach a class at a local training institute. Once you figure out what structure you want to use for your cards and all that, the PHP stuff is really seconda

Re: [PHP] WAP?

2006-11-02 Thread tg-php
Ah.. grat pull! I did forget about that one. Good stuff, thanks! And yes, that appears to be the address. = = = Original message = = = On Thu, 2006-11-02 at 17:11 -0500, [EMAIL PROTECTED] wrote: > http://www.w3schools.com/wap/ Also, don't forget hawhaw. I think it lives at http://www.hawhaw.

Re: [PHP] Viruses

2006-11-02 Thread tg-php
As Rasmus said, they filter as much as they can on the list. But consider this... if someone's machine is infected and they below to this email list, it can harvest your email address and either spam (or send malware) from their PC to you or send your email address to somewhere else where it can

Re: [PHP] Viruses

2006-11-02 Thread tg-php
As Rasmus said, they filter as much as they can on the list. But consider this... if someone's machine is infected and they below to this email list, it can harvest your email address and either spam (or send malware) from their PC to you or send your email address to somewhere else where it can

Re: [PHP] Viruses

2006-11-02 Thread tg-php
As Rasmus said, they filter as much as they can on the list. But consider this... if someone's machine is infected and they below to this email list, it can harvest your email address and either spam (or send malware) from their PC to you or send your email address to somewhere else where it can

Re: [PHP] Viruses

2006-11-02 Thread tg-php
As Rasmus said, they filter as much as they can on the list. But consider this... if someone's machine is infected and they below to this email list, it can harvest your email address and either spam (or send malware) from their PC to you or send your email address to somewhere else where it can

Re: [PHP] WAP?

2006-11-03 Thread tg-php
Doesn't look like the content type is set properly. Here's another link that may be useful (from Zend themselves!) maybe that can help you out a bit. Content type and setting the xml version and DOCTYPE in the header are all fairly important. Also, if I recall.. Firefox and/or Opera (not IE)

RE: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread tg-php
Would it be possible, Jochem, to just make a shell script that does the call to mysql and have PHP exec() the shell script? I don't know if you'd have the same problem or not. I've never done something like this in *nix and paid attention to the process list. Also, I'm guessing you're seeing y

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-11-29 Thread tg-php
Ah.. makes sense. Good old DOS is stupid enough not to card most times. You can create a text file with a "Y" in it, and redirect it into a command like: del . < y.txt Guess that's not a pipe technically. And some commands may be smart enough to prevent something like this. Thanks for the

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-12-01 Thread tg-php
If you did use ENV to set the username and password, you could always unset it using the same method after you ran the mysql command. So it'd only be exposed for a very brief period of time and slightly less accessible than just running a process list. It still falls under the category of "sec

Re: [PHP] Random pictures - not twice

2006-12-03 Thread tg-php
Without using cookies or session information, you're going to go through your picture list faster depending on how many users are accessing the random pic page. If you don't make it user-specific, then it doesn't really matter if you go through the images sequentially.. it may appear random on

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-12-04 Thread tg-php
You'd assume those ENV variables are secure.. or secure "enough". I know there's no such thing as perfect security, but I still wonder if there's a better way. Although at this point, if there was a way to read other process/subprocess ENV variables, it'd most likely be something an attacker w

RE: [PHP] Need help with RegEx

2006-12-11 Thread tg-php
If you didn't say "using regex" this is how I'd do it (untested, forgive typos and such..ripped from some code I actively use and stripped down): = = = Original message = = = The example provided didn't work for me. It gave me the same string without anything modified. I am also looking for

Re: [PHP] Recomended host

2006-12-18 Thread tg-php
I'm going to be controversial here and take issue with both of you. 1. The original question was about a hosting provider. Presumably a PHP web hosting provider. So it is vaguely on-topic and is a question that's asked a lot. It's easy to get a list of hosting providers online, but I believe t

Re: [PHP] Recomended host

2006-12-18 Thread tg-php
I'm going to be controversial here and take issue with both of you. 1. The original question was about a hosting provider. Presumably a PHP web hosting provider. So it is vaguely on-topic and is a question that's asked a lot. It's easy to get a list of hosting providers online, but I believe t

[PHP] Re: [an attempt to inject a bit of humor back into the situation] Re: [PHP] Recomended host

2006-12-19 Thread tg-php
I hate you all. Screw PHP. I'm switching to Cold Fusion. :) PS. Puppies are good with ketchup. = = = Original message = = = tedd wrote: > At 3:50 PM -0500 12/18/06, <[EMAIL PROTECTED]> wrote: >> I'm going to be controversial here and take issue with both of you. >> >> 2. Pointing out someone

Re: [PHP] Video question

2006-12-19 Thread tg-php
To view a video, you do have to download it. But you don't have to download all of it at once. If a user did have to download the whole video and you still wanted to protect it, you'd want to look into some kind of DRM (digital rights management) solution probably. YouTube and similar streamin

Re: [PHP] [an attempt to inject a bit of humor back into the situation] Re: [PHP] Recomended host

2006-12-19 Thread tg-php
Cheers tedd! Thanks for coming around. Life's too short to stress about stuff like this. There's always going to be people who don't understand (after all.. HE WASNT THERE MAN! sorry.. I couldn't help it :) I wasn't there either so my turn to be village idiot for a moment.. forgive the at

Re: [PHP] Database Question

2006-12-20 Thread tg-php
So you have two "single table" votes.. make this a third. I'm guessing that each time you collect data, it's going to be one of each piece of data every time. Temperature, barametric pressure, humidity, wind direction, etc. You're not going to have 5 things all the time and like 3 other thin

Re: [PHP] Are PHP5 features worth it?

2006-12-21 Thread tg-php
Ha! Mine too! How long before this secret gets out and our apps all start imploding?? Technically this is true. You can't do AJAX with PHP4. Or PHP5. Not the "AJAX" part at least, since it's all handled in Javascript.What gets returned to the AJAX app and what it interacts with on the

Re: [PHP] Count empty array

2006-12-21 Thread tg-php
Not sure why it does it, but doesn't seem to be a huge deal. I'm guessing it's because an empty string is still a string. It's not null. Anyway, it's documented at: http://us3.php.net/manual/en/function.explode.php A user writes: "If you split an empty string, you get back a one-element array

Re: [PHP] Jump to a record when searching MYSQL with PHP Paging?

2006-12-22 Thread tg-php
I would guess this would depend highly on how you're displaying the data. Let's set up a scenario: 1. Full results come out to say, 100 records. 2. Searched item is #53 in the result set. Your choices for displaying the data could be one of the following: * One big web page, jumping to the res

Re: [PHP] Calling API on Windows?

2006-02-24 Thread tg-php
Don't know if it helps much, but maybe there's something buried in WinBinder (http://www.winbinder.com) that could help. It's a much better (IMO) Windows GUI for PHP than GTK is... and is windows specific so might have have w32/ffi helper functions. Good luck! -TG = = = Original message = =

Re: [PHP] Re: Is this possible with php

2006-03-06 Thread tg-php
Yeah, you can't do the local computer file moving and all that with the same script as your server side component, but if you'd rather not learn C# or another language like that, but you're comfortable with PHP, I'd highly recommend checking out Winbinder (http://www.winbinder.com). Assuming yo

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread tg-php
Yeah, that foreach is outright printing the arrays (foreach $parent... print $parent?) I'm guessing you wouldn't ask this, Jay, unless there was an issue with not knowing the depth of the data. I saw something once with doing recursive function calls to dig down into an array or something. S

Re: [PHP] Going loopy with arrays.....

2006-03-31 Thread tg-php
Yeah.. or something like this! (Chris' looks better than mine.. maybe his brain's working at 70% today :) -TG = = = Original message = = = > a. loop through it and recognize when I have com upon a new sub-array so > that I can do 'new' output > 2. OR get each of the sub-arrays out as individua

RE: [PHP] Going loopy with arrays.....

2006-03-31 Thread tg-php
If you need to backtrack from the lat/long to the "H" key, why not build a reverse lookup array? $arr[$lat . ":" . $long] = $hvalue; ? -TG = = = Original message = = = [snip] > a. loop through it and recognize when I have com upon a new sub-array so > that I can do 'new' output > 2. OR get ea

Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread tg-php
For the purpose of creating phpBB accounts? As in, automated creation of mass amounts of phpBB accounts maybe for the purpose of spamming phpBB's? Just curious. Please clarify the need to automate creation of phpBB accounts if that's what you're asking for. -TG = = = Original message = = = I

Re: [PHP] PHP Script to open phpBB2 accounts

2006-04-19 Thread tg-php
Stut... how many of those have asked for your credit card number? -TG = = = Original message = = = Jay Blanchard wrote: > [snip] > I'm looking for a ready made php script that can open phpBB 2.0.20 > accounts > By sending username, email and password. > /snip] > > I am looking for a good hearte

RE: [PHP] PHP Script to open phpBB2 accounts

2006-04-20 Thread tg-php
The idea of creating a phpBB user when a weberdev one is created has merit, but I'm not sure I saw anyone recommend doing the opposite? Since you have a fair idea of how weberdev creates users (since you created it) why not insert some PHP code into phpBB to create a weberdev account when someo

Re: [PHP] strange php url

2006-04-21 Thread tg-php
Not sure about php.net specifically, but two things to note here: If you leave off a filename at the end of the URL, the web server will look for a 'default' document. On apache and unix systems I believe the default is "index.html" and on IIS systems it's something like "Default.htm". Most of

Re: [PHP] strange php url

2006-04-21 Thread tg-php
You could do that... a "poor man's mod_rewrite" might involve something like this and making the main PHP parsing script your 404 page.. so no matter where you went on a page, the 404 redirect to your PHP script would parse the request (or would you get the post-redirected URL? in which case you

Re: [PHP] strange php url

2006-04-21 Thread tg-php
All depends on how the data is used after it's interpreted/split: http://www.example.com/index.php/edit/customer/1234 $action = "edit"; $type = "customer"; $id = "1234"; header("Location: http://www.example.com/index.php?action=$action&type=$type&id=$id";); In this case, what happens if someo

Re: [PHP] Natural order of things.

2006-04-26 Thread tg-php
You could try separating out the number an formatting it with SQL and doing an ORDER BY on the post-processed number. It doesn't have to appear in the SELECT portion to be able to use it in the ORDER BY section. SELECT BookName, PageNum, Citation FROM BookQuotes ORDER BY LPAD(PageNum,4,'0');

Re: [PHP] Natural order of things.

2006-04-26 Thread tg-php
Going to amend this by saying that whereever the number you need to sort by is located, you should be able to extract it and do the padding trick even if it's in the middle of a string.. as long as the format is regular enough. -TG = = = Original message = = = You could try separating out the

Re: [PHP] we are looking for experienced php programmers full time freelance...

2006-04-28 Thread tg-php
Damn.. tough crowd here.. hah.. glad everyone has a sense of humor at least. hah.. -TG = = = Original message = = = Sumeet wrote: > John Nichel wrote: >> cajbecu wrote: >>> $300 / hr 8 hr minimum per day available 0800 - 0900EST >>> >>> >>> it`s a joke, right? >>> >> >> Not

[PHP] [JOB] PHP developered needed in Largo, MD

2006-04-28 Thread tg-php
Ok.. my turn for the $300/hr jokes (no, we're not paying that.. nor are we paying $299/hr.. sorry John) Here's the skinny.. more details available upon request. Should have a more-than-decent grasp on the following: PHP4 MySql4 Javascript (AJAX experience is nice but not necessary) HTML and CSS

Re: [PHP] Printing with php

2006-05-03 Thread tg-php
Couple of things you can try.. 1. If you have control of the browsers being used, there may be a setting to turn off the address printing (I seem to remember something like that.. but don't remember what browser it was). 2. CSS2 has some print control functionality that might help 3. (more PHP

Re: [PHP] Convert from jpg to gif ... change dpi...

2006-05-08 Thread tg-php
Actually I don't believe this is exactly right from playing around with Photoshop you can see that you change an image's resolution under Image -> Image Size and if you turn off "Resample Image", it will retain the same pixel dimensions. GIF's are limited to 72dpi (or ppi if you prefer.. p

Re: [PHP] Convert from jpg to gif ... change dpi...[off something]

2006-05-08 Thread tg-php
First, a correction or clarification to what I was saying. PPI and DPI are not the same. PPI is used for on-screen display, DPI is used for printing. The quick and dirty with DPI is that printers can print dots, but each dot represents only (typically) the standard CMYK (cyan, magenta, yellow

Re: [PHP] WINNER

2006-05-08 Thread tg-php
His name was invoked and he appears (didn't even have to say it three times)!! All too reminiscent of Kibo of usenet days of old. hah So if you won the international lottery, Jason, where's the latte and/or beer that we all got coming to us? Just skypecast me an e-coupon to my iPod GPS. Than

Re: [PHP] Sessions - session_start()

2006-05-15 Thread tg-php
session_start() doesn't need to be the first line of your PHP code, it just needs to be called before any other output is performed. Including any blank spaces or anything else. If you have: --- 1: 2: --- It's not going to work because you have a blank line being output to the browser for i

Re: [PHP] round behavior changed

2006-05-19 Thread tg-php
I seem to remember something about rounding functions and accounting.. that there's a rule in accounting that says if the trailing number is even you round down, odd you round up.. or something like that. I know that's different than standard 'math' but in accounting it apparently helps deal wi

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

2006-05-26 Thread tg-php
Since we're talking about include()ing functions specifically, I don't think there's going to be much trouble to be had. Your file may be something like this: If that's executed by PHP by being called directly, it won't do anything. It's worth noting your point for completeness' sake so som

Re: [PHP] OO purism sucks - sell me on PHP5?

2006-06-02 Thread tg-php
I'm kind of coming from the outside here, so forgive my ignorance on some matters. I have some OO experience, just not with PHP and have only worked with PHP4 so again.. kind of on the outside of all this. Rasmus, you make a great point here. OO is structured and is all about constraints wher

RE: [PHP] If value is odd or not

2006-06-02 Thread tg-php
The Obfuscated C contest had a category for most complicated solution to a simple problem. Like 50 lines of code to add two numbers together, stuff like that. -TG = = = Original message = = = At 9:52 AM -0500 6/2/06, Jay Blanchard wrote: >[snip] >It might be interesting to see how long of a p

Re: [PHP] When is "z" != "z" ?

2006-06-05 Thread tg-php
I know this discussion doesn't need to continue any further..hah.. but I think the biggest confusion people are having is that they're looking at two things and assuming that PHP operates the same on both and these two things serve different purposes. 1. Incrementing strings: Best example givin

Re: [PHP] When is "z" != "z" ?

2006-06-05 Thread tg-php
This is just one of those cases where the designers had to make a judgement call on how things were going to operate. It makes sense if you look at the two things separately (incrementing vs string 'greatness' evaluation) and makes sense that how they chose to implement the functions are two va

Re: [PHP] remove keys from array

2006-06-12 Thread tg-php
Crap.. I remember seeing an example of something that yielded arrays like this and now I can't find it. It basically created an array (from a database I thought.. but can't find the example under mysql_fetch_assoc or mysql_fetch_array... thought it was in the standard PHP documentation (not the

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread tg-php
I'm guessing that phpBB is doing things the "right way".. that is, separating presentation and logic. In cases like that, you have your PHP code and your HTML in separate files with as little 'logic' in the HTML as possible. I'm kind of oversimplifying the explaination and I'm sure there are "m

Re: [PHP] Calculating difference between two days

2006-06-14 Thread tg-php
Shouldn't be too difficult in PHP. \n"; echo "Minutes difference: $minutesdiff\n"; echo "Hours difference: $hoursdiff\n"; echo "Days difference: $daysdiff\n"; ?> And if you want a larger example to play with, here's something I did a couple years ago (forgive the word wrapping and any unr

Re: [PHP] mysql_db_query & INSERT

2006-06-20 Thread tg-php
After you do your first insert, do: $insertedid = mysql_insert_id(); That will give you the autoincrement ID from the last INSERT you did. Note, this doesn't retrieve the last autoincrement ID from any insert, just the last one for thta specific mysql connection. So you don't have to worry ab

RE: [PHP] FCK Editor

2004-12-07 Thread tg-php
It worked on my IE and I don't have .NET Framework installed, so guess it's not a .NET specific thing. Did not work on my Firefox (as it was advertised not to). I havn't looked at the code, but it's not a matter of the module doing a browser detect and 'downshifting' if it didn't detect a genu

Re: [PHP] Removing a return character

2004-12-10 Thread tg-php
All the suggestions made earlier make sense. You could use a regular expression or a str_replace() if you knew what you were looking for. And as someone mentioned, depending on your data set, you might want to use trim() (or the left or right variety thereof). When dealing with a single line

Re: [PHP] Text tools

2004-12-13 Thread tg-php
You maybe able to do this (and will eventually definitely be able to do this) with Winbinder on Windows platform with native GUI. He's still on what he calls "pre-alpha" but what's in there already is coming along very nicely. Check out the sourceforge pages: http://winbinder.sourceforge.net/

Re: [PHP] Re: Good and free encoder for PHP5

2004-12-15 Thread tg-php
Well, you could try XP's "Compatibility Mode", I think my girlfriend got Afterlife to run under XP doing that. She got it to run somehow..haha.. because we just found a copy of Afterlife for like $1 somewhere and she picked it up. Or, if you happen to be blessed with VMWare, there's always tha

Re: [PHP] Sort by string length...

2004-12-21 Thread tg-php
Is it an associative array? That is, are you assigning values like this: Method 1: $arr[] = "some text string"; or $arr = array("some text string","some text string too"); or like this... Method 2: $arr["value1"] = "some text string"; or $arr1 = array("value1"=>"some text string","value2"=>"som

Re: [PHP] stripping negative number

2004-12-23 Thread tg-php
I believe this is because taking a value and displaying it as an unsigned value isn't the same as displaying the absolute value of a number. Ever take a calculator that does hex and decimal, enter a negative number then convert it to hex? There's no negative in hex, so you end up with something

Re: [PHP] filesize math

2004-12-24 Thread tg-php
Well, depends on your definition of a kb, mb, gb, etc.. You seem to be mixing definitions here. One school of thought is that... 1000 bytes = 1 kb 1000 kb = 1 mb 1000 mb = 1 gb In reality... 1024 bytes = 1 kb 1024 kb = 1 mb 1024 mb = 1 gb You're checking filesize against the '1000' method the

Re: [PHP] Calculate No Of Days

2005-01-03 Thread tg-php
Greetings! I've posted this before, but there are always new readers so here's my script solution. One of these days I'll make it a function or something, but this should give you a good general idea of how to do such a thing in case you need it again in the future. btw: This also calculates

Re: [PHP] Comparison Operator

2005-01-10 Thread tg-php
Ahh.. the trick question. hah.. Ok, let me see if I remember this (although it doesn't seem to follow the logic in my head.. I know someone else will explain it better but let me take a crack at it): When comparing a two different variable types that PHP thinks it knows how to compare, it will

Re: [PHP] Error in foreach?

2005-01-10 Thread tg-php
Sounds like $_GET isn't populated or has been over-written. Try doing the classic print_r on $_GET to see what it contains before you do the foreach. If you are using a form (rather than an a_href link) to pass the GET data and you're using all checkboxes or something else that returns nothing

Re: [PHP] $_GET & $_POST simultaneously

2005-01-11 Thread tg-php
If your question is a matter of "Is this a good programming practice" then I think it's ok. There are times when something like this could be really useful. Should people get into the practice of using this kind of thing? I think it really depends on the circumstances and there's definitely ti

Re: [PHP] NT Auto Authentication?

2005-01-18 Thread tg-php
Ok, I think the other response you got is mostly right, but I don't think it's clear what you're trying to do. If you enable NTLM authentication on the web server, then you can have the user's browser send the authenticated username to the web server. You'd do that like this: 1. On your web s

[PHP] Re: PHPED PHP IDE

2005-01-18 Thread tg-php
One minor correction. Zend Studio is not available as a complete product for free, but the last time I used it they let you use most of the functionality for free, just disabled some of the advanced functions unless you paid. You just needed to get a new freeware license every 30 days or so.

[PHP] Search indexing.. Re: [PHP] Search engine

2005-01-20 Thread tg-php
Just out of curiosity.. relating to this subject.. does anyone have any good documentation on creating your own site index so you can create your own search engine? That is.. do search engines like Google take every word in a web page and if you search for that specific word it has a list of a

Re: [PHP] quoting values in HTML - is there a diference between ' and "

2005-01-20 Thread tg-php
I believe HTML uses ' and " interchangeably. No real difference. Well, it also depends on the HTML rendering engine too I guess. IE might do it ok but Firefox might not.. things like that. But I think as far as the spec goes, you can use both.In a lot of cases, as long as there are no sp

[PHP] Firefox's Web Developer Extension.. Re: [PHP] quoting values in HTML - is there a diference between ' and "

2005-01-20 Thread tg-php
Yeah, that looks like it. Even one little feature like being able to "show table cell borders" and toggle that one and off can be invaluable to someone who habitually goes in and sets a "border=1" for a table then has to go back and do "border=0" after checking the table. The web browser know

<    1   2   3   4   >