RE: [PHP] variable variables

2002-01-17 Thread scott [gts]
there's one example of var-of-vars along with arrays below my rant rant var-of-var is almost always an evil thing. there are some rare instances where they're necessary, but i assure you that your script would be MUCH cleaner and easier to modify in the future if you used a simple array.

RE: [PHP] Passing vars w/refresh w/register globals off?

2002-01-17 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 you could save the password to a database, associated with an ID number, then pass the ID number. DATABASE: - id| password 12345 | blah$$ URL: form.php?id=12345 - Scott Hurring - Internet Programmer

[PHP] How would you code: $r = func() or return 0?

2001-09-26 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I thought i'd ask for your comments on how you'd code this common perl code with PHP: $value = some_function() or return 0; i usually code my functions to return 0 or on error, but have to use the following code to handle it... neither seem like

RE: [PHP] How would you code: $r = func() or return 0?

2001-09-26 Thread scott [gts]
the other two ways and i'm looking for an equally terse way of accomplishing the same thing with PHP -Original Message- From: Sterling Hughes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 26, 2001 4:57 PM To: scott [gts] Cc: php Subject: Re: [PHP] How would you code: $r

RE: [PHP] Have y'all seen this?

2001-09-14 Thread scott [gts]
it's also a joke, in case anyone happens to take is seriously :-) -Original Message- From: Jon Farmer [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 10:01 AM To: Thomas Deliduka; PHP List Subject: Re: [PHP] Have y'all seen this? This is a pretty funny article:

RE: [PHP] Last Modified question..

2001-08-28 Thread scott [gts]
did you try stat()'ing the file? as long as you have read permission to the file, you should be able to run a stat() on the file with no problems -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED]] Subject: [PHP] Last Modified question.. I have a problem... I want to

RE: [PHP] is_numeric for php3

2001-08-28 Thread scott [gts]
i think he's asking for a numeric test, not an integer test. your example looks like it should fail 3.50 (for example), even though 3.50 is a perfectly valid numeric value. personally, i think you should just use regexps. ;-) i tried to write a little is_num() type function, but i kept getting

RE: [PHP] Link Checker

2001-08-28 Thread scott [gts]
although it's a bit klunky (and not entirely correct) to do things this way, but a simple fopen(); will tell you if the URL is retrievable or not. (although i dont think that fopen() handles redirects or any of those esoteric HTTP features) but if you want to make sure that a link is there,

RE: [PHP] Check if a word is in my string.

2001-08-28 Thread scott [gts]
use regexps. that's what their specialty is ;-) // case insensitive if ( preg_match(/$text/i, $string) ) { print $text is in $string; } // case sensitive if ( preg_match(/$text/, $string) ) { print $text is in $string; } -Original Message- From: daniel james

RE: [PHP] is_numeric for php3

2001-08-28 Thread scott [gts]
a few months to fully understand them and get over regexp-heebie-jeebies of my own. -Original Message- From: daniel james [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 28, 2001 6:42 PM To: scott [gts]; php Subject: RE: [PHP] is_numeric for php3 Ahhh, in that context

RE: [PHP] is_numeric for php3

2001-08-28 Thread scott [gts]
my understanding is that numeric is a broad term for number values (any value with only numbers and a decimal point) like 1, 5.6, 332, 0.5532, for example. integers are a sub-set of numerics, so any integer is a numeric value, but any numeric value is not necessarily an integer. $num=123 is

RE: [PHP] The future of PHP

2001-08-23 Thread scott [gts]
:-) for the type of sites that i develop (non-mission-critical, non-financial), i find PHP's simplicity and elegance more than offsets a lack of things like strong typing and a harshly BDSM compiler (and whatever else Java/JSP has that PHP doesn't) for most websites out there, Java is probably

RE: [PHP] Re: Mem and variables

2001-08-22 Thread scott [gts]
amen. :-) -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Subject: [PHP] Re: Mem and variables At any rate -- The right way to worry about perforance is to figure out where your code is spending 90% of its time, and to optimize that. I'm betting it ain't in

