Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread CPT John W. Holmes
You have to check for it, regardless. See if this works for you. $url = $_SERVER['REQUEST_URI'] . '?' . ((isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] . '' : '' ) . 'newVar=1'; The middle part basically sees if the QUERY_STRING is empty. If it is, it includes a question mark

Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread CPT John W. Holmes
Replying to myself... :) You have to check for it, regardless. See if this works for you. $url = $_SERVER['REQUEST_URI'] . '?' . ((isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] . '' : '' ) . 'newVar=1'; The middle part basically sees if the QUERY_STRING is empty. If it is, it

RE: [PHP] Notice: Undefined variable: PHP_SELF

2003-05-29 Thread John W. Holmes
['PHP_SELF']. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

RE: [PHP] creating thumbnails from .BMP files

2003-05-29 Thread John W. Holmes
How do you create thumbnails from .BMP files? Is there a function like there is for JPG (ImageJPEG)? Probably need to use an external program that understands that format and an exec() call. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect

Re: [PHP] strip_tags() Quandry....

2003-05-30 Thread CPT John W. Holmes
Yes, no problem! Glad it worked out. you may wish to actually study the perlre man page on perl.com. This goes into the most details and talks about how PERL actually EXTENDS shell regular expressions significantly and excellent resource that I have used many many times. I figure since PHP

RE: [PHP] mysql field getting cut off

2003-05-30 Thread John W. Holmes
is it? Are you sure it's not fine in the database and you're just showing it like: input type=text value=$value name=field which will end up like input type=text value=St. Petersburg, FL name=field and will only show St. in the text box... ---John W. Holmes... Amazon Wishlist: http

RE: [PHP] PHP- Converting to and from TIMESTAMPS

2003-05-30 Thread John W. Holmes
I am wanting one field on a table in one of my MYSQL databases to contain different dates and times as a epoch timestamps. Firstly how do I convert a particular time and date which the user will enter on the website into the epoch timestamp. $db_timestamp = strtotime($user_input); And

RE: [PHP] trikky authentication question

2003-06-01 Thread John W. Holmes
the first user. Hope that helps. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

RE: [PHP] trikky authentication question

2003-06-01 Thread John W. Holmes
ridiculous. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] zip code validation/regular expression

2003-06-03 Thread CPT John W. Holmes
Simply trying to use regular expressions to validate a 5 or 5+4 zip code, excluding 0 and 0-. Looked on http://www.regexlib.com, and that's where I found the pattern below, but it doesn't work. The best I can do on my own is two separate regular expressions, one to match a valid

RE: [PHP] Supplied argument is not a valid MySQL result resource

2003-06-03 Thread John W. Holmes
: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Can someone tell me what's wrong with this part of the code? You're query is failing. Use mysql_error() to find out why (probably because you need a GROUP BY clause). ---John W. Holmes... Amazon Wishlist: http

Re: [PHP] Variables changes their values

2003-06-03 Thread CPT John W. Holmes
I'm getting strange behavior in some of my scripts I just upgraded from 4.3.1 to 4.3.2 and was hoping it would solve the problem. The problem is that variables changes its values from one line og code to another - without specific code that should change the value. Do anybody else had this

Re: [PHP] convert seconds to hours, minutes, seconds

2003-06-04 Thread CPT John W. Holmes
I have a value 178607, which is stored as seconds. I like to convert it (178607 Secs) to Hours, Minutes and Seconds appropiatly. Can anybody help me supplying the code? If it's stored in MySQL, you can use SEC_TO_TIME() mysql select sec_to_time(178607); +-+ |

Re: [PHP] Variables changes their values

2003-06-04 Thread CPT John W. Holmes
On Tuesday 03 June 2003 13:58, Jay Blanchard wrote: [snip] We would have to see some code Jay I'm not able to reproduce this in a short code-snippet. But from the first echo to the last echo $lid change its value: Either this is a bad cut and paste job or this script will never

Re: [PHP] Displaying 5 records only/displaying specific records

2003-06-04 Thread CPT John W. Holmes
I'm trying to build a news panel for my home page. Basically I want to present the five most recent news articles in a recordset, but I'm not sure how to cut off the recordset after 5. Also I want to present a picture with my first headline. My code will go something like this: ?php

