Re: [PHP] How to wrap output of formatted text

2001-02-26 Thread Stephan Ahonen
There's a PHP function that does this. See: http://www.php.net/wordwrap Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to reply by email --

Re: [PHP] Way to generate Passwords

2001-03-01 Thread Stephan Ahonen
gt; $pw.= substr($allowed,$pos,1); > $i++; > } > return $pw; > } > > My questions is, if this is a good or bad way? It's a whole lot better than using real words. As long as you encrypt the passwords using a good one-way hash when you store them on the server, you should be f

Re: [PHP] How to convert a date to an int?(Need help as soon as possible)

2001-03-02 Thread Stephan Ahonen
http://www.php.net/manual/en/function.strtotime.php No need to code it yourself, just say $timestamp = strtotime($livedate) Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single

Re: [PHP] date

2001-03-04 Thread Stephan Ahonen
er a big blanket folder for each entry, you put variables (?) for the timestamp, the general contents of the entry, etc. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s&

Re: [PHP] what does $$ mean?

2001-03-05 Thread Stephan Ahonen
An example of $$variables: Returns: wimpymeat smelly ditto wimpymeat smelly Now, why anyone would want to write a script that returns words like "wimpymeat" is beyond me. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!"

Re: [PHP] hello

2001-01-15 Thread Stephan Ahonen
I don't know about everybody else, but I learned PHP by taking a simple, pre-existing script and upgrading it to my needs by studying the syntax and putting in new code to do what I wanted it to, always keeping the PHP online manual at my side. By just jumping in like that, I've managed to build a

Re: [PHP] password()

2001-01-15 Thread Stephan Ahonen
> Im curious to see how other php developers store their passwd's I store it in the "universal include file" as $password["User"] = "Encrypted password"; Then when the user logs in: if (encryption_function($entered_password) == $password[$entered_username]) { Do this stuff } else{ echo("Please

Re: [PHP] phpwebhosting.com

2001-01-17 Thread Stephan Ahonen
> OC12 > 622 Mb > > Monthly Fee > $550,000 > > Setup Fee > call (prolly between 10k and 20k) Hmm, I think my allowance should be able to cover that. It'll really speed up all the instant messaging I do. Sig for a Day Stephan Ahonen, ICQ 491101 "Don't

Re: [PHP] Profanity Filter

2001-01-19 Thread Stephan Ahonen
I'd make it an array: $filter = array(moron, idiot, pratt); foreach($filter as $badword) { if (strstr($name, $badword)) { do this if it contains one of the bad words } else { do this if it doesn't } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PRO

Re: [PHP] Profanity Filter

2001-01-19 Thread Stephan Ahonen
> I don't like > arrays, because then it requires a programmer to add dirty word... You could probably make an addbadwords.php that loads the filterbadwords.php, does some stupid PHP tricks(tm) to find the line that defines the array, then writes the filterbadwords.php back out with the new words

Re: [PHP] get last directory of a full path? (parent directory)

2001-01-20 Thread Stephan Ahonen
> $i = 1; > foreach ($dirs as $value) { > if ($i == ($numberofelements-1)) $lastdir = $value; > if ($i == $numberofelements) $file = $value; > $i++; > } I don't think the foreach is necessary - Why can't you just say: $lastdir = $dirs[$numberofelements-1]; $file = $dirs[$numberofelements]; T

Re: [PHP] Include statement problems

2001-01-21 Thread Stephan Ahonen
> Any ideas? Work arounds? I am using PHP3. Try: $page = str_replace("?", "&", $page); That'll change: include.html?page=main.html?date=12 into: include.html?page=main.html&date=12 So the variables get passed properly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-

Re: [PHP] How to count time in php

2001-01-22 Thread Stephan Ahonen
talseconds / 60) . " minutes."); to get the total number of minutes. Use ceil() instead of floor() if you want to round up instead of down, or just echo((int)$totalseconds); to round to the nearest integer. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, n

Re: [PHP] News gateway question

2001-01-23 Thread Stephan Ahonen
> Is there any easy way to post to the group instead? I'm reading and posting from the very handy news://news.php.net server they have set up. It's just the coolest! =) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: [PHP] Greek PHP mailing list

2001-01-24 Thread Stephan Ahonen
> Ah, the good ol' days of sitting in college Match classes not understanding > all those letters on the chalkboard. :-) At least you're not sitting in high school calculus and actually understanding everything on the board, but not being able to use any of it because Texas Instruments is the onl

Re: [PHP] Greek PHP mailing list

2001-01-25 Thread Stephan Ahonen
> Ah now, but who would use a HP, when you've got your trusty TI? :-) Yup, especially since all the games are on the TI, though they're pretty scarce for the 89, my personal preference, since they're more expensive, so fewer people have them. The options: Get a graph-link cable (which I can't fi

Re: [PHP] expressions

2001-01-26 Thread Stephan Ahonen
> if ($co_area != !ereg("([0-9]{3})",$co_area)) > { echo " * Area code must be 3 digital"; } I don't know anything about ereg and regex, so if there's an error in that part I won't be able to help with that, but I can tell you that ($something != !$something_else) is a double negative, it's like

