[PHP] Array question - maybe UTF?

2007-02-26 Thread Gerry D
Perhaps it's more a UTF8 issue that is going wrong for me. At first strtr() was not giving me the results I wanted, so I started tinkering. This is what I came up with... Still no satisfactory results. I think character support is rather lacking in php, or maybe I just don't have a clue? Gerry

Re: [PHP] Array question

2007-02-26 Thread Hap-Hang Yu
Try: $fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry'); $search = 'apple'; foreach($fruit as $key => $val) { if ($val == $search) { echo "$search found: array key is $key, value is $val"; } } 2007/2/27, Gerry D <[EMAIL PROTECTED]>: I have a question on how to retrieve t

[PHP] Array question

2007-02-26 Thread Gerry D
I have a question on how to retrieve the value that corresponds to a key in an array. $fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry'); $key = array_search($c, $fruit); if ( $key === FALSE ) $n = $c; else

Re: [PHP] Multiple Submit

2007-02-26 Thread Jim Lucas
Dan Shirah wrote: Okay, I partially figured it out! YAY! I only needed to have one form object. ** Instead of putting an action in the form, leave it blankand then specify the forms action based on which button is clicked. ** And this will $_POST all your entered values as it should.

Re: [PHP] read file local not remote

2007-02-26 Thread Joker7
In news: [EMAIL PROTECTED], "Martin Zvarík" said: >> Difference: You don't call file as http://www.myweb.com/ but instead >> you use the path like c:\some.txt or ../some.txt etc. >> >> PHP 5 >> = >> echo file_get_contents("some.txt"); Works a treat Cheers Chris -- Cheap As Chips Bro

Re: [PHP] Multiple Submit

2007-02-26 Thread Dan Shirah
Okay, I partially figured it out! YAY! I only needed to have one form object. ** Instead of putting an action in the form, leave it blankand then specify the forms action based on which button is clicked. ** And this will $_POST all your entered values as it should. Now all I have to fi

Re: [PHP] Re: Uploading into website directory for Php files

2007-02-26 Thread Edward Vermillion
On Feb 26, 2007, at 12:06 PM, Edward Vermillion wrote: Or you can set a constant to the includes directory: Ooopps... should be define('INCLUDE_DIR', '/files/include/'); forgot the last '/'... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/un

Re: [PHP] Multiple Submit

2007-02-26 Thread Jim Lucas
Dan Shirah wrote: Hello all, I have a page that has multiple submits on it. One submit is within my javascriptfor form checking, the other submit is a button used to populate all customer information if an order ID is entered. Problem: I cannot get the two to coincide at the same time. They

Re: [PHP] Multiple Submit

2007-02-26 Thread David Giragosian
I always use : onClick=\"this.form.action='SomeOtherPage.php'; \" inside the button tag. Seems to work just fine. David On 2/26/07, Dan Shirah <[EMAIL PROTECTED]> wrote: When I click on "save" at the bottom, I want it to check my form and submit all the values. When I click on the "Retriev

Re: [PHP] Multiple Submit

2007-02-26 Thread Dan Shirah
When I click on "save" at the bottom, I want it to check my form and submit all the values. When I click on the "Retrieve" button I want it to submit my order number to another page, and also carry over the $_POST value of any field that may have had info entered into it. However, since I have a

Re: [PHP] Multiple Submit

2007-02-26 Thread tedd
At 11:23 AM -0500 2/26/07, Dan Shirah wrote: Hello all, I have a page that has multiple submits on it. One submit is within my javascriptfor form checking, the other submit is a button used to populate all customer information if an order ID is entered. Problem: I cannot get the two to coinci

Re: [PHP] Multiple Submit

2007-02-26 Thread Jim Lucas
Dan Shirah wrote: Hello all, I have a page that has multiple submits on it. One submit is within my javascriptfor form checking, the other submit is a button used to populate all customer information if an order ID is entered. Problem: I cannot get the two to coincide at the same time. They

[PHP] Re: Uploading into website directory for Php files

2007-02-26 Thread Edward Vermillion
On Feb 26, 2007, at 11:22 AM, [EMAIL PROTECTED] wrote: Thanks alot for your response.. your information really was a help. but now knowing that I an use a folder in my root DIR.. how do I let PHP know where to look? For example the location lets say of my include fold is www.example.

