[PHP] tutorials

2002-06-11 Thread Adriaan . Putter
hi i want to start learning this PHP, i've got the manual but i need a kind of a starting point? any suggestions Adriaan Putter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Stylesheet to query an xml file

2002-06-11 Thread William S.
I am looking for an example or an explanation of how to set up a stylesheet so it will enable a user to query content in an XML file. For instance. Have an XML file with names and addresses and the user would be able to search for a name and get back a list of matches. This would need to work wi

Re: [PHP] Array into database

2002-06-11 Thread Leon Mergen
"Stuart Dallas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > As far as I know, serialize will handle multi-dimensional arrays. If I were you > I would suck it and see. And how should I store a serialized variable in my database? As String or as Blob? --

Re: [PHP] apache/oracle/php

2002-06-11 Thread Miguel Cruz
On Tue, 11 Jun 2002, Michael P. Carel wrote: > Is there anyone who could give me some reasons why does my php script with > oracle function does'nt work if i run apache as nobody/nobody? > > My script only work if i run apache as oracle/dba. Maybe your environment variables (ORA_BASE, etc.) are

Re: [PHP] catching plurals

2002-06-11 Thread Miguel Cruz
On Tue, 11 Jun 2002, Zac Hillier wrote: > I'm trying to write a function to catch and remove plurals from a search > feature, can anyone suggest how I can efficiently remove 'ies' and 's' > from the right hand end of each word within an array? You are wasting your time (and preparing to really an

Re: [PHP] Store/Retrieve Word Documents in MySQL/PHP?

2002-06-11 Thread Brad McCrorey
Aha! Nice one. thanks for that! Miguel Cruz wrote: >I usually just grep through the one that comes with Apache; it's fairly >thorough. You might find it in /usr/local/apache/conf/mime.types > >miguel > >On Wed, 12 Jun 2002, Brad McCrorey wrote: > > >>This raises an interesting question (at le

Re: [PHP] Store/Retrieve Word Documents in MySQL/PHP?

2002-06-11 Thread Miguel Cruz
I usually just grep through the one that comes with Apache; it's fairly thorough. You might find it in /usr/local/apache/conf/mime.types miguel On Wed, 12 Jun 2002, Brad McCrorey wrote: > This raises an interesting question (at least to me). I've had problems > like this before and had to hunt

Re: [PHP] Unlink question more or less

2002-06-11 Thread Miguel Cruz
On Tue, 11 Jun 2002, Tom Ray wrote: > I want to use unlink() to delete a wildcard, but at the moment I keep > getting parse errors. Here's what happening: > > I'm mucking around with some login stuff, when a user logs in it writes > a flat file that collects some information about them, the fla

Re: [PHP] Store/Retrieve Word Documents in MySQL/PHP?

2002-06-11 Thread Brad McCrorey
This raises an interesting question (at least to me). I've had problems like this before and had to hunt high and low for the mime type for a file. Does anyone know of a listing for mime types (besides going through the built-ins in the browser). Seems like a really handy resource. File it nea

Re: [PHP] subscription problem

2002-06-11 Thread Miguel Cruz
On Tue, 11 Jun 2002, Doug DeVries wrote: > Why am I getting all the messages from this newsgroup delivered to my > mailbox? > > I subscribed to the newsgroup -- or at least that is all I wanted. > >> To unsubscribe, visit: http://www.php.net/unsub.php The above link would be a good start. You d

Re: [PHP] Store/Retrieve Word Documents in MySQL/PHP?

