RE: [PHP] a good hosting experience

2001-02-21 Thread ..s.c.o.t.t..
liquidweb.com has some nice looking deals. last time i checked, they supported MySQL/PHP/Perl/lots of other stuff > -Original Message- > From: Jeff Gannaway [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 21, 2001 05:59 > To: Mark Maggelet; [EMAIL PROTECTED]; [EMAIL PROTECTED] >

RE: [PHP] Using while as for...

2001-02-23 Thread ..s.c.o.t.t..
this is how you'd do it, in any of three ways, depending on the values you want to start/stop with. //counts from 0 to 10 $count=0; while ($count <= 10) { echo "$count, "; $count++; } print ""; //counts from 1 to 10 $count=0; while (++$count <= 10) { echo "$count, "; } pr

RE: [PHP] special characters with perl,mysql,php

2001-02-23 Thread ..s.c.o.t.t..
i use a regexp to slash-out single quotes for inclusion into an SQL query: // quote a value to make it appropriate for inclusion in an SQL string function db_quote($value) { return ereg_replace("'","\\'",$value); } > -Original Message- > From: Mitchell Hagerty [mailto:[EMAIL PROTECTE

RE: [PHP] Help INSERTing to MySQL

2001-02-23 Thread ..s.c.o.t.t..
0 also works for AUTO_INCREMENT fields... > -Original Message- > From: Philip Olson [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 23, 2001 18:41 > To: Clayton Dukes > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Help INSERTing to MySQL > > > > > If I knew I could get answers that e

RE: [PHP] Help INSERTing to MySQL

2001-02-23 Thread ..s.c.o.t.t..
you dont need to have a list of field names if you insert the exact amount of fields that exist in the table... if you have fields Name and Email, you can do: INSERT INTO mytable VALUES ('myname','[EMAIL PROTECTED]') without a problem. however, if you have fields Name, Email and Password the pr

RE: [PHP] Download PHP from Linux machine?

2001-02-23 Thread ..s.c.o.t.t..
well, you could load lynx, then type "G" (go) and type in "www.php.net" on the address bar, then navigate your way to the download page from there. (it's only one page deep into the site) that's how i did it at work on our linux machine. > -Original Message- > From: Simons [mailto:[EMAI

RE: [PHP] ++$i and $i++ whatz the difference?

2001-02-28 Thread ..s.c.o.t.t..
one is post-increment, and one is pre-increment: POST-increment ($i++) $i = 1; print $i++; print "\n" print $i; prints : 1 2 becuase $i is printed out and *then* it is incremented, so the next print statement prints out the incremented value, not the print $i++; statement PRE-increment (++$i) $

RE: [PHP] PHP and Ranges

2001-04-19 Thread ..s.c.o.t.t..
this works: $r_start = 0; $r_end = 65535; $a = array('12', '198', 'b'); while ( list($k,$v) = each($a) ) { if ( ($v > $r_start) && ($v < $r_end) ) { print "[$v] OK\n"; } else { print "[$v] NOPE\n"; } } > -Original Messag

RE: [PHP] Last Element in an Array?

2001-04-19 Thread ..s.c.o.t.t..
you can get the amount of elements in an array using count() and use that # as an index value for 1+ the last value (the last value that's NOT IN the array) $a = array('12', '198', 'b'); print count($a); this'll give you "3", which, as you can see, the last valid subscript of $a is $a[2]; > -

RE: [PHP] image-resize (thumbnail 150x150 code)

2001-04-19 Thread ..s.c.o.t.t..
this is what i use to scale down an arbitrary .GIF or .JPG image to 150x150... $image_name is the name of the original file that you want to create a thumbnail of... function save_thumb($image_name,$image_type) { global $Svar; $new_w = 150; $new_h = 150; $image_path

RE: [PHP] test

2001-05-23 Thread ..s.c.o.t.t..
why dont you just use an email program that works correctly? > -Original Message- > From: Jon Yaggie [mailto:[EMAIL PROTECTED]] > Subject: [PHP] test > > It wasnt a test my email program gets out of hand occassionally. trust me > i am trying very hard to control. i am sorry if it real

RE: Re[2]: [PHP] Problem with PHP as CGI

2001-05-23 Thread ..s.c.o.t.t..
as a test, try removing the shebang line from your script and running the PHP binary from the shell: "/usr/local/bin/php myscript.php" i've used the CGI version for months now with apache for my website, and frequently use PHP from the shell to test out ideas and code snippets and i've never

RE: [PHP] Problem with PHP as CGI

2001-05-23 Thread ..s.c.o.t.t..
im not sure that i understand the question, but the way i've got my apache/PHP configured, i dont ever see the actual path to the PHP binary. what type of problem are you having ?? PS: i never use shebang lines in my PHP scripts; i have apache configured to handle *.php files as PHP code.

RE: [PHP] two data base connections on one page

2001-05-23 Thread ..s.c.o.t.t..
look at the manual def's for both: mysql_connect and mysql_db_query if you have multiple database connections active, remember to *always* use the linkid of the database you want to talk to > -Original Message- > From: David Robley [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 2

RE: [PHP] Pre-Written Script ?

2001-03-21 Thread ..s.c.o.t.t..
phpmyadmin http://www.phpwizard.net/projects/phpMyAdmin/ > -Original Message- > From: Jack Sasportas [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 21, 2001 16:17 > To: php > Subject: [PHP] Pre-Written Script ? > > > Has anyone found a good prewritten (gpl) script that helps you

RE: [PHP] [OT-ish] Optional Extras.

2001-06-25 Thread ..s.c.o.t.t..
off the top of my head, you could try using a "lookup table" to define the extra options... ford_spec table: id desc --- --- 1 air conditioning 2 whatever ford_cars table: car extra1 extra2 -- --- - 'contour' 1

RE: [PHP] error_log not obeyed

2001-07-03 Thread ..s.c.o.t.t..
does the directory exist? does php or apache have the right to create new files in /var/www/logs/? if the file exists, are the permissions set correctly on it? keep in mind that the user that owns apache usually has very limited powers > -Original Message- > From: [EMAIL PROTECTED] [m

RE: [PHP] Help Meeeeeeeeeee!!!!!!

2001-07-03 Thread ..s.c.o.t.t..
perhaps you'll have better luck finding comments and suggestions on a VB or MySQL list > -Original Message- > From: Veerappan Rajendrakumar [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 03, 2001 19:30 > To: [EMAIL PROTECTED] > Subject: [PHP] Help Meee!! > > > > >

RE: [PHP] How to prevent people from downloading images

2001-07-03 Thread ..s.c.o.t.t..
there are two answers to this: 1) it cannot be done. as long as that image is on the person's computer screen, it is physically impossible to prevent that person from saving the image and using it. (a simple tap of the "print screen" will take a screenshot on windows machines, as someone else me

RE: [PHP] Deleting a string from a text file

2001-07-03 Thread ..s.c.o.t.t..
you could also do it this way: $ofile = "file.txt";// original file $nfile = "new.file.txt";// new file $string = "original"; // what needs to be replaced $replace = "replacement"; // what to replace it with $data = file($ofile); // original file's d

RE: [PHP] Re: changing to a different file in browser

2001-07-05 Thread ..s.c.o.t.t..
put "Location" before the URL: header("Location: http://server.com/file.php";); or header("Location: ./file.php"); > -Original Message- > From: Brad Wright [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 05, 2001 18:54 > To: PHP General List > Subject: Re: [PHP] Re: changing to a diff

RE: [PHP] Re: changing to a different file in browser

2001-07-05 Thread ..s.c.o.t.t..
missing something? Can I actually use the headr() function to redirect to a > different page while using sesions and session variables?? > > > From: "..s.c.o.t.t.." <[EMAIL PROTECTED]> > > Date: Thu, 5 Jul 2001 22:32:22 -0700 > > To: "Php-General&quo

RE: [PHP] Submiting Data with an '

2001-07-05 Thread ..s.c.o.t.t..
or you could roll your own function db_quote($data) { $data = preg_replace("/'/", "''", $data); return $data; } > -Original Message- > From: ReDucTor [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 05, 2001 19:54 > To: Chris Anderson > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Sub

RE: [PHP] PHP/Apache security question

2001-07-07 Thread ..s.c.o.t.t..
of course that's possible... it's not default, but it's very possible i think it's an apache module called suEXEC that will run the script with the script owner's name.group, not apache.apache > -Original Message- > From: [EMAIL PROTECTED] > Subject: [PHP] PHP/Apache security question >

RE: [PHP] PHP/Apache security question

2001-07-07 Thread ..s.c.o.t.t..
webhosting.com does it, and they set each > user to their own unique primary group, and are (i believe) using suexec in > their apache config setting each VirtualHost with their respective user and > group... But does that really 'secure' everyone's code from other equall

RE: [PHP] Can PHP execute a refresh to a new page?

2001-02-16 Thread ..s.c.o.t.t..
i've been using the header("...") approach myself, but was curious to see if there's a builtin PHP function that will accomplish the same thing im a kind-of new PHP programmer, and havent really been exposed to too much of the language yet, but i found it quite odd that such a function seems

RE: [PHP] Finding the? in $REQUEST_URI?page=blah

2001-02-16 Thread ..s.c.o.t.t..
Message- > From: John Monfort [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 16, 2001 16:57 > To: ..s.c.o.t.t.. [gts] > Cc: php-general > Subject: Re: [PHP] Finding the? in $REQUEST_URI?page=blah > > > > >Is the PHP split command the same as that in Per

RE: [PHP] Can I select only the newest record?

2001-02-16 Thread ..s.c.o.t.t..
there are two ways that come to mind of doing this if you're using some kind of auto-incrementing field (not necessarily AUTO_INCREMENT, but any field that increases [or decreases] with time) this will select the entire row, but limit the query to only return 1 result (and depending on how your o

RE: [PHP] more on trimming

2001-02-17 Thread ..s.c.o.t.t..
well, there are two solutions, 1) for variables with only whitespace to be trimmed 2) variables with whitespace and \n to be trimmed 1) solution: the way i'd do it too is regexp... very similar to your solution (you're on the right track, but just needed to take that final step) $var = "This i

RE: [PHP] location

2001-02-17 Thread ..s.c.o.t.t..
you could possibly store the name/password as cookies, so that they're available to the PHP script without the user having to type them in more than once per session (or even longer if you set the expire date properly) i know that cookies are horribly insecure, but for purposes of a very simple v

RE: [PHP] search

2001-02-17 Thread ..s.c.o.t.t..
it's such a complex question and answer that i really think you need to ponder some more fundamental design concepts before you ask for advice on actually coding the thing... such as what type of database layout fits the type of information you will be storing/searching/retrieving, how you want t

RE: [PHP] Can I select only the newest record?

2001-02-18 Thread ..s.c.o.t.t..
ilto:[EMAIL PROTECTED]] > Sent: Saturday, February 17, 2001 03:12 > To: ..s.c.o.t.t..; Php-General > Subject: RE: [PHP] Can I select only the newest record? > > > I wonder, if LAST_INSERT_ID will work in here... > > I know it works when on the same file was an insertion.

RE: [PHP] Simple REGEX?

2001-02-18 Thread ..s.c.o.t.t..
well, if the only characters that you want to allow are alphanum/space/underscore, you could use a perl regexp to match against anything *other* than those things...(a positive match would indicate that the string being matched had invalid characters in it) use this: preg_match('/[^\w\s]/', $inp

RE: [PHP] Apache config

2001-02-18 Thread ..s.c.o.t.t..
any good .conf files? ...mine reads like a stephen king novel :) it's easy... if you go to php.net and read thru their installation documentation, there are about 4-5 lines total that you need to add to your httpd.conf (at least when you install php as a stanalone cgi) to get apache to properl

RE: [PHP] Count of multi-dimensional array

2001-02-18 Thread ..s.c.o.t.t..
it's not very elegant, but i havent come across any PHP core function that will do what you asked, so here's a little loop that will return the total length of a multidimensional array $total = 0; for ($i=0; $i < count($myarray); $i++) { $total += count( $myarray[$i] ); } print $total; i

RE: [PHP] Determingin if cookies are useable?

2001-02-18 Thread ..s.c.o.t.t..
hmmm... what i would do is set a cookie named "cookies_enabled" in the very beginning of your site, and check for the presense of that variable in places that you need cookie functionality... logically, if $cookies_enabled isnt set, it means that the cookie doesnt exist (and thus cookie support

RE: [PHP] checking image extensions

2001-02-18 Thread ..s.c.o.t.t..
or, a bit more concisely, you could use a regexp... to allow only jpg/gif/png file formats, setup the regexp to match on those three formats, and yell at people who submit anything other than those three $imgName = "one.jpg"; if (! preg_match('/\.(jpg|gif|png)$/', $imgName) ) { print "fil

RE: [PHP] Stylesheets

2001-02-18 Thread ..s.c.o.t.t..
well, CSS support in netscape 4 is abyssmal to begin with, and it's a 5 year old browser, so i would venture to guess that's why you cant get anything to look the way it should... i never thought i'd see the day when MSIE was more standards compliant and more stable than netscape... (well, at lea

[PHP] using a regular expression to trim whitespace

2001-02-18 Thread ..s.c.o.t.t..
there's a much easier way to get rid of whitespace and linebreaks at the end of a variable than using a looped ereg_replace (as i previously suggested) 1) use trim() 2) use preg_replace('/\s*$/', '', $input) both will cremate spaces and linebreaks -- PHP General Mailing List (http://www.php.ne

RE: [PHP] REGEX prob

2001-02-18 Thread ..s.c.o.t.t..
did you check the value *before* writing it to a file? before trying to solve any problem, you have to know where to look perhaps the problem lies with the file instead of the regexp. the following code worked great for me: Lnk'; $html = preg_replace('/&flag=(\d{9})&PHPSESSID=(\w{32})/', ap

RE: [PHP] system()

2001-02-19 Thread ..s.c.o.t.t..
i am not positive about this, but you could try making the amp process a background process by adding a " &" to the end of the command line (at least if you're using *nix) > -Original Message- > From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 19, 2001 00:40

RE: [PHP] array

2001-02-19 Thread ..s.c.o.t.t..
from the "unset" documentation on php.net // destroy a single variable unset ($foo); // destroy a single element of an array unset ($bar['quux']); // destroy more than one variable unset ($foo1, $foo2, $foo3); > -Original Message- > From: andreas (@work) [mailto:[EMAIL PROTECTED]] >

RE: [PHP] PHP as CGI

2001-02-19 Thread ..s.c.o.t.t..
i had a very similar problem when i first setup PHP/Apache on my linux box... i forgot to add a line to my httpd.conf and got all sorts of "Cant find this" "Cant find that" type of errors my mistake was that i did not set ScriptAlias and Action correctly, and thus apache was having all sorts

RE: [PHP] question about multidimension array

2001-02-19 Thread ..s.c.o.t.t..
> -Original Message- > From: Zenith [mailto:[EMAIL PROTECTED]] > Subject: [PHP] question about multidimension array > > Consider the following code: > > $ary1 = array ("one","two"); > $ary2 = array ("three","four"); > > $2d_Dimension[] = $ary1; > $2d_Dimension[] = $ary2; > > // is $2d_

[PHP] ASP / PHP / embedded scripting (possibly OT)

2001-02-19 Thread ..s.c.o.t.t..
i dont know too much about ASP, as i've never had to use it, but i thought ASP as more of an enviornment (or meta-language) rather than an actual programming language (becuase VBscript is the default language for ASP pages, i always assumed that other languages could be utilized in place of VB(yuc

[PHP] some more about include() and require()

2001-02-19 Thread ..s.c.o.t.t..
include() will only load the file if the include() statement is encountered during the execution of your script if (1==0) { include("file"); } the file will never be include()'d, since the if/then will always fail. require() will always put the contents of the file

RE: [PHP] system()

2001-02-19 Thread ..s.c.o.t.t..
> -Original Message- > From: Christian Reiniger [mailto:[EMAIL PROTECTED]] > Subject: Re: [PHP] system() > > On Monday 19 February 2001 21:00, ..s.c.o.t.t.. wrote: > > i am not positive about this, but you could try making > > the amp process a background process

RE: [PHP] Session support in PHP (buffering output to browser)

2001-02-19 Thread ..s.c.o.t.t..
there was an awesome article on phpbuilder about buffering output, controlling when things got to the browser... so that you could set cookies/headers anywhere in your script (or, as he talks about, gzip content on the fly beofre outputting it to the browser) http://phpbuilder.com/columns/argeric

RE: [PHP] Libraries (OT)

2001-02-19 Thread ..s.c.o.t.t..
well, i agree about writing some of my own libraries it helps me get to know the language and the features that i am using better. Libraries are a "Good Thing", it's just that i've seen loads of people ask questions (on other lists mostly, since im new here) about things that they'd know abou

RE: [PHP] mysql problem

2001-02-19 Thread ..s.c.o.t.t..
ahhh... yes... :) the linux version is much stricter when it comes to table definitions... i had the same problem trying to declare an INDEX for my table too for linux, any key that you use as an INDEX on a table must be declared NOT NULL (whereas the win32 port doesnt seem to care very m

Re: [PHP] MySQL execution order?

2001-02-22 Thread ..s.c.o.t.t.. [gts]
mysql executes the queries in the order it recieves them, (so if your program's logic executes a select before an update, you'll never see results from the update in your select... at least not normally :) Are you able to access the MySQL monitor program? if so, verify that the data really does

RE: [PHP] do..while(0) not staying true

2001-03-07 Thread ..s.c.o.t.t.. [gts]
or do .. while (0==0); > -Original Message- > From: Jim Winstead [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 07, 2001 2:23 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] do..while(0) not staying true > > > trick question, right? 0 is false. you want do { ... } while(1); > >

RE: [PHP] fopen to validate a URL

2001-03-15 Thread ..s.c.o.t.t.. [gts]
try @fopen(...) prepending a '@' to the mysql funcs will suppress error messages by those functions... maybe it'll work for fopen also. never tried it, though. > -Original Message- > From: Kenneth R Zink II [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 4:58 PM > To: PHP >

RE: [PHP] need some help..

2001-03-15 Thread ..s.c.o.t.t.. [gts]
you could just tar/gzip up the entire tree, open a regular FTP session and FTP it all over in one shot. trying to write the whole thing in PHP is a waste of time if the sole purpose is to move files as easily and quickly as possible. > -Original Message- > From: Andreas D. Landmark [ma

RE: [PHP] passing variables from one form to another

2001-03-15 Thread ..s.c.o.t.t.. [gts]
the same way that you passed information over to the second page. > -Original Message- > From: Don [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 4:09 PM > To: php list > Subject: [PHP] passing variables from one form to another > > > Hi, > > I have a PHP script (script_

RE: [PHP] Error working

2001-03-15 Thread ..s.c.o.t.t.. [gts]
this is a PHP list. your problem is with java, not PHP > -Original Message- > From: Celestino Roberto Alejandro [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 3:34 PM > To: Lista PHPGral > Subject: [PHP] Error working > > > Hello..i'm veri tired, and i am going to require

RE: [PHP] Help! Can't redeclare already declared function in

2001-03-15 Thread ..s.c.o.t.t.. [gts]
try using include_once() and require_once() in place of include() and require() also, make sure you havent defined any functions that match PHP internal funcs. > -Original Message- > From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 3:29 PM > To: php > Subj

RE: [PHP] Re: How do you keep your scripts secure?

2001-03-15 Thread ..s.c.o.t.t.. [gts]
since PHP is executed before any otuput is shown to the browser, all you have to do is keep a server between your code and the other person. unless i am horribly mistaken, you can turn off options to allow people to view PHP source code via their browser. > -Original Message- > From: R

RE: [PHP] Interactive Shells

2001-03-15 Thread ..s.c.o.t.t.. [gts]
of course. if it supports sockets then i dont see why it wouldnt work with a back-n-forth exchange of information over those sockets. php.net/sockets look how much smaller that URL is than all the text you typed out in the message :) always check the online manual first. -Original Message

RE: [PHP] Has anyone got MSSQL2000 to connect and work properlly?

2001-03-15 Thread ..s.c.o.t.t.. [gts]
of course it's possible... :) > -Original Message- > From: Brandon Orther [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 15, 2001 5:33 PM > To: PHP User Group > Subject: [PHP] Has anyone got MSSQL2000 to connect and work properlly? > > > Hello, > > I am trying to get PHP4 to conn

RE: [PHP] Password Generator?

2001-04-19 Thread ..s.c.o.t.t.. [gts]
you could try swapping out some letters with look-alike alphanum characters to make the password a bit more secure a=@ s=$ d=& thus, "password" = "p@$$wor&" > -Original Message- > From: Jon Snell [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 19, 2001 11:47 AM > To: [EMAIL PRO

RE: [PHP] Which is better coding style...

2001-04-19 Thread ..s.c.o.t.t.. [gts]
i say the first style. unneeded variables and other thingies just obscure things and make it harder to maintain. > -Original Message- > From: Boget, Chris [mailto:[EMAIL PROTECTED]] > Subject: [PHP] Which is better coding style... > > Which is better? > > function blah() { > switch(

RE: [PHP] Which is better coding style...

2001-04-19 Thread ..s.c.o.t.t.. [gts]
default: > $retval = "other"; > break; > } > > return $retval; > } > > > -Original Message- > > From: ..s.c.o.t.t.. [gts] [mailto:[EMAIL PROTECTED]] > > Sent: 19 April 2001 21:31 > &

RE: [PHP] PERL vs. PHP

2001-04-20 Thread ..s.c.o.t.t.. [gts]
PHP was started as a suite of perl programs... it is heavily influenced by perl. if you understand PHP and are comfortable with it, you should not have any problems learning Perl. there are some very important differences between the two languages that you need to keep your eyes open for, thing

RE: [PHP] PERL vs. PHP

2001-04-20 Thread ..s.c.o.t.t.. [gts]
i program in both PHP/Perl, and the concepts are extremely similar... granted, there are some similarities to C++, but by far, the largest contributor to PHP's language design has been Perl. > -Original Message- > From: Steve Lawson [mailto:[EMAIL PROTECTED]] > Subject: Re: [PHP] PERL

RE: [PHP] PERL vs. PHP

2001-04-20 Thread ..s.c.o.t.t.. [gts]
ahhh... sorry. i thought the history of PHP was a bunch of perl scripts that were used to keep track of website statistics or somethign guess i was wrong. but since you replied, can i ask what influenced you most when developing PHP? personally, i see perl influence everywhere in PHP, but

RE: [PHP] Another easy question!

2001-04-20 Thread ..s.c.o.t.t.. [gts]
it depends. is it a char restriction that MySQL is placing on you? e.g. a TINYTEXT field type can only contain 255 chars, whereas a TEXT type can contain 16MB (or something like that) if it's a PHP restriction, you'll have to wade thru PHP scripts to find the function that checks the length, and

RE: [PHP] Passing arrays from page to page

2001-04-25 Thread ..s.c.o.t.t.. [gts]
well, one idea is to serialize the array and put into a HIDDEN text field to be submitted with the FORM. or, with no form, try this: "doc.php?myarray=". htmlentities(serialize($array)); > -Original Message- > From: Clif [mailto:[EMAIL PROTECTED]] > Subject: [PHP] Passing arrays from page

RE: [PHP] translating a function from Perl to PHP

2001-04-25 Thread ..s.c.o.t.t.. [gts]
i tried to do it myself and nearly fell off my chair becuase PHP makes you jump through hoops to do such a simple thing print preg_replace('/<%([a-zA-Z]*)%>/e', "\$mioArray['$1']", $testo); i never could understand why other languages made regular expressions so convoluted. why not just sup

RE: [PHP] Filesystem security

2001-04-26 Thread ..s.c.o.t.t.. [gts]
my advice would be to disconnect the box from the internet until you understand how to properly secure it. please read the documentation and manuals before your box gets raped and pillaged > -Original Message- > From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] > Subject: RE: [PHP] F

RE: [PHP] Can I install Lihnux on My Windows 95 machine ?

2001-04-26 Thread ..s.c.o.t.t.. [gts]
the learning curve is smaller than most people think... if you are willing to learn, and refuse to be intimidated by the reputation that has been built up around linux, i doubt you'll have any problems installing and running/using it in a lot of ways, i think linux is probably a more "natural" O

[PHP] Multiple select box and form submitting

2001-05-07 Thread ..s.c.o.t.t.. [gts]
i apologize in advance if the answer to my question is glaringly obvious. i've got a multiple select on a form and want to find out *all* selected values. the form looks like so: First Second Third when the form submits, $form['category'] is not an array of selected values, but rather a sing

RE: [PHP] Variable question (eval is cool)

2001-05-07 Thread ..s.c.o.t.t.. [gts]
$bob = "Roy"; $s = 'Hey there $bob'; $s = 'print "'. $s .'";'; eval ($s); prints: "Hey there Roy"; perhaps that's what you're looking for? > -Original Message- > From: John Vanderbeck [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 07, 2001 4:21 PM > To: King, Justin; [EMAIL PROTECTED]

RE: [PHP] Variable question

2001-05-07 Thread ..s.c.o.t.t.. [gts]
this also works, since you mentioned that you're trying to get away from evalling an "echo" statement. $bob = "Roy"; $s = 'Hey there $bob'; $s = '$somevar = "'. $s .'";'; eval ($s); print $somevar; prints: "Hey there Roy"; personally, i think that using regexps to implement an entire symbol pa

RE: [PHP] conversion script

2001-05-08 Thread ..s.c.o.t.t.. [gts]
if you're renaming to .PHP, i assume that you'll be using PHP. use PHP to solve your problem: This was taken directly from the PHP.net site: if ($dir = @opendir("/tmp")) { while($file = readdir($dir)) { echo "$file\n"; } closedir($dir); } as others have said before, "read the docum

RE: [PHP] php, snmp, and mibs

2001-05-08 Thread ..s.c.o.t.t.. [gts]
as someone else suggested... a regexp is probably the thing you want. since i have no idea what the format of a MIB is, i cannot give you any example. but to find dotted num's, use something akin to this: preg_match_all('/(\d+)(?=\.?)/', $MIB, $matches); > -Original Message- > From:

RE: [PHP] bulletin board or forum

2001-05-10 Thread ..s.c.o.t.t.. [gts]
blaze board is what i use: http://www.bbhacks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

RE: [PHP] if $index=1 how can I create a variable named $column_1

2001-05-10 Thread ..s.c.o.t.t.. [gts]
And even though it's much less elegant than the solution by Sean below, you could also use 'eval' $toast = array("wheat", "rye", "pumpernickel"); $numbreads = count($toast); for ($index = 0; $index < $numbreads; $index++) { eval("\$column$index = '$toast[$index]'; echo

RE: [PHP] Forms and PHP_SELF

2001-05-10 Thread ..s.c.o.t.t.. [gts]
or if you're hellbent on using one form, you could set a cookie "db_insert_formname=1"; so that if the page refreshes, you can check the value of the cookie to make sure you dont re-insert the data > -Original Message- > From: Sandeep Hundal [mailto:[EMAIL PROTECTED]] > Sent: Thursday

RE: [PHP] ereg issues

2001-05-10 Thread ..s.c.o.t.t.. [gts]
print preg_replace('/(.*?)(\w{2})(.*)/', '\\2', $blah); works for: $blah = "*9 scott 777zxsdf"; and $blah = "scott"; > -Original Message- > From: Jerry Lake [mailto:[EMAIL PROTECTED]] > Subject: [PHP] ereg issues > > I'm feeling a bit stupid today > how do I truncate a string to the >

RE: [PHP] regex pattern match and extract

2001-05-10 Thread ..s.c.o.t.t.. [gts]
use match_all to get an array of matches. $s = "[VET]We r NOT [PA]-Crew [TC]"; preg_match_all('/\[.*?\]/', $s, $matches); while (list($k,$v) = each($matches[0])) { print "$k = $v\n"; } prints: 0 = [VET] 1 = [PA] 2 = [TC] > -Original Message- > From: Michael Roark [mailto:[

RE: [PHP] Check this out -> http://www.hotscripts.com/webpoll/results.php

2001-05-10 Thread ..s.c.o.t.t.. [gts]
that's an extremely biased poll... considering that it's a *scripting* website. it's only logical that a majority of people going there would choose a scripting language (and since PHP is so newbie friendly, it also makes sense that it has such broad appeal to the newbie web-programmers at the si

RE: [PHP] I need an authentication method that is good... any Ideas? - please help

2001-03-22 Thread ..s.c.o.t.t.. [gts]
the way i do it for sites that need minimal to medium is to generate a session id whenever a user comes to the site. this session id is stored in mysql table and as a cookie on the user's computer. when the user logs in correctly, the username is stored in the database with the session ID (not a

RE: [PHP] Encryption Problem

2001-03-22 Thread ..s.c.o.t.t.. [gts]
quite possibly you did not compile PHP with mcrypt library support. for linux distrib's, mcrypt is not default, you have to specify ./configure --with-mcrypt to get mcrypt functionality (i dont know whether it's included by default with the win binary, but i doubt it) do the phpinfo() thing and

RE: [PHP] Printing MySQL into HTML Tables

2001-03-22 Thread ..s.c.o.t.t.. [gts]
modulus also works for finding even nums: if ($i % 2) { // not even } > -Original Message- > From: darion mapp [mailto:[EMAIL PROTECTED]] > Subject: Re: [PHP] Printing MySQL into HTML Tables > > > now it seems like you know what is to be done and you are not willing to > do the wo

RE: [PHP] PHP/CGI Help

2001-03-22 Thread ..s.c.o.t.t.. [gts]
do .php files work anywhere else? > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf > Of Maroufski > Sent: Thursday, March 22, 2001 5:41 PM > To: [EMAIL PROTECTED] > Subject: [PHP] PHP/CGI Help > > > Hi all, > This is a tough one, wasn't able to fin

RE: [PHP] Crypt problem

2001-03-22 Thread ..s.c.o.t.t.. [gts]
you dont... as far as i know, crypt only works on <= 8 chars it will truncate anything over 8. perhaps try using md5 or mcrypt... > -Original Message- > From: Randy Johnson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 22, 2001 4:33 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Cry

RE: [PHP] php 4.04pl 1-3 for red hat 7

2001-03-22 Thread ..s.c.o.t.t.. [gts]
check php.net and read the 'README' and 'INSTALL' files that come in the .tar.gz file for more detailed information. very basically, you want to get the sources, untar/zip them, run configure, then build the thing and test it (you can do all of this as an unprivileged user). then install as roo

[PHP] Sessions: suggestions and comments

2001-03-23 Thread ..s.c.o.t.t.. [gts]
what i did was implement my own session class so that i can have a single session variable ($s) and have it handle all my session needs via an OO interface ($s->CleanUp(), $s->Update(), ...) consequently, all of my session data is in a simple assoc. array that's a variable of the session class (

RE: [PHP] How send a file usig PHP code ?

2001-03-23 Thread ..s.c.o.t.t.. [gts]
send the proper HTTP headers and then output the contents of the file here's what i used when i had to prompt the user for a download box for arbitrary binary files (.gif, .zip, .png, .pdf) you might be able to not tell the browser the size of the data, but it's best to offer that informatio

RE: [PHP] BSD/GD/PHP/APACHE/SOS

2001-03-30 Thread ..s.c.o.t.t.. [gts]
i did it for linux. basically, what i did was to get GD and the other libraries, 'configure' and 'make' them all then, go into the PHP directory and tell PHP's configure script where GD and such reside: ex: ./configure --with-gd-dir=../gd-1.8.4/ --with-jpeg-dir=../jpeg-6b/ somthing similar to

RE: [PHP] BSD/GD/PHP/APACHE/SOS

2001-03-30 Thread ..s.c.o.t.t.. [gts]
did you compile apache yourself? try compiling apache yourself and then compiling PHP as a stanalone-CGI (as opposed to server module) and see if that helps any of your prob's. > -Original Message- > From: Louis Grenzebach [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 29, 2001 11:5

RE: [PHP] sanity check please

2001-03-30 Thread ..s.c.o.t.t.. [gts]
well, besides the fact that your code is interpreted and the only data that makes it to the browser is what you decide to output (or error message, but they can be turned off/silenced) i dont see how a surfer could get your PHP source code via the webserver. > -Original Message- > From:

[PHP] compiling PHP4

2001-03-30 Thread ..s.c.o.t.t.. [gts]
has anyone had trouble compiling PHP and GD on a linux/redhat machine?? (what baffles me the most is that it compiled flawlessly on another, almost identical, machine) could anyone offer suggestions or hints, or perhaps suggest a good website/discussion/archive that might address GD-PHP compilati

[PHP] PHP and CVS

2001-04-05 Thread ..s.c.o.t.t.. [gts]
do any of you know of any nice web-interfaces to CVS done in PHP? since i write code at home and at work, i wanted to maintain a single repository for files/code that i frequently use... thanks for any suggestions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMA

Re: [PHP] PHP Book Recommendations

2001-02-16 Thread ..s.c.o.t.t.. [gts]
I agree... The red book "Professional PHP Programming" (WROX "Programmer to Programmer" series) is an exellent PHP book but, if you're looking for novice level stuff, WROX also published a companion called "Beginning PHP4". i was fluent in perl when i picked up the professional one, and had no

Re: [PHP] Finding the? in $REQUEST_URI?page=blah

2001-02-16 Thread ..s.c.o.t.t.. [gts]
i'd use split, to split the value up into an array: if this is your url $url = "/pages/error.php?/pages/login.php?user=scott"; and use this code: $thing = split('\?', $url); print $thing[0] ." \n "; print $thing[1] ." \n "; print $thing[2] ." \n "; output will be: /pages/error.php

Re: [PHP] ereg match problem

2001-02-20 Thread ..s.c.o.t.t.. [gts]
this will work... (if you wnat to check against any other possible domains, just add it into the "|" separated list... (com|edu|cc|uk|org|tv), and so on. (the following regexp should be all on one line) preg_match("/([a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.(com|edu|net|org|tv)/", $email); - Origin

Re: [PHP] Where do i look up return status codes?

2001-02-20 Thread ..s.c.o.t.t.. [gts]
for system("perl test.pl", $retval); and exec("perl test.pl", $ary, $retval); the value of $retval is the value that the perl script "test.pl" returns, (not a perl status code). as someone else suggested, go and look for exit(126) statements (or just exit(), if exit returns the value of a variab