Re: [PHP] Good Reads

2001-01-27 Thread Stephan Ahonen
As much as reading a book is helpful in getting you started really quick, I was able to do most of my learning by taking a simple "web page on a template" script, studying the syntax, and trying to improve it, keeping the language reference nearby for the stuff I didn't know. After a couple weeks,

Re: [PHP] Problem with a regex!

2001-01-29 Thread Stephan Ahonen
> Your not going to find {title} when $var = "TITLE". Everything PHP is case > sensitive. If it absolutely *has* to be case insensitive, you can use eregi instead of ereg. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: [PHP] Problem!

2001-01-29 Thread Stephan Ahonen
<<1. $date = "20010101"; How could I output 01 01 2001 (or make it 3 variables, like day, month, year)?>> $year = substr($date,0,4); $month = substr($date,4,2); $day = substr($date,6,2); ...Assuming that the date is stored in mmdd format. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] VIRUS ON LIST?

2001-02-01 Thread Stephan Ahonen
> You left some attributes off: > > $retaliation = explode("",$badjoke); Either that, or: $joke = str_replace($badjoke,$goodjoke,$joke); Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorro

Re: [PHP] Want to learn PHP

2001-02-01 Thread Stephan Ahonen
s. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to reply by email -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: [PHP] contracting & consulting (was "[PHP] Pricing for PHP pr ogramming???")

2001-02-01 Thread Stephan Ahonen
How about making a mailing list for job postings, i.e. [EMAIL PROTECTED]? -- 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] update two frames at once?

2001-03-12 Thread Stephan Ahonen
sectionframeset.html Clear as mud? Take a look at http://www.geocities.com/tfc_squad/, my attempt at a web page for an ill-fated TFC clan. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single

Re: [PHP] Script to convert # of seconds to HH:mm

2001-03-19 Thread Stephan Ahonen
> Oh in addition this won't work accurately if $time is greater than about 2 > billion(2147483648 I believe). This shouldn't be a problem unless you're calculating how many hours and minutes a really old guy (>68) has been alive or something. Sig for a Day Stephan Ah

Re: [PHP] How to convert '2001032018' -> '2001 03 20 18' ? (Fomating Date)

2001-03-20 Thread Stephan Ahonen
. Look at the on-line manual (http://www.php.net/manual/en/) under String Functions. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to reply by email -- PHP General Mailin

Re: [PHP] Decrypt Function?

2001-03-25 Thread Stephan Ahonen
tore them on the server, nobody can see the actual passwords. Now when someone tries to login with one of those passwords, you crypt the password he enters, compare it with the version on the server, and if they match, it's the right password. Sig for a Day Stephan Ahonen, ICQ 491101 "Th

Re: [PHP] The ubitquitous forum project

2001-03-25 Thread Stephan Ahonen
> Any advice? USENET style threads. I *really* hate Phorum-style threads, where everything's just tacked onto the end. Though Phorum-style is easier, it really detracts from the conversation when you have to write whose post you're replying to in your replies. Sig for a Day Stepha

Re: [PHP] The ubitquitous forum project

2001-03-26 Thread Stephan Ahonen
[Explanation of UBB-style] ...And that's USENET-style. In OE I can expand and contract threads at will, like you mentioned, and I can tell which posts are in reply to which other posts. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clot

Re: [PHP] Better way (if...elseif...else)

2001-03-29 Thread Stephan Ahonen
;); $val_name = array("High","Medium","Low"); $fcol_name = array("high","med","low"); $count = count($val); for ($counter = 0; $counter < $count; $counter++) { $selected = ""; if ($val[$counter] == $priority) { $selected = "

Re: [PHP] Better way (if...elseif...else)

2001-03-30 Thread Stephan Ahonen
$pstr.="selected"; > $fcol=$fc_arr[$x]; > } > $pstr.=">$ptext_arr[$x]\n"; > } Even better! This looks like to winning entry for our mini-programming contest. =) Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now b

Re: [PHP] How to limit a WHILE statement?

2001-04-02 Thread Stephan Ahonen
$count = 0; while (($myrow = mysql_fetch_array($result))&&($count<20)) { do stuff $count++; } Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to repl

[PHP] Need some RegEx help

2001-07-19 Thread Stephan Ahonen
Okay, I've been asked to take a bunch of HTML pages and turn them into Excel spreadsheets by running them through a PHP script and outputting a semicolon-delimited text file. The pages are in this format: Name: LAST, FIRST MIDDLE Pilot's Address : ADDRESS LINE 1

Re: [PHP] Can php give me row number?

2001-05-06 Thread Stephan Ahonen
y index you find the word in is the line number. To save a couple lines of code, use the file() function, it returns the contents conveniently pre-split into the array. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow f

Re: [PHP] OT question..

2001-05-08 Thread Stephan Ahonen
#x27;s trying to get crawl into absolute power so we can recognize it and prevent it when it happens. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to reply by e