Re: [PHP] Stdout to file

2002-05-13 Thread Martin Thoma
> man tee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: template logic problem

2002-05-13 Thread Martin Wickman
List Peters wrote: > > > > navigation > > > > > In the include file I have all the code i need. > > My problem is that for one page in the site I need to display a image in the > navigation bar that is referenced from a database. The database query > happens in the included file which is

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 [ma

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

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: Th

[PHP] Re: IF Statements

2002-05-16 Thread Martin Wickman
Jon Yates wrote: > People, hope you can help. The below IF statement is getting a PARSE error. > Can anyone spot why? > > if (($this->checkReferralCB($this->benefitRef, $this->benefitNo, > $this->childDOB)) > && (!$this->checkLocation($this->post, "W")) && (!empty($this->childDOB))) > || (

Re: [PHP] I'm doing something wrong....

2002-05-16 Thread Martin Wickman
Robert Rothe wrote: > Thanks. So the next() and prev() functions just traverse an array > some type of linked list? This is what precludes direct access to > specific elements? Yup, there is an internal position pointer in every array which are used by most array_ functions. -- PHP Gene

[PHP] Re: Generate every possible combination

2002-05-16 Thread Martin Wickman
Evan Nemerson wrote: > I need to generate every possible combination of the the values in an array. > For example, if... > > $array = Array("A", "B", "C"); > I really have no idea where to begin. The best lead I can think of is that > there are going to be n! elements in the output array, where

[PHP] Re: help with arrays

2002-05-16 Thread Martin Wickman
Josh Edwards wrote: > This is a basic question but I'm a basic fellow. If I have an array > > $timespread = array("12am-01am"=>0); > $timespread["01am-02am"]=0; > $timespread["02am-03am"]=0; etc > > Using $time which is a number, I want to add 1 to the value of > $timespread[$time] without chan

Re: [PHP] Looking for web based email

2002-05-17 Thread Martin Wickman
Jared Boelens wrote: > This is the one my company uses: > > http://nocc.sourceforge.net/ > > I found it very easy to modify, and it fully supports attachments as well as > the related RFCs. I had problem with it, since it required imap stuff and whatnot. Anyway, I ended up using squirrelmail a

[PHP] Re: problem with strtolower()

2002-05-17 Thread Martin Wickman
David Orn Johannsson wrote: > I'm having a problem with StrToLower function in php > > I'm trying to convert characters like Þ and acute letters from > uppercase to lowercase, but it dosen't work. > > this is what the manual says: "Note that 'alphabetic' is determined by > the current locale.

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: Tues

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

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

[PHP] Bot?!

2002-06-03 Thread Martin Thoma
Hello! Perhaps you know the programms called "Bot", which allows the user to ask questions just by writing it in natural speak or which guides the user in some process. I wonder if there is a (free?) solution of this somewhere in the net. Martin -- PHP General Mailing List (http://w

Re: [PHP] Bot?!

2002-06-04 Thread Martin Thoma
Well, the bot should work on a webpage and obviously php would be the best solution. > And what exactly has this got to do with PHP? > > - Original Message - > From: "Martin Thoma" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, Ju

[PHP] multisite hit counter, includin session statistics

2002-06-04 Thread Martin Smetak
Hi! I want to write some multisite hit counter, but including session statistics. Anyone knows how to do that? I mean: I need to place some link on the page, on not allways php enabled site - probably in form of blank image, which will run script on my server. Ex.: http://my_serv.org?site=0011";>

Re: [PHP] multisite hit counter, includin session statistics

2002-06-04 Thread Martin Smetak
gt; Any suggestions welcome... > > ---John Holmes > > - Original Message - > From: "Martin Smetak" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, June 04, 2002 11:30 AM > Subject: [PHP] multisite hit counter, includin session

RE: [PHP] resolution

2002-06-04 Thread Martin Towell
I think this was asked recently by someone else You need to use javascript/vbscript to grab the dimensions then pass it to php php is server side and doesn't know anything about the client unless it's told about it HTH Martin -Original Message- From: Doron [mailto:[EMAIL

RE: [PHP] Creating pop-up window and passing variable to it?

2002-06-04 Thread Martin Towell
function myopen() { window.open("foobar.html?var1=&var2="); } click for new window -Original Message- From: Igor Portnoy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 9:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Creating pop-up window and passing

RE: RE: [PHP] Creating pop-up window and passing variable to it?

2002-06-04 Thread Martin Towell
quot; for "_blank" and get the same effect. HTH Jason Soza - Original Message - From: Martin Towell <[EMAIL PROTECTED]> Date: Tuesday, June 4, 2002 3:55 pm Subject: RE: [PHP] Creating pop-up window and passing variable to it? > > function myopen() > { >

RE: [PHP] Converting non latin characters

2002-06-04 Thread Martin Towell
'ð' is an accented 'o' - just like these are: 'ò', 'ó', 'ô', 'õ', 'ö' I've never seen an 'o' accented that why before, so I have no idea how you're meant to pronounce it. But going from "Tokyo" then I guess it's pronounced "oe" as in "toe" I dunno what function (built-in or otherwise) you can us

Re: [PHP] multisite hit counter, includin session statistics

2002-06-05 Thread Martin Smetak
P script. Maybe you can > do more with Javascript or SSI, if that's available... > > ---John Holmes... > - Original Message - > From: "Martin Smetak" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, June 04, 2002 12:14 PM > Subject: Re:

Re: [PHP] multisite hit counter, includin session statistics

2002-06-05 Thread Martin Smetak
the user closes the browser, and then comes back to > your site in a new window, then the session will not exist and they will be > considered a "new" user. > > Have you tried anything so far? > > ---John Holmes... > > - Original Message - > From: "Mart

RE: [PHP] redirection

2002-06-05 Thread Martin Clifford
You can pretty much use ANY JavaScript event handler to accomplish the redirection. I'm new to PHP, so the header is the only place I know of to redirect. onclick onmouseup onmousedown onmouseover onmousemove onkeydown onkeypress onkeyup onchange etc. -- PHP General Mailing List (http://www.

Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford
Use substr() to extract the appropriate information, then format it and compare it. 20020603 is obviously June 3, 2002 and 20020605 is obviously June 5, 2002 which means there was 1 day (plus x hours) between the two. Hope to help! Martin >>> "Tyler Longren" <[EMAIL P

Re: [PHP] days between two timestamps

2002-06-05 Thread Martin Clifford
Well, I had the right idea... John is just more advance than me. :o) >>> "1LT John W. Holmes" <[EMAIL PROTECTED]> 06/05/02 11:09AM >>> Since those look like MySQL timestamps, I would suggest you do it in your query. SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table Adapt to

Re: [PHP] Sessions question (-enable-trans-sid)

2002-06-05 Thread Martin Clifford
, you don't have to worry about cookies being on at all. Just some idle speculation, I've never tried to use both at the same time. Martin >>> "Jeff Field" <[EMAIL PROTECTED]> 06/05/02 12:56PM >>> Hi, I'm confused about one thing regarding sessio

Re: [PHP] php and javascript question

2002-06-05 Thread Martin Clifford
As far as I'm aware you can't create a javascript variable and use it within PHP on the same page. You can add that variable's value to a hidden form element to be passed to the next page, but I don't think so with the same page. martin >>> "kemu" <

RE: [PHP] Automatic color coded HTML

2002-06-05 Thread Martin Towell
highlight_file() or something like that -Original Message- From: Jarrad Kabral [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 11:55 AM To: Php-General (E-mail) Subject: [PHP] Automatic color coded HTML Hi All, Is a command in PHP to format source code as color coded HTML?

RE: [PHP] Automatic color coded HTML

2002-06-05 Thread Martin Towell
ROTECTED]] > Sent: Wednesday, June 05, 2002 10:14 PM > To: Php-General (E-mail) > Subject: RE: [PHP] Automatic color coded HTML > > yeah that would be niceis it configurable at all? > > > > -Original Message----- > From: John Holmes [mailto:[EMAIL PROTECTED]]

RE: [PHP] Modifying the sort order of a query

2002-06-05 Thread Martin Towell
isn't this just a matter of doing order by country, whatever ?? -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 1:02 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Modifying the sort order of a query I still really don't u

RE: [PHP] carrying a query string

2002-06-05 Thread Martin Towell
try it and see if it doesn't work, try using base64_encode() and base64_decode() after all, you're not encrypting the string, just making sure the script handles it okay, ay? -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 3:21 PM To: php Su

RE: [PHP] return array

2002-06-06 Thread Martin Towell
that seems odd I've got a function that returns an array something like you had in your example. eg function blah() { return array("C"=>3,"D"=>9,"M"=>1); } $arr = blah(); then doing echo $arr["C"] output's 3 -Original Message- From: Jule Slootbeek [mailto:[EMAIL PROTECTED]] Sent:

RE: [PHP] Files

2002-06-06 Thread Martin Towell
if the file's not too long, you could use file() to read the file into memory, then loop through the array you get back and look for the line(s) you're after. if you don't want to read the entire file into memory, you can loop through the file with: $f = fopen($file, "r") or die("can't open file

RE: [PHP] URL / slash reduction

2002-06-10 Thread Martin Towell
There's probably a single reg.ex. you could use, but I'm too lazy to figure that one out. But try this instead (not tested though) $str = "http://www.tuned-belgium.com/user/?id=/junni"; $tmp = explode("?", $str); $tmp[1] = str_replace("/", "", $tmp[1]; $str = implode("?", $tmp); -Original M

RE: [PHP] URL / slash reduction

2002-06-10 Thread Martin Towell
it's because you've got single quotes inside single quotes... change $_GET['id'] to $_GET[id] -Original Message- From: X-power.be [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:04 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] URL / slash reduction the nickname 'junni' was an

RE: [PHP] Re: Arrays

2002-06-10 Thread Martin Towell
use ".=" instead of "=" $echo .= "". $name .""; (remember to initialise $echo = "" somewhere first just in case is contains something from elsewhere) -Original Message- From: Dan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 11:36 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: A

RE: [PHP] Adding zeros in front

2002-06-10 Thread Martin Towell
$num2 = sprintf("%4d", $num); the "d" might have to be something else, can't remember -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 1:20 PM To: César L. Aracena; PHP General List Subject: Re: [PHP] Adding zeros in front I think certain t

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:

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] 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

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

AW: [PHP] Array questions...

2002-06-12 Thread Martin Lucas
hi leon, > > Hello, > > Assume I have the following array: > > $array = array ( > "apple" => "cherry", > "foo" => "bar", > "wom" => "bat" > ); > > How could I easy remove the key and the value of the key > "foo" from that > array? > unset ($array[foo]); > Also, what is the best

[PHP] Emptying a Single Array Value

2002-06-12 Thread Martin Clifford
Howdy, If someone out there could tell me how to get rid of a single key/index pair within an array, it would be great. I've tried both unset() and empty(), but both destroy the entire array. Please CC me directly, as I'm on the digest. Thanks in advance! Martin -- PHP Gener

Re: [PHP] Emptying a Single Array Value

2002-06-12 Thread Martin Clifford
st a short test script that misbehaves for you. $arr = array('foo','bar'); unset($arr[0]); print_r($arr); // only $arr[1] = 'bar' exists now See also: http://www.php.net/unset http://www.php.net/array_splice Regards, Philip Olson On Wed, 12 Jun

RE: [PHP] Querying for MAX

2002-06-12 Thread Martin Towell
what's you're after is select max(id) from table -Original Message- From: David Freeman [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 9:36 AM To: 'PHP General List' Subject: RE: [PHP] Querying for MAX > What I'm trying to do here is not inside PHP nor MySQL books > I hav

RE: [PHP] Varible Varibles

2002-06-12 Thread Martin Towell
well, the first method is the same as saying $a = "foo"; $foo = "bar"; echo "$a $foo"; whereas the second method is appending "bar" to $a (thus making it "foobar") In first method, you get two variables, the second, just one -Original Message- From: Peter [mailto:[EMAIL PROTECTED]] Sent

RE: [PHP] Dynamic Arrays

2002-06-12 Thread Martin Towell
If you want to use an array for you form, then here's one method on you form page * * ... on you script page \n"; ?> I haven't tested it though. Maybe you could use array_diff() ??? -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:48 PM To

[PHP] converting C to PHP

2002-06-12 Thread Martin Towell
I'm converting some C functions to PHP and have come across this: int skipf(..., char *format) { /* ... */ cp = format; char *cp, *cp2; multiplier = strtol(cp, &cp2, 10); /* ... */ } How can I implement this line in PHP ? multiplier = strtol(cp, &cp2, 10); Oh, and an example of fo

RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell
send the results of putting these two line just before your while loop print_r($mycart); print_r($catalog); -Original Message- From: Phillip Perry [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:31 PM To: Tom Rogers; Php Subject: RE: [PHP] beginner in PHP Thanks, but that did

RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell
Ah! $catalog is a 2D array - any your if statement is expecting a 1D array... -Original Message- From: Phillip Perry [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:52 PM To: Tom Rogers; Php Subject: RE: [PHP] beginner in PHP I meant Martin :) sorry. -Original Message

RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell
here's the revised loop $cat_cnt = count($catalog); while (list($key,$value) = each($mycart)) { for ($j = 0; $j < $cat_cnt; $j++) if ($value == $catalog[$j]["itemcd"]) { echo $catalog[$j]["unitprice"]; break; } } -Original Mess

RE: [PHP] converting C to PHP

2002-06-12 Thread Martin Towell
rn, the entire string is valid.) Instead of a pointer - a position number would be okay (Actually, to get the number, I could just do "$cp-0" or "$cp*1" - gotta love variants) -Original Message- From: Daniel Tryba [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13,

RE: [PHP] beginner in PHP

2002-06-12 Thread Martin Towell
try this for chout() function chout(){ global $mycart, $cart_items; session_destroy(); -Original Message- From: Phillip Perry [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:18 PM To: Martin Towell; Tom Rogers; Php Subject: RE: [PHP] beginner

RE: [PHP] Re: converting C to PHP

2002-06-12 Thread Martin Towell
t back is the first number and the first letter after that number (which can be "L", "P", or "W"). So in the example I gave, I'll need to get back "12" and "L" What I settled on is: ereg("([0-9]*)([LPW])", $format, $bits); list(, $cnt, $skip) = $bits; But maybe there's a better way ?? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] question about ? :

2002-06-13 Thread Martin Towell
Lee - I would bracket anyway, just to make sure, and to make it clear to the coder what's happening Miguel - that's fine when using two operators that have different precedence, but all three operators are ?: -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Friday, J

RE: [PHP] Can I set the value of variable depending on when the page is loaded?

2002-06-13 Thread Martin Towell
instead of using js to redirect, could you use header("location:"); ? -Original Message- From: Don [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 12:36 PM To: php Subject: [PHP] Can I set the value of variable depending on when the page is loaded? Hi, I have a an HTML page cont

RE: [PHP] Can I set the value of variable depending on when the page is loaded?

2002-06-13 Thread Martin Towell
it works for me - to only problem is if you're transferring data from one page to the other via the form. You'll need some other why of doing it (sessions, cookies, use GET, other) -Original Message- From: Don [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 12:43 PM

RE: [PHP] Re: Spam Bots/E-mail Addys

2002-06-13 Thread Martin Towell
It all depends on the traffic to the server. I agree that any checks should be done on the server anyway, just in case someone has js turned off. But to reduce the load on the server, you can use js to at least filter _some_ of the traffic. Also, using js to alert a user of an error is much quic

RE: [PHP] Different colors on lines

2002-06-13 Thread Martin Towell
have a seperate counter $query = mysql_query("select * from $tabell_4"); $number = mysql_numrows($query) ; $i = 0; $bgcolor[0] = "#FFE38E"; $bgcolor[1] = "#FF"; $Search = "Test"; $j = 0 while ($i < $number) { $Name = mysql_result($query_1,$i,"Name"); if (eregi ($Search, $Name)) { Echo '

RE: [PHP] Nested IF's (Is there a LIMIT ?)

2002-06-13 Thread Martin Towell
Bracketing looks good try pulling chunks of code out and gradually add it in to see where the problem lies eg (sorry for reformatting your code) html code in here, then html code in here, etc.. -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Fri

AW: [PHP] PHP to Excel?

2002-06-18 Thread Martin Lucas
hi chad, on http://www.cnovak.com/ you'll find a php-class that generates native excel-files, even with cell formatings and other more or less useful things. greetings martin > -Ursprüngliche Nachricht- > Von: Chad Day [mailto:[EMAIL PROTECTED]] > Gesendet: Dienstag, 18

RE: [PHP] How do I hide download link ...

2002-06-18 Thread Martin Towell
Hi, if using the header command for attaching a file really prevents the user from seeing the actual download link, is it really all that important that the file is read from behind the document root if it is in a very hard to guess directory? "Martin Towell" <[EMAIL PROTECTED]> wrote in

RE: [PHP] How do I hide download link ...

2002-06-18 Thread Martin Towell
ansfer-Encoding: binary"); Header("File-Length: $fsize"); Header("Content-Disposition: attachment; filename=$fname"); echo $buff; -Original Message- From: Lazor, Ed [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 19, 2002 8:59 AM To: 'Martin Towell

RE: [PHP] URGENT

2002-06-18 Thread Martin Towell
you might need to place a space before WHERE -Original Message- From: Phil Reid [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 19, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: [PHP] URGENT I am in urgent need of help! (AGAIN) Can anyone spot anything wrong with this query? $sql =

RE: [PHP] what kind of weird problem is this?

2002-06-18 Thread Martin Towell
Doing a search on php.net for T_CONSTANT_ENCAPSED_STRING comes up with this page: http://www.php.net/manual/en/tokens.php This then leads to: http://www.php.net/manual/en/language.types.string.php#language.types.string .syntax I have no idea how to interpret all this, but try changing mailto:[

[PHP] Forum with php

2002-06-19 Thread Martin Thoma
Hello! I saw a lot of forums (or boards) which looks almost the same and they are done in php. Is there a free forum-software in php? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] How many copies

2002-06-20 Thread Martin Towell
For the first question: Will this work? In class A, you wont get anything when you use $this->bar if the class hasn't been instantiated. besides that fact, you'll should get the output of: settig:bar+foo if you call A::foo(); As for the second question: How many times A will be made answer: zero

RE: [PHP] Hex operations

2002-06-20 Thread Martin Towell
looks like it's trying to treat $cap1 as a decimal number, and not a hex number have a look at this: for ($cap = 0; $cap < 64; $cap++) { $cap1 = dechex($cap); $bit = ($cap1 | 0x01); echo "$cap - $cap1 - $bit\n"; } and you'll see what I mean... -Original Message- From: Frank S. Kic

<    1   2   3   4   5   6   7   8   9   10   >