Re: [PHP] Delete from Multidimensional Array?

2003-06-04 Thread CPT John W. Holmes
I've built a page that collects network card information, assigning each element its place within a $Card array, and all of the cards to $NetCards. As you enter your card information at the bottom, the previous card is displayed above it, with a Delete checkbox option at the end of that row

RE: [PHP] pagenting logic to cut short

2003-06-04 Thread John W. Holmes
,$page+5); for($i = $minpage; $i = $maxpage; $i++) { ... } ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net

RE: [PHP] PHP and MYSQL record locking

2003-06-04 Thread John W. Holmes
to zero if need be or timing it out after so long... ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net

Re: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread CPT John W. Holmes
yeah .. I knew it .. but it would be so very helpfull if it would be just included in a superglobal similar to $_REQUEST ... Do it yourself, if you must: array_merge() ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: John - RE: pagenting logic to cut short

2003-06-04 Thread CPT John W. Holmes
Thanks, its working fine now, actually a little better than I expected :-) Dont understand the logic though, if you find time point me to the correct place where i can read up and figure out the logic you used. The logic isn't too hard. You're on page X. You show links to other pages from X

Re: [PHP] setting up a cron job for a PHP script

2003-06-04 Thread CPT John W. Holmes
You can also call the file through lynx or wget if you can't call the php executable directly. lynx --dump http://www.yourserver.com/file.php wget http://www.yourserver.com/file.php Down side is that the file has to be in your web root. Works great for calling remote files, though. ---John

RE: [PHP] Problem with strtotime()

2003-06-04 Thread John W. Holmes
W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Doing simple math

2003-06-04 Thread John W. Holmes
can't leave out the * for multiplication. y = mx + b in algebra must be written as $y = $m * $x + $b, for example. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http

Re: [PHP] Best open source banner advertising application

2003-06-05 Thread CPT John W. Holmes
From: Randum Ian [EMAIL PROTECTED] Why pay for something when you can get this for nowt! ;o) I love getting things for nowt... like candy from a baby... :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] setlocale() changes?

2003-06-05 Thread CPT John W. Holmes
I've been getting a warning on one of my scripts since I upgraded from 4.1.2 to the most recent version of PHP. The warning is: Warning: setlocale(): Passing locale category name as string is deprecated. Use the LC_* -constants instead The script at the line that is failing sez:

Re: [PHP] Sessions and headers

2003-06-05 Thread CPT John W. Holmes
When using PHP sessions, if the user's browser supports cookies, PHP sets the session id as a cookie (so far as I understand it). So when trying to use the session ID in a script, a cookie request is sent to the browser to get the ID and assigns it to the internal variable $PHPSESSID (again,

Re: [PHP] Is gd present?

2003-06-05 Thread CPT John W. Holmes
Is there a way to check within an application if the gd library has been installed? Maybe get_loaded_extensions() ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] file output, columns, etc...

2003-06-05 Thread CPT John W. Holmes
Need some help here. I have to format a line with each piece of the line being a fixed set of characters in length, wether its a mix of spaces and letters, or all letters. Here's an example of the line: 06?4111ABDALARM333 N COUNTRY CLUB CANTON DD8 In this file,

Re: [PHP] function re-defined | WorkAround? [and some more Q's]

2003-06-05 Thread CPT John W. Holmes
I'm working on quite a large website with a lot of php pages.. And a lot of includable functions (modules).. Sometimes one of those modules gets included twice accidently and then it generates an error .. of course.. This made me wonder of there's any way to prevent the function from being

RE: [PHP] mail() problem affecting output to browser on completion

2003-06-07 Thread John W. Holmes
Alright with the following code I am using is printing/echoing to the browser a 1 before the html output. It's like it's adding 2 variables together. Here is what I am trying to do. I have a form that enters information to a text file, and at the same time sends the information to a

RE: [PHP] IE Pagelength issue

2003-06-07 Thread John W. Holmes
an entire database and then using PHP to match criteria? Are you using a WHERE clause to do the sorting? Sounds like you may be going about this the wrong way... if not, carry on. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine

RE: [PHP] please help, simple problem (i think)

2003-06-07 Thread John W. Holmes
] = count 2 To cycle through and display it: foreach($var as $key = $value) { echo $key : $value; } ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP

