Re: [PHP] reference a function in a class from array_walk()

2003-06-21 Thread David Otton
On Sat, 21 Jun 2003 19:24:26 +0200, you wrote: >I want to call this generic echo function within a class, but have >trouble referencing the output function with $this-> . >Any suggestions? Maybe there is a better solution to this? > >This is within a class: > >[snip] ># generic WALK functions >

Re: [PHP] SQL injection

2003-06-23 Thread David Otton
On Mon, 23 Jun 2003 08:59:56 +0300, you wrote: >Is there any way, doc, article, example, idea, suggestion to how to >prevent sql injection on php sites... It's really not that hard to do. Rule 1: Never trust the client This means validating all data that comes from the client - make sure that

Re: [PHP]

2003-06-23 Thread David Otton
On Mon, 23 Jun 2003 13:22:40 -0400, you wrote: > >When I include in my html >code, I get a parse error. The version is 4.1.2; phpinfo() reports >that XML support is turned on. Can anyone help with this? "' . "\r\n"); ?> or turning short tags off. -- PHP General Mailing List (http://www.php

[PHP] Application-level scope

2003-06-25 Thread David Otton
Not a specific question, more a request for comments. Does anyone have any opinions/comments on creating data or objects with application scope in PHP? I'm thinking of implementing what would essentially be a Singleton in a PHP extension, which could cache/uncache arbitary zvals. But I'd like to

Re: [PHP] Converting Array

