RE: [PHP] PHP object-oriented features

2001-12-16 Thread Martin Towell
I totally agree with you!! From what someone told me, the new version of the Zend engine will fully support OOP (but don't quote me on this as I haven't had time to look at the Zend site to confirm this) - I'm looking forward to seeing it. This would make PHP a really powerful language then!!

RE: [PHP] 'Select All'

2001-12-17 Thread Martin Towell
you _can_ reference it by name - try this: script function my_select(type) { frm = document.forms.test; ele = frm[mycheckbox[]]; len = ele.length; for (i = 0; i len; i++) ele[i].checked = type; } /script form name=test input type=button value=All

RE: [PHP] JavaScript php question - mainly JS though so slightly OT but hep needed!!! :o)

2001-12-18 Thread Martin Towell
if you have lots of links, then doing it this way, IMO, would be easier/better - so: script function windowPopup(xx) { window.open(info.php?patch=+xx, _new, windowattribs); } /script but if there's only a few links, then placing the window.open code in the link would be easiest, i think.

RE: [PHP] addslash/stripslashes

2001-12-19 Thread Martin Towell
When putting strings into form values (and maybe other places too), I would advise wrapping the variable in: htmlentities(); so this: INPUT TYPE=TEXT NAME=name VALUE=?= $string; ? would become this: INPUT TYPE=TEXT NAME=name VALUE=?= htmlentities($string); ? and magically

RE: [PHP] Slash problem

