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

2005-01-20 Thread tg-php
> just to hammer the point home - CSS - the table killer. I still like tables. Absolute positioning be damned. Most times I'm perfectly happy letting the browser figure out where to put things without being explicit. Given, I need to do more work with CSS, but one thing I know that drives m

RE: [PHP] REPOST: Serving WML

2005-01-21 Thread tg-php
Sorry, I didn't completely follow this thread (deleted the messages before I really read them). But I've served WAP/WML before. Made a couple of basic WML scripts and was able to access them via my cell phone. I posted them on a regular web server, nothing fancy. All I had to do is make sur

Re: [PHP] Replace credit card numbers with X ???

2005-01-25 Thread tg-php
In addition to what was mentioned already, using ereg_replace, if you're pulling the CC# string out of a database of off of some POST data or something, just use a substr() function to pull the last 4 digits and prepend a bunch of X's. $ccnum = "342342522342342"; # fake CC #, prob not even cor

Re: [PHP] PHP and USB Devices

2005-05-31 Thread tg-php
The fingerprint reader may have software that has COM capabilities too. So you might be able to use a COM call to the software to get the fingerprint ID (big huge "password" mentioned) that it generates. Reading directly from the device would probably mean writing a custom driver since even

Re: [PHP] foreach ($media as $key => $val) problem

2005-06-01 Thread tg-php
Ahh.. an easy one. Unless I'm mistaken (and it does happen more often than I'd like.. hah :) then you might want to ommit the first: $media = mysql_fetch_assoc($media_result); That's reading data into $media and then it happens again at the start of your while loop which is why you're only ge

Re: [PHP] Exporting to MS Word or Excel

2005-06-02 Thread tg-php
To export it exactly as displayed (like when you print to a virtual printer to generate a PDF) might be tricky, but you can definitely create Excel and I believe Word files without even having Excel or Word installed. If you DO have Excel or Word installed on your server, then you can always u

Re: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-06 Thread tg-php
That looks like some of my code.. or a derivative of my code. For some reason, my PC at work here is having issues with PHP instantiating with COM so I can't test this, but the code you posted is conspicuously missing all the braces { }. I'm guessing that's not your issue though... or else yo

Re: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-06 Thread tg-php
Reasons: 1. Because you can. 2. Because I believe you need Exchange Server and IIS running to share outlook calendars out via the web(?) 3. Because the project has a requirement to do it this way 4. Because he likes a challenge The question "Is this the best way to accomplish your goal" is

Re: [PHP] This is happening why?

2005-06-06 Thread tg-php
Yeah.. you're comparing a string, 'NULL' with an integer 0. You're not comparing NULL with anything, you're comparing a string that contains the word 'NULL'. You can use === to do an exact comparison without conversion. echo intval('NULL'); intval('NULL') === 0 = = = Original message = = =

RE: [PHP] Displaying an Outlook Calendar on a webpage using PHP