Re: [PHP] getting authentication information from apache

2007-02-26 Thread Ryan
Tried that ($PHP_AUTH_USER) and it is also empty. On 2/24/07, dave <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 try echo $PHP_AUTH_USER; Ryan wrote: > Richard, > > I looked at phpinfo() as you said, same thing... > > _SERVER["REMOTE_USER"]no value > > You may be

[PHP] Re: audio CAPTCHA - was Combining sound files

2007-02-26 Thread Colin Guthrie
tedd wrote: > PS: What does this have to do with php? Well... a good deal of the code > is php and a mix of a bunch of other stuff (we don't live in a vacuum) > -- so please permit me this indulgence. Personally, I think this would be quite easy to do in flash... tho' I don't really know flash, it

Re: [PHP] audio CAPTCHA - was Combining sound files

2007-02-26 Thread Németh Zoltán
2007. 02. 26, hétfő keltezéssel 08.26-kor benifactor ezt írta: > i was just trying again, and entered 406 via keyboard and pressed > submit, and it said i was successful, then i pressed back on my browser and > no longer had the error. it displayed the captcha at the top of the page > where

Re: [PHP] Multiple Submit

2007-02-26 Thread Németh Zoltán
2007. 02. 26, hétfő keltezéssel 11.23-kor Dan Shirah ezt írta: > Hello all, > > I have a page that has multiple submits on it. One submit is within my > javascriptfor form checking, the other submit is a button used to populate > all customer information if an order ID is entered. > > Problem:

Re: [PHP] audio CAPTCHA - was Combining sound files

2007-02-26 Thread benifactor
i was just trying again, and entered 406 via keyboard and pressed submit, and it said i was successful, then i pressed back on my browser and no longer had the error. it displayed the captcha at the top of the page where the error was. -- PHP General Mailing List (http://www.php.net/) To u

[PHP] Multiple Submit

2007-02-26 Thread Dan Shirah
Hello all, I have a page that has multiple submits on it. One submit is within my javascriptfor form checking, the other submit is a button used to populate all customer information if an order ID is entered. Problem: I cannot get the two to coincide at the same time. They both use the submit

Re: [PHP] audio CAPTCHA - was Combining sound files

2007-02-26 Thread benifactor
yea, same for me... but maybe the variable needs to be defined for anything to happen, as we are probably supposed to press that before we speak tha captcha.. - Original Message - From: "Németh Zoltán" <[EMAIL PROTECTED]> To: "benifactor" <[EMAIL PROTECTED]> Cc: Sent: Monday, Februar

Re: [PHP] audio CAPTCHA - was Combining sound files

2007-02-26 Thread Németh Zoltán
I got the same notice on the top of the page. besides that, when clicking the "speak captcha" button nothing happens greets Zoltán Németh 2007. 02. 26, hétfő keltezéssel 08.12-kor benifactor ezt írta: > tried, and failed. got this error: > > Notice: Undefined variable: captcha in > /home/httpd

Re: [PHP] array issues

2007-02-26 Thread Matt Carlson
If i'm understanding you correctly, you have something like a flat file, and hopefully it is artist[tab]artist[tab] with the title being something like artist1title[tab]artist2title[tab], etc. If so, use explode. $artists = explode("\t", $stringofartists); $songs = explode("\t", $stringoftitles

Re: [PHP] audio CAPTCHA - was Combining sound files

2007-02-26 Thread benifactor
tried, and failed. got this error: Notice: Undefined variable: captcha in /home/httpd/vhosts/sperling.com/httpdocs/a/c/index.php on line 29 and no captcha was displayed. - Original Message - From: "tedd" <[EMAIL PROTECTED]> To: Sent: Monday, February 26, 2007 8:04 AM Subject: [PHP]

Re: [PHP] GET doesn't work as POST

2007-02-26 Thread Jim Lucas
Otto Wyss wrote: On the page http://www.orpatec.ch/turniere/5erfussball/index.php?page=bvallist.php&kind=regions I have a form with method="post" and action="?>". While it works fine this way, as soon as I change the form to method="get" it looses the parameter "kind" when I change e.g. the

[PHP] audio CAPTCHA - was Combining sound files

2007-02-26 Thread tedd
Hi gang: Thanks for all the advice regarding combining sound files. I shall look into all of it. In the meantime, I am trying a different solution and would appreciate your review of the technique: http://www.sperling.com/a/c/ The point of this experiment is to "speak" the numbers required

Re: [PHP] PHP4 and PHP5

2007-02-26 Thread Jochem Maas
Steven Macintyre wrote: > "This tutorial shows how to install and configure Apache2 with PHP5 and PHP4 > enabled at the same time. Because it is not possible to run both PHP5 and > PHP4 as Apache modules, we must run one of them as CGI, the other one as > Apache module." alternatively run 2 apache

Re: [PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread Jochem Maas
Vincent DUPONT wrote: > hi > > I'm afraid this is not available by default. > You can try to parse the debug_backtrace() (see > http://be2.php.net/manual/en/function.debug-backtrace.php) > but this is probably too complex for online processing. unless you are doing something *very* exotic (whic

Re: [PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread Stut
clive wrote: Thanks Vincent,Stut and Olaf. Thats __file___ is exactly what I needed :) now for another brain teaser for your collective brains, How does a function know what file it was called from. a.php includes functions.php in a.php we call function test(); which is declared in functions

RE: [PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread Vincent DUPONT
hi I'm afraid this is not available by default. You can try to parse the debug_backtrace() (see http://be2.php.net/manual/en/function.debug-backtrace.php) but this is probably too complex for online processing. if there are some native functions, please tell me !! Vincent Dupont Principal Co

[PHP] Re: PHP4 and PHP5

2007-02-26 Thread Fahad Pervaiz
ORIGINAL Is it posible to run apache with PHP4 and PHP5 on different virtual domains? END ORIGINAL ### No! Its not possible. To set php environment in virtual hosts. You can have both php5 and php4 at the same time but you can not configure two php version with one apache. Yes you

Re: [PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread clive
Thanks Vincent,Stut and Olaf. Thats __file___ is exactly what I needed :) now for another brain teaser for your collective brains, How does a function know what file it was called from. a.php includes functions.php in a.php we call function test(); which is declared in functions.php Is there

[PHP] Re: Combining sound files

2007-02-26 Thread Colin Guthrie
tedd wrote: > I'll investigate what you suggest. I definitely think it's the right way to go. sox can also convert from mp3 to wav etc. as per Clive's suggestions too, so if you can use lame from the command line via PHP, there is no reason not to just use sox instead. > It was by accident that I

RE: [PHP] PHP4 and PHP5

2007-02-26 Thread Steven Macintyre
"This tutorial shows how to install and configure Apache2 with PHP5 and PHP4 enabled at the same time. Because it is not possible to run both PHP5 and PHP4 as Apache modules, we must run one of them as CGI, the other one as Apache module." http://www.howtoforge.com/apache2_with_php5_and_php4 That

RE: [PHP] Re: OCI8 under WINDOWS

2007-02-26 Thread Vincent DUPONT
hello is this not a problem of user rights? With IIS under XP, the user is always something as IUSR_xxx, so , the c:\oracle folder must be granted execute grants to IUSR_xx try to figure out under what user Apache is executed (see the Taskt Manager to check the user running the Apache process

[PHP] PHP4 and PHP5

2007-02-26 Thread Martin Marques
Is it posible to run apache with PHP4 and PHP5 on different virtual domains? -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática|

Re: [PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread Stut
clive wrote: A project that I work on has a index.php that includes other files depending on certain requirements. so index.php includes a.php; in a.php if you echo $_SERVER['PHP_SELF'] it echos index.php and I understand why it does this. But, I want echo the file name of a.php from a.php

RE: [PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread Vincent DUPONT
hello, try with the system constant __FILE__ print(__FILE__); inside a.php should always return a.php, even though this is included into index.php. Vincent Dupont Principal Consultant OpenSource Competence Center Ausy Belgium http://www.ausy.be -Original Message- From: clive [mail

[PHP] $_SERVER['PHP_SELF'] in a included file

2007-02-26 Thread clive
A project that I work on has a index.php that includes other files depending on certain requirements. so index.php includes a.php; in a.php if you echo $_SERVER['PHP_SELF'] it echos index.php and I understand why it does this. But, I want echo the file name of a.php from a.php and I dont wan

Re: [PHP] RE: [PHP-DB] NOT NULL query

2007-02-26 Thread Németh Zoltán
SELECT * FROM table WHERE NOT ISNULL(field_3) (in MySQL) greets Zoltán Németh 2007. 02. 26, hétfő keltezéssel 15.21-kor Steven Macintyre ezt írta: > SELECT * FROM table WHERE field_3 IS NOT NULL > > > -Original Message- > > From: Ron Piggott [mailto:[EMAIL PROTECTED] > > Sent: 26 Februa

[PHP] Re: OCI8 under WINDOWS

2007-02-26 Thread Fahad Pervaiz
#ORIGINAL## Hi, I am trying to use oci8.dll under PHP 5.2 and Apache 2 under Windows XP... The system variables are all configured (TNS_ADMIN, SQLPATH, LD_LIBRARY_PATH, etc...). I use ORACLE Instant Client and sqlplus works OK ... PHP-CLI loads the extension without any problem but I canno

Re: [PHP] Combining sound files

2007-02-26 Thread clive
That's a good point, then all I would have to do is to change the resultant mp3 file to a wav file. However, I'm not aware of how to do that using php. I would hope it's as easy as changing a jpg to a gif file, but I have never done a mp3 to a wav conversion before. I'll investigate that. you

[PHP] RE: [PHP-DB] NOT NULL query

2007-02-26 Thread Steven Macintyre
SELECT * FROM table WHERE field_3 IS NOT NULL > -Original Message- > From: Ron Piggott [mailto:[EMAIL PROTECTED] > Sent: 26 February 2007 02:56 PM > To: PHP DB > Subject: [PHP-DB] NOT NULL query > > Is it possible to do a SELECT query where field_3 isn't null? What > would the syntax loo

[PHP] Re: Combining sound files

2007-02-26 Thread tedd
clive wrote: However, I can't do the same with .WAV files. Does anyone know a way to combine .WAV files similar to the way shown above? Can you not convert the wav files to mp3's then combine them? While I'm sure you could do this technically, the principle is wrong for so many reasons

Re: [PHP] Combining sound files

2007-02-26 Thread tedd
At 11:39 AM +0200 2/26/07, clive wrote: However, I can't do the same with .WAV files. Does anyone know a way to combine .WAV files similar to the way shown above? Can you not convert the wav files to mp3's then combine them? -- Regards, Clive. Clive: That's a good point, then all I would

[PHP] array issues

2007-02-26 Thread Steven Macintyre
Hi all, I am working on a project for someone and with the brief I received before - I created a record per action with the following information; Artist[tab]artist[tab]artist[tab] etc as a entry for "artists" Then I have the same for titles etc ... What I have been doing is creating the array

Re: [PHP] Re: how to retrieve pictures from postgreSQL DB

2007-02-26 Thread Colin Guthrie
Alain Roger wrote: > Sorry Colin, > > but what do you mean by "adding some cache related headers" ? > What is the idea behind that ? Well, PHP is a dynamic language and as such it tells web browsers (Firefox, Safari etc.) "DO NOT CACHE THIS PAGE, I MAY GENERATE IT DIFFERENTLY NEXT TIME!!!". So t

Re: [PHP] Combining sound files

2007-02-26 Thread clive
However, I can't do the same with .WAV files. Does anyone know a way to combine .WAV files similar to the way shown above? Can you not convert the wav files to mp3's then combine them? -- Regards, Clive. Real Time Travel Connections {No electrons were harmed in the creation, transmission o

[PHP] Re: Combining sound files

2007-02-26 Thread Colin Guthrie
clive wrote: >> However, I can't do the same with .WAV files. Does anyone know a way >> to combine .WAV files similar to the way shown above? > > Can you not convert the wav files to mp3's then combine them? While I'm sure you could do this technically, the principle is wrong for so many reasons.

[PHP] OCI8 under WINDOWS

2007-02-26 Thread Miguel J.
Hi, I am trying to use oci8.dll under PHP 5.2 and Apache 2 under Windows XP... The system variables are all configured (TNS_ADMIN, SQLPATH, LD_LIBRARY_PATH, etc...). I use ORACLE Instant Client and sqlplus works OK ... PHP-CLI loads the extension without any problem but I cannot get it load under A