2002-06-11 Thread Miguel Cruz
On Tue, 11 Jun 2002, Håkan Askengren wrote: > I have managed to load images to database through php, but what about other > file types as MS Word (yes I dare to mention it here...) > What headers etcetera are needed? Content-Type: application/msword miguel -- PHP General Mailing List (http:

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Lars Torben Wilson
On Tue, 2002-06-11 at 22:01, Tom Rogers wrote: > Hi > A revised cleanup function for multiple instances of the same class. > > $ref = array(); > class cRoute{ > var $txt; //identify the class > function cRoute($txt=""){ > global $ref; > $x = co

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Martin Towell
FYI: c and c++ do have goto -Original Message- From: JSheble [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 3:29 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] GOTO command. Doest it exist? I sure hope I'm not going to stir up any trouble, but why exactly would you need a GOTO

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread JSheble
I sure hope I'm not going to stir up any trouble, but why exactly would you need a GOTO statement? Many languages have no such construct because the ability to use functions or routines makes GOTO statements obsolete. They are most likley only in VB because it's a legacy thing, but AFAIK C, C++,

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Lars Torben Wilson
On Tue, 2002-06-11 at 22:27, Tom Rogers wrote: > > Hi > It was the register_shutdown_function(array($this, 'cleanup')); syntax > that had me stummped and looking for magic :) > > Tom Yeah, that needs to be explained a little better...hopefully I'll have time to fix up that page in the next f

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Tom Rogers
Hi It was the register_shutdown_function(array($this, 'cleanup')); syntax that had me stummped and looking for magic :) Tom snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] netscape wont show form result

2002-06-11 Thread Chris Shiflett
Well, my explanation to problem number 2 still stands. :) The browser cannot "ignore" code that you write on the server with PHP, such as exit. The HTTP response from the server is exactly the same regardless of browser unless you specifically take different actions according to the value of U

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Tom Rogers
Hi A revised cleanup function for multiple instances of the same class. txt = $txt; $ref[$x] =& $this; //setup a pointer //create a function $f_txt = 'global $ref; trigger_error("Please call close() to prevent probl

Re: [PHP] netscape wont show form result

2002-06-11 Thread Steve Fitzgerald
Thanks for your reply, but it was neither of these things :) An 'exit' directive had secretly sneaked into the script! which caused ns to abort the rest of the script (as it should) while ie blissfully ignored it(??). Anyway it all works now. Thanks again. Chris Shiflett wrote: > You are experie

[PHP] Postgres query problem

2002-06-11 Thread Aaron
I have a sql quer like this : " select a.title AS bugga, b.id AS asdf FROM tableone AS a FULL JOIN tabletwo AS b ON(a.title=b.filething)" anyway, thats a test query which is slightly smaller then the one I want. BUT when i use it from the command console in postgres, it works no problem but i

Re: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread David Robley
In article <001901c21190$c2ffc4e0$017f@localhost>, [EMAIL PROTECTED] says... > Many will tell you that the goto command is extinct. It isn't, it's just > evolved into the function command. What you do now is create a function: > > function some_name($variable,$other_variable,...) > { >

[PHP] Re: Email with PHP.

2002-06-11 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Well I have install the second version from the end :) .. in a slack box > with the latest apache server.. > > I tried to use the mail() function and it says that: > > Warning: mail() is not supported in this PHP build in . . . . . >

Re: [PHP] is preg_replace the fastest way?

2002-06-11 Thread Jason Wong
On Wednesday 12 June 2002 05:00, Zac Hillier wrote: > Hi All, > > I'm writing a search facility and am stripping noise words from a string > (The string contains between 50 - 200 words). Presently I'm importing a > text file of noise words (The noise words file contains almost 1000 words) > then u

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Tom Rogers
At 01:18 PM 12/06/2002, Lars Torben Wilson wrote: >On Tue, 2002-06-11 at 20:12, Tom Rogers wrote: > > Hi > > One way is to create an external reference to your class and use that in > > the cleanup function. To make the cleanup function visible it has to be > > declared inside the constructor (whi

RE: [PHP] Unlink question more or less

2002-06-11 Thread John Holmes
Just be aware that if the name is based on the username, it'll be easy for other people to guess the names of files on your computer and possibly inject code into it. Just something to be aware of. ---John Holmes... > -Original Message- > From: Tom Ray [mailto:[EMAIL PROTECTED]] > Sent:

Re: [PHP] netscape wont show form result

2002-06-11 Thread Chris Shiflett
You are experiencing two different problems. 1) The blank page you are seeing is possibly due to incorrect HTML markup, where you are using tables incorrectly (most common problem for people). Check to make sure you have the same number of data cells in each row, that all your tag are properly

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Lars Torben Wilson
On Tue, 2002-06-11 at 20:12, Tom Rogers wrote: > Hi > One way is to create an external reference to your class and use that in > the cleanup function. To make the cleanup function visible it has to be > declared inside the constructor (which makes it invisible to the rest of > the class:) This