RE: [PHP] [Newman] How to pass an image through PHP.

2003-06-07 Thread John W. Holmes
I would like to know where i should be looking to pass an image through PHP Pass it from where to where? What to you mean by pass? ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy

RE: [PHP] IE Pagelength issue

2003-06-07 Thread John W. Holmes
If you view source in IE, do you see the entire page? If so, then it's an IE display issue. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original

RE: [PHP] use print

2003-06-07 Thread John W. Holmes
How can I print table in my page without I use print command from file menu? I means just table not all page Make a print-friendly page that just contains your table. Printing is pretty much a client side issue, not a PHP issue. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o

RE: [PHP] thumbnail program

2003-06-07 Thread John W. Holmes
Anyone know of a good free thumbnail program that can be called from a PHP script using the exec() call or something similar? Netpbm is used by Gallery. Works very well. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine

RE: [PHP] Checking for Valid Charactors.

2003-06-08 Thread John W. Holmes
not desirable, you could look into using the is_float() or is_numeric() functions, or a regex such as: if(preg_match('/^[0-9]*\.?[0-9]+$/',$string)) { echo good; } else { echo bad; } That will allow text/numbers with or without a period. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o

RE: [PHP] SESSION ISSUES

2003-06-08 Thread John W. Holmes
linking to the other domain. This will only work if both domains use the same directory for storing session files, though. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http

RE: [PHP] Session Newbie Question: Cookieless sessions

2003-06-08 Thread John W. Holmes
lifetime so it persists after the browser is closed, like a regular cookie. Where you store your session data is irrelevant. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http

RE: [PHP] filter out with date?

2003-06-08 Thread John W. Holmes
place?? Anyhow...now you'll have to loop through each ingress Object and see if substr($obj-publisert,-2) matches the month you want. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today

RE: [PHP] Yearbook script?

2003-06-09 Thread John W. Holmes
a little to support certain fields. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe

RE: [PHP] post data?

2003-06-09 Thread John W. Holmes
It's an Apache2 / PHP bug. Upgrade to the latest versions of each (although Apache2 and PHP are still not recommended). ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http

RE: [PHP] condensing a list from MySQL

2003-06-09 Thread John W. Holmes
. Leaving them in there will allow you to produce more stats on which keywords are most popular, etc. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP

RE: [PHP] filter out with date?

2003-06-09 Thread John W. Holmes
or not. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

RE: [PHP] what is the OOP structure for PHP

2003-06-09 Thread John W. Holmes
Is there an OOP (object oriented programming) structure for PHP? If so, could someone show me the basic structure of such an object? An exmple with definition and implementation would be great. Thanks! http://us2.php.net/manual/en/language.oop.php ---John W. Holmes... Amazon Wishlist: http

RE: [PHP] categorise list

2003-06-09 Thread John W. Holmes
, also. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

RE: [PHP] Mutile select search engine

2003-06-09 Thread John W. Holmes
of a link and use GET, or put them all into COOKIEs to retrieve on the next page, or finally, put them all into the SESSION to retrieve on the next page. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals

Re: [PHP] Another Session Question

2003-06-09 Thread CPT John W. Holmes
So does your code work? Here's a tip: Try a simple example, like what's in the manual, and see which method works for you. If they both work, which one do you understand? Use that one... ---John Holmes... - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL

RE: [PHP] Is It Possible to Tell PHP To Output x Decimal Places Per Float?

2003-06-09 Thread John W. Holmes
Is it possible to tell PHP when converting a number to a string (i.e. in an echo or print command) to use x decimal places? Yes, it is. Specifically, if I ?php echo '$' . $some_price; ? And some_price is $1.50, it outputs: $1.5 Thanks in advance, You're welcome. ---John W

RE: [PHP] howto write a DOS file output into a file...

