RE: [PHP] how to popup a new browser window from php

2002-04-18 Thread Martin Towell
use vbscript :P otherwise no - php = server - [java|vb]script = client -Original Message- From: Wo Chang [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 9:15 AM To: [EMAIL PROTECTED] Subject: [PHP] how to popup a new browser window from php Dear All, One simple question: Is th

RE: [PHP] PHP @ 24-hour programming competition

2002-04-21 Thread Martin Towell
Firstly, since you can take in already written code, if you have a lot of pre-written generic code, that would be good. > We're really interested in your opinions - is this feasible or > are we just plain mad? :) You've probably both - aren't all programmer mad? -Original Message- Fro

RE: [PHP] Better standards in PHP-coding

2002-04-21 Thread Martin Towell
(Just got back from the weekend) Just my 2c worth IMHO, as long as the code is indented "properly", it doesn't matter where the braces are, just be consistant. Personally, I prefer to put the opening brace on a new line, but I can just as easily read other people's code when the opening brace is

RE: [PHP] From where was function called?

2002-04-22 Thread Martin Towell
um - (unix) grep (windows) find files That's something that I've been wanting for a while - a function call stack that the php script can look at. -Original Message- From: Nico van der Dussen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 3:04 AM To: [EMAIL PROTECTED] Subject:

RE: AW: [PHP] Re: Second opinion needed - javascript blocker

2002-04-22 Thread Martin Towell
What about: 1. getting rid of anything between "" 2. get rid of any attributes that start with " on" and end with a quotes or space Maybe I'm forgetting about some valid attributes that start with "on", you might have to cater for them Does this work? HTH Martin

RE: [PHP] Unsubscribe?

2002-04-22 Thread Martin Towell
[snip from bottom of msgs] PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php [end snip] -Original Message- From: Josiah Wallingford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 10:38 AM To: [EMAIL PROTECTED] Subject: [PHP] Unsub

RE: [PHP] Why isn't this working? :(

2002-04-22 Thread Martin Towell
> Can someone try to figure out what's wrong with my code? What are you expecting, and what are you seeing? -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 11:12 AM To: [EMAIL PROTECTED] Subject: [PHP] Why isn't this working? :( I have a

RE: [PHP] Interesting Links, can be not PHP

2002-04-22 Thread Martin Towell
it's a "bookmark" basically, it's telling the browser to scroll the page down until it finds the named bookmark eg Top of page blah... ... go to top clicking on that link will scrol the page to "top" in your case, it's a "no-name" bookmark, and most browsers treat this as either "don't move" o

RE: [PHP] ASP to PHP

2002-04-23 Thread Martin Towell
I used it for a site I did. The code wasn't doing anything too funky. Just simple accesses to adodb and also simple form manipulation - worked like a treat. Although, the database stuff, it converts it the standard PHP functions, but I had some classes for that, so I still had to manually go thro

RE: [PHP] Re: Wich Database abstration layer?

2002-04-23 Thread Martin Towell
I hope we're not going to get into the "this db class is better than that one" thread again -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 9:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Wich Database abstration layer? Hello, Javier wr

RE: [PHP] how to give vars to a php(shell env) script?

2002-04-23 Thread Martin Towell
try setting an environment variable before calling your script -Original Message- From: Hermann Bier [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 12:34 PM To: [EMAIL PROTECTED] Subject: [PHP] how to give vars to a php(shell env) script? Hi NG! how could i give some vars

RE: [PHP] SQL Warning

2002-04-23 Thread Martin Towell
or make it $config[prefix] -Original Message- From: Jason Murray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 1:51 PM To: 'Jennifer Downey'; [EMAIL PROTECTED] Subject: RE: [PHP] SQL Warning > Would you please direct your attention to this URL > > http://testphp.netfirms.

RE: [PHP] SQL Warning

2002-04-23 Thread Martin Towell
The reason why I said that is 'cause the array was inside quotes, so quoting again would break out of the original quotes -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 2:03 PM To: Jason Murray Cc: [EMAIL PROTECTED] Subject: RE: [PHP] SQL W

RE: [PHP] lookin for a Menuing System...

2002-04-28 Thread Martin Towell
javascript should be easy enough to convert to php - thier language constructs are basically the same. I even found out, by accident, that you can have dollar signs ($) in front of javascript variables (in ie5.5 at least, haven't tried it in other browsers) -Original Message- From: Migu

RE: [PHP] Last time Append line to text file

2002-04-28 Thread Martin Towell
or you could code it like this: $file_pointer = fopen('/public_html/emails.txt', "a") if (!$file_pointer) exit; -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 2:34 PM To: Richard Emery Cc: [EMAIL PROTECTED] Subject: Re: [PHP]

RE: [PHP] lookin for a Menuing System...

2002-04-28 Thread Martin Towell
We have 1 or 2 clients that have js disabled because of "security" Also, I very often use Lynx (the text browser, not the game :) ) to browse the web. -Original Message- From: michael kimsal [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 2:46 PM To: [EMAIL PROTECTED] Subject: Re:

RE: [PHP] lookin for a Menuing System...

2002-04-28 Thread Martin Towell
> Konqueror is the only browser (that I've used) which supports per-site > javascript policy (deny, allow, disable pop-ups). Actually, Opera support this too - one reason why I do a lot of my browsing in Opera or Lynx, no pop-ups :) -- PHP General Mailing List (http://www.php.net/) To unsubscr

RE: [PHP] function not returning value

2002-04-30 Thread Martin Towell
you're only returning the value, and not setting the global variable you could place a "global $handle_guess:" as the first line of your function or you could do "$handle_guess = get_handle($lastname, $firstname);" -Original Message- From: Mark Pelillo [mailto:[EMAIL PROTECTED]] Sent: We

RE: [PHP] Variables from XML Documents

2002-05-06 Thread Martin Towell
look at xml_set_character_data_handler() it works fine for me xml_parser = xml_parser_create(); xml_set_object($this->xml_parser, $this); xml_set_element_handler($this->xml_parser, "start_element", "end_element"); xml_set_character_data_handler($this->xml_parser, "character_data");

RE: [PHP] Date Q

2002-05-09 Thread Martin Towell
if you insist in using your existing loop, try this (in pseudo-code) min_date = some really large date (31-Dec-2100 maybe?) max_date = some really small date (01-Jan-1970 maybe?) while (row = fetch(result)) { if (curr_date > max_date) max_date = curr_date if (curr_date < min_date) min_date

RE: [PHP] Generate inline image

2002-05-12 Thread Martin Towell
HTML docs only contain text. If you want images "inline" then you use the tag. -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 10:31 AM To: [EMAIL PROTECTED]; php Subject: Re: [PHP] Generate inline image Your tag calls a script (imagemaker.

RE: [PHP] How can obtain referer's name?

2002-05-12 Thread Martin Towell
if you have the globals setting in your ini file set to "on" then you can use: $HTTP_REFERER otherwise, I think, it's found in $_SERVER["HTTP_REFERER"] - just check for something like that in phpinfo(); -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 200

RE: [PHP] Re: MySQL or FlatFile

2002-05-12 Thread Martin Towell
If the content is going to be the same each time, then loading from a flat-file would probably be better, because accessing a database would require the connection to be established, the database to parse and execute your query, then send that data back. Where as reading from the file, it's just o

RE: [PHP] inserting data to mutliple mysql tables

2002-05-12 Thread Martin Towell
Isn't this more of a database question than a PHP question? -Original Message- From: Peter [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 1:38 PM To: Php Subject: [PHP] inserting data to mutliple mysql tables Hi, I have a table that's full of references to indexs in other tables

RE: [PHP] Generate inline image

2002-05-12 Thread Martin Towell
yep, then in the file generateimage.php you'd have obviously, the above "code" is for png, but you can use any that your gd library/broswer supports. -Original Message- From: Engineering Software Center [mailto:[EMAIL PROTECTED]] Sent: Monday, May 13, 2002 2:42 PM To: M

RE: [PHP] version differences

2002-05-13 Thread Martin Towell
a little look at: http://www.php.net/manual/en/function.sprintf.php shows: (PHP 3, PHP 4 >= 4.0.0) and a look at: http://www.php.net/manual/en/function.floatval.php shows: (PHP 4 >= 4.2.0) So that's where your problem is Martin -Original Message- From: baldey_uk [mailto:[EMAIL PROTECT

RE: [PHP] make hitting enter in a text box =

2002-05-13 Thread Martin Towell
when the data gets to php, do a $str = str_replace("\n", "", $str); (not tested, but should work) HTH Martin -Original Message- From: Rob Packer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 2:33 PM To: [EMAIL PROTECTED] Subject: [PHP] make hitting enter in a text box = I h

RE: [PHP] Problem with the double quotes

2002-05-13 Thread Martin Towell
You shouldn't need to addslashes() if you read from a file, only for string literals, like in your test. Are the file(s) you're reading in, just text files? If so, try doing your code with the file read commands and you should see you don't need to addslashes() -Original Message- From: M

RE: [PHP] Where's the error?

2002-05-13 Thread Martin Towell
$line = $fcontents[i]; should read $line = $fcontents[$i]; -Original Message- From: Josh Edwards [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 1:02 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Where's the error? Thanks heaps for your help I really appreciate it. I have made

RE: [PHP] Where's the error?

2002-05-13 Thread Martin Towell
that'll prob. be: $lastdate = getmydate($fcontents[count($fcontents)-1]); remember that array indexes start at 0, hence the "-1" bit -Original Message- From: Josh Edwards [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 14, 2002 1:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Where's the er

RE: [PHP] Sessions Without Cookies or SID Passing...

2002-05-14 Thread Martin Towell
You're missing one method - using the user's IP address It's not a guaranteed fool-proof method, but if you don't want to use cookies or the URL, then this sorta works. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 15, 2002 10:04 AM To: Matthew Wa

RE: [PHP] Generate every possible combination

2002-05-15 Thread Martin Towell
recursive function, passing back in the array, minus the current position and current combination. when array is empty, use current combination. um... something like (but not tested) function comby($arr, $comb = "") { $num = count($arr); if ($num == 0) { echo $comb; return; }

RE: [PHP] class and error handling

2002-05-15 Thread Martin Towell
Have a look at this page http://www.php.net/manual/en/function.set-error-handler.php and at the user comments dated: "09-Sep-2001 03:16" and "01-Mar-2002 11:52" these might help you Martin -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002

RE: [PHP] while loop question - problem (new set of eyes needed)

2002-05-19 Thread Martin Towell
Line 13 is re-assigning $result, the save variable you're using in line 1! 1 while($row = mysql_fetch_array($result)) 2 { 3$pri = $row['pri']; 4$fg = $row['fg']; 5$molw = $row['molw']; 6$density = $row['density']; 7$denstype = $row['denstype']; 8$pctd = $row['pct

[PHP] multiply by 2

2002-05-19 Thread Martin Towell
I was doing some timing of a function on the weekend and in one of the loops, I had to multiply a variable by 2 - easy enough - $i*2 but then I remembered that in C, it's quicker to do a left shift - so $i<<1 but this actually took longer to execute in php than the $i*2 - can anyone confirm my t

RE: [PHP] Variable won't work in function, even when I global it?

2002-05-19 Thread Martin Towell
what's that value of $footertext? is it the actual contents of the footer file? have you tried displaying the contents of $footertext just before you call checkmember()? does it contain what you're expecting? -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]

[PHP] php4.2.0 (win) error message question

2002-05-20 Thread Martin Towell
Just thought I'd try defining a class method outside of the class definition block. Here's the code blah(); ?> Here's the error I got Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting '(' in C:\WINNT\Profiles\mtowell\Desktop\test1.html on line 7 So, okay, I can't do that.

RE: [PHP] php4.2.0 (win) error message question

2002-05-20 Thread Martin Towell
d.paamayim-nekudotayim.php -Original Message----- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 21 May 2002 12:55 PM To: '[EMAIL PROTECTED]' Subject: [PHP] php4.2.0 (win) error message question Just thought I'd try defining a class method outside of the class definiti

RE: [PHP] How to implode with carraige return ?

2002-05-23 Thread Martin Towell
unix uses just \n ( chr(13) ) windows uses \r\n ( chr(10).chr(13) ) try changing \n\r to \r\n HTH Martin -Original Message- From: Manisha [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 1:35 PM To: [EMAIL PROTECTED] Subject: [PHP] How to implode with carraige return ? I have

RE: [PHP] Mail Headers problem.......

2002-05-23 Thread Martin Towell
dunno if this helps, but try using "\r\n" instead of just "\n" when you create $headers -Original Message- From: CDitty [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 1:20 PM To: [EMAIL PROTECTED] Subject: [PHP] Mail Headers problem... I am writing a small email logging / for

RE: [PHP] Validating forms and showing errors

2002-05-26 Thread Martin Towell
These are the five methods I know of getting the data back to the original form. 1. Client side cookies 2. Server side cookies/session variables 3. URL 4. hidden form 5. submit back on yourself Take your pick Martin -Original Message- From: Victor Boivie [mailto:[EMAIL PROTECTED]] Sent:

RE: [PHP] Parse Error(Newbie)

2002-05-26 Thread Martin Towell
$query = "select * from news WHERE id = "$_get['id']""; you've got quotes within quotes - either change the inner quotes to single quotes, or escape them $query = "select * from news WHERE id = '$_get[id]'"; or $query = "select * from news WHERE id = \"$_get['id']\""; -Original Message--

RE: [PHP] Regex Assistance

2002-05-27 Thread Martin Towell
this is what I use to get rid of "line" from the url $qs = ereg_replace("&$", "", ereg_replace("line=[^&]*&?", "", $QUERY_STRING)); HTH MArtin -Original Message- From: Scott Reismanis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 12:00 PM To: [EMAIL PROTECTED] Subject: [PHP] R

RE: [PHP] Setting PHP Authentication manually?

2002-05-27 Thread Martin Towell
Two way's I can see 1. Use session variables 2. Use client side cookies Martin -Original Message- From: Laura Harley [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 2:02 PM To: [EMAIL PROTECTED] Subject: [PHP] Setting PHP Authentication manually? I am trying to build a login pa

RE: [PHP] PHP new super globals or something else??

2002-05-28 Thread Martin Towell
code snippets would be good, if possible -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 10:46 AM To: PHP Subject: [PHP] PHP new super globals or something else?? I hope this makes sense to someone Im converting a script over to work

RE: [PHP] easy date question?

2002-05-28 Thread Martin Towell
1. set date = 1 2. get day of 1st of month 3. if day != tuesday, set date = 10-day_num (assuming Sun = 0, Mon = 1, etc) 4. add 14 to date 5. now you have your date There's most likely a better way of doing it though -Original Message- From: Ed Lazor [mailto:[EMAIL PROTECTED]] Sent: Wedn

RE: [PHP] PHP new super globals or something else??

2002-05-28 Thread Martin Towell
hod >to get and you should be fine. > > > >>echo ''; >>echo ''; >>echo ''; >>} >>?> >> >>Now as it stands, initially it would work fine, but when the form is >>submitted, it would break

RE: [PHP] dynamic indexes in arrays

2002-05-28 Thread Martin Towell
why not just do this? $this->m_menu[$index] = array("title"=>$title, "content"=>"", "color"=>$color); -Original Message- From: Joe Pemberton [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 2:23 PM To: php list Subject: [PHP] dynamic indexes in arrays I have a member variable

[PHP] can I use regex for this?

2002-05-28 Thread Martin Towell
I have a string which is a date - eg "01-JUL-02" I want to convert the month bit to it's corresponding number, so the above would become "01-07-02" Can this easily be done using a regex? Otherwise I was thinking of this: $mon = array("JAN"=>"01", "FEB"=>"02", "MAR"=>"03", etc...); list($x, $y, $

RE: [PHP] easy date question?

2002-05-28 Thread Martin Towell
If you want to make it a few line shorter, change if ($MonthStartDay < $Day) { $C = $Day - $MonthStartDay; } else if ($MonthStartDay > $Day) { $C = 7 - $MonthStartDay + $Day; } to $C = ($MonthStartD

RE: [PHP] Is there any substitute for header function?

2002-05-28 Thread Martin Towell
try specifying the full url. see how that goes -Original Message- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 4:06 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Is there any substitute for header function? Hi Jason and friends, I am very sorry for that. Pl

RE: [PHP] File Path - Which way is better ?

2002-05-29 Thread Martin Towell
IMO: use relative paths if the two files will be in the same place relative to each other, otherwise use absolute -Original Message- From: Manisha [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 11:51 AM To: [EMAIL PROTECTED] Subject: [PHP] File Path - Which way is better ? I am

RE: [PHP] File Path - Which way is better ?

2002-05-29 Thread Martin Towell
What I'm saying is that if these files are in the same place, relative to each other (this includes using "../") then I think it's easier to use relative paths. The exception to this would be if the relative path length is longer than the absolute path length -Original Message- From: Man

RE: [PHP] Write permission problem

2002-05-29 Thread Martin Towell
on linux : chmod in php : chmod() http://www.php.net/manual/en/function.chmod.php the script will need write access to the directory otherwise it can't. write to it... :) -Original Message- From: Manisha [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 1:46 PM To: [EMAIL PROTE

RE: [PHP] array question

2002-05-30 Thread Martin Towell
$_POST["product"][0] $_POST["product"][1] etc. -Original Message- From: Michelle [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 9:25 AM To: [EMAIL PROTECTED] Subject: [PHP] array question I'm a newbie at php and I'm sure you will be able to tell by my question. I'm just doing a

RE: [PHP] Failed opening '' for inclusion...

2002-05-30 Thread Martin Towell
have you looked in php.ini ? -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 10:19 AM To: PHP General Subject: [PHP] Failed opening '' for inclusion... I am running PHP 4.2.1 on Windows XP. I had 4.1.2 running perfectly fine and then decided to

RE: [PHP] Failed opening '' for inclusion...

2002-05-30 Thread Martin Towell
Do you have an auto-prepend file? If so, maybe it's in there ??? If not, I'm stumped -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 10:31 AM To: Martin Towell; PHP General Subject: Re: [PHP] Failed opening '' for inclusi

RE: [PHP] Undefined variables

2002-05-30 Thread Martin Towell
if you want to do the same thing for "no task supplied" and "unknown task" then you could do this: switch(@$Task) { case 'ShowVersion': ShowVersion(); break; case 'GetData': GetData; print $DataOutput; break; case 'CreateImage': CreateImage(); break; default:

RE: [PHP] Previous & Next Navigation

2002-06-03 Thread Martin Towell
If you don't want to query the database again, you could always write the results to a file. There's a matter of cleaning up old cache files though, but that's not what was asked... ;D -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 11:40 AM

RE: [PHP] Re: email attachments and PHP

2002-06-03 Thread Martin Towell
Or, if you're into doing it yourself, have a look at RFC2045 and RFC2046 http://rfc.sunsite.dk/rfc/rfc2045.html http://rfc.sunsite.dk/rfc/rfc2046.html -Original Message- From: Jason Morehouse [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 3:16 PM To: [EMAIL PROTECTED] Subject: [

RE: [PHP] How can I call C or FORTRAN functions from PHP?

2002-06-03 Thread Martin Towell
yep - I can see two ways of doing it - either using exec()/system() or compile the c/fortran code into a library file (.dll or .so depending on server type) and, in php, use dl() -Original Message- From: Cui Chenzhou [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 3:56 PM To: [EMA

RE: [PHP] INT function?

2002-02-20 Thread Martin Towell
$z = (int)($x / $y); // should work or $z = $x / $y; settype($z, "integer"); -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 12:07 PM To: [EMAIL PROTECTED] Subject: [PHP] INT function? Just curious what the function is to convert x

RE: [PHP] Need help

2002-02-20 Thread Martin Towell
or maybe explode using ";" as your delimiter first then loop through the returned array depending on what the current item is, and the previous item(s) are (maybe using flags to know where you are, and what has happened), act on the current one in a certain way dunno if i've written it in an unde

RE: [PHP] wordwrap not working

2002-02-20 Thread Martin Towell
Are you looking at the output in a web browser? Martin -Original Message- From: Michael P. Carel [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 2:25 PM To: php Subject: [PHP] wordwrap not working Hi, Im testing the example in the http://www.php.net/manual/en/function.wo

RE: [PHP] timestamp confusion

2002-02-20 Thread Martin Towell
well, just add 17 hours (17h * 60m/h * 60s/m = 61200 [aren't calculators wonderful :)] ) i guess -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 4:02 PM To: php Subject: Re: [PHP] timestamp confusion Jeff Sheltren wrote: > Well, what

RE: [PHP] Re: regular expressions

2002-02-21 Thread Martin Towell
yeah! remember that php interprets the string first, before it gets to reg.ex. !! That's some I keep forgetting... lol Martin -Original Message- From: Murray Chamberlain [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 2:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: regular ex

RE: [PHP] Re: Creating methods runtime

2002-02-21 Thread Martin Towell
dunno about using eval() but this worked - not as elegant as I'd want it, but it works class test { function user_func($f, $a, $b) { $z = $this->$f; return ($z ? $z($a, $b) : null); } } $blah = new test; $blah->new_func = create_function('$a,$b', 'return $a+$b;'); echo $blah->user_func("new_fu

RE: [PHP] Help needed - need to access a value from DB into all pages

2002-02-21 Thread Martin Towell
I can think of three ways you could do this. 1. as a cookie 2. using sessions 3. put it in every link Martin -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:59 AM To: PHP db list; PHP List Subject: [PHP] Help needed - need to acces

RE: [PHP] This?: ob_start

2002-02-21 Thread Martin Towell
if it "does" then there's one small problem with it. you have the echo before the ob_end_clean(), it should be after... -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 1:25 PM To: [EMAIL PROTECTED] Subject: [PHP] This?: ob_start Does th

RE: [PHP] Access Array Values?

2002-02-24 Thread Martin Towell
foreach (array_count_values ($names) as $name=>$count) -^^ -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Access Array Values? I knew there was ar

RE: [PHP] Email Verification

2002-02-24 Thread Martin Towell
You can use sockets and connect to their mail server (bit after the @) and "pretend" to send an email to them, but cancel the request before you actually send anything - doesn't always work though, as some servers will report back the all users are correct This is the code I use - a bit long thou

RE: [PHP] RE: (HTML related) helping to creating dropdown lists from fetched arrays.

2002-02-24 Thread Martin Towell
try this: (I don't have experience w/ mysql, but I do with other dbs) ".$row["col2"]; } ?> -Original Message- From: Matthew Darcy [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 10:06 AM To: [EMAIL PROTECTED] Subject: [PHP] RE: (HTML related) helping to creating dropdown lis

RE: [PHP] [NEWMAN] Collecting information from a my sql table.

2002-02-24 Thread Martin Towell
how about ? $row = mysql_fetch_array($sql_result); $pub_id = $row["pub_id"]; $pub_headline = $row["pub_headline"]; $pub_dateline = $row["pub_dateline"]; $pub_info = $row["pub_info"]; $pub_image = $row["pub_image"]; -Original Message- From: Philip J. Newman [mailto:[EMAIL PROTECTED]

RE: [PHP] RE: (HTML related) helping to creating dropdown lists from fetched arrays.

2002-02-24 Thread Martin Towell
original line: while ($row = mysql_fetch_array($results); new line: while ($row = mysql_fetch_array($results)) -Original Message- From: Matthew Darcy [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 10:37 AM To: Martin Towell; [EMAIL PROTECTED] Subject: RE: [PHP

RE: [PHP] Email Verification

2002-02-24 Thread Martin Towell
to do this, but can anyone see a problem with simply issuing a VRFY or an EXPN command instead of actually faking out sending a message? /bsh/ Martin Towell wrote: >You can use sockets and connect to their mail server (bit after the @) and >"pretend" to send an email to them, bu

RE: [PHP] HTTP Request Headers - PUHLEASE HELP!

2002-02-24 Thread Martin Towell
what about $argv ? -Original Message- From: SpamSucks86 [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 11:40 AM To: [EMAIL PROTECTED] Subject: [PHP] HTTP Request Headers - PUHLEASE HELP! I have an infinitely annoying problem. I coded a script which tracks who viewed my profi

RE: [PHP] HTML Email Has Random '!'

2002-02-24 Thread Martin Towell
it's to do with the length of a line - I think it's 1024 - if a lines longer than that, an ! is put there and a new line is made Martin -Original Message- From: Steven Walker [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] HTML Emai

RE: [PHP] MySQL joins

2002-02-25 Thread Martin Towell
can you supply some examples please -Original Message- From: Alexander P. Javier [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:34 AM To: [EMAIL PROTECTED] Subject: [PHP] MySQL joins why do i get errors on MySQL queries that have joins? alyx ---

RE: [PHP] Variables containing HTML?

2002-02-25 Thread Martin Towell
there's htmlentities or something like that - try that w/ your hidden field -Original Message- From: Nick Richardson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 2:56 PM To: PHP General Subject: [PHP] Variables containing HTML? Stupid question for everyone... i'm just hav

RE: [PHP] includes and variables

2002-02-26 Thread Martin Towell
think of an included file as if it were part of the parent code. so file1.php file2.php file2.php would basically be: HTH Martin -Original Message- From: Pax [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 9:24 AM To: [EMAIL PROTECTED] Subject: [PHP] includes and var

RE: [PHP] is_uploaded_file() emulation?

2002-02-26 Thread Martin Towell
try: http://www.php.net/manual/en/function.getmyuid.php -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 10:33 AM To: Stewart Gateley Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] is_uploaded_file() emulation? Thank yo

RE: [PHP] includes and variables

2002-02-26 Thread Martin Towell
-Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 5:30 PM To: 'Pax'; [EMAIL PROTECTED] Subject: RE: [PHP] includes and variables think of an included file as if it were part of the parent code. so file1.php file2.php file2.php wo

RE: [PHP] Dumb question on terminology

2002-02-26 Thread Martin Towell
In a nutshell: $row->data is referring to an object, not an array, that has an attribute of "$data" $row['data'] is an associative array - ie, indexes are non-numerical - with an index of "data" Martin -Original Message- From: Dean Householder [mailto:[EMAIL PROTECTED]] Sent: Wednesday

RE: [PHP] mysql php - while loops

2002-02-26 Thread Martin Towell
with a bit of cheating... use a table... (nb: this code not tested, but logic has) " ?> - - "; $i++; } ?> -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:43 AM To: php-general-list Subject: [PHP] mysql php - while loops

RE: [PHP] Apache Server Side Includes mixed with PHP pages

2002-02-27 Thread Martin Towell
why don't you just do this? -Original Message- From: Richie Chauhan [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 6:40 AM To: [EMAIL PROTECTED] Subject: [PHP] Apache Server Side Includes mixed with PHP pages Hi all, First post to this list. I am trying to do the followi

RE: [PHP] if(isset($submit))

2002-02-27 Thread Martin Towell
I used this code when I clicked on the image, I got this url file:///C:/inetpub/wwwroot/top.html?submit.x=118&submit.y=20 so php would get this as $submit_x and $submit_y HTH Martin -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 28, 2002 4:

RE: [PHP] if(isset($submit))

2002-02-27 Thread Martin Towell
ou getting submit.x=118&submit.y=20 Martin Towell wrote: > I used this code > > > value="submit"> > > > when I clicked on the image, I got this url > > file:///C:/inetpub/wwwroot/top.html?submit.x=118&submit.y=20 > > so php would get th

RE: [PHP] if(isset($submit))

2002-02-27 Thread Martin Towell
h, it's not fair! :) J Martin Towell wrote: > I used this code > > > value="submit"> > > > when I clicked on the image, I got this url > > file:///C:/inetpub/wwwroot/top.html?submit.x=118&submit.y=20 > > so php would get this as $su

RE: [PHP] Reference problem

2002-02-28 Thread Martin Towell
Title: RE: [PHP] Reference problem I wrote an xml parsing class, and xml tag class, that might help you there see the attachment -Original Message- From: John English [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 12:35 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject:

RE: [PHP] loading Arrays

2002-02-28 Thread Martin Towell
sure, you can add/remove/modify element whenever you want your syntax is wrong though try this // add value to array if($flag == "true"){ $samplearray[] = $samplevalue; // append value to end of array } -Original Message- From: sundogcurt [mailto:[EMAIL PROTECTED]] Sent: Friday, M

RE: [PHP] elseif without else

2002-02-28 Thread Martin Towell
if there's nothing to do in the else block, then it's a bit pointless to have one eg value="xxx" name="blah"> see what I mean? Martin -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 11:32 AM To: PHP Subject: [PHP] elseif without else For any

RE: [PHP] elseif without else

2002-02-28 Thread Martin Towell
In this case I would assign false to $error before your if's - just to make sure it's set to something definite - that is unless you have already set it furthur up in your code... Martin -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 11:59 AM

RE: [PHP] % character in sprintf

2002-03-03 Thread Martin Towell
try %% -Original Message- From: Job Miller [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 10:20 AM To: [EMAIL PROTECTED] Subject: [PHP] % character in sprintf how do i escape the % character to appear in a sprintf statement? it doesn't mention that in the sprintf php manual

RE: [PHP] Multiple Forms

2002-03-03 Thread Martin Towell
1) not unless you have them opening up a new window for each form 2) combine them into one form Martin -Original Message- From: Ramesh Nagendra Pillai [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 2:27 PM To: Php Mailing list Subject: [PHP] Multiple Forms Hai I am having two

RE: [PHP] Need help with a PHP script

2002-03-03 Thread Martin Towell
instead of $HTTP_POST_VARS, try $_POST -Original Message- From: PHP [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 12:10 PM To: [EMAIL PROTECTED] Subject: [PHP] Need help with a PHP script http://infinitep.t35.com/countmein/control.phtml\";>"; echo ""; echo ""; echo "Use

RE: [PHP] Storing Script information in MySQL

2002-03-03 Thread Martin Towell
store it as text when you get it back, do an exec() on it -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Storing Script information in MySQL Is it possible to store the contents of a PHP file wi

RE: [PHP] remove everything

2002-03-03 Thread Martin Towell
$output = ereg_replace("[^a-zA-Z0-9]", "", $output); (not tested - but should work) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:04 PM To: [EMAIL PROTECTED] Subject: [PHP] remove everything What is the code to remove everything but

RE: [PHP] Storing Script information in MySQL

2002-03-03 Thread Martin Towell
sorry - it's eval() -Original Message- From: David Redmond [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:09 PM To: 'Martin Towell'; [EMAIL PROTECTED] Subject: RE: [PHP] Storing Script information in MySQL I couldn't seem to get this working. Contents of

RE: [PHP] Displaying Number values

2002-03-03 Thread Martin Towell
printf("%02i", $num); should work -Original Message- From: Phillip S. Baker [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:39 PM To: PHP Email List Subject: [PHP] Displaying Number values Hey All, I want PHP to print out the value of a number in a variable as something lik

RE: [PHP] convert to lowercase

2002-03-03 Thread Martin Towell
strtolower() -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 4:55 PM To: [EMAIL PROTECTED] Subject: [PHP] convert to lowercase What is the code to make a string into lower case? Regards, Joseph A. Bannon -- PHP General Mail

<    1   2   3   4   5   6   7   8   >