RE: [PHP] header() not working.

2001-08-21 Thread scott [gts]
header() works. it's the text that header() is printing that's causing problems. what are you outputting via header() ? -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 21, 2001 3:10 PM To: [EMAIL PROTECTED] Subject: [PHP] header() not working.

RE: [PHP] PNG support...

2001-08-20 Thread scott [gts]
looks like some GD options were changed between builds. check phpinfo() to find out how PHP was compiled, and what version GD it's using. -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Monday, August 20, 2001 10:21 AM To: [EMAIL PROTECTED] Subject: [PHP] PNG

RE: [PHP] need real expert (geting outer files) *english/german*

2001-08-15 Thread scott [gts]
-Original Message- From: Chris Hayes [mailto:[EMAIL PROTECTED]] Subject: Re: [PHP] need real expert (geting outer files) hi Patrick, your question is not entirely clear. I try to get a URL like: www.server.com?var=xyz i would recommend www.server.com/x.php?var=xyz as with

RE: [PHP] build button with php

2001-08-15 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 just output the proper HTML codes. INPUT TYPE=SUBMIT -Original Message- From: nafiseh saberi [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 15, 2001 3:12 PM To: [EMAIL PROTECTED] Subject: [PHP] build button with php hi. I

RE: [PHP] new one is it ??

2001-08-13 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 what about something like this ? (just configure apache to have PHP handle *.ida files) ? // this is so our script won't time out set_time_limit(0); // how many bytes of junk to generate $jsize = 1024 * 10; // how many times to print $junk $jout

RE: [PHP] The secrecy of PHP code

2001-08-13 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 they are kinda safe if the webserver is the only way that your files can be viewed if people can log into the machine, they could just view the plaintext of your PHP script. hint: security thru obscurity is not secure. -Original

RE: [PHP] Having trouble with PHP exec function calling CGI program

2001-08-13 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 it could be that the webserver chroot()'s to some secure path, and thus your script cannot find `date`. perhaps all you have to do is to copy the binaries that you need into the safe directory (if you can first find out where the server is

RE: [PHP] new one is it ??

2001-08-13 Thread scott [gts]
dont think it's appropriate to lash back against an infected machine (though a quick why dont you patch your @#(*)( machines to the network owner has been known to occur on occasion when I get hit by many many servers within a given netblock). -Original Message- From: scott [gts

RE: [PHP] UPDATE syntax

2001-08-13 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 try this syntax: UPDATE table SET col=value, col2=value2 ... WHERE ID=$id; -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: Monday, August 13, 2001 3:20 PM To: PHP Subject: [PHP] UPDATE syntax I have a

RE: [PHP] large external script to include in many pages

2001-08-13 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 here docs also work good for big blocks of text (although interpolation will occur, which you might not want) $mytext = EOT blah blah blah EOT; http://php.net/manual/en/language.types.string.php#language.types.string.syntax.hered oc

RE: [PHP] Copy function usage ?

2001-08-09 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 look in httpd.conf to get the user name, then chown the directory to that user ex. chown apache:apache ./dir/ chmod 755 ./dir/ and make sure that you change permissions to all files that you write into the directory to be read-write only (not

RE: [PHP] PHP in corporate settings?

2001-08-09 Thread scott [gts]
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 a big reason i use PHP as much as i do is becuase of the excellent documentation and ease of finding it all... -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 1:02 PM To: Rasmus Lerdorf;

RE: [PHP] regexps

2001-08-08 Thread scott [gts]
here are two regexps that might do what you want \w matches alphanum (1-9a-zA-z) IMO, the best way to check for non-alphanum chars is to check for \W (upper case is negation of alphanum, which will match only non-alphanum). if (preg_match('/^\w+$/', $data)) { print entirely alphanum

RE: [PHP] How to Compare dates?

2001-08-03 Thread scott [gts]
or, if the field is a MySQL DATE field, try comparing to -00-00, since that's what a blank date defaults to. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 02, 2001 10:34 AM To: Jack Sasportas Cc: php Subject: Re: [PHP] How to Compare

RE: [PHP] ----- BEING AN ASS CLICK HERE NOT ABOVE!!!!!

2001-08-03 Thread scott [gts]
and since you're running Win32, i'd *highly* suggest running apache to a service... so that you dont have to spawn a console window everytime you want to use your webserver. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 02, 2001 5:52

RE: [PHP] Spot the difference?

2001-08-03 Thread scott [gts]
ASP is basically like PHP, only it uses a VB-based language instead of perl/c-based one. which means it sucks - vb is evil. -Original Message- From: Jon Yaggie [mailto:[EMAIL PROTECTED]] Subject: Re: [PHP] Spot the difference? isnt this fact a good enough reason to believe it

RE: [PHP] Replacing template variables with values?

2001-08-02 Thread scott [gts]
try using single quotes : preg_replace(/\$(\w+)/e, '${$1}', $template); -Original Message- From: Ryan Fischer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 6:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Replacing template variables with values? Hello! :) I have

RE: [PHP] How to Compare dates?

2001-08-02 Thread scott [gts]
it also appears that you're checking for the same thing over and over and over '0' is the same as 0 and 00 is the same as 0 and 00 is the same as '00' try checking for either 0 or -00-00 -Original Message- From: Tim [mailto:[EMAIL PROTECTED]]

RE: [PHP] Q: Hiding Folder Directories from public while still...

2001-08-02 Thread scott [gts]
if you're using apache, there's a *much* easier/secure way of doing this. setup an .htaccess file to restrict access to certain username/passwords. check out both: man htaccess man htpasswd -Original Message- From: Jon Yaggie [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 02,

RE: [PHP] Oh and one more thing

2001-08-02 Thread scott [gts]
it's a little bit complicated, but here goes. 1) format your harddrive 2) take out your motherboard and spraypaint it bright orange. 3) dance around the desk three times holding the motherboard above your head chanting mail mail, give me mail date date, give me date

RE: [PHP] Re: issues with __sleep() and __wakeup()

2001-08-01 Thread scott [gts]
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 3:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: issues with __sleep() and __wakeup() class Scott { var $svar = array(); // free-form hash for whatever data function

RE: [PHP] Attitude of B van Ouwerkerk

2001-08-01 Thread scott [gts]
so now it's shifted from his attitude to your seeming inability to cope with words related to sexual intercourse? we all need to calm down and relax. -Original Message- From: Alexander Wagner [mailto:[EMAIL PROTECTED]] Subject: Re: [PHP] Attitude of B van Ouwerkerk B. van

RE: [PHP] Visual Login

2001-08-01 Thread scott [gts]
if you go this route, you would, however, have to check for valid-login users on every page that you want to have security on. -Original Message- From: Ben Bleything [mailto:[EMAIL PROTECTED]] Subject: RE: [PHP] Visual Login One way would be to use a database (of any type) to store

RE: [PHP] Example high-profile PHP sites

2001-08-01 Thread scott [gts]
www.audiogalaxy.com is almost entirely PHP -Original Message- From: CC Zona [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 4:57 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Example high-profile PHP sites In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Ralph

RE: [PHP] writing while reading

2001-08-01 Thread scott [gts]
try only locking the file on a write, *not* on a read. you are going to have many times more reads than writes, even on the busiest day what you need to have is a blocking-lock your writes and not bother with locks for reading. the way you have it setup now, there's no locking for writes,

RE: [PHP] Re: issues with __sleep() and __wakeup()

2001-08-01 Thread scott [gts]
i added a (hopefully helpfull) addition to the online notes regarding magic-functions: http://www.php.net/manual/en/language.oop.magic-functions.php Here's what i posted, if anyone's interested: Here is a sample class and some test statements to demonstrate how __sleep() is used. If you do

RE: [PHP] Re: FAQ

2001-08-01 Thread scott [gts]
and adding a little explanation of the http://php.net/function syntax for searching the php.net site would be a big help too. -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 11:32 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Re:

RE: [PHP] SQL syntax error in PHP script. dunno what's wrong

2001-08-01 Thread scott [gts]
*always always always* quote everything in SQL statements. you run the risk of letting people insert arbitrary SQL statements into your script if you dont quote values. if you're using MySQL, try mysql_escape_string http://php.net/manual/en/function.mysql-escape-string.php or you could roll

RE: [PHP] env var

2001-08-01 Thread scott [gts]
a lot of people send the reply to the list and Cc: a copy to the sender so you end up getting two copies. -Original Message- From: Jon Yaggie [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 12:41 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] env var thanks dave

RE: [PHP] Re: Hmmm?

2001-08-01 Thread scott [gts]
oh man... it gives me such a headache when i have to try and make sense of scripts with no indentation (or arbitrary indentation)... it's always fun dealing with things like this :-) if ($this){ print hi ;} else {print bye ; }

RE: [PHP] Testing if Scripting has been disabled

2001-08-01 Thread scott [gts]
Scripting is a rather large word... do you mean javascript? -Original Message- From: Don [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 12:58 PM To: php list Subject: [PHP] Testing if Scripting has been disabled Is there a method to test if Scripting has been

RE: [PHP] SQL syntax error in PHP script. dunno what's wrong

2001-08-01 Thread scott [gts]
no offense to you sam, but please dont ever simply place single quotes around values. you have to escape the values *themselves*. what if someone submitted the form field title as: $title = '; DELETE FROM seminar; if you didn't escape the single quotes in there, it would get interpreted as a

RE: [PHP] Testing if Scripting has been disabled

2001-08-01 Thread scott [gts]
]] Subject: Re: [PHP] Testing if Scripting has been disabled Well, yes, but if I disable scripting in I.E., won't PHP scripts not work as well? - Original Message - From: scott [gts] [EMAIL PROTECTED] Subject: RE: [PHP] Testing if Scripting has been disabled Scripting is a rather large

RE: [PHP] Installing PHP probs

2001-08-01 Thread scott [gts]
it's a piece of cake for windows... two steps: 1) download the .EXE and double-click on it or download the .ZIP and unzip it somewhere (usually C:\php) 2) configure restart your webserver if you download the .EXE it'll configure any non-apache server for you. if you use apache, you'll have

RE: [PHP] How can I make a Loading... screen?

2001-08-01 Thread scott [gts]
use javascript. put this at the top of your big document: var waitwin = window.open( ... ); and this at the end: waitwin.close(); you might have to double-check the syntax, as i dont really use javascript too often, but that should work fine. -Original Message- From: Michael

RE: [PHP] Re: How can I make a Loading... screen?

2001-08-01 Thread scott [gts]
make the same window say Loading? not unless you used DHTML to create an IFRAME or DIV or some similar HMTL element (i havent kept up on DHTML, so i dont know exactly what you'd need to use). set it to be the entire size of the browser width and height = 100%, then, at the bottom of the page,

RE: [PHP] PHP INSTALL (please, im too young to die!!!)

2001-08-01 Thread scott [gts]
get the windows ZIP -Original Message- From: Kyle Smith [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 01, 2001 11:04 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP INSTALL (please, im too young to die!!!) ok i really need to get this sorted quickly so could somebody please

RE: [PHP] Installing PHP probs

2001-08-01 Thread scott [gts]
you dont have to have a server running. just use the CGI binary. ...and if you're using windows - why not just use apache... it's free, easier to install/configure than PWS (yech!) and it has *MUCH* better documentation and support than microsoft can ever offer. :-) -Original

RE: [PHP] Good Tutorial

2001-07-31 Thread scott [gts]
The red WROX book, Professional PHP Programming is really good. -Original Message- From: Steve Wright [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 11:12 AM To: PHP List Subject: [PHP] Good Tutorial Hey, I have done a few tutorials, but they aren't very long, and

RE: [PHP] Re: What tools do you use to develop PHP?

2001-07-31 Thread scott [gts]
TextPad is my personal favourite, but i've also tried ConTEXT and PHP Coder and liked them a lot, so i'd recommend that you check out all three of them. TextPad: http://textpad.com/ PHP Coder: http://synedit.sourceforge.net/ ConTEXT: http://www.fixedsys.com/context/ -Original Message-

RE: [PHP] Attitude of B van Ouwerkerk

2001-07-31 Thread scott [gts]
there's a fine line between being terse and being nasty. please don't misinterpret this, but i think that we could all benefit from being less sensitive of the style each of us express ourselves in... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED]

RE: [PHP] fopen not opening url

2001-07-31 Thread scott [gts]
i wish i could help you out, but i tried your code (below) and it worked perfectly... i'm running PHP Version 4.0.4pl1 on a Windows 2000 box. perhaps it isn't the fopen() that's failins. $x = fopen(http://p.moreover.com/cgi-local/page?c=Music%20business%20newso=xml,r;) or die(Cannot

RE: [PHP] Failure Configuring 4.0.6 on SuSE 7.1

2001-07-31 Thread scott [gts]
it seems that your 'lex' is in a non-standard place, and cannot be found in your PATH. make sure you have 'lex' on your machine, find out where, then open up the Makefile and change it's path to lex to the correct one. -Original Message- From: Chris Anderson [mailto:null@YAST_ASK]

RE: [PHP] Question on Commercial Offerings

2001-07-31 Thread scott [gts]
and not to mention that almost any form of script protection or source-code encryption can be broken with minimal effort... you'd probably be wasting valuble time trying to protect your scripts that you could better spend improving and maintaining the code. IMO: it's better to spend your time

RE: [PHP] Re: HELP!! What wrong with this code...

2001-07-31 Thread scott [gts]
or, if you're going to be dealing with a lot of data that has lots of quotes in it, you could take the safe route and just exit out of PHP mode lots of times, it's easier than escaping every single php; code; here; ? P align=centerYour feedback has been sent to a

RE: [PHP] RE: php_oci8.dll

2001-07-31 Thread scott [gts]
try using: extension_dir = c:\php\extensions that's what i use on my Win32 machine with an identical install as Liviu. -Original Message- From: Liviu Popescu2 [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 31, 2001 11:12 AM To: [EMAIL PROTECTED] Subject: [PHP] RE: php_oci8.dll

RE: [PHP] FAQ - was Attitude of B van Ouwerkerk

2001-07-31 Thread scott [gts]
it everyday, but not too many newbies seem to know about it) -Original Message- From: mike cullerton [mailto:[EMAIL PROTECTED]] Subject: Re: [PHP] Attitude of B van Ouwerkerk on 7/31/01 12:37 PM, scott [gts] at [EMAIL PROTECTED] wrote: there's a fine line between being terse and being

[PHP] issues with __sleep() and __wakeup()

2001-07-31 Thread scott [gts]
I am having a problem with __sleep(); there mere existance of it is causing my object to not get serialized at all. __wakeup() works fine. i am using PHP v4.0.6 / apache / win2k. If i keep __sleep() in the object, it will not serialize, but if i remove it, it serialized fine. Does anyone know

[PHP] references

2001-07-31 Thread scott [gts]
i've been reading over the docs on references, and i can't see anyway to pass around functions as references. i know how to do this easily with perl, but i cannot seem to find the correct syntax for creating a reference to a function in PHP. what i'd like to do is something like this: // X is

[PHP] references... found it

2001-07-31 Thread scott [gts]
im sorry, but i was trying to do that the hard way. i figured out how to execute a function name in a variable. $x =test; print Hello: $x\n\n; $x(); function test() { print yee haw; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: [PHP] Revision Tracking - program concept

2001-07-30 Thread scott [gts]
you are severely re-inventing the wheel. Look for CVS or RCS programs on the net. you'll save yourself a ton of work. -Original Message- From: Dave Freeman [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 6:27 AM To: [EMAIL PROTECTED] Subject: [PHP] Revision Tracking -

RE: [PHP] MS SQL datetime format problem

2001-07-30 Thread scott [gts]
*how* are you putting it in? -Original Message- From: Brian Weisenthal [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 1:01 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] MS SQL datetime format problem Hi, I am having trouble setting a datetime in a ms sql

RE: [PHP] php stand alone

2001-07-24 Thread scott [gts]
but remember, if you put your cron/admin scripts into a directory on a publicly accessable webserver, you run the risk of having anonymous websurfers run your scripts at inopportune moments. -Original Message- From: Gunther E. Biernat [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 24,

[PHP] A good PHP auto-reply system

2001-07-19 Thread scott [gts]
Can anyone reccomend a good PHP (or perl) Web-based email auto-reply thingy. I work at a company that hosts websites and provides POP email accounts, and i'd like to allow our clients to come to our website, log into a clients section and have more control over their service... I'd like to

RE: [PHP] Email Software

2001-07-19 Thread scott [gts]
...and also a really sleazy way to annoy people. -Original Message- From: Christian Reiniger [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 3:35 PM To: Wee Chua; PHP (E-mail) Subject: Re: [PHP] Email Software On Wednesday 18 July 2001 14:50, Wee Chua wrote: Hi all,

RE: [PHP] Making php execute php

2001-07-18 Thread scott [gts]
It's failing becuase $abc is not valid PHP code, but is HTML. to get eval to work correctly, only pass it valid PHP code. This will print Hello World; $abc = ' print $Message; '; $Message=Hello World ; eval ($abc) ; If you want to output HTML, enclose it within a print statement, or

RE: [PHP] set var in PHP

2001-07-18 Thread scott [gts]
u $TITLE = some title here; -Original Message- From: jessica lee tishmack [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 11:28 AM To: php Subject: [PHP] set var in PHP In html, I can do !--#set var=TITLE value=some title here-- How do I do this in PHP?

RE: [PHP] wordwrap()

2001-07-17 Thread scott [gts]
i know this is a silly question, but you're not looking at it thru a web browser, are you? browsers are for HTML and markup code. the output on my computer is the same as the manual output: A very long wooo ord. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]]

RE: [PHP] Need help with formatting time

2001-07-17 Thread scott [gts]
This will convert minutes to hours, then convert to 12-hour am|pm based time. all hours have 60 minutes. it's simple mathematics to convert. $m = 780; $h = 0; // convert to hours:minutes while ($m = 60) { $h++; $m -= 60; } print $h:$m \n; // convert to 12-hour am|pm if (!$h) { $suff

RE: [PHP] sessions . . . .

2001-07-16 Thread scott [gts]
any number of things could happen to the $directory variable... it could be out of scope, gotten overwritten or unset by another function, or it might just never have been saved to the database... but the real problem with that code is that there are no error checks on the file functions. that

RE: [PHP] echo vs printf

2001-07-16 Thread scott [gts]
from the manual: [print is a language construct [EMAIL PROTECTED]] The print() function returns a boolean indicating the status of the call. If the write was successful, print() returns 1. If not, it returns 0. This can be used to detect when the client has closed the connection, and appropriate

RE: [PHP] RE: string search

2001-07-16 Thread scott [gts]
read the docs for ereg... i hardly use it, so i dont know for certain if it will match. (althouth the use of ^ at beginning *and* end suggests that it wont do what you expect) preg will match aol.com with this regexp: preg_match('/aol.com/', $string ) -Original Message- From: Joseph

RE: [PHP] How can I see if variable is a odd or an even number?

2001-07-16 Thread scott [gts]
even numbers are even becuase they're divisible by 2 w/o a remainder... use this property to your advantage: if ( $num % 2 ) { print $num is odd; } else { print $num is even; } -Original Message- From: SED [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 12:07

RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]
$text = Hello there, test. My name is name; $ASSIGN = array(test = this is a test, 'name'= 'BOB', ); $OPENTAG = ; $CLOSETAG = ; print preg_replace( /$OPENTAG(.*?)$CLOSETAG/e, '$ASSIGN[$1]', $text ); prints: Hello there, this is a test. My name is BOB To do what you want, throw a loop

RE: [PHP] string replace using ereg

2001-07-16 Thread scott [gts]
what code are you trying to use? i have exactly the following code, and it prints out: Hello there, this is a test. My name is BOB $text = Hello there, test. My name is name; $ASSIGN = array(test = this is a test, 'name'= 'BOB', ); $OPENTAG = ; $CLOSETAG = ; print

RE: [PHP] RE: string search

2001-07-16 Thread scott [gts]
hehe... that's what regular expressions are for. they're extrememly powerful... but that doesnt mean that you should only use them for extremely complicated situations. they work great everywhere... if you dont like overdoing it, you might as well loop thru the string character by character,

RE: [PHP] Do not get any PHP-binary in install?

2001-07-16 Thread scott [gts]
i know it's silly to ask -- but did you look for php in /usr/local/bin/ -Original Message- From: Lasse Andersson [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 2:49 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Do not get any PHP-binary in install? Hi,

RE: [PHP] submitting free-form text to a database

2001-07-16 Thread scott [gts]
for the quotes thing. you must have single quotes around the values that will go to the database, and you must escape single quotes inside the value with either '' or \' (at least in MySQL, both work) and as for the database... IMO, you should download MySQL now and save yourself a ton of

RE: [PHP] Exec, system, passthru didn't work

2001-07-16 Thread scott [gts]
did you try and capture error messages from the system calls? webserver probably doesnt have permission to do what you want it to do. -Original Message- From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]] Subject: [PHP] Exec, system, passthru didn't work Hi, I tried to execute

RE: [PHP] Thumbnail Generation from DB Stored Images.

2001-07-13 Thread scott [gts]
Here is my code to turn a directory full of *files* into thumbnail images. im sure you can adapt it to your own needs... the code is a bit long-winded, but it was my first attempt at writing thumbnail code, so forgive me ;) // example call to the function make_thumbs('./pictures/cavern/',

RE: [PHP] Strong typing?

2001-07-13 Thread scott [gts]
and as far as i know, perl's 'strict mode' has absolutely nothing to do with typing of variables... use strict; will force you to define all variables with my $var; or local $var; before you assign values to them or try and use them... but it doesnt do anything about enforcing typing... in

RE: [PHP] The need for strong typing...

2001-07-13 Thread scott [gts]
you could easily write yourself a typing function to take care of all that (as someone suggested previously) using the same familiar syntax as you want to use in the function definition. function pay($fromaccount, $toaccount, $amount, $memo) { $good = checkInput($fromaccount, int, $toaccount,

RE: [PHP] Enabling short tags in PHP 4.0.6

2001-07-13 Thread scott [gts]
what do the tags look like? ? ? or % % the first is a short tag the second is an asp style tag maybe you're looking at the wrong option in the 'ini' file. -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 11:17 PM To: Coulee Web;

RE: [PHP] Re: How to maintain a variable between PHP pages (sessions?).

2001-07-13 Thread scott [gts]
sessions or cookies is the way you probably want to go. you could pass the variable around to each and every form, but that is a pain in the ass, and extremely prone to errors. on the first page, where you check the user's ability to use attachments, you could simply set a cookie

RE: [PHP] Alternative to phpMyAdmin

2001-07-13 Thread scott [gts]
like you said... as long as the database provider accepts connections from outside, you can administer it from anywhere. if the provider doesn't accept incoming connections, no amount of tools and software will work for you. -Original Message- From: Alexander Skwar [mailto:[EMAIL

RE: [PHP] forms and IP numbers

2001-07-13 Thread scott [gts]
no offense, but that's a bad kludge for the problem. however, if you really want to do that, you could try checking $SERVER_NAME and $HTTP_REFERER and other enviornment variables like that... what would be easier (and better practise) to do is to verify that the incoming username is valid...

RE: [PHP] forms and IP numbers

2001-07-13 Thread scott [gts]
stat() -Original Message- From: Randy Johnson [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13, 2001 4:09 PM To: scott [gts]; php Subject: RE: [PHP] forms and IP numbers I would like to pull the date and time of the creation of a file via a php script and compare

RE: [PHP] Re: How to convert a string into a mathematical expression?

2001-07-13 Thread scott [gts]
be *extremely* careful. eval() is like spawning another PHP interpreter... it'll execute *any* code that you give it. people could type in unlink(); and such commands and really trash your webserver. -Original Message- From: Philip Hallstrom [mailto:[EMAIL PROTECTED]] Subject: [PHP]

RE: [PHP] session problem using headers

2001-07-13 Thread scott [gts]
you're passing the PHPSESSID incorrectly, it seems you must do something like this: A HREF=nextpage.php??=SID? or header(Location: nextpage.php?$SID); what you're doing now will go to page input.php?=SID instead of input.php?938sa9fa98f7daf987a9s (or similar) -Original Message-

[PHP] peculiar behaviour of large integers with and

2001-07-13 Thread scott [gts]
Has anyone come across this before? // compare 5 to the max value of an integer if (5 -2147483647) { print This is; } // knock a digit off the max and compare again if (5 -214748364) { print weird; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread scott [gts]
This is; } else { print Nothing ; } // knock a digit off the max and compare again if (5 -214748364) { print weird; } else { print unusual; } ? I get nothing unusual Kirk -Original Message- From: scott [gts] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 13

RE: [PHP] Variable name declarations?

2001-07-13 Thread scott [gts]
-Original Message- From: Matthew Aznoe [mailto:[EMAIL PROTECTED]] Subject: [PHP] Variable name declarations? However, I do have one complaint about PHP that seems to have a tendency to bite me far too often, and that is the lack of variable declaration. While I do not think the

RE: [PHP] Re: Warning: mail() is not supported in this PHP build

2001-07-12 Thread scott [gts]
run 'make clean' find out where your current PHP stuff is *now*. use that directory as --prefix=[dir] for the configure script. make; make test; make install; then, restart apache. always do this whenever you make any changes to anything even remotely apache-related. -Original

RE: [PHP] php mail form with predefined subject

2001-07-12 Thread scott [gts]
link to the mail form like this: mailform.php?subject=Requesting+information+on and in the mailform, have a subject field something like this: INPUT TYPE=TEXT NAME=subject VALUE=?= $subject ? -Original Message- From: Ed Peddycoart [mailto:[EMAIL PROTECTED]] Subject: [PHP] php mail

RE: [PHP] Re: $HTTP_REFERER 10

2001-07-12 Thread scott [gts]
a partial suggestion would be to try an fopen() on the HTTP_REFERER if it was a static document like .html or .txt but if someone is being redirected from a CGI script or dyanmic page of any sort, it'll be virtually impossible to find out exactly where they came from and if that page is

RE: [PHP] building a search engine ??

2001-07-12 Thread scott [gts]
and to answer one of the previous questions, yes... it is *very* resource intensive to scan an entire directory tree full of files every single time a user wants to search as far as i know, htdig indexes the information into one big file, and just reads thru that... which will save you

RE: [PHP] Alternative to phpMyAdmin

2001-07-12 Thread scott [gts]
i manage the production mysql database on a linux server from my windows desktop at work it's an extremely nice program. :) many compliments to the authour, if he reads this list. -Original Message- From: Alexander Skwar [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001

  1   2   3   >