2003-06-25 Thread David Otton
On Wed, 25 Jun 2003 18:37:02 -0700, you wrote: >I've got an array in the following format: >Array ( [Jan-1999] => 36.04,140.35,319.53,324.07 [Feb-1999] => >1.78,71.78,320.58,141.97 ) Assuming that I've interpreted your array structure correctly, $a = array ("Jan-1999" => array (36.04,140

Re: [PHP] need help breaking out of loop.

2003-06-26 Thread David Otton
On Thu, 26 Jun 2003 13:00:45 +0200, you wrote: > What am I missing? At first glance >while ($i <= $number_of_days) > { > $issue_date = strftime("%Y-%m-%d", $current_date); > $issue_month = date("m", $current_date); > $issue_day = date("d", $current

Re: [PHP] twodimensional array / word-frequencylist

2003-06-26 Thread David Otton
On Thu, 26 Jun 2003 13:25:39 +0200, you wrote: ># i would like a similar function that removes interpuntuation like "." etc. ># all i want remaining in the array are the separate words, all in lower >case How do you define a word? Is a hyphen part of a word? Do you want to strip out numbers? Make

Re: [PHP] Sorting problem

2003-06-27 Thread David Otton
On Fri, 27 Jun 2003 17:06:50 -0600, you wrote: >I need to sort an array and have the key 'follow' the value. I know I could >splice a string, sort it, then split it again but what a pain. Is there a >simpler way? AFAIK, there's no one-liner answer here. the usort() family of functions pass either

Re: [PHP] Sorting problem

2003-06-27 Thread David Otton
On Fri, 27 Jun 2003 19:45:27 -0500, you wrote: >ckeck out asort and arsort I'm looking... My understanding was that the original poster wanted to sort an array by "value"|"key" ("sort an array and have the key 'follow' the value") eg 'pear' => 'green', 'orange'=> 'orange', 'banana'

Re: [PHP] parsing problem

2003-06-28 Thread David Otton
On Sat, 28 Jun 2003 12:33:27 +0200, you wrote: >I have problem in including this text in my PHP parsed file for XHTML >definition: >It works if I remove the first line: > > >So, I am assuming PHP has problems with the symbols, as they are >recognised to be PHP code delimiters. Yup. try ' . "

Re: [PHP] Another newbie

2003-06-28 Thread David Otton
On Sat, 28 Jun 2003 15:10:03 -0500, you wrote: >Since I want to more more into programming than design, can anyone >recommend where to learn how to make sure your code is clean, optimized and >as error-free as it can get? Even if it is the style of how to write the >code, please let me know

Re: [PHP] Close Connection to Browser

2003-06-29 Thread David Otton
On Sun, 29 Jun 2003 23:41:09 +0200, you wrote: >is it possible to close the connection to the client/browser without calling >exit? >I have an input-script for a chat-system, wich gives a Status 204 No Content >to the client after submit, wich works great. The problem is, that sometimes >the scrip

Re: [PHP] php.net's custom 404 scripts

2003-06-29 Thread David Otton
On Mon, 30 Jun 2003 11:26:50 +1000, you wrote: >I used to have a bookmark for how php.net's custom 404/redirect/search >script worked, but I can't find it now, and can't see it on php.net... has >anyone got a link? I guess you're looking for Apache's ErrorDocument directive. It's in the manual.

Re: [PHP] Subtracting dates in php

2003-07-01 Thread David Otton
On Tue, 1 Jul 2003 01:21:54 -0400, you wrote: >Anyone know of an easy way to add or subtract dates in php the way you can >in mysql? Easier, that is, than coding the logic by hand? This seems like >a total pain. Convert to Unix timestamps, do regular maths, unconvert. -- PHP General Mailing

Re: [PHP] hiding submitted variable values in location bar of browser !

2002-07-09 Thread David Otton
On Tue, 9 Jul 2002 22:09:58 -0400 (EDT), you wrote: >Is there any way to hide my form submitted variables (like >passwords etc) >in the location >bar "http://somedomain.org/checkpassword.php? >password=mypassword" >or atleast show in an encypted form n the location bar. You could use POST rather

Re: [PHP] Functions list

2002-07-09 Thread David Otton
On Tue, 9 Jul 2002 15:05:21 -0300, you wrote: >I have the PHP manual in my PDA but its extraordinary large to search >for a function. Does anybody know a Functions list that I can download >for my PDA? I’m looking for something which shows the function and a >short description of what it works fo

Re: [PHP] Re: Working under Apache 1.3 but not Under IIS (Problem Resolved But its too Slow)...

2002-07-09 Thread David Otton
On Tue, 9 Jul 2002 16:31:50 -0230, you wrote: >> http://www.coop.mun.ca/verification.php >> >> Try and Type in any Name... As it should simply >> Step through the Database not find it and Respit the Page... >> However this does not happn... >> >> Please Help... >> >> if (function_exists(odbc_fet

Re: [PHP] Dos Paths

2002-07-10 Thread David Otton
On Wed, 10 Jul 2002 13:14:44 +0100, you wrote: >I've got an application that requires dos folder names (8.3 standard) as >input. > >I also have PHP, which quite happily can cope with both. > >Can someone help me write a function to translate full paths to dos paths You may have to drop down to C

Re: [PHP] Dos Paths

2002-07-10 Thread David Otton
On Wed, 10 Jul 2002 13:35:50 +0100, you wrote: >"David Otton" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> On Wed, 10 Jul 2002 13:14:44 +0100, you wrote: >> >> >I've got an application that requires

Re: [PHP] Generating word documents based on fields in a browser

2002-07-10 Thread David Otton
On Wed, 10 Jul 2002 15:53:36 +0100, you wrote: >I want to create a form, similar to an invoicing system that generates a >word document that the user can print out You may have better luck with RTF (http://www.phpbuilder.com/columns/nair20020523.php3) or PDF (http://www.php.net/manual/en/ref.cpd

Re: [PHP] Generating word documents based on fields in a browser

2002-07-10 Thread David Otton
On Wed, 10 Jul 2002 16:13:53 +0100, you wrote: >"David Otton" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> On Wed, 10 Jul 2002 15:53:36 +0100, you wrote: >> >I want to create a form, similar to an invoicing s

Re: [PHP] fopen() ??

2002-07-10 Thread David Otton
On Wed, 10 Jul 2002 11:33:52 -0400, you wrote: > >"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Thanks a million!!! >> > Didn't I read the article somewhere on PHP.net that said that? Using >> > fopen() to open a file, does it attempt to c

Re: [PHP] Character Array

2002-07-11 Thread David Otton
On Thu, 11 Jul 2002 12:08:59 +0100, you wrote: >Is there an easy way to get an array of characters from a string? $str = 'string'; $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); print_r($chars); from http://www.php.net/manual/en/function.preg-split.php djo -- PHP General Mailing

Re: [PHP] Execute script then output image.

2002-07-11 Thread David Otton
On Thu, 11 Jul 2002 21:00:36 +1000, you wrote: >How do I output a static image through a php script? > >it had something to do with headers but I can't remember exactly what. You need to output the correct content-type header for the image (eg image/gif), take it's size and output it as content-

Re: [PHP] Character Array

2002-07-11 Thread David Otton
On Thu, 11 Jul 2002 13:50:59 +0200, you wrote: >> >Is there an easy way to get an array of characters from a string? >> $str = 'string'; >> $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); >> print_r($chars); > >A string is already an array of chars : >$toto="test"; >echo $toto[0]; // pr

Re: [PHP] Execute script then output image.

2002-07-11 Thread David Otton
On Thu, 11 Jul 2002 22:01:03 +1000, you wrote: >> You need to output the correct content-type header for the image (eg >> image/gif), take it's size and output it as content-length, and >> suppress error reporting. Then output the image data. >There was a much simpler way. It just said the locat

Re: [PHP] How to set focus in a form field

2002-07-11 Thread David Otton
On Thu, 11 Jul 2002 11:25:50 -0400, you wrote: >Is there anyway to automate this, so that when a page loads it automatically >goes to the first field, and 'highlights' the entry area? (Btw, I tried >'tabindex=1' but it still does not do what I'd like it to. Javascript, not PHP. Look up the foc

Re: [PHP] Need help - past deadline

2003-08-26 Thread David Otton
On Tue, 26 Aug 2003 12:39:53 -0500, you wrote: > > $row[0]; ?> > Missing > >Jay Fitzgerald, Design Director >- Certified Professional Webmaster (CPW-A) >- Certified Professional Web Designer (CPWDS-A) >- Certified Professional Web Developer

Re: [PHP] php equivalent to asp's instr()

2003-08-28 Thread David Otton
On Wed, 27 Aug 2003 14:07:34 -0700, you wrote: >I don't know why but I've had the darndest time trying to find an easy >equivalent of asp's InStr() function in PHP. I know there is >preg_match(), strpos(), and strstr(), but none of them work like I want >them to. > >In fact, except for maybe preg_

Re: [PHP] Re: IS THIS A BUG?

2003-08-28 Thread David Otton
On Wed, 27 Aug 2003 18:36:26 -0400, you wrote: >DvDmanDT wrote: > >>When using register_globals=off, this might be off intrest: (notice $$var) >>while(list($var,$val)=each($_REQUEST))$$var=$val; >> >Why not just turn register_globals on, then? I assume you could use it to only pull in variables f

Re: [PHP] beginner: cut text after " "

2003-08-28 Thread David Otton
On Wed, 27 Aug 2003 21:30:25 -0700, you wrote: >Want to remove the string after the first whitespace like: > >"here is a text what i have" >to: >"here" I'd explode() the string into an array, and take the 0th element of the array. $s = 'here is a text what i have'; $a = explode (' ', $s); echo (

Re: [PHP] LWP::Parallel in PHP

2003-08-28 Thread David Otton
On Thu, 28 Aug 2003 20:25:05 +0300, you wrote: >I am looking for PHP analog of Perl LWP::Parallel. >I need to fetch several URL(pages) from PHP at the same time. >I have a script which fetch 5-10 URL, each URL fetched 0.5 - 2 sec. >Totally it's about 10 seconds in average. >I suppose if I fetched

Re: [PHP] LWP::Parallel in PHP

2003-08-29 Thread David Otton
On Thu, 28 Aug 2003 15:49:15 -0700, you wrote: >> Think you're out of luck. Yes, it's a problem I've run up against more than >> once. There's no thread support in PHP [4. Anyone know if it's in 5?]. >php.net/pcntl_fork Interesting - that's new. Unix-only and not in the default install. Not ava

Re: [PHP] post v get

2003-08-29 Thread David Otton
On Thu, 28 Aug 2003 18:50:55 -0400, you wrote: >> When you POST a form to the server the server replies with a new >> page. if you click the Back button in the browser the server wants to >> re-POST the form. Short of using GET is there a way to prevent >> re-submitting the previous form? >One te

Re: [PHP] Array Push and Keys

2003-08-29 Thread David Otton
On Thu, 28 Aug 2003 18:14:39 -0400, you wrote: >While($row=mysql_fetch_array($res) { >That *should* create the array above, but as I mentioned array_push does not >seem to be taking the keys I just get a Parse error message for the >line. (the first array_push) Ahem. Count the brackets? :)

Re: [PHP] Array Push and Keys

2003-08-29 Thread David Otton
On Fri, 29 Aug 2003 07:54:45 -0400, you wrote: >Correct on the brackets - but not on the results still working... The code >I had in the email was just a sample - here is the real code... Ack. For anyone watching, if you have a problem please post a minimal code snippet that illustrates the prob

Re: [PHP] Accessing objects of other objects?

2003-08-29 Thread David Otton
On Fri, 29 Aug 2003 15:19:23 +0200, you wrote: >On page "A" of my homepage I create an object "1" which itself creates an >object "2". >Now how can I access the properties of object "2" from "A" ? Two approaches. C contains an instance of A or E extends A. input : $s"); }

Re: [PHP] Array Push and Keys

2003-08-29 Thread David Otton
On Fri, 29 Aug 2003 11:18:18 -0400, you wrote: >The question for anyone out there is simple - does array_push allow you to >push key=>value pairs? That is what is causing errors - nothing else, >everything else is a result of inherited systems, and other developers >crappy design. I agree with y

Re: [PHP] Form Parameters

2003-08-29 Thread David Otton
On Fri, 29 Aug 2003 11:00:14 -0700, you wrote: >This might be staring straight at me, but I can't seem to figure out >how to reference form parameters in php code. For example: > > > if ($formName["fieldName"] == "this") { > // do this > } else { > // do t

Re: [PHP] Multiple word strings getting truncated - help please.

2003-08-30 Thread David Otton
On Sat, 30 Aug 2003 14:52:30 -0700, you wrote: >I have a form for a member to signup for an account. The form has standard >fields for addresses, city state, etc. When I insert the data into the >table, if the string has more than one word, it gets truncated to the first >word. > >Does this sound

Re: [PHP] XML to PHP help

2003-08-31 Thread David Otton
On Sun, 31 Aug 2003 11:20:23 -0500, you wrote: >No, what I'm looking for is a script that will download the backend.php >file like you get from slashdot.org, and turn it into a readable html >file that can be insterted into another php file. Make sense? Not really. Forget about the file extension

Re: [PHP] XML to PHP help

2003-08-31 Thread David Otton
On Sun, 31 Aug 2003 11:20:23 -0500, you wrote: >No, what I'm looking for is a script that will download the backend.php >file like you get from slashdot.org, and turn it into a readable html >file that can be insterted into another php file. Make sense? Oh, hey, wait a sec - XML, backend... are y

Re: [PHP] simple Apache question I'm sure

2003-09-06 Thread David Otton
On Fri, 5 Sep 2003 20:30:22 -0700, you wrote: >This is more Apache related but I have a php/apache config'd box at home I >want to test stuff out on before uploading to a public server. Every >directory except wwwroot dir I must place a '/' after the dir name to get a >listing such as http:://192.

Re: [PHP] Maximum amount of variables in a session?

2003-09-06 Thread David Otton
On Fri, 5 Sep 2003 14:40:39 -0700, you wrote: > I am creating a project for a web hosting control panel and just wondering >if there is a limit to the amount of variables I can store in a session? If >I have too many variables will it create an uneccassary strain on my server? >What is an average

Re: [PHP] Re: yahoo messeger scrpt php

2003-09-10 Thread David Otton
On Wed, 10 Sep 2003 11:40:14 +0700, you wrote: >dear all how to created the script in php / html , that someone knows that >another people online / off line in yahoo messeger in page ? You just need to pick up an image from Yahoo: http://opi.yahoo.com/online?u=YahooID -- PHP General Mailing Li

Re: [PHP] unexpected results using sprintf() with %u

2003-10-03 Thread David Otton
On Fri, 3 Oct 2003 15:51:59 +1000, you wrote: >Im trying to retrieve the unsigned value of an integer. sounds pretty simple... > >[code] >$i = -86; >echo "" . sprintf("%d", $i); >echo "" . sprintf("%u", $i); >[/code] > >produces: >-86 >4294967198 > >what i expected: >-86 >86 > >Ive searched the ar

Re: [PHP] stripping comments

2003-10-05 Thread David Otton
On Sun, 5 Oct 2003 04:46:16 -0400, you wrote: >I'm trying to strip comments out of my code. I can get it to strip one >section of comments but the problem comes in when I have more then one >comment section to strip. > >I am using this: $code = preg_replace('/\/*(.*?)*\//is', '$1', $code) and >ne

Re: [PHP] Select Query problem

2003-10-05 Thread David Otton
On Mon, 6 Oct 2003 14:22:59 +0800, you wrote: >Now my question is: What if I would like to display data for the CURRENT MONTH >and the last 11 months???(May also said to be the LAST MONTHS) >HOw should my select query be like?? This question isn't on-topic for this list; it's about SQL, not PHP.

Re: [PHP] ps command in php

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 14:55:56 +0800, you wrote: >I'm trying to have the output of the "ps -ef" command in Linux to my >browser. Can anyone help how to properly have the output in proper format. >I've used the passthru() function but the output is scrambled. Scrambled how, exactly? Remember, your br

Re: [PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 10:06:44 +0100, you wrote: >I have on my site a part where users' can submit articles and no doubt their >articles will contain code. Code is wrapped inside of [code] tags, i.e. >[code][/code] > >However, there is other text in the same article, so I need to format the >code ins

Re: [PHP] Wrapping code inside [code]xxx[/code] tags.

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 07:12:07 -0500, you wrote: >Also Evolt.org does a nifty thing with code in iframes within >articles. Just a . CSS's overflow: property is a possible text-within-text solution, too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/un

Re: [PHP] Array of Classes

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 13:41:22 -0400, you wrote: >1) How can I create an array of classes so they could be referenced, for >instance: $array[$uniqueID][$class->var] = 10; ? > >2) Would it instantiate when that particular element was used and would the >constructor run at that point? > >3) Any way to

Re: [PHP] PHP & CSS

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 11:13:04 -0700, you wrote: >I'm currently building a dynamic site which draws page configuration >variables from config (ini) files. To use those variables from the >ini files, I write the style sheet in the header of each page. > >Here's my problem. I want to link to a style

Re: [PHP] storing the passthru() output as an array

2003-10-06 Thread David Otton
On Tue, 7 Oct 2003 09:41:03 +0800, you wrote: >Have another problem here I need to get the output of this syntax > >$ps = (passthru("ps -ef")); > >and store it in an array line by line, Turn on output buffering, grab the output of your script, then turn it off. (ob_start, ob_get_contents, ob_end_

Re: [PHP] shell_exec question

2003-10-08 Thread David Otton
On 08 Oct 2003 13:25:51 +0200, you wrote: >I`m using a shell_exec to get a list of files from a specified >directory. > >When I run it locally on my machine i works. When I run it on the other >machine I get What Marek said. However, is there any reason you're not using readdir()? http://uk.php

Re: [PHP] Re: PHP & CSS

2003-10-08 Thread David Otton
On Wed, 8 Oct 2003 08:49:17 -0700, you wrote: >On Wed, 08 Oct 2003 20:34:51 +0600 >Raditha Dissanayake <[EMAIL PROTECTED]> wrote: >> Raquel Rice wrote: >> >Well, yes ... in a way. The plan is to have a main site, where >> >users can have a subsite off the main site. I want to give the >> >user

Re: [PHP] pasted text from word

2003-10-09 Thread David Otton
On Thu, 9 Oct 2003 11:53:51 +1000, you wrote: >Hi all, > >I'm interested in alternative solutions (to those found in the comments >on http://au.php.net/htmlspecialchars) for dealing with text pasted >into a textarea from Word et al. > >I want a way of 'dumbing down' certain characters (like quot

Re: [PHP] Multiple PHP modules

2003-10-10 Thread David Otton
On Fri, 10 Oct 2003 03:10:53 -0400, you wrote: >> > Is it possible to load two different PHP modules in apache having them >> > linked to different virtual hosts? I'm hoping I can run one site with PHP >> > 5 and another with 4.3.x >I thought that might work but the Apache docs don't list LoadMod

Re: [PHP] PHP generated AuthUserFiles?

2003-10-10 Thread David Otton
On Fri, 10 Oct 2003 06:34:43 -0400, you wrote: >Is there a way to let PHP generate the necessary AuthUserFiles for use with >.htaccess? > >I don't allow my clients the ability to use .htpasswd in the command line. > >From what I see, the user file is just a text file with the username and the >enc

Re: [PHP] unset() un-appropriate ?

2003-10-13 Thread David Otton
On Mon, 13 Oct 2003 12:47:44 +0200, you wrote: >I have a form with 3 checkboxes x1,x2,x3. I want to build an array of >values from the checked boxes; I choosed the following approach: >1. build an array with all values >2. eliminate from array the "" values using unset > >For some reason, the code

Re: [PHP] 'Return values' from links

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 08:54:23 +0200 (MEST), you wrote: >I have a php file in website A's directory, which, when given a key value, >will check whether it is valid or not. Is there any way I can treat this >website like a function and have it give me a return value after it has "run >through" ? Yes

Re: [PHP] Back option using php

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 14:50:21 +0530 (IST), you wrote: > Is there any way to restrict the user not to go back once he >submitted the html form ?? Javascript, but that can't be relied on. Are you're trying to avoid the "This page has expired, resubmit?" warning in IE? Use header ("Location:") to

Re: [PHP] Dynamic tables

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 14:42:34 +0800, you wrote: >Right now, I am able to change the colour of cells using a drop down menu, and >when I clicked on "Reload" it still remains the colour that I have changed, but >when I open the page in another browser, as I echoed the value "colour", the >browser dis

Re: [PHP] Creating local vars from HTTP Post Array

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 10:11:57 +, you wrote: >I'm re-coding a fairly large multi step form which was written with PHP's >register globals turned on. Since upgrading PHP this form has stopped >working and needs editting. > >Rather than manually changing each var - > >$foo to$_POST['foo']

Re: [PHP] Session not getting destroyed !

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 15:58:36 +0530, you wrote: >My session is not getting destroyed once i close the browser. Problem is only in IE 5 >as IE 6+ its getting destroyed. I don't know what is the problem. I looked at the >session settings parameters in php.ini file but couldn't figure it out. > >I a

Re: [PHP] 'Return values' from links

2003-10-17 Thread David Otton
>fputs ($sp, "POST /path/to/script.php HTTP/1.0\r\n"); >fputs ($sp, "Host: $host\r\n"); Sorry. That should be HTTP/1.1, of course. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Session not getting destroyed !

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 16:46:45 +0530, you wrote: >Yes its showing 0 only.. > >Its a weird kind of problem for me .. Is the browser really being closed? SID caught in a bookmark? Broken cache? Try starting from bare - delete all IE cookies and run the tests again. Check the cookie on the client si

Re: [PHP] variable in e-mail

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 14:51:54 +0100, you wrote: >I would like to use a form in a html page to pass the variables to a php >page, which sends an mail including these variables. > >All I get in the mail though is a 1 rather than the string that I put into >the form??? > >Can anyone help please! Redu

Re: [PHP] variables in e-mail 2nd

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 15:09:48 +0100, you wrote: >I would like to use a form in a html page to pass the variables to a php >page, which sends an mail including these variables. > >All I get in the mail though is a 1 rather than the string that I put into >the form??? > >Can anyone help please! > >So

Re: [PHP] Shouldn't script errors show in my browser?

2003-10-17 Thread David Otton
On Fri, 17 Oct 2003 11:29:41 -0400, you wrote: >I hope this question is not too stupid! When I have an error in my script, >it seems to me that the web server, or in my case the php CGI module I am >using for testing, should send something back to my browser displaying an >error message. Instead,

Re: [PHP] Re: $PHP_SELF

2003-10-20 Thread David Otton
On Mon, 20 Oct 2003 09:11:37 -0400, you wrote: >"Boris Sagadin" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> I'm having problems with $PHP_SELF variable. Mostly it works, other >> times (about 10% of tries) it's just empty. Is this a known issue with >Apache >> 2? If I use $_SE

Re: [PHP] Re: $PHP_SELF

2003-10-20 Thread David Otton
On Mon, 20 Oct 2003 14:36:33 +, you wrote: >I believe the issue is where exactly is $PHP_SELF being used. >$PHP_SELF isn't available inside a function, without global'ing >it but $_SESSION is available all the time. Then I would expect an E_NOTICE (though the default error reporting level is

Re: [PHP] Re: $PHP_SELF

2003-10-20 Thread David Otton
On Mon, 20 Oct 2003 10:40:23 -0400, you wrote: >No, you seem to be misunderstanding the point. > > >http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server Ok, there's nigh-on 30k of text on that page. I have /no/ idea what you're referring to. However, I did find this: "If

Re: [PHP] HTTP 405 - Resource not allowed error

2003-10-21 Thread David Otton
On Tue, 21 Oct 2003 18:22:26 +0530, you wrote: > > > This file and the index.php are kept in the same directory. But the > browser returns 405 is Method Not Allowed. My first guess would be that your web server won't allow you to do POSTs to that resource. If Apache, check httpd.conf or .hta

Re: [PHP] similar_text

2003-10-21 Thread David Otton
On Tue, 21 Oct 2003 17:42:17 +0200, you wrote: >does any one have an example of a function to search a database for similar >names and display them if the user inputs a name that is not found? Are you looking for SOUNDEX, perhaps? http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=SOUNDEX+al

Re: [PHP] Sorting an array by value length.

2003-10-22 Thread David Otton
On Wed, 22 Oct 2003 11:21:13 -0700, you wrote: >I've been scouring the php.net site for a few hours now trying to find a >viable way to sort a single dimensional array( array('0'=>'fddfsdsfdds', >'1'=>','d','2' => 'gofofle'); ). so that the longest lengthed >item is at the top, and the

Re: [PHP] Simple array question

2003-10-22 Thread David Otton
On Thu, 23 Oct 2003 14:01:59 -0500, you wrote: >Is there a simple way to return the key (name) of one element in an >array? I looked up key() in the docs, but there are no examples or >notes... Ok, to make sure I understand you: given an array ('apple' => 'red', 'banana' => 'yellow') you wan

Re: [PHP] Php and Fortune

2003-10-22 Thread David Otton
On Wed, 22 Oct 2003 22:54:55 -0400, you wrote: >Is there a way I can get php to call the program fortune then print that a >web page. http://uk2.php.net/system -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] session_destroy causes backspace on IE

2003-10-24 Thread David Otton
On Fri, 24 Oct 2003 15:42:45 -0400, you wrote: >Tried breaking up the echo, but still didn't work. What PHP version are you using? 4.10, maybe? http://bugs.php.net/bug.php?id=14695 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] usort

2003-10-24 Thread David Otton
On Sat, 25 Oct 2003 04:03:12 +0300, you wrote: >I don't know what the names are. I just know that there might be numbers. :) > >It still doesn't work. It gives very odd results with the $x_out variables. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

Re: [PHP] Trying to organise an array

2003-10-25 Thread David Otton
On Sat, 25 Oct 2003 09:17:46 +0100, you wrote: >I have made this function which should be quite simple but doesn't seem to >do what it is meant to. >What I want it to do is create an array where there is a numbered key (the >rows of the table) and the colume headings as the second key. First, you

Re: [PHP] output

2003-10-25 Thread David Otton
On Sat, 25 Oct 2003 11:52:53 +0300, you wrote: >I'm getting output from program I run (exec) to the web page. >How can I avoid this ? Did you even look at the manual? http://uk.php.net/manual/en/ref.exec.php escapeshellarg -- escape a string to be used as a shell argument escapeshellcmd -- esca

Re: [PHP] Trying to organise an array

2003-10-25 Thread David Otton
On Sat, 25 Oct 2003 08:55:15 -0700, you wrote: >my god man, do you know what indenting is? Uhm... it's that thing I did with 4-space tabs, all the way down. Allman-style, not K&R, for what it's worth. >that confused the heck out of me. Mailer problem? Thisparagraph

Re: [PHP] Page encoding

2003-10-25 Thread David Otton
On Sat, 25 Oct 2003 23:19:33 +0300, you wrote: >I have to use windows-1251 encoding for my pages. But just inserting > is >not enough. What shold I do? Meta tags are generally substitutes for headers. Declare the content-type with a header() statement. Oh, and you have a typo in "enncoding". (

Re: [PHP] manual key generation

2003-10-25 Thread David Otton
On Sat, 25 Oct 2003 20:31:37 -0200, you wrote: >When I enter: > >SELECT MAX(quotation_id)+1 from quotations > >I get simply the number 7 (which is ok) > >But when I do: > >$new_key = mysql_query("SELECT MAX(quotation_id)+1 from quotations") > >I get $new_key = Resource id #3 L

Re: [PHP] Get image file size

2003-10-26 Thread David Otton
On Sun, 26 Oct 2003 14:01:36 -, you wrote: >How can I get the file size of an image in KB, I know how to get the width >and height of an image using the getimagesize(); but not sure how to get the >image file size. http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php+filesize http://www

Re: [PHP] Re: Recommendation for Unique URL

2003-10-26 Thread David Otton
On Mon, 27 Oct 2003 13:29:47 +1100, you wrote: >> What is the best approach to the unique page ID? I thought I would store >the >> dept. mgrs. email address and the session ID in a db, and use the session >ID in >> the URL. Do I even need the mgr's email address? Is another approach >better? >> Wh

Re: [PHP] Oh why won't it work

2003-10-27 Thread David Otton
On Mon, 27 Oct 2003 13:00:19 -, you wrote: $n is created /outside/ the function. > $n = 1; So you can't use it here. It's not in scope. > $array[$n][$colname] = $value; >But when I run this script, it looses the first row and doesn't really That's because you get the first row here. >

Re: [PHP] Multi-dimensional array help

2003-10-27 Thread David Otton
On 27 Oct 2003 13:20:48 -0500, you wrote: >echo ''."\n" >.'' >.'SKU' >.'Jan' >.'Feb' >.'Mar' >.'Apr' >.'May' >.'Jun' >.'Jul' >.'Aug' >.'Sep' >.'Oct' >.'Nob' >.'Dec' >.''."\n"; for ($i = 1; $i <= 12; $i++) { e

Re: [PHP] keyword search syntax

2003-10-27 Thread David Otton
On Mon, 27 Oct 2003 20:00:24 -0600, you wrote: >I've got a field in my database that contains keywords about the particular >record. I've got a form with a text entry field for visitors to enter >keywords for which they would like to find records whose keyword field >contains the words they entere

Re: [PHP] Echo issue

2003-10-29 Thread David Otton
On Wed, 29 Oct 2003 11:56:11 +1100, you wrote: >I have spent about an hour looking at this and have found I can't echo >anything with 16 characters or less! It can be over a single line or >multiple lines eg. > >echo("12345678"); >echo("12345678"); >?> >->"" > >but > >echo("12345678"); >echo("123

Re: [PHP] Echo issue RESOLVED!

2003-10-29 Thread David Otton
On Thu, 30 Oct 2003 10:00:51 +1100, you wrote: >> I would be very interested in learning more about this issue. Would you happen >> to be able to provide an example HTTP transaction that Safari mishandles? > >If you use a 'proper' html file it works OK. If you simply create a text >file (with

Re: [PHP] Passing constructor values to functions in a class

2003-10-30 Thread David Otton
On Fri, 31 Oct 2003 11:38:47 +0800, you wrote: >I've been struggling with this for some time now and can't for the life of >me figure out why the output is "GeorgeGeorge" and not "GeorgeBush" > $this->$staff_name="George"; Try this instead > $this->staff_name="George"; (superfluous $). Same

Re: [PHP] php selecting problem

2003-11-01 Thread David Otton
On Sun, 2 Nov 2003 00:06:46 +0100, you wrote: >if($bok==1) >{$query = "select compno,thCompany from main_company where thCompany LIKE >'%0123456789%'";} > >I have looked in the DB and i see quite a few companies have a number in the >beginning, but still this returns me no rowsany ideas why?

Re: [PHP] Web Applications and C++?

2003-11-01 Thread David Otton
On Sat, 1 Nov 2003 20:19:13 -0500, you wrote: >Inappropirate but intruiging nonetheless. I've always been curious >how Amazon handles the amount of traffic their site generates and now >I've got a slightly better idea. I know eBay uses CGI as I've already >seen discussion of it. Amazon mostly l

Re: [PHP] deleting characters from strings

2003-11-01 Thread David Otton
On Sat, 1 Nov 2003 11:25:09 -0600, you wrote: >I feel really stupid posting this but I can't seem to find the correct >syntax in the language guide. I have a string which has been progressively >built during a FOREACH loop through an array (a SELECT statement in which >the WHERE part is built with

Re: [PHP] passing variables to subsequent pages

2003-11-02 Thread David Otton
On Sun, 2 Nov 2003 07:44:29 -0600, you wrote: >I have a two page search. The first page queries a database and creates a >list of MANUFACTURERS from which the visitor can select all, one or >multiple entries. The page is submitted via GET to the second page of the >search. The second page uses

Re: [PHP] How to remove a variable from an array

2003-11-02 Thread David Otton
On Sun, 2 Nov 2003 14:06:31 -0500, you wrote: >I have an array variable that is set, then put into a session >variable. All is good so far, but how can I remove a specific variable >from the array? unset() >I have tried basically copying and pasting this, and adding a foreach >loop. Inside this

Re: [PHP] How to remove a variable from an array

2003-11-02 Thread David Otton
>>I have tried basically copying and pasting this, and adding a foreach >>loop. Inside this foreach loop, the array is split apart and I tried >>using unnset, but I couldn't get it to work, so I deleted the code. > >unset ($array[$index]) > >http://uk.php.net/unset There are examples in the manua

Re: [PHP] Endless 'while' loops?

2003-11-02 Thread David Otton
On Mon, 3 Nov 2003 12:29:10 +0900, you wrote: Without running the code, I can see two immediate problems. >$subject = "EigoImprov Newsletter for " .member[1]; should be $subject = "EigoImprov Newsletter for " . $member[1]; Also rewrite >$mailcontent = "Dear " .$member[0] .",\n".$message ."\nT

<    1   2   3   4   >