2005-06-07 Thread tg-php
Sorry, wasn't able to test this when I got home. But to clearify, when you use COM, it's loading Outlook (as you've seen) and then talking directly to it. So you don't need an exchange server to make it work. Try tracing through the code and see where it's failing. And nothing's showing up w

Re: [PHP] problem with IE and php

2005-06-08 Thread tg-php
PHP doesn't really have anything to do with IE or Firefox working or failing to work, it's all about the HTML that PHP generates. What does your tag look like? That's probably more the issue than your button or anything having to do with PHP. If you have no tag, then the browsers might be tr

Re: [PHP] How do I create an Outlook calendar entry?

2005-06-24 Thread tg-php
Actually most/all outlook items should be able to be created with straight text. Try creating a calendar entry and sending it to a normal POP3 email account then looking at it in a non-Outlook email client (view full source/headers/etc). You can try just dragging a calendar item to your deskto

RE: [PHP] Trimming Text

2005-07-15 Thread tg-php
Sounds like maybe he wants to keep his output to 25 chars not including HTML tags.. but wants to output tags if they're present. Turn this: This is regular text with some text inside a span Into this: This is regular text with some text inside a span Then trim to: This is regular text with The

Re: [PHP] Tracking a mobile phone... PHP related?

2005-07-18 Thread tg-php
Not really a PHP question, but you could look to see if your friend has a GPS enabled phone and phone service and if there's an API for pulling the location from the phone co's systems. Then you could see if there's a PHP solution for interfacing with that API. Some cell phone companies let yo

Re: [PHP] snapshot

2005-07-27 Thread tg-php
Launching a brower shouldn't be difficult.. there's a few ways to do that. Taking the screenshot might be trickier though. I don't know of any function in IE that'll take a screenshot so don't know if you could do it through a COM interface to IE. My first impulse was to maybe check out the P

Re: [PHP] PHP Spider/Crawler for Emails possible?

2005-07-29 Thread tg-php
You might get a cold response because it sounds like you're asking if you can write a program in PHP that harvests email addresses from web pages. Typically this would be used for mass email marketing aka 'spam'. Not a lot of people want to support that kind of programming project. But maybe

Re: [PHP] PHP Spider/Crawler for Emails possible?

2005-07-29 Thread tg-php
I guess my question at this point is that it sounds like you have control of the system. Why not have it so when they enter their email address, they can check a box saying "Add me to your mailing list".. and it'll put them directly into the database? Why the need to parse already built webpa

Re: [PHP] Running a PHP script everyday

2005-08-01 Thread tg-php
Don't forget also that if you're running on a Windows platform, you can use the php-win.exe to avoid having any console window appear at all. -TG = = = Original message = = = Steve Buehler wrote: > At 04:54 AM 8/1/2005, you wrote: > >> Shit shit shit!!! I completelly forgot! >> >> #!/usr/local

Re: [PHP] Access and PHP

2005-08-03 Thread tg-php
Just looked into this recently and here's a brief rundown of what I've found: 1. If you run PHP on a non-Windows system, your only option seems to be making a connection to a remote ODBC data source (hosted on a Windows machine presumably). There was something..err.. ODBTP (?) that would work

Re: [PHP] select * from...

2005-08-09 Thread tg-php
Sounds like you want to do an inner(?) join on the two tables. This will show you where you have matches between the two tables but also show you the items that don't match (no special instructions). If I understand right, you have an "order_id" in both "orders" and "special_orders_instruction

RE: [PHP] Restarting windows from php

2005-08-10 Thread tg-php
Could be that he's trying to use PHP to restart the server. Or could be using php via command line or through a system like GTK or Winbinder. It's worth noting that you should make sure you're restarting the machine you think you are, but the question still remains... is this possible and how

Re: [PHP] Oracle Question

2005-08-11 Thread tg-php
Yeah, you can connect to Oracle remotely. The standard PHP functions should do it probably, but I've done it using ADODB. I don't know if this is the same on a *nix box, but I was running PHP on a Windows box and needed special Oracle stuff installed on my machine to connect to the Oracle DB.

Re: [PHP] Re: possible bug (string equality to zero)?

2005-08-11 Thread tg-php
Using === should work. This is most likely because, if I remember correctly, when you compare a string to a integer, it essentially does an intval(string). If the string contains no numbers, you end up with nothing.. or zero. It definitely isn't a bug and definitely has to do with type conver

Re: [PHP] PHP and Active Directory

2005-08-11 Thread tg-php
Just to clearify what you're trying to do. Maybe LDAP (or the ADLDAP? suggestion) isn't what you need. Are you trying to have a user type their username and password into a web form and have PHP pass that information to an active directory server? Or are you trying to make sure that the user

Re: [PHP] How to suppress HTTP headers?

2005-08-16 Thread tg-php
So their page POSTs to a PHP page that you've created? I'm not seeing where headers come into play there, they're on output, not input. Maybe I just stayed up too late last night, but I'm having trouble wrapping my brain around the problem. One thing I did notice was you mentioned switches fo

RE: [PHP] How to suppress HTTP headers?

2005-08-16 Thread tg-php
BTW: I made a mistake last time. Apparently with CLI there are headers. You can use "php -q" to suppress headers when using PHP via CLI. Odd. Not sure I had to do that when I wrote a few CLI scripts before. Oh well, something to play with another day (don't have time to check it right now).

Re: [PHP] How to suppress HTTP headers?

2005-08-16 Thread tg-php
hah.. I should have mentioned this as well, but my brain is absorbed in... sockets... and xml.. and sending headers manually via fputs.. nothing relative to this discussion at all.. hah.. \r\n"; $_FULL_XML_REQUEST = "\r\n"; $_FULL_XML_REQUEST .= "\r\n"; $_FULL_XML_REQUEST .= $_XML_DAT

Re: [PHP] PEAR and MSSQL

2005-08-17 Thread tg-php
Without wading through all the code and queries it might be difficult to give you an exact answer, but maybe some of us can point out a 'gotcha' or two that you can check. One that jumps to mind that I had issues with using ADODB (abstraction layer), and it was mostly with speed but I could see

Re: [PHP] Re: error while running com

2005-08-22 Thread tg-php
Showing your code might be useful but taking a shot in the dark here, I'm guessing that after a while, you have too many instances of Word still instantiated. I remember there being an issue when using COM where the application wouldn't quit properly. Try using $appinst->Quit() as well as $app

Re: [PHP] php as standalone?

2005-08-23 Thread tg-php
Damn... you said those words "cross platform".. But I'll still take this opportunity to plug Winbinder again. If you're just working with a Windows platform, Winbinder has it all!Fantastic interface, very self contained, just a great PHP standalone/app/etc extension all around. Eh.. chec

Re: [PHP] php as standalone?

2005-08-23 Thread tg-php
What I've done with it hasn't included any compiling or code obscuring, but there are a number of PHP code protection schemes that may work with this. I havn't kept up on recent developments, but I've seen the question ask a number of times if you can compile or at least wrap a Winbinder/PHP pr

Re: [PHP] Weird results of "=="

2005-08-23 Thread tg-php
What other values are you trying? I tested it and it seems to work the way it's supposed to. Changing just $a, I get the expected > or < results. Changing $a and $b so that $a always equals $b it always returns the first option. Your test values for $a and $b that yield odd results would be h

Re: [PHP] String format problem

2005-08-31 Thread tg-php
To elaborate on Philip's response (which is correct)... Anything in double quotes (" ") will be interpreted by PHP before figuring out what the actual value is. Items like \n, \t, etc are therefore converted to a newline (\n) or a tab (\t) before assigning to the variable. Variables within t

Re: [PHP] String format problem

2005-09-01 Thread tg-php
Wow! Fantastic rundown Satyam! Thanks for posting such a complete analysis. I had no idea that you could use commas instead of periods to join multiple strings much less do it without concatinating, that's very interesting. I don't think I've ever seen that used in any sample code before. I'm

Re: [PHP] php equivalent for cut

2005-09-06 Thread tg-php
The closest you get to 'cut' in PHP is probably the 'explode' command. It splits a string by a delimiter like 'cut' does, only it dumps the results into an array: $etcpasswd = "username:passwd:123:345::/home/username:/bin/sh"; $pwdarr = explode(":", $etcpasswd); echo $pwdarr[4]; That should

Re: [PHP] Assign values in foreach-loop

2005-09-07 Thread tg-php
Yeah, you can assign values, but you have to keep track of keys, so you'll want to use the => operator for foreach (pardon my reformatted, I feel naked without my braces): foreach ($_SESSION['arr1'] as $key1 => $arr1) { foreach ($_SESSION['arr2'] as $key2 => $arr2) { if ($arr1['id']

Re: [PHP] It's A Windows World

2005-09-16 Thread tg-php
I've used PHP on Windows systems quite a bit and have had very little problem. But then again, many times it's been for small projects that didn't have a chance to develop any nasty 'gotchas'. First thing that comes to mind to investigate further, though, is Zend's WinEnabler product. Even if

Re: [PHP] replace

2005-09-19 Thread tg-php
I hope this is what you were looking for: $contents = "Numbers 1, 2, 3, 4 and 5 will be replaced with A, B, C, D, and E"; $searcharr = array("1", "2", "3", "4", "5"); $replacearr = array("A", "B", "C", "D", "E"); $newcontents = str_replace($searcharr, $replacearr, $contents); echo $newcontents;

Re: [PHP] URL Referral Tracking with AIM

2005-09-27 Thread tg-php
Havn't done it myself, but why not try pasting a link in IM and have it go to a php script that does a var_dump (or print_r) of $_SERVER. Think that's where the referrer data is. It may not show any referrer information since it's coming from an IM, but who knows.. would be interesting to tr

Re: [PHP] Missing pear executable

2005-10-04 Thread tg-php
I believe you're right, they used to include it with PHP. I believe the PEAR docs even say something about it being included. Maybe they don't anymore so you have to go to the PEAR site to get the latest installer. That way they don't get people using an older installer/package manager that m

Re: [PHP] Non-Javascript PHP Onsubmit function?

2005-10-04 Thread tg-php
Nope.. you're pretty much stuck using Javascript or processing it all on the back end with PHP as you described. You could store the data in a database or a $_SESSION variable but without using something client-side, you're going to have to juggle it all with PHP. -TG = = = Original message

Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread tg-php
Check to make sure absolutely nothing before the header() function is outputing anything. No echos, no prints, no var_dumps, no HTML or even blank lines. If it's something tangible like an echo or print or something, then putting an exit()/die() function right before the header() function then

Re: [PHP] Re: form not submitting when I change action from PHP_SELF to thanks page

2005-10-06 Thread tg-php
You don't have to put anything specific, it just stops the script from executing. You can optionally put text in there. I like using die() for some reason (shorter? more.. err.. aggressive? hah) so I'll using commands like: die("Made it to this point..."); I might use this to see if I got to

Re: [PHP] setcookie() is not my friend

2005-10-06 Thread tg-php
Good catch, Chris. I was wondering about that myself but hadn't taken the time to see if setcookie() used regular serial time or if cookies had another time standard. echo date("m/d/Y h:i:s", 15552000); 06/29/1970 08:00:00 That's what I get. -TG = = = Original message = = = Unless I'm mist

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread tg-php
I know that part of the POST transaction with the client and web server involves sending the 'content-length'.. there's no way to tap into that before the file's uploaded though I guess. (example of how to manually POST using Python at leastfound here: http://aspn.activestate.com/ASPN/Cookbook/

[PHP] Re: [PHP-DB] Search & Replace within PHP

2005-10-06 Thread tg-php
str_replace() is the first thing that comes to mind. From the manual: // Provides: $bodytag = str_replace("%body%", "black", ""); Using %keyword% and is kind of a template style method, but has worked out well for me (and I assume others) so try something along those lines. You can also use

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread tg-php
Yeah, you're right. I didn't test that before I posted it. Looks like you can do it as long as your clients are running Windows and you can use Active X or another Windows trick using something like JScript, but with pure Javascript it looks bleak. I tried to use something like this: img = New

RE: [PHP] Having resource variables over several scripts

2005-10-10 Thread tg-php
Ok, first let me disclaim that there are definitely a lot of people a lot smarter than me out there who may have figured this one out already, but as far as I know, resources like open file handles, database connection handles, objects, etc.. but especially anything that returns a resource numb

Re: [PHP] onChange js running a php function

2005-10-11 Thread tg-php
First, I want to beat everyone to the punch in yelling at you.. "This is not a PHP question!!! RTFM STFU NOOB" or something stupid like that. hah But, maybe it seems like it COULD be a PHP question. And it's definitely relevant to PHP development, so how about we give a REAL answer instead of

Re: [PHP] Removing Items from an Array

2005-10-12 Thread tg-php
If I understand what you're asking, then maybe this will help: $arrset1 = array("Apples" => 3, "Oranges" => 5, "Apricots" => 1); $arrset2 = array("Couches" => 6, "Chairs" => 2, "Benches" => 5); $alldataarr["Fruits"] = $arrset1; $alldataarr["Furniture"] = $arrset2; Say we want to remove "Chairs",

[PHP] Re: [PHP-WIN] Re: [PHP] Removing Items from an Array

2005-10-13 Thread tg-php
That works just as well, if you have only two levels of depth. Mostly I was trying to illustrate how to use $key => $value in a foreach and what to do if you need to go multiple levels down. Once you get to the bottom level, then you can use isset() certainly. Just wanted to make sure that it

Re: [PHP] function to compare ip addr to a ip range

2005-10-13 Thread tg-php
You could try converting to long IP addresses and comparing that way: http://us3.php.net/manual/en/function.ip2long.php $startip = "192.168.0.5"; $endip = "192.168.0.16"; $targetip = "192.168.0.7"; $startlong = ip2long($startip); $endlong = ip2long($endip); $targetlong = ip2long($targetip);

Re: [PHP] Ardent Pursing help

2005-10-13 Thread tg-php
I would just go to Ford's dealership lookup page here: http://www.fordvehicles.com/dealerships/index.asp Pick a major city or two or three in each state and go down the list. that should get you a list of all the major Ford dealerships and be quicker than finding/implementing and/or using a PHP

[PHP] Re: [PHP-WIN] Is this a PHP bug?

2005-10-16 Thread tg-php
It's because PHP is trying to convert different var types into a common var type and then compare them when you use ==. === means compare value AND type so that's why it fails. Your string, 'Some kind of string' is getting converted down to the lowest common denominator, an int. Since there a

Re: [PHP] Re: Inserting NULL Integer Values

2005-10-18 Thread tg-php
What Ben said is correct, but I'd like to elaborate so you know why it's correct. The INSERT statement you're trying to end up with is: INSERT INTO MYTABLE (column1, column2) VALUES ('somevalue1', 'somevalue2') I'm not sure why it wouldn't work if you ended up with: INSERT INTO MYTABLE (column

Re: [PHP] Re: Inserting NULL Integer Values

2005-10-18 Thread tg-php
Sorry everyone, I missed the "integer" requirement here. I apologize. And yes, '' isn't a good integer value and will throw an error. That's what I get for not reading thoroughly enough :) -TG = = = Original message = = = On Tue, October 18, 2005 12:42 pm, [EMAIL PROTECTED] wrote: > That sho

RE: [PHP] Ugh, w32 anything is making me want to drink!

2005-10-21 Thread tg-php
Search the machine for "php.ini", I'm guessing that you'll find one in your main PHP directory as well as in your main Windows directory. I believe the Windows directory copy is read first. I'm not sure why. At any rate, if it looks like it's reading the wrong copy of PHP.ini, searching your

Re: [PHP] Memory Leak?

2005-10-22 Thread tg-php
Because of the way it spikes and maintains, I'm guess that this is normal behavior, but we'll see what the real experts have to say. In theory, if you allow a process 100MB of memory and it thinks it might need some stuff again later, it's likely to cache for faster reuse of that data later. B

Re: [PHP] Processing two post values

2005-10-22 Thread tg-php
Depending on your requirements, I think add one room at a time. For instance, your property sheet comes up initially with "No rooms configured". Then have a SELECT/OPTION pulldown for type: Bedroom Bathroom Living Room Garage Dining Room Kitchen etc... Then have an X and Y input box. You could

Re: [PHP] Memory Leak?

2005-10-22 Thread tg-php
One other thing to keep in mind. Connecting to a database and disconnecting takes some amount of time. If you do it in batches of 10, 100, whatever then make sure you only connect and disconnect once or else you won't have any time savings at all (and will burden the server unnecessarily). Su

Re: [PHP] PDF printing under windows.

2005-10-25 Thread tg-php
Two (and a half) things: 1. Even though DOS/Windows machines don't have, specifically, /dev/printer or /dev/lpr or whatever the *nix specific is, it does have a LPTx: device According to the page listed below, it may be possible to do: copy /b filename LPTx The /b indicates it's a binary file.

Re: [PHP] PDF printing under windows.

2005-10-25 Thread tg-php
This is really dumb and overly simple, which is probably why it was missed/not brought up, but it just occurred to me that, assuming you have a browser-based interface to your app, why don't you just send the PDF to the browser for printing? Then it should use the Acrobat Reader plugin to open

Re: [PHP] [DONE] Substr by words

2005-10-29 Thread tg-php
Good start guys. That's usually how I start down the path in solving a new problem. Invariably down the road I find a more "refined" way of doing what I did the hard way. The hard way is good though, you learn stuff along the way. Let's see how tight we can make this though: $maxwords) {

Re: [PHP] is there a number translation function?

2005-10-29 Thread tg-php
I couldn't find one out there Linda (and I'm sure I've seen them before) so since I'm stuck at work on a Saturday I thought I'd take a break and see if I could hack this out myself. Probably a more elegant way to do this, but here's what I came up with. Feel free to use and modify it at will.

Re: [PHP] getting rid of bad characters

2005-10-31 Thread tg-php
Have you tried using htmlentities()? It should convert stuff like double-quotes (") to it's associated HTML entity which, when echo'd to the browser, will be displayed as " again. Good for safe output. Not so good for storing in a database (which you'd probably want to use whatever your datab

Re: [PHP] could someone remove [EMAIL PROTECTED] from the list.

2005-11-02 Thread tg-php
That's not a sadist.. that's a masochist. :) I nominate Jay too. It's been a while since I've seen someone go totally insane and I think Jay is the man for the job. Congrats on your promotion(??) Jay! -TG = = = Original message = = = John Nichel wrote: > Jochem Maas wrote: > >> getting pr

Re: [PHP] Register Globals

2005-11-04 Thread tg-php
I'm guessing it's because of the double quotes within double quotes in the "From" part: mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"], 60), "From: $_POST["from"]\r\n"); Your $_POST["subject"] is ok because that's all that's in that part of the parameter, but the part:

Re: [PHP] T_PAAMAYIM_NEKUDOTAYIM

2005-11-09 Thread tg-php
Yay! Useless Trivia Time! That big nasty word is apparently the name for "::". Here's a PHP manual page explaining how it's used. I'd recommend looking for a misuse of the "::" operator in your code. http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php Enjoy! -TG = = = Original

Re: [PHP] Text between two tags

2005-11-10 Thread tg-php
Maybe just treat it like XML and use PHP's XML parsing routines. Should work pretty good but maybe someone else has a better way of handling it. (code below) -TG // $string - contains your HTML string $innerText = ""; $_XML_PARSER = xml_parser_create(); xml_set_element_handler($_XML_PARSER,'

Re: [PHP] Text between two tags

2005-11-10 Thread tg-php
Great example.. haha.. I knew someone would pull some nice regex out for this one.. I suck at regex. hah I still like my XML parsing fix, but Leonard's regex is probably better. hah -TG = = = Original message = = = HI, > Hello > I'm trying to extract some text between two tags: I am answerin

Re: [PHP] Walking through a bunch of MySQL Records

2005-11-14 Thread tg-php
Depending on how strict your requirements are for the table layout, you could always do something like this: Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7 Item 8 Item 9 Item 10 Each item isn't in it's own , but if they don't have to be, th

Re: [PHP] Uploading more than one file

2005-11-21 Thread tg-php
Sorry, my brain's running on one cylinder this morning, but maybe this helps: http://us2.php.net/manual/en/features.file-upload.multiple.php If not, excuse my waste of bandwidth :) -TG = = = Original message = = = Hi, I have a form on my page that has many file input fields: File A:

Re: [PHP] Howto search in SQL for a specific character?

2005-11-29 Thread tg-php
Probably because the apostrophe aka single quote is used the same way it and the double quotes (") are used in PHP, as a string delimiter. What you're ending up with is: SELECT nameOfPedigree FROM tbpedigrees WHERE SUBSTR(nameOfPedigree,0,1) = ' What you'd want is something more like: SELECT n

Re: [PHP] Schroedinger's Bug - may require exorcism...

2005-11-30 Thread tg-php
What to do next? I'd check to see if your page is being inadvertantly called twice (I've seen this happen when people used frames.. or like someone else mentioned, doing a double include() or sometimes redirecting back to itself via header())... anything that could possibly re-initiate the page

Re: [PHP] Newline character problem...

2005-12-03 Thread tg-php
In addition to what was mentioned below, you can also wrap your text in tags to have it output exactly as you've formatted it: echo "\n"; echo "one\n"; echo "two\n"; echo "\n"; Actually, I don't think either of these methods is going to output what you want. Even though \n is newline, it's st

Re: [PHP] Unnecessary if statement? Programming technique

2005-12-06 Thread tg-php
This is probably going to sound strange, but I like to try to think outside the box (buzzphrase!) and hit things at odd angles. Would someone care to test (or already know) the performance difference between a "for" loop and a "foreach" loop? Or the performance difference over many iterations o

Re: [PHP] Arrays

2005-12-06 Thread tg-php
This what you want? http://us3.php.net/manual/en/function.array-search.php -TG = = = Original message = = = If I have an array, such as $Var[0] = "Dog"; $Var[1] = "Cat"; $Var[2] = "Horse"; Is there a way to quickly check to see if $Var contains "Lion" without walking through each value? ___

Re: [PHP] Non-trivial task of converting text to HTML

2005-12-07 Thread tg-php
Maybe I'm missing some requirement, but what if you just used HTML "" tags. You can still use other HTML for formatting within the tags but it'll pay attention to carriage returns/line feeds and spaces without having to use s For example, if you did the following... is it what you need or wha

Re: [PHP] Create Image From HTML

2005-12-09 Thread tg-php
As Jochem mentioned, you can use the 'onclick' event to trigger some JS when a user clicks on something. I wanted to add that you may be able to use the 'innerHTML' property to get the HTML contained within the area clicked too. It sounds like you're saying that the user clicks on a table and t

RE: [PHP] Forwarding $_POST Values

2005-12-09 Thread tg-php
And if for some reason that's not viable, you can simulate a real POST method by using a socket connection and manually sending the POST variables. Take a look at this script: http://www.flashkit.com/board/history/topic.php/384942-1.html That looks about right (sorry, no time to test myself.. bu

RE: [PHP] Forwarding $_POST Values... please no flaming

2005-12-09 Thread tg-php
Ok.. not one bit of this was necessary guys. Please take it off-list if you have personal problems that need resolving. Yeah.. people do join the list and expect to have their hands held through everything, or expect others to solve all their problems, but if the question offends you, it's bet

RE: [PHP] Message Should be displayed based on Date ,Time and Eve nt name

2005-12-14 Thread tg-php
This is a kinder, gentler Jay.. hey, don't look a gift horse in the mouth! But if anyone's still not satisfied... you can go RTFM if it makes you feel better. :) Happy holidays! (yeah, holidays.. christmas IS included in that.. jesus.. how did political correctness turn to bite everyone on the

Re: [PHP] Re: Programming Query - Authentication - Multiple Logons

2005-12-14 Thread tg-php
Where I work, the system that was set up before I got here uses session ID and a timeout of a couple of hours. I'm pretty sure that there's a good chance that two people would not be issued the same session ID within a short period of time. Certainly not within say 4 hours. Maybe someone has

Re: [PHP] Re: Declaring arrays? Good practice?

2005-12-14 Thread tg-php
In the examples I saw, when you used $new_array = $value (without the []), you weren't going to get a proper copy of the array, as multiple people stated. I'm curious why I didn't see (or maybe I just missed it) something like this: $old_array = array('one', 'two', 'three', 'four'); $new_array

Re: [PHP] 4 Digit ID with Leading Zeros

2005-12-15 Thread tg-php
If it's really a temporary table, then you can probably reset the auto increment counter periodically so you'll never hit . If it doesn't have to be 4 digits, that you just want it padded out with zeros, you can have the numbers in the databse be 1, 2, 3, 4 (regular, no padding) and just us

Re: [PHP] Function Overloading

2005-12-17 Thread tg-php
If all you want to do is pass an unknown number of arguments to a function, this looks like it demonstrates what you're doing: Found it at: http://www.php.net/manual/en/function.func-num-args.php = = = Original message = = = "PHP does not support function overloading." So, is there any othe

Re: [PHP] accessing RAW response

2005-12-19 Thread tg-php
There's probably a better way to do it, but I'd start parsing your respond and search for "" and start your data collection after you see that. If you're using PHP's XML parser (xml_parser_create() and such), then you don't have to worry about the header. It'll be disregarded since it's not 'co

RE: [PHP] Connecting to PHP

2005-12-19 Thread tg-php
No.. it sounds like he wants to make function calls to PHP from another app.. kind of the reverse of using PHP's COM calls. I'm not aware that PHP has any registration in an OS or any kind of inherent "listening" mechanisms like COM has (I'm phrasing that poorly but you get the idea). You ca

Re: [PHP] Problem with fopen and sending POST vars

2005-12-20 Thread tg-php
There are a couple examples of manually sending POST data via fsockopen() on: http://us2.php.net/manual/en/function.fsockopen.php Basically the stucture is the same as URL "GET" variables but you have to send the header data manually and set content-type to "application/x-www-form-urlencoded".

Re: [PHP] load testing tools

2005-12-27 Thread tg-php
Oh boy.. here we go.. hah.. can we refrain from a giant anti-Microsoft war type thing? I'll use whatever does the job. MS actually has some good free tools for certain things. And then they have a lot of retarded stuff (why is it that I can't use my mouse wheel in ANY VBA editing window? I

RE: [PHP] nifty little tools - resposity - evaluations..

2005-12-30 Thread tg-php
Wasn't this just brought up on another thread? "nifty little tools" that is and a repository for such things. There are lots of code repositories but none that I go directly to right off. Usually I hit Yahoo/Google and do a search for what I'm looking for and find whatever looks best for my s

RE: [PHP] nifty little tools - resposity - evaluations..

2005-12-30 Thread tg-php
Haha.. well, with any luck, 10 years from now I'll have as much content. hah (or even ANY code written) = = = Original message = = = I sort of had the same idea almost a decade ago... http://l-i-e.com/compare/ You can see how well I've kept it up :-v On Fri, December 30, 2005 10:33 am, [EMAI

Re: [PHP] printing keys and values of array

2006-01-06 Thread tg-php
I agree with the previous responder, foreach() is the way to go. Here's the doc page: http://uk2.php.net/manual/en/control-structures.foreach.php To get the keys, use the examples that are use $key => $value. Assuming your array is in $infoArr, you'd do this: foreach ($infoArr as $category =

Re: [PHP] Converting IP Address to int value?

2006-01-06 Thread tg-php
I believe this may help: http://uk2.php.net/manual/en/function.ip2long.php It converts the IP address to the 'long' format (which is valid to put into a browser as an address btw). I think 127.0.0.1 and 127.0.0.2 will be sequential in the 'long' format. So if you convert starting address and e

Re: [PHP] input validation?

2006-01-12 Thread tg-php
Hmm.. I didn't see anyone ask "before or after the user clicks SUBMIT"? If it's before, then you should use javascript to check the form element prior to submitting (you can check realtime with the onkeydown, onkeyup events... check after a user moves off of the form element with onchange or ev

Re: [PHP] Best way to do this: www.domain.com?page=var

2006-01-16 Thread tg-php
On your web server you can configure 'default pages'. Apache and *nix type servers seem to favor the "index.html" type default pages while Microsoft's IIS goes for the "Default.htm" just to be different. But you can add default pages to a list in the order you want them accepted. For instance

Re: [PHP] Best way to do this: www.domain.com?page=var

2006-01-17 Thread tg-php
If you can't set a new 'default page' on your server, using a header('Location: ...') will simulate the same thing. I believe the web server sends an error "302" (like a "404" when page isn't found) for saying that a page has moved and redirect the browser automatically to the new page. So lik

Re: [PHP] odd behavior

2006-01-19 Thread tg-php
Ok.. now maybe a constructive answer :) If I recall, PHP on Windows will look for PHP.INI in your Windows system folder (in this case C:\WINNT) first, then in the folder where PHP is installed. Deleting the PHP.INI under WINNT should be fine (sounds like removing that makes things work ok for

Re: [PHP] Determining number of days in a selected month

2006-01-20 Thread tg-php
date("t") will give you the number of days in the current month. Or you can do: date("t", mktime(0, 0, 0, $month, $day, $year)) to get the number of days in a specific month in a specific year (that way you can get leap year accurate counts..) -TG = = = Original message = = = Is there a way

Re: [PHP] Str to Int

2006-01-20 Thread tg-php
Ok, some good points where made already, but let's pull it all together: 1. You should get in the habit of using $_GET[] instead of $HTTP_GET_VARS.. minor thing but worth noting (info at http://us2.php.net/reserved.variables) 2. case reserve: This, I believe, will treate "reserve" as a consta

<    1   2   3   4   >