2003-06-09 Thread John W. Holmes
that backtick (`) is not the same as a single quote ('). ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net

RE: [PHP] .htaccess

2003-06-09 Thread John W. Holmes
Just one question, is there any way that when a person logs in via the htaccess popup that i can know via my php script...and can i also get his username? Have you read the chapter on HTTP Authentication? No. Read the very first paragraph: The HTTP Authentication hooks in PHP are only

Re: [PHP] PHP vs. jsp, advice please

2003-06-10 Thread CPT John W. Holmes
Agree 100%. Don't assume that just because you use JSP, or any other language, your program is going to instantly scale well and be easy to maintain. You can write crappy, inefficient code in any language. You can also write good programs in most any language if you put the proper planning into it

Re: [PHP] How to show BLOB ?

2003-06-10 Thread CPT John W. Holmes
I have a blob in the database. I want to open a file=BLOB in the browser such a way as if I clicked on a link. So if it is pdf, its opened by pdf plugin, if it is doc, it is open by word plugin, if it is zip the dialog for opening/saving to disk is opened, if it is jpeg it is directly

Re: [PHP] MSSQL - Previous/Next Paging Results

2003-06-10 Thread CPT John W. Holmes
-Original Message- MSSQL seems to be a little bit messier that MySQL..e.g limit clause etc Anyone know of articles/examples that specifically deal with this issue? Look into the Top() function for MSSQL. It goes something like: SELECT Top(10) * FROM table You should be able

Re: [PHP] confusing problem or am just plain confused....

2003-06-10 Thread CPT John W. Holmes
I dont know how exactly to explain this but will do my best, i have many of the following lines in a page: tdpinput type=checkbox name='id[]' value=23input type=hidden name =package value=loco package/td tdpinput type=checkbox name='id[23]' value=loco package/td each line of course has a

RE: [PHP] magic_quotes_gpc

2003-06-10 Thread John W. Holmes
Anyone know how to change the magic_quotes_gpc? I need it to be on in PHP. Running PHP 4.1.2 Change it in php.ini or in an .htaccess file. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get

RE: [PHP] Session Array...

2003-06-10 Thread John W. Holmes
: $_SESSION['id'] = $id; Since you have register_globals on, I guess you'd use: Session_register(id); maybe... :) ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http

RE: [PHP] string question

2003-06-11 Thread John W. Holmes
if a string is: $x=A.B. XYZ; and if I post it as a hidden form control and echo $_POST['x'] then I get: A.B. and not A.B. XYZ ! What should I do? Learn HTML. Use quotes around your attribute values: input type=hidden name=foo value=A.B. XYZ ---John W. Holmes... Amazon

RE: [PHP] Math: Adding DB numbers to PHP script number

2003-06-11 Thread John W. Holmes
id number. Any help is appreciated $next_number = $id + 1; $link = http://xx/index.php?id=$next_number;; ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com

Re: [PHP] nl2br

2003-06-11 Thread CPT John W. Holmes
I am trying to create a very basic page where we can all easily work on a document. I just have a huge textarea that inserts the text into a longtext field in the mysql db. I use nl2br to keep the formatting. Of course, when the document is viewed in the textarea, all of the br / are there.

Re: [PHP] slash trouble when editing text

2003-06-11 Thread CPT John W. Holmes
Use stripslashes() to remove the slashes. Use htmlentities() on the text before you put it into the textarea, also. ---John Holmes... - Original Message - From: Matt Palermo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 4:16 PM Subject: [PHP] slash trouble when

Re: [PHP] How to find if a string is an integer?

2003-06-12 Thread CPT John W. Holmes
snip Sorry, I donĀ“t know that you needed an effective snipet. And you are right, I only writed for positive integers. Try something like apply 2 type cast simunltaneous. if ( (string) ((int) $_POST[var_int]) == $_POST[var_int]) echo is int; Why not just use the is_int()

Re: [PHP] dealiong with quote's in SQL strings

2003-06-13 Thread CPT John W. Holmes
I recently installed 4.3.1 and enabled the magic_quotes_gpc to deal with quotes in mysql inserts. However, I think I have run into a problem that might be related, and was wondering if there is an easy way to fix it: I have a script that gets user input from a drop-down, on the action

Re: [PHP] Very Wierd Problem

2003-06-14 Thread John W. Holmes
James E Hicks III wrote: I am experiencing some weird problems with PHP. When I execute the following query from within a PHP script, the description is set to 'EBCO' and not 'EBCO\030774-006\BUBBLER VALVE'. When I execute this query from the mysql monitor the value is inserted correctly. $query =

Re: [PHP] Very Wierd Problem

2003-06-14 Thread John W. Holmes
James E Hicks III wrote: \0 is a NULL character, IIRC. Either use single quotes: echo ('EBCO\030774-006\BUBBLER VALVE'); or use two slashes, like you did above: echo (EBCO\\030774-006\\BUBBLER VALVE); ---John Holmes... Problem is that this description is coming from a DB, that's why I was

Re: [PHP] reverse DNS lookup with PHP

2003-06-15 Thread John W. Holmes
Tim Thorburn wrote: I'm setting up a simple tracking program for a website I'm working on. Currently it records a visitors IP address, but I would like to be able to do a DNS lookup of these IP addresses. Is this possible with PHP and if so, how is it done? I've been looking through Google,

Re: [PHP] Very Weird Problem Continued

2003-06-15 Thread John W. Holmes
James Hicks wrote: The following variable needs to be escaped before it can be submitted as an MySQL query. It seems that the \0 in this string is causing me the problem. I have tried several functions in an attempt to escape this variable. Anybody got any other suggestions. The resulting

Re: [PHP] need working php.ini under apache 1.3.27 and redhat 7.2

2003-06-15 Thread John W. Holmes
[EMAIL PROTECTED] wrote: doe anyone quickly have a working 4.3.1 php.ini file, under apache 1.3.27 and redhat 7.2 that I could take a look at...for reference... you see, I think ours is missing some lines... of commands or something...it just doesn't look right something is missing...I think. so

Re: [PHP] When putting or ' in text field, \' or \ is returned

2003-06-15 Thread John W. Holmes
Ben Houlton wrote: As the subject say, when putting or ' in text field, \' or \ is returned. I'm not sure why, but it only happerns when it is returned in a input - text field box. Could you tell me how to fix this. If you have magic_quotes_gpc enabled (which it is by default), then quotes will

Re: [PHP] rows by day

2003-06-15 Thread John W. Holmes
Sebastian wrote: I posted this at several other discussion forums, and i haven't received any real way of doing this. i am about 3/4 done with a article management i am working on and came across a problem i can't seem to figure out. On to the question .. I currently have this query: $result =

Re: [PHP] page name string

2003-06-16 Thread CPT John W. Holmes
I need a really simple function that retrieves the actual page file name from a URL. So, if the URL is http://www.server.com/pagename.php, or if it is http://www.server.com/directory/pagename.php, the function in both cases will return pagename.php. I'm sorry if this is a ridiculously easy

Re: [PHP] Array in a $_session

2003-06-16 Thread John W. Holmes
Frank Keessen wrote: Still strugling with array's ; : Can you help me with this?? input type=\text\ name=\test1[$i]\ size=\6\ How can i put that value into an $_SESSION?? Something like $_SESSION[test1][$i]?? This is the way i put into a database foreach($_POST['test1'] as $i = $Value) {

Re: [PHP] functions, opinion...

2003-06-16 Thread John W. Holmes
Rolf Brusletto wrote: Just kind of curious what people think. In your opinion, should a function avoid output? What I mean by that, is should a function on do something without having echo or printf commands in it? This is something I've been thinking about lately to improve my

Re: [PHP] Array in a $_session

2003-06-16 Thread John W. Holmes
Frank Keessen wrote: Hi jason the rest, Dit the session_write_close()! Nothing still displayed in step3, more thoughts?? $_REQUEST[submit]=isset($_REQUEST[submit])?$_REQUEST[submit]:; if($_REQUEST['submit']!=) { foreach($_POST['test1'] as $i = $Value) { $_SESSION['test1'][$i] =

Re: [PHP] Q : HELP HTML forms parsed into an array for PHP

2003-06-16 Thread John W. Holmes
Ow Mun Heng wrote: What I would like to do is to input multiple isbn numbers into a form, get PHP to parse it into an array so that I can build the SQL query for multiple insert. Currently I'm able to perform single inputs, one at a time, which is time consuming. I want to have a formtextarea

Re: [PHP] Re: Difference between $_POST[foo] and $_POST['foo']?

2003-06-17 Thread CPT John W. Holmes
At 16:19 17-6-03, you wrote: $sql = 'select * from db where apple = \'' . $_POST['foo'] . '\';'; Like that? you missed some quotes: $sql = 'select * from db where apple = \''' . $_POST['foo'] . '\''; Go back and count the quotes again. The original post is correct as far as quotes go. Yours

Re: [PHP] sorting an array

2003-06-17 Thread CPT John W. Holmes
array[numrooms] = Array ( [3] = 2 [2] = 5 [1] = 1 ) I want to get a result like this: 2=5 3=2 1=1 ( I want the keys to stay attached to the results) perhaps asort()? This function sorts an array such that array indices maintain their correlation with the array elements they are

Re: [PHP] cron job

2003-06-17 Thread CPT John W. Holmes
Is there a way to run a script (to check a table for new fields, or to check time..etc) evrey few hours, without using programes souch as crontab. In addition to what others have said, you don't _have_ to set up the cron job (or any scheduled job) on the same computer as your scripts. If you

Re: [PHP] PHP.net Manual Magic?

2003-06-17 Thread CPT John W. Holmes
One of the coolest things I have seen online, and some of you may not even know this works, but if you type in the url: http://www.php.net/foo; you'll be taken straight to the foo page of the php manual, if one exists. If foo doesn't exist, you pull up a Google search-within-the-site page. I

Re: [PHP] strip tags not working - any ideas ?

2003-06-18 Thread John W. Holmes
Jason Wong wrote: On Wednesday 18 June 2003 18:27, Neil wrote: I am trying to strip all HTML and other tags from a document, I have read the docs and written a 4 line script that should do the job (from my point of view ! ). However it seems to have literally no effect. Heres the script : ?

Re: [PHP] strip tags not working - any ideas ?

2003-06-18 Thread John W. Holmes
Neil wrote: I know that file() returns arrays, but i think readfile() returns a string. Stop thinking and read the manual. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General

Re: [PHP] Problems with quotes in URL - SOLVED - plz FLAME me!!!

2003-06-18 Thread CPT John W. Holmes
No, I'm all for a public flaming... let him serve as an example to others!! :) In all honesty, I have posted about the htmlentities/htmlspecialchars() requirement when putting data in form inputs quite a lot recently. You should have picked up on it sooner. :) Oh well, though... at least you know

Re: [PHP] Session filesize limit

2003-06-18 Thread CPT John W. Holmes
Does anyone know about the ideal session filesize limit? I am using the common functionality in the entire application. So i am thinking to store data into the session file once user logs into the system rather retrieving the information from database on each user request. But i dont know

[PHP] Re: Fatal error: Call to undefined function: str_word_count()

2003-06-18 Thread CPT John W. Holmes
nabil [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... when i use str_word_count() i got the following : Fatal error: Call to undefined function: str_word_count() and my PHP is Version 4.2.3 What is the problem ??? Reading English? us2.php.net/str_word_count PHP

Re: [PHP] Calling c function from php

2003-06-18 Thread CPT John W. Holmes
Anyway, can any make a suggestion on how to connect to a c function from a php app? I have to connect to a sales tax calculation software. The function is being written for me but I have to figure how to call it - get the variable - and use it again in my php app. I've been told there's

Re: [PHP] Software Testing and Internationalization - Free book by LISA/Lemoine International

2003-06-18 Thread CPT John W. Holmes
LISA, in collaboration with Lemoine International has made Software Testing and Internationalization by Galileo Computing freely available for download. [snip] To download a copy, please visit http://www.lisa.org/interact/2003/swtestregister.html How about a privacy statement on

Re: [PHP] Error in php after uprading

2003-06-18 Thread John W. Holmes
Javier wrote: Hi, I've upgraded to the latest version of php last week. Suddenly parts of code that was working now displays error. The errors I've found until now are related to Sybase (I use MSSQL 2k as DB server) Here is an example: Warning: mssql_num_rows(): supplied argument is not a

Re: [PHP] Validating a money input

2003-06-18 Thread CPT John W. Holmes
What is the best way to validate a money input? For example, 3452.67 versus 3452..67. if($value == (string)round((float)$value,2)) or if(preg_match('/^[0-9]*\.?[0-9]+$/',$value)) appear to work. :) Assuming your value is a string to start with. ---John Holmes... -- PHP General Mailing

Re: [PHP] direct access to file uploads

2003-06-18 Thread CPT John W. Holmes
I am new to PHP and am trying to get access to files that are uploaded. I have RTFM ;-) and have noticed that PHP writes the file to disk in a temporary location and provides a method/class with all of the information needed to access it. I am loading (PDF's) into a binary field in mySQL and

Re: [PHP] User's Screen Resolution Size

2003-06-18 Thread John W. Holmes
Vernon wrote: Not for nothing, but every time I post to this group I get treated poorly. It has to do with php and I've already gotten an answer from this group, off the PHP web site no less! http://www.php.net/manual/en/faq.html.php#faq.html.javascript-variable Doesn't take much to spread a

Re: [PHP] [Newman] Passing an image through a php file.

2003-06-19 Thread CPT John W. Holmes
try this: ?php header(Content-type: image/jpeg); fopen (d:/crushme/images/1.jpg, r); Just my opinion, but maybe you should try reading the file and echoing the data instead of just opening it. :) ---John Holmes... I would like to pass an image throught

Re: [PHP] Trapping PHP Errors

2003-06-19 Thread CPT John W. Holmes
How do I trap a PHP error and display my own error message instead? I have two PHP scripts - one that creates tables on MSSQL and one that deletes tables on MSSQL. I wish to capture the message that appears if the user attempts to create tables that already exist, or delete ones that do not

Re: [PHP] unique random id

2003-06-19 Thread CPT John W. Holmes
How do i generate a unique random number? You can use rand(), but there's no guarantee it'll be unique unless you remember every number you've ever generated ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Session Vars

2003-06-19 Thread CPT John W. Holmes
setting up some pages to allow users to log in, and store their userID in a session var. for development purposes, i've installed AMP on my windows box. -everything parses fine -register globals is on. problem: session vars do not seem to be carrying over pages, even when i set the

Re: [PHP] php https file download

2003-06-19 Thread CPT John W. Holmes
Apache 2.0.40 PHP 4.2.2 Linux I have a single php script for downloading requested files. It works beautifully on http over port 80. It does NOT work at all over https on port 443. I am using the exact same script (the very same file) for both http and https connections. Apache has the

Re: [PHP] Empty Page problems

2003-06-19 Thread CPT John W. Holmes
Can anyone tell me what is wrong with my PHP script? I am trying to add information to an MSSQL database from a separate HTM file. The script it as follows: How about you tell us what the problem is? What is the result of this script? What are you expecting the result to be? Take away the @

Re: [PHP] PHP: cannot configure SMTP_port....

2003-06-19 Thread CPT John W. Holmes
i am trying to send mail from a script, but i receive these error message: Warning: mail() [function.mail]: Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in c:\apacheserver\apache\htdocs\work-net\serial.php on line

Re: [PHP] Re: error handling

2003-06-19 Thread CPT John W. Holmes
I looked in the manual (twice now). I want to keep logging to the log file but print to browser on this one script. I have in my script: error_reporting (E_ALL); error_reporting (E_ERROR | E_WARNING | E_PARSE); but they're still only being logged to file. I dont have access to php.ini.

Re: [PHP] Month loop

2003-06-19 Thread CPT John W. Holmes
Is there any way I could loop thru and print all the month names (i.e. January, February)? Just make an array and loop through the array. You know the rest of the names, right? :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread CPT John W. Holmes
1. How do you setup a cookie that will not expire?? You can't. 2. How do you put 2 items that you want to save in the cookie and retrieve?? Examples in the PHP manual only show how to work with a single value. You can't. Use an array or two cookies. ---John Holmes... -- PHP General

<    6   7   8   9   10   11   12   13   14   15   >