Re: [PHP] Unlink question more or less

2002-06-11 Thread Tom Ray
Yeah they are, actaully I switched it to a static name and then added the time stamp as part of the information I'm gathering. Now I just re-write the file on each log in. John Holmes wrote: >You can't use wildcards. Use a system() or exec() call to do it. > >Why use the datetime part at all?

RE: [PHP] Unlink question more or less

2002-06-11 Thread John Holmes
You can't use wildcards. Use a system() or exec() call to do it. Why use the datetime part at all? The usernames are unique, right? ---John Holmes... > -Original Message- > From: Tom Ray [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 11:06 PM > To: [EMAIL PROTECTED] > Subject

[PHP] netscape wont show form result

2002-06-11 Thread Steve Fitzgerald
I. am testing a feedback form which consists of a single file with the standard '>' It has problems when using ns4.7. If the form is filled in correctly it works and sends email, but it checks for required fields and correct email address and if there is a mistake ns shows a blank page with the fo

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Tom Rogers
Hi One way is to create an external reference to your class and use that in the cleanup function. To make the cleanup function visible it has to be declared inside the constructor (which makes it invisible to the rest of the class:) This is how I have done it: close(); } } f

[PHP] Unlink question more or less

2002-06-11 Thread Tom Ray
I want to use unlink() to delete a wildcard, but at the moment I keep getting parse errors. Here's what happening: I'm mucking around with some login stuff, when a user logs in it writes a flat file that collects some information about them, the flat file is created with the name username.date

RE: [PHP] WHAT IS NEW to PHP 4.2.1

2002-06-11 Thread John Holmes
I'm banking it's your register_globals setting in PHP.ini. Set it to on, then read the release notes of the program you just installed so you can learn why you want it OFF. ---John Holmes... > -Original Message- > From: Septic Flesh [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 20

RE: [PHP] Include question

2002-06-11 Thread David Freeman
> somefile.php > $apple = 'green'; > $pear = 'yellow'; > ?> > > callfile.php > include 'somefile.php'; > echo "Apples are $apple and Pears are $pear"; \\ which would > return the > line with green and yellow in the correct spots. > ?> > > But when I just do > > include 'som

Re: [PHP] WHAT IS NEW to PHP 4.2.1

2002-06-11 Thread Chris Shiflett
This may be entirely incorrect, but something that might be worth checking is to find the SQL statements being executed for item 2) in your list and make sure that all values in the SQL statement have had addslashes() performed on them. For example, if your statement is something like: insert

[PHP] WHAT IS NEW to PHP 4.2.1

2002-06-11 Thread Septic Flesh
Well I have jsut updates to the latest PHP version.. I was running a shopping catalog that now does not work with the new update.. I access the Database to get 1). a list of available Product categories. (that works) 2). then from the selected category I get the available products that are in t

Re: [PHP] Include question

2002-06-11 Thread Tom Ray
Well I got it solved. It would help if I formatted my files correctly. Sorry about that, i've been messing with PHP for about a year now, but am now really diving into it so I may have stupid questions here and there :) TIA to all for help. John Holmes wrote: >Umm...that's what it's supposed

RE: [PHP] Include question

2002-06-11 Thread Peter
Tom, just did ur test on win2k php 4.2.1 with apache and when i just did .. i get a blank screen as I should the only way you should be getting anything is by calling the values... -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 12 June 2002 11:36 AM To:

Re: [PHP] Include question

2002-06-11 Thread Justin French
Check that you actually have wrapped around the PHP code in somefile.php that you include. Justin French on 12/06/02 11:36 AM, Tom Ray ([EMAIL PROTECTED]) wrote: > Yes, but according to http://www.php.net/manual/en/function.include.php > I should be able to delcare the include and then pull t