2001-12-19 Thread Martin Towell
either set magic_quotes_gpc to off in you .ini file - or use stripslashes() on the variable -Original Message- From: Evansville Scene [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 11:40 AM To: [EMAIL PROTECTED] Subject: [PHP] Slash problem I'm fairly new @ PHP, so

RE: [PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Martin Towell
My 2c worth... IMO, If you download a script and just blindly copy it to your system, then you're just asking for trouble, period - I think you should ALWAYS check code for anything that could be malicious and also check for any loopholes that need to be closed before using it. This might mean

RE: [PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Martin Towell
another 2c worth... So it's the programmer's responsibility to ensure all his/her code is as secure as possible. If it can be shown that it isn't secure, then the programmer should endevour to close that hole. This goes for any area that hackers can exploit, software and hardware...

RE: [PHP] How to save the result page generated by a Form?

2001-12-20 Thread Martin Towell
separate the email address with, can remember which now, either a comma or a semicolon - try one, if it does work, it must be the other :) -Original Message- From: Webleycity [mailto:[EMAIL PROTECTED]] Sent: Friday, December 21, 2001 3:52 PM To: Stefan Rusterholz; Joe Cc: PHP Subject:

RE: [PHP] Multiple JavaScript Windows with PHP

2001-12-20 Thread Martin Towell
I haven't tried your code, but I'm thinking what's happening is that the browsers that the code isn't working in is stopping at the returnwin=window.opener.navigate(urlLoc); line - what happens if you change it to returnwin=window.opener.location = urlLoc; ?? Original Message- From:

RE: [PHP] Beginner question?

2001-12-20 Thread Martin Towell
?php //$fp = fopen (C:/Program Files/localhost/info.txt, r); //$fp = fopen (http://compcanlit.ca/;, r); $fp = fopen (./info.txt, r); while (!foef($fp)) { $line = fgets($fp, 1024); echo $line; } fclose($fp); ? what you were doing was opening a file ready for reading and then printing the

RE: [PHP] Oracle

2002-01-01 Thread Martin Towell
there's the OCI* or ORA_* functions depending on the version of oracle you're using. -Original Message- From: Phillip B. Bruce [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 02, 2002 10:54 AM To: PHP Subject: [PHP] Oracle Hi, Has any one on this list worked with Oracle, Apache

RE: [PHP] ora_numrows() function

2002-01-02 Thread Martin Towell
someone left this comment on the php site - [EMAIL PROTECTED] at 27-Dec-2000 09:37 It is important to note that this function acts more as a counter of the number of rows fetched from the cursor. If you execute this prior to processing the cursor

RE: [PHP] Code not working in 4.1

2002-01-02 Thread Martin Towell
use: extract($GLOBALS); http://www.php.net/manual/en/function.extract.php -Original Message- From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 11:32 AM To: [EMAIL PROTECTED] Subject: [PHP] Code not working in 4.1 I used to run PHP 4.0.3 and at the

RE: [PHP] Holy Moly...

2002-01-02 Thread Martin Towell
This one's pretty good, IMO but as for the best - hmm... that would be a matter of personal opinion... :) -Original Message- From: Julie Hull [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 1:16 PM To: [EMAIL PROTECTED] Subject: [PHP] Holy Moly... Could someone please

RE: [PHP] Date aritmetic

2002-01-02 Thread Martin Towell
convert both in dates into a time stamp using mktime() subtract the two figures you get back then divide by 86400 (60sec/min * 60min/hr * 24hr/day) -Original Message- From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 12:57 PM To:

RE: [PHP] Date aritmetic

2002-01-02 Thread Martin Towell
This isn't to pick on Carlos, but I've notice there's heaps of ppl who don't read the manual, or do a search on the manual - I've found that many of my questions have been answered by doing a search on the docs -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent:

RE: [PHP] If Statement with more than one conclusion

2002-01-02 Thread Martin Towell
something like: If(in_array($ext, array(com, net, org, info)){ //Then do this } If(in_array($ext, com.uk, me.uk, org.uk)){ //Then do this } maybe?? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 4:22 PM To: php-general Subject:

RE: [PHP] Re: how can I add a variable to this sample

2002-01-03 Thread Martin Towell
$service_type_insert = $x['${key}service_type']; //returns empty even though I know a value is there change the single quotes to double, thusly: $service_type_insert = $x[${key}service_type]; 'cause PHP is using the literal ${key}service_type and not interpreting it -Original

RE: [PHP] no reply-to header?

2002-01-06 Thread Martin Towell
I thought that if there's no reply-to, then email clients will use the from as the reply to ?? -Original Message- From: Jimmy [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 3:22 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] no reply-to header? Hi All, I just

RE: [PHP] counting with dates (help!)

2002-01-07 Thread Martin Towell
You'll need to use Julian format (I think that the name for it) which is DDD - is the year and DDD is the number of days into the year. I'm unsure as to how to do this in PHP so you'll need to do some searching - unless someone knows... Would be nice to know exactly how to do it in case

RE: [PHP] counting with dates (help!)

2002-01-07 Thread Martin Towell
for my dates for that reason... Martin -Original Message- From: DL Neil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 08, 2002 10:42 AM To: Boget, Chris; 'Sander Peters'; [EMAIL PROTECTED]; Martin Towell Subject: Re: [PHP] counting with dates (help!) RE: [PHP] counting with dates

RE: [PHP] Webmail with Attach

2002-01-08 Thread Martin Towell
you just need to loop this part of the code: $msg_body .= \n\n--Message-Boundary\n; $msg_body .= Content-type: $attach_type; name=\$attach_name\\n; $msg_body .= Content-Transfer-Encoding: BASE64\n; $msg_body .= Content-disposition: attachment; filename=\$attach_name\\n\n; $msg_body .=

RE: [PHP] functions...

2002-01-08 Thread Martin Towell
it's possible to pass a variable number of parameters to a function $num = func_num_args(); for ($i = 1; $i $num; $i++) { $arg = func_get_arg($i); } try looking at these... -Original Message- From: Chris Hall [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002

RE: [PHP] Time

2002-01-08 Thread Martin Towell
date(d M Y, H:i:s, $replyby); -Original Message- From: Necro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 4:27 PM To: [EMAIL PROTECTED] Subject: [PHP] Time How can I make a variable which is the current time + 48 hrs?? I had $replyby = time() + 172800; But that returns

RE: [PHP] need help looping through each record with a query - stumped

2002-01-09 Thread Martin Towell
could you change this $query2 = (SELECT Month, Score FROM scores WHERE Username = '$Username'); to $query2 = (SELECT count(*) FROM scores WHERE Username = '$Username' and Score = 75 and Month in ('January', 'December', 'November', 'October')); $result2 = mysql_query($query2) or die

RE: [PHP] need help looping through each record with a query - st umped

2002-01-09 Thread Martin Towell
: Mehmet Kamil ERISEN [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 11:10 AM To: Martin Towell; 'Brian Tully'; PHP DB; PHP Subject: RE: [PHP] need help looping through each record with a query - st umped If you are querying the Score = 75 how are you ging to take the Consecutive requirement

RE: [PHP] Delete on exit

2002-01-09 Thread Martin Towell
http://www.php.net/manual/en/function.setcookie.php -Original Message- From: Ryan Kelley [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 12:34 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Delete on exit Exactly how would i do that. I am new to cookies. Please advise. Ryan

RE: [PHP] does this work?

2002-01-10 Thread Martin Towell
is this valid in PHP?? (haven't tried it myself yet...) $tempsql = SELECT COUNT(*) AS count FROM divisions; maybe it needs to be on one line??? -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 8:39 AM To: 'Erik

RE: [PHP] global/local var in a function

2002-01-10 Thread Martin Towell
change for(i=0;ib.value;i++) { to for(var i=0;ib.value;i++) { javascript is treating i as a global var so when you call itself, global i gets changed which will bugger up your loop - I've done this s many times and spent t many hours trying to debug, just to find I forgot to

RE: [PHP] A variable with a variable

2002-01-10 Thread Martin Towell
you'll be wanting pointers eg $Var_1_Stat = hello world; $Num = 1; $var_name = Var_${Num}_Stat; // set up the actual var name $Var_Call = $$var_name; // now reference the actual var echo $Var_Call; // should by hello world ... :) -Original Message- From: Yoed

RE: [PHP] Specific References Incident

2002-01-10 Thread Martin Towell
does this work?? change foreach ($this-children as $child) { to foreach ($this-children as $child) { -Original Message- From: Ken Kinder [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 10:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Specific References Incident I

RE: [PHP] New to list

2002-01-10 Thread Martin Towell
have a look at: http://www.php.net/manual/en/function.number-format.php -Original Message- From: Andrew [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 11:05 AM To: [EMAIL PROTECTED] Subject: [PHP] New to list Hello to you all! I am new to this list and I have a question that

RE: [PHP] How to get a function backtrace?

2002-01-13 Thread Martin Towell
Hmm... I've been wondering if a function to do this exists too... would be REALLY handing for debugging!! Anyone know?? -Original Message- From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 8:35 PM To: PHP Subject: [PHP] How to get a function backtrace?

RE: [PHP] PHP and search engine???

2002-01-13 Thread Martin Towell
you could try looking at http_referer or remote_host or something like that. Never tried it myself, but sounds like it'd work... dunno what the values for them would be though :( -Original Message- From: Dani [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 2:17 PM To: PHP LIST

RE: [PHP] IF Statements

2002-01-13 Thread Martin Towell
if (action == list) { if (isset($clientcode)) // or just if ($clientcode) would work... { // extended listing here } else { // normal listing here } } else if -Original Message- From: Necro [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 2:09 PM To:

RE: [PHP] splitting up an array into lines ...

2002-01-15 Thread Martin Towell
The problem is that this line: $rpm_list = `rpm -qa`; gives back a string, so use this: $rpm_list = `rpm -qa`; $rpm_list = explode(\n, $rpm_list); and see how that goes Martin -Original Message- From: Neil Mooney [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002

RE: [PHP] best way to approach dates

2002-01-20 Thread Martin Towell
Never worked with mysql but I would assume there's something like 'NOW' or now() or something similar, don't know how you'd put a different date in though :( timestamps are handy within php, you can then convert it to whatever format you want with date() or, if you wanted to go even further,

RE: [PHP] Variable referencing/substitution

2002-01-20 Thread Martin Towell
${$vNames[1]} = new value; // look at variable-variables in the manual for more info -Original Message- From: Gaylen Fraley [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 20, 2002 3:44 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable referencing/substitution How can this be done?

RE: [PHP] agh - what am I doing wrong - regular expressions

2002-01-20 Thread Martin Towell
try this... I changed 1. the double quotes in $pattern = ... to single quotes 2. escaped the ? 3. used ereg_replace to do everything, dropping the while loop $content = http://www.globalhealth.org/text.php3?id=151 adjfladjfajdfkladfjl;kadjf jlkadjflkajdflkj

RE: [PHP] Re: PHP-JavaScript

2002-01-20 Thread Martin Towell
the only way php is going to know about a variable is if the server the script is on is sent the variable, the normal way of doing that is through posting/getting a page/script Martin -Original Message- From: Andrew V. Romero [mailto:[EMAIL PROTECTED]] Sent: Monday, January 21, 2002

RE: [PHP] PHP to another language

2002-01-20 Thread Martin Towell
*light hearted reply* blasphemy! sacrilege!! how can you ask a php mail list about converting code to another language?? (paraphase coming...) php is the one true language and you shall not code any other language before it :) Martin -Original Message- From: Andrew V. Romero

RE: [PHP] ok, I ask again.. how to encrypt to be able to match database info?

2002-01-21 Thread Martin Towell
whichever way the original password was encrypted, encrypt the incoming password the same way, ie. if the original was encrypted in php, encrypt the incoming password in php before passing it to the sql statement, similarly if the original password was encrypted using mysql. Martin

RE: [PHP] file upload with story

2002-01-21 Thread Martin Towell
I'm assuming all this data is coming in from a form - somewhere in the manual (too lazy at the monent to look where) there's a section on how to upload files. Once a file is uploaded (in your case, an image), just move it to somewhere accessable. Have field in the database that contains the name

RE: [PHP] Re: easy question

2002-01-23 Thread Martin Towell
and I think, also, if it's the last command then you don't need to semi-colon (I put it in anyway for completeness, etc) found that out by accident... -Original Message- From: val petruchek [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 1:02 AM To: PHP Subject: Re: [PHP] Re:

RE: [PHP] to evaluate ...

2002-01-23 Thread Martin Towell
try changing: echo $$temp\n; to echo $$temp.\n; or even echo ${$temp}.\n; does that work? -Original Message- From: Thorsten Wandersmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 12:16 PM To: [EMAIL PROTECTED] Subject: [PHP] to evaluate ...

RE: [PHP] Form Problem

2002-01-23 Thread Martin Towell
somewhere in the form put: input type=\hidden\ name=\Dno\ value=\$Dno\ -Original Message- From: Michael P. Carel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 1:48 PM To: php Subject: [PHP] Form Problem Hi there, I have a problem here regarding the form table name

RE: [PHP] I lost the message...

2002-01-23 Thread Martin Towell
$result = `ls foo*`; // :) :# ??? Martin -Original Message- From: Todd Cary [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 3:17 PM To: [EMAIL PROTECTED] Subject: [PHP] I lost the message... I am embarrassed to say that I lost the anser to my question on the syntax

RE: [PHP] seems easy...

2002-01-23 Thread Martin Towell
$limit = 5000; if(strlen($text) $limit) { $text = substr($text, 0, $limit); $text .= ...sorry, text was too long; } -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 3:34 PM To: php Subject: [PHP] seems easy... Hi, Really

RE: [PHP] set_time_limit() in a loop

2002-01-24 Thread Martin Towell
your first thought was correct - it sets it to 1800, it's NOT accumulative. it would have something to do with ignore_user_abort(true); and also is your while loop's exit check working? Martin -Original Message- From: Matthew Delmarter [mailto:[EMAIL PROTECTED]] Sent: Friday, January

RE: [PHP] A link

2002-01-24 Thread Martin Towell
ok, i wont!! not trying to do reverse psychology are you? -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 11:34 AM To: [EMAIL PROTECTED] Subject: [PHP] A link [link snipped] Don't click the above link.

RE: [PHP] set_time_limit() in a loop

2002-01-24 Thread Martin Towell
-Original Message- From: Matthew Delmarter [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 11:56 AM To: Martin Towell Cc: PHP Mailing List Subject: RE: [PHP] set_time_limit() in a loop I should also mention that the loop is sending mail using mail(). Is it possible

RE: [PHP] array[] and Javascript.

2002-01-24 Thread Martin Towell
syntax: document.forms[form_name].elements[element_name] so: document.forms[fname].elements[array[]].somethingelse -Original Message- From: Rodolfo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 1:55 PM To: [EMAIL PROTECTED] Subject: [PHP] array[] and Javascript.

RE: [PHP] Mpeg

2002-01-28 Thread Martin Towell
http://www.wotsit.org/search.asp?page=2s=animated I haven't looked at the docs there for mpeg - but the other one's i've looked at are really useful... Martin -Original Message- From: Jon Farmer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 12:22 AM To: Edward van

RE: [PHP] Help with Logical 'OR'

2002-01-28 Thread Martin Towell
basically it's to do with lazy evaluation or whatever it's called * logical expressions are read from left to right. * with OR, the expression reading is halted when the first TRUE is found * with AND, the expression reading is halted when the first FALSE is found so with : if

RE: [PHP] How? :)

2002-01-29 Thread Martin Towell
-- $news = mysql_query(select * from bookmarks ORDER by TNum,AU asc); $old_TNum = ; while ($mydata = mysql_fetch_object($news)) { if ($old_TNum != $mydata-TNum) #when TNum occurs the first time, echo it once only.

RE: [PHP] Change Text to CAPS.

2002-01-29 Thread Martin Towell
strtoupper() -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 2:12 PM To: [EMAIL PROTECTED] Subject: [PHP] Change Text to CAPS. Is there anyway that I can change a string with lettle letters to caps? Philip J. Newman Philip's

RE: [PHP] '' and \ - How do you avoid removing these?

2002-01-29 Thread Martin Towell
there's a directive in the php.ini file, something like magic_quotes or something (too lazy to look...), set that to 0 (zero) or use stripslashes() (this might have an underscore in the name, again too lazy to check) on the vars Martin -Original Message- From: Jon [mailto:[EMAIL

RE: [PHP] John: [PHP] How? :)

2002-01-29 Thread Martin Towell
:) http://DELETETHISccl.flsh.usherb.ca/bookmarks/DELETETHIS Martin Towell wrote: -- $news = mysql_query(select * from bookmarks ORDER by TNum,AU asc); $old_TNum = ; while ($mydata = mysql_fetch_object($news

RE: [PHP] Swapping BR for \n... ?

2002-01-29 Thread Martin Towell
Isn't there a function br2nl() and it's relative nl2br() ?? -Original Message- From: Jason Murray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 3:14 PM To: 'Jon'; [EMAIL PROTECTED] Subject: RE: [PHP] Swapping BR for \n... ? I'm processing a form but all the functions

RE: [PHP] Could somebody PLEASE explain this one to me

2002-01-29 Thread Martin Towell
dunno if this'll help, but try changing these two lines $this-$obj = new test1; $test = new test2; to these $this-$obj = new test1; $test = new test2; see if that helps - other than that - anyone else? -Original Message- From: Aric Caley [mailto:[EMAIL PROTECTED]] Sent: Wednesday,

RE: [PHP] wait for existance of a remote file.....

2002-01-30 Thread Martin Towell
1. look for it 2. if it's not there 2a. wait a bit 2b. go back to 1. -Original Message- From: Wade Barrance [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 10:57 AM To: [EMAIL PROTECTED] Subject: [PHP] wait for existance of a remote file. I need a function that will

RE: [PHP] .

2002-01-30 Thread Martin Towell
sure about that ? -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 2:10 PM To: [EMAIL PROTECTED] Subject: [PHP] . . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: [PHP] redirection rather than include()

2002-01-31 Thread Martin Towell
use: { header(location: new_full_url_here); exit; } -Original Message- From: Benjamin deRuyter [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 9:42 AM To: PHP Subject: [PHP] redirection rather than include() This is a PHP newbie trying to figure something out. I am creating

RE: [PHP] table row

2002-01-31 Thread Martin Towell
something like ? $cntr = 0; echo tr; while ($r = mysql_fetch_array($result0)) { $cntr++; $cityid = $r[t_city_id_city]; $cityname = $r[t_city_name]; echo td class=\text\a href=\city_person.php?city_id=$cityid\$cityname/a/td ; if ($cntr % 2 == 0) echo

[PHP] suppressing division by zero errors

2002-01-31 Thread Martin Towell
Is there a way to suppress division by zero errors? echo 5/0; // this give a warning - obviously!! @echo 5/0; // this gives a parse error echo @5/0; // this still comes up with a warning unless I turn error_reporting off before and turn it back on afterwards, but I don't want to do that

RE: [PHP] suppressing division by zero errors

2002-01-31 Thread Martin Towell
PROTECTED]] Sent: Friday, February 01, 2002 10:17 AM To: [EMAIL PROTECTED] Cc: Martin Towell Subject: Re: [PHP] suppressing division by zero errors You really need to do some error checking on the denominator. $num = 5; $den = 0; echo $den != 0 ? $num/$den : 0; A number divided by zero isn't

RE: [PHP] suppressing division by zero errors

2002-01-31 Thread Martin Towell
that's alright - i'm using 4.0.6 and the suppression works thnx again -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 10:33 AM To: Christopher William Wesley Cc: [EMAIL PROTECTED]; Martin Towell Subject: Re: [PHP] suppressing

RE: [PHP] ereg_replace help

2002-02-03 Thread Martin Towell
$lines = file(filename_here.blah); // read in file as an array $content = implode(\n, $lines); // join it all back together $new_cont = ereg_replace(from, to, $content); fopen(...); fputs(..., $new_content); fclose(...); if your intent is to replace all new lines with br's then use this

RE: [PHP] ereg_replace help

2002-02-03 Thread Martin Towell
that purpose as well. See the Strings section of the Functions Reference in the manual. Mike Frazer Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $lines = file(filename_here.blah); // read in file as an array $content = im

RE: [PHP] PHP Classes and Sessions

2002-02-04 Thread Martin Towell
i believe you're meant to serialise objects and then register the serialised version?? Don't quote me on that, never used sessions, but I didn't read/hear it somewhere Martin -Original Message- From: PHP-List [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 4:30 PM To:

RE: [PHP] Problem...header already sent by

2002-02-04 Thread Martin Towell
you have : 24. header(www-Authenticate: Basic realm='Private'); 25. header(HTTP/1.0 401 Unauthrized); I have (and this works) Header (WWW-authenticate: Basic realm=\$blah\); Header (HTTP/1.0 401 Unauthorized); * Unauthrized should be Unauthorized - missing o -Original

RE: [PHP] How do I display variables in text boxes when the value of a drop down menu changes?

2002-02-05 Thread Martin Towell
to access php var in javascript, you'll need to set up javascript vars with the values of the php vars you want to use. eg. ? $foobar = testing; ? script alert(foobar); // will display nothing - not set yet foobar = ?= $foobar; ?; alert(foobar); // now will display testing /script

RE: [PHP] MySQL selecting the maximum value from a column

2002-02-05 Thread Martin Towell
what happens if you do this? $result = mysql_query(SELECT MAX(Thought_Num) as Thought_Num FROM quotes,$db); I'm thinking that the column name in your original query is being called MAX(Thought_Num) and not Thought_Num. Martin -Original Message- From: Melanie Gann [mailto:[EMAIL

RE: [PHP] Fw: why !^ in email?

2002-02-06 Thread Martin Towell
I think it has something to do with the lines being too long, try throwing in a few carriage returns and see if that solve your problem Martin -Original Message- From: nina [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 5:21 PM To: [EMAIL PROTECTED] Subject: [PHP] Fw:

RE: [PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Martin Towell
that should be okay - it's to make sure that it is exactly equal to (as opposed to equates to be equal to) eg (0 === false) = false (0 == false) = true -Original Message- From: Ben Crawford [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:28 AM To: [EMAIL PROTECTED]

RE: [PHP] Re: XML closing elements called for tag /

2002-02-06 Thread Martin Towell
if you set up the xml_set_character_data_handler(), maybe this isn't called for tag /, but it will be called for tag/tag (??) you might want to check that 'cause I haven't :) Martin -Original Message- From: Christian Stocker [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002

RE: [PHP] cURL and XML?

2002-02-06 Thread Martin Towell
this is what I'm using: $ch = curl_init($gat_url); // url to post to curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); // contains the XML curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $x = curl_exec($ch); curl_close($ch);

RE: [PHP] Using functions before they're defined

2002-02-07 Thread Martin Towell
I've found that you can specify a function anywhere in the page and call it anywhere in the page so: ? foobar(); function foobar() { echo in foobarbr\n; } foobar(); ? would work and display the text twice, without errors/warnings I haven't looked at the php's source code, but maybe it's a two

RE: [PHP] Regex function needed

2002-02-07 Thread Martin Towell
what about words at the start of the string?? eg $str = One can see this is or was a test for short words, although an, should be deleted to.; -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 10:47 AM To: [EMAIL

RE: [PHP] Regex function needed

2002-02-07 Thread Martin Towell
what about? $str = a bc def ghij klmno p qr i'd do, it. stu vwxy a; $az = [a-zA-Z']; $str = str_replace(,, , , $str); $str = str_replace(., . , $str); $str = trim(preg_replace(array(/ $az /, / $az$az /, / $az$az$az /), , $str )); // couldn't get / [a-zA-Z]{1,3} / to work :( $str =

RE: [PHP] Checking for plus signs?

2002-02-07 Thread Martin Towell
remember to escape the escape character so php passes it onto the reg.ex. function correctly, so: if(eregi(\\+,$variable)) -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 12:54 PM To: Jim Lucas [php]; Leif K-Brooks; [EMAIL PROTECTED]

RE: [PHP] http://

2002-02-07 Thread Martin Towell
try this: $str = $s24; // this is the string you want to look at... $dst = 'a href=\\1\\1/a\\2'; foreach (array(http://;, mailto:;, telnet:, news:;) as $src) { $str = ereg_replace((.$src.[^ ]*)( *), $dst, $str); } echo $str; -Original Message- From: jtjohnston [mailto:[EMAIL

RE: [PHP] Execing problems

2002-02-07 Thread Martin Towell
does using system() work? what about back-ticks? - `funky script stuff here`; -Original Message- From: Jason Rennie [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 3:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Execing problems Hi all, I have a seperate perl script that I

RE: [PHP] determining script url

2002-02-07 Thread Martin Towell
I think what'll you'll need to do is look through the phpinfo() output and piece together all the parts, eg $HTTP_HOST (or should that be $_HTTP[HOST] ?), $PHP_SELF, etc. If anyone knows of a better way, I'd like to know too Martin -Original Message- From: [EMAIL PROTECTED]

[PHP] call stack

2002-02-07 Thread Martin Towell
I know this comes up again, and again, and I'm bringing it up again now :) There's been requests for a function that displays the current heirachy of calls I was just thinking about this - php must maintain a stack so that it knows what function to return to when another function exits, why can't

RE: [PHP] escaping ?

2002-02-10 Thread Martin Towell
what about this? $contents = str_replace('?xml version=1.0?'.'', '', $contents); -Original Message- From: Steven Jarvis [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 09, 2002 8:46 AM To: [EMAIL PROTECTED] Subject: [PHP] escaping ? I'm trying to do some string replaces on XML

RE: [PHP] Forms and IE

2002-02-10 Thread Martin Towell
might be the header(location...); bit - you might need to specify the full address -Original Message- From: Sean Hurley [mailto:[EMAIL PROTECTED]] Sent: Monday, February 11, 2002 3:40 PM To: [EMAIL PROTECTED] Subject: [PHP] Forms and IE Please forgive me if this has been covered

RE: [PHP] image generation issues

2002-02-11 Thread Martin Towell
when you say it doesn't work, do you mean that you get an error message or it just doesn't write the text to the image? -Original Message- From: Adrian Murphy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 1:16 PM To: [EMAIL PROTECTED] Subject: [PHP] image generation issues

RE: [PHP] image generation issues

2002-02-11 Thread Martin Towell
, 2002 2:04 PM To: Martin Towell; [EMAIL PROTECTED] Subject: Re: [PHP] image generation issues i get 'Could not read font in..' i set permissions to 777 on both file and folder - Original Message - From: Martin Towell [EMAIL PROTECTED] To: 'Adrian Murphy' [EMAIL PROTECTED]; [EMAIL PROTECTED

RE: [PHP] PHP Work in New York

2002-02-12 Thread Martin Towell
I guess I'm lucky living in Australia then - there's quite a few places using ASP but there's a HUGE increase in the number of businesses who are starting to use PHP. Maybe you should all move to Oz?? hehehe :) Martin -Original Message- From: Jason Murray [mailto:[EMAIL PROTECTED]]

RE: [PHP] Limiting use on public scripts.

2002-02-12 Thread Martin Towell
maybe have a client id that they need to send with each request and have the checking script use that, instead of the ip or url, etc -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:32 AM To: [EMAIL PROTECTED] Subject: [PHP] Limiting

RE: [PHP] Troubles With Mail Function

2002-02-12 Thread Martin Towell
Have you set up the [mail function] section of your php.ini file ? -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 12:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Troubles With Mail Function Hello. I'm pretty new to PHP, so if this is a

RE: [PHP] Troubles With Mail Function

2002-02-12 Thread Martin Towell
Function No I haven't. How do I do that Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Have you set up the [mail function] section of your php.ini file ? -- PHP General Mailing List (http://www.php.net/) To unsubscrib

RE: [PHP] Filling Forms with $variables

2002-02-13 Thread Martin Towell
also remember that strictly speaking, _all_ html attribute values _should_ be quoted -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:07 AM To: PHP Subject: RE: [PHP] Filling Forms with $variables Enclose the value in quotes, like

RE: [PHP] Troubles With Mail Function

2002-02-13 Thread Martin Towell
I think the SMTP would be same as you use for your email client (outlook, eudora, other?) -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 11:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Troubles With Mail Function Alright, I will show

RE: [PHP] Anyway to open a PHP file and view its code in thebrowser?

2002-02-14 Thread Martin Towell
yeah - going through a seb server, you're going to get the executed version of the code and not the code itself. -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 9:19 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Anyway to open a PHP file

RE: [PHP] Anyway to open a PHP file and view its code in the browser?

2002-02-14 Thread Martin Towell
symbolic links are basically pointers to another file/directory eg. you have a file foo.html you can create a symbolic link to it and call it bar.html - if you refer to bar.html, then you're really referring to foo.html why are they useful ? well, suppose you want a two or more files/dirs

RE: [PHP] fopen

2002-02-14 Thread Martin Towell
or read the original file into memory, reopen the file for writing, write the first prepend bit, then write what you just read -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 1:18 PM To: John Smythe Cc: [EMAIL PROTECTED] Subject: Re:

RE: [PHP] searching key words from a database field

2002-02-14 Thread Martin Towell
Something at the top - :) -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 2:47 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] searching key words from a database field In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... try something

RE: [PHP] Polymorphism question

2002-02-17 Thread Martin Towell
A bit late in replying - but what the hay (or is that hey??) oh well... From my understanding of virtual functions (and it's been at least 3 to 4 years since I've done C++) is that a virtual function has basic functionality and a pure virtual function has no, and can't have, and code. Please

  1   2   3   4   5   6   7   >