Re: [PHP] preg

2002-06-11 Thread Rasmus Lerdorf
Sounds like a weird thing to want to do, but this will do it: preg_replace('/(\w)\1$/','2',$str) -Rasmus On Wed, 12 Jun 2002, Zac Hillier wrote: > Does anyone know how I can use preg or any other function to identify a > double letter on the end of a string and then replace it. > > So 'foo'

[PHP] File download/upload

2002-06-11 Thread Brad Wright
Hello, Can anyone point me towards a tute (or any info) about using php to upload and download medium size (~500k-1meg) files into a mySQL database (as blob's i assume). Cheers, Brad Nel vino la verità, nella birra la forza, nell'acqua i bacilli

Re: [PHP] Include question

2002-06-11 Thread Tom Ray
Yes, but according to http://www.php.net/manual/en/function.include.php I should be able to delcare the include and then pull the information out normally. So by what the manual says I can do this somefile.php callfile.php But when I just do It prints: $apple = 'green'; $pear = 'yellow':

RE: [PHP] Include question

2002-06-11 Thread John Holmes
Umm...that's what it's supposed to do...it's "including" it... ---John Holmes... > -Original Message- > From: Tom Ray [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 9:29 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Include question > > I'm trying to use the include function in

[PHP] Include question

2002-06-11 Thread Tom Ray
I'm trying to use the include function in some PHP scripts, but when I do include 'config.inc'; or include 'config.php; It returns all the information in the file when I look at my test php file (which calls the include) Anyone know why this is? -- PHP General Mailing List (http://www.php.ne

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Martin Towell
functions are evolved version of gosub/call - not goto w/ goto, there's no way of returning back to where you came from, unless you use another goto -Original Message- From: hugh danaher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 10:52 AM To: php Subject: Fw: [PHP] GOTO com

Fw: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread hugh danaher
- Original Message - From: "hugh danaher" <[EMAIL PROTECTED]> To: "Carlos U. Cirello Filho" <[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]> Sent: Tuesday, June 11, 2002 2:41 PM Subject: Re: [PHP] GOTO command. Doest it exist? > Many will tell you that the goto command is extinct. It isn

RE: [PHP] get pwd on windows

2002-06-11 Thread Peter
Jim, Try it and find out ;) just do a simple echo of that and you find it does what it says it returns the path to the document root of ur sever ie where the page is located on the machine. Cheers Peter -Original Message- From: Jim lucas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 12 J

RE: [PHP] Installation and/or configuration problems w 4.2.1 on NT

2002-06-11 Thread Peter
George, your problem seems to be with your ACL ( Access Control List ) in other words the user permissions on the machine you are remotely logging into .. you need to have full Administrator rights inorder to install php onto NT.. get the People who are local to the machine to give you the full

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Rasmus Lerdorf
There are times where a GOTO is really the most efficient way to get out of a deeply nested set of loops or switches where the overhead of adding the additional checks at each level would be painful. There are 1125 gotos in the PHP C code. But, PHP has multi-level breaks to get around this situati

Re: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Edward Marczak
On 6/11/02 4:06 PM, "Chris Hewitt" <[EMAIL PROTECTED]> wrote: > Carlos, > > A search of the on-line manual does not find it > (http://www.php.net/manual) but even if it has, I would advise you not > to use it. Its a throwback to the 1970s before "structured programming". Sometimes, it's appropr

Re: [PHP] get pwd on windows

2002-06-11 Thread Jim lucas
what does $GLOBALS['DOCUMENT_ROOT'] return? Jim Lucas - Original Message - From: "Lazor, Ed" <[EMAIL PROTECTED]> To: "'Shane Wright'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, June 11, 2002 4:35 PM Subject: RE: [PHP] get pwd on windows > Will getcwd() work for you? > > Als

Re: [PHP] include_once("blah"); vs $blah="blah"; include($blah);

2002-06-11 Thread Jim lucas
is your isp using a unix machine or windows machine? if they are using a unix box then your backslash needs to be a forward slash "/", and if they are using a windows machine, your backslash needs to be escaped. --> "\\" other wise you are escaping the "b" in blah... Jim Lucas - Original

Re: [PHP] Emulating a class destructor

2002-06-11 Thread Lars Torben Wilson
On Tue, 2002-06-11 at 23:21, William_dw -- Sqlcoders wrote: > Hi there!, > I'm trying to emulate a class destructor, according to the PHP documentation > I can emulate this by using a call to register_shutdown_function(), > containing the function to be called upon shutdown. > > While this appare

Re: [PHP] regex

2002-06-11 Thread Jim lucas
$file = preg_replace('/^([a-z0-9\-\_]*).([a-z]{3,4})$/i', $new_file . ".$2", $_FILES['upload']['name']); Maybe this? Jim Lucas - Original Message - From: "Gerard Samuel" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Tuesday, June 11, 2002 3:11 PM Subject: [PHP] regex > Im ex

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Martin Towell
I've found that any language that supports "while", "do/while", "for" and "if/else" as well as functions/subroutines doesn't need "goto". IMO, you should be able to do code using just those basic elements (sequence, loops, conditions -> basic flowchart "commands") just my 2c worth -Original

RE: [PHP] get pwd on windows

2002-06-11 Thread Lazor, Ed
Will getcwd() work for you? Also, try phpinfo() to find out which variables are set. -Original Message- From: Shane Wright [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:45 AM To: [EMAIL PROTECTED] Subject: [PHP] get pwd on windows -BEGIN PGP SIGNED MESSAGE- Hash: S

RE: [PHP] Installation and/or configuration problems w 4.2.1 on NT

2002-06-11 Thread Lazor, Ed
I don't know the answer, but... It sounds almost like a server configuration issue. Almost as if the web server (Apache?) doesn't have the php extension configured correctly. -Original Message- From: George Pitcher [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 3:48 AM To: [EMAI

RE: [PHP] include_once("blah"); vs $blah="blah"; include($blah);

2002-06-11 Thread Martin Towell
if that's a direct copy of what you've got, then the parse error's probably to do with the "var" and not the "include_once" "var" is used only in classes... -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 11:11 PM To: [EMAIL PROTECTED] Subject: Re:

[PHP] preg

2002-06-11 Thread Zac Hillier
Does anyone know how I can use preg or any other function to identify a double letter on the end of a string and then replace it. So 'foo' would become 'f2' and 'bar' would not change. Thanks Zac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsu

Re: [PHP] Email with PHP.

2002-06-11 Thread Pushkar Pradhan
There's no special flag to compile the mail function. If you've installed it and it still doesn't work, try giving the path to sendmail in the line sendmail_path in php.ini In my file this line is commented out, seems like php detected the sendmail exec. at configure time. > Well I have install th

[PHP] Email with PHP.

2002-06-11 Thread Septic Flesh
Well I have install the second version from the end :) .. in a slack box with the latest apache server.. I tried to use the mail() function and it says that: Warning: mail() is not supported in this PHP build in . . . . . Well I notice that I haven't got sendmail installed, and so I installed

RE: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread David Freeman
> I do beg your pardon... But does PHP not have GOTO command? Why do you need one? In my experience, going right back to BASIC over 10 years ago, it's rarely _necessary_ to have a goto. In php I suspect you'd get similar functionlity out of either include() for creating functions. Not using

RE: [PHP] Arrays

2002-06-11 Thread Lazor, Ed
Create two database tables. One for categories and one for links. Here are the fields you want for categories: - ID - ParentID - Title The ParentID field allows you to create a hierarchy of categories - one category and it's sub-categories. For example: ID ParentIDTitle ===

Re: [PHP] regex

2002-06-11 Thread Gerard Samuel
Well Ive gotten (.*) and ([a-z]*[0-9]*_*-*) to work thus far as the first group. I would like to avoid option 1, and option 2 doesn't seem right Gerard Samuel wrote: > Im expecting a string like foo.png. > Im trying to replace 'foo' with another value that I have. > Im trying this -> > $

RE: [PHP] addslashes for db search?

2002-06-11 Thread Lazor, Ed
Can you put things in standard quotes? "'Aimburu" > -Original Message- > From: andy [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 12:44 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: [PHP] addslashes for db search? > > > Hi there, > > I have some db records star

Re: [PHP] How do I stop foreach if $menu not set??

2002-06-11 Thread hugh danaher
You should be able to contain your foreach statement within an if statement: if (isset($menu)) { foreach ($sub as $link => $name) ( $sublink .= "".$name.""; } else { print "menu variable not set" } Hope this helps. Hugh - Original Message - From: "Dan" <[EMA

[PHP] regex

2002-06-11 Thread Gerard Samuel
Im expecting a string like foo.png. Im trying to replace 'foo' with another value that I have. Im trying this -> $file = preg_replace('/([a-z][0-9]-_*)(.[a-z]{3,4})/i', $new_file . "$2", $_FILES['upload']['name']); The second regex group works ok, its the first one I cannot figure out. It is su

RE: [PHP] 405 Method Not Allowed with Post Request on PWS

2002-06-11 Thread Lazor, Ed
Could you post an example of the code you're working with? > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 10:32 AM > To: [EMAIL PROTECTED] > Subject: [PHP] 405 Method Not Allowed with Post Request on PWS > > > I'm running PHP 4.2

Fw: [PHP] Array into database

2002-06-11 Thread Kevin Stone
Yes I believe serialize will work with any array. When you extract it from the database simply do $array = unserialize($str) to rebuild the array. -Kevin - Original Message - From: "Leon Mergen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 11, 2002 3:59 PM Subject: Re:

Re: [PHP] How do I stop foreach if $menu not set??

2002-06-11 Thread Stuart Dallas
On Tuesday, June 11, 2002 at 10:59:13 PM, you wrote: > I Have worked out this, but when $menu is not set it does the foreach > function anyway, and desplays an error. > What Can I do to stop the foreach function from working if $menu is not > set?? http://www.php.net/isset -- Stuart -- PHP

RE: [PHP] How do I stop foreach if $menu not set??

2002-06-11 Thread Lazor, Ed
Change introduction to a variable with $ in front of it or put it in quotes "introduction". > What Can I do to stop the foreach function from working if > $menu is not > set?? > > if ($menu==(introduction)) {$sub = array( > 'overview.php' => 'Overview', > 'moreinfo.php' => 'More Info' > ); > }

[PHP] How do I stop foreach if $menu not set??

2002-06-11 Thread Dan
I Have worked out this, but when $menu is not set it does the foreach function anyway, and desplays an error. What Can I do to stop the foreach function from working if $menu is not set?? 'Overview', 'moreinfo.php' => 'More Info' ); } #These parts are topics and there may be more than two. if

Re: [PHP] Array into database

2002-06-11 Thread Stuart Dallas
On Tuesday, June 11, 2002 at 10:59:00 PM, you wrote: > So this would handle 2-demensional arrays too? > So, if I have > $array = ( > "foo" => "bar", > "wom" => "bat" > ); (erm, i know it's late, but that looks like a 1-dimensional associative array) > it would work? As far as I k

Re: [PHP] Array into database

2002-06-11 Thread Leon Mergen
So this would handle 2-demensional arrays too? So, if I have $array = ( "foo" => "bar", "wom" => "bat" ); it would work? And darn, that I didn't come up with this (I'm familliar with Java, and they use Serializable) ... "Stuart Dallas" <[EMAIL PROTECTED]> wrote in message [EMAIL

Fw: [PHP] Array into database

2002-06-11 Thread Kevin Stone
Not directly no. You can serialize the array and store it in a single text field. Or, if this array contrains data that you'll be retrieving often then you can construct a table and store each array element in a new row. -Kevin - Original Message - From: "Leon Mergen" <[EMAIL PROTECTED

Re: [PHP] Array into database

2002-06-11 Thread Stuart Dallas
On Tuesday, June 11, 2002 at 10:25:36 PM, you wrote: > I would like to know wether it's possible to put an array into a database? > If not, what is the best way to archieve something like that? Yes it is. See http://www.php.net/serialize -- Stuart -- PHP General Mailing List (http://www.php.

[PHP] Array into database

2002-06-11 Thread Leon Mergen
Hello, I would like to know wether it's possible to put an array into a database? If not, what is the best way to archieve something like that? Thanks in advance, Leon Mergen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread hugh danaher
Many will tell you that the goto command is extinct. It isn't, it's just evolved into the function command. What you do now is create a function: function some_name($variable,$other_variable,...) { some code here; } then, call it using : call_user_func('some_name',$variable,$other

[PHP] Re: is preg_replace the fastest way?

2002-06-11 Thread Scott Hurring
I think this is similar to what you're asking for, but it's probably slower (you have to split(), traverse, then join()) foreach ($noiselist as $noise) foreach ($inputlist as $input) if ($noise == $input) // do something -- Scott Hurring Systems Programmer EAC Corporation scott (*) e

[PHP] is preg_replace the fastest way?

2002-06-11 Thread Zac Hillier
Hi All, I'm writing a search facility and am stripping noise words from a string (The string contains between 50 - 200 words). Presently I'm importing a text file of noise words (The noise words file contains almost 1000 words) then using : #-- remove noisewords $cntLmt = count($noise_word

Re: [PHP] Re: Emulating a class destructor

2002-06-11 Thread Scott Hurring
In the 5 minutes i took to test it out, it seems that register_shutdown doesn't seem to like object methods (?) I did come up with a solution, but it't not really the best way to do things put cRoute_Destructor() into the same file as the class declarations, so that when you include() the clas

Re: [PHP] Re: Emulating a class destructor

2002-06-11 Thread Sqlcoders.com Programming Dept
> This is completely off the top of my head (i've never done this > before) -- but try single-quoting it to prevent interpolation > > register_shutdown_function('$this->cleanup()'); > Hiya, thanks for the suggestion, but i get the same 'Unable to call ...' message. Any other ways you can think of

Re: [PHP] Re: GOTO command. Doest it exist?

2002-06-11 Thread Scott Hurring
Well, IMO, the only languages that really need goto's are low-level ones like assembly and C. goto's are more trouble than they're worth when you get into structured or OO programming. -- Scott Hurring Systems Programmer EAC Corporation scott (*) eac.com -- "Carlos U. Cirello Filho" <[EMAIL PROT

[PHP] Re: Emulating a class destructor

2002-06-11 Thread Scott Hurring
This is completely off the top of my head (i've never done this before) -- but try single-quoting it to prevent interpolation register_shutdown_function('$this->cleanup()'); -- Scott Hurring Systems Programmer EAC Corporation scott (*) eac.com -- "William_dw -- Sqlcoders" <[EMAIL PROTECTED]> wro

Re: [PHP] Re: GOTO command. Doest it exist?

2002-06-11 Thread Carlos U. Cirello Filho
OK, Anyway goto's are bad and wrong things... And one shouldn't use it. I am wrong in trying to solve such problem using it. But I was really amazed that PHP did not have goto Kind Regards, Carlos Cirello "Jay Blanchard" <[EMAIL PROTECTED]> wrote in message 000e01c21183$ab49e590$8102a8c

Re: [PHP] cut text?

2002-06-11 Thread Scott Hurring
Try (this is untested) if (length($string) > 30) { print substr($string, 0, 30) ."..."; } else { print $string; } --OR-- (if you want to over-write $string) $string = ((length($string) >= 30) ? substring($string, 0, 30) ."..." : $string ); -- Scott Hurring Systems Programmer EAC Corporatio

Re: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Carlos U. Cirello Filho
I am affraid to say that there is indeed, however not under keyword goto but under commentaries of do while statements.. "Chris Hewitt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Carlos, > > A search of the on-line manual does not find it > (http://www.php

[PHP] Emulating a class destructor

2002-06-11 Thread William_dw -- Sqlcoders
Hi there!, I'm trying to emulate a class destructor, according to the PHP documentation I can emulate this by using a call to register_shutdown_function(), containing the function to be called upon shutdown. While this apparently works outside a class, I want to use it inside a class, in other wo

Re: [PHP] Comments / Question about XML?

2002-06-11 Thread Scott Fletcher
Havent' thought about that. That's what so great about UNIX!!! Windows, too picky Scott "Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hey Scott: > > > I also found out that I would need to recompile PHP with the "--xml" option. >

Re: [PHP] GOTO command. Doest it exist?

2002-06-11 Thread Chris Hewitt
Carlos, A search of the on-line manual does not find it (http://www.php.net/manual) but even if it has, I would advise you not to use it. Its a throwback to the 1970s before "structured programming". Regards Chris Carlos U. Cirello Filho wrote: >I do beg your pardon... But does PHP not hav

RE: [PHP] Re: GOTO command. Doest it exist?

2002-06-11 Thread Jay Blanchard
[snip] Subject: Re: [PHP] GOTO command. Doest it exist? [/snip] No, and you don't need it. The reason? Ask yourself, "what is the use of a GOTO?". Usually GOTO indicates a function of some sort, which you could easily replicate with a function() or switch() if you need to send your application in

Re: [PHP] Comments / Question about XML?

2002-06-11 Thread Analysis & Solutions
Hey Scott: > I also found out that I would need to recompile PHP with the "--xml" option. > That's suck! Will have to do it while the server is on live site. > Hopefully nothing will go wrong. (Cross my finger!). Why the fear? Do the make/build in a location other than where the live binary i

Re: [PHP] cut text?

2002-06-11 Thread Chris Hewitt
I'd probably use substr. For the first 30 characters plus three full stops (untested): $shortstring = substr($longstring,0,30)."..."; The manual shows all the string handling functions http://www.php.net/manual/en/ref.strings.php Regards Chris Hawk wrote: >Lets say I have a news text, and i

[PHP] Re: GOTO command. Doest it exist?

2002-06-11 Thread Carlos U. Cirello Filho
Non sequitur. C is a structured languaged and has goto. Why shouldn't PHP have goto? Sometimes is pointless bundle together HTML and PHP and keep it in a if statement or a function, like this if(TRUE){ ?> SHOW THIS SHOW THAT SHOW THIS SHOW THAT Yes... and it seems that there ain't any GO

Re: [PHP] get pwd on windows

2002-06-11 Thread Paul Roberts
just use php to do it getcwd() Paul Roberts [EMAIL PROTECTED] - Original Message - From: "Shane Wright" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 11, 2002 6:45 PM Subject: [PHP] get pwd on windows -BEGIN PGP SIGNED MESSAGE- Hash:

[PHP] GOTO command. Doest it exist?

2002-06-11 Thread Carlos U. Cirello Filho
I do beg your pardon... But does PHP not have GOTO command? Am I wrong? Carlos Cirello -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] cut text?

2002-06-11 Thread Jason Wong
On Wednesday 12 June 2002 03:36, Hawk wrote: > Lets say I have a news text, and in a menu, I just want to print the > first.. lets say 30 letters, and maybe add a "..." after, and link it to > the full text. substr(), wordwrap() -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open S

Re: [PHP] cut text?

2002-06-11 Thread Hawk
Lets say I have a news text, and in a menu, I just want to print the first.. lets say 30 letters, and maybe add a "..." after, and link it to the full text. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] register_globals flag in some directories

2002-06-11 Thread Chris Hewitt
Ahmed. If you changed the AllowOverride setting in httpd.conf, you will need to restart apache. I tried what I suggested here (on a RedHat 7.3 system) so I know its OK. In httpd.conf there can be many instances of AllowOverride, one per directory. Are you sure you changed the right one? Just

[PHP] Getting info from a realvideo file.

2002-06-11 Thread Rodolfo Gonzalez
Hello list, I'm wondering if there's any way to get the info of a realvideo file (resolution, author, and so on). I know rm is a closed format, but maybe you know of something, done either in PHP or in another language. Thank you, Rodolfo. -- PHP General Mailing List (http://www.php.net/)

  1   2   >