Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread John Taylor-Johnston
;#112;#45;#103;#101;#110;#101;#114;#97;#108;#64;#108;#105;#115;#116;#115;#46;#112;#104;#112;#46;#110;#101;#116; On 2/27/07, John Taylor-Johnston [EMAIL PROTECTED] wrote: I need an anti-spam-spider measure for my site. Too many addresses are getting raked. In once instance, I created a flash

[PHP] echo text - anti-spam-spider measure

2007-02-27 Thread John Taylor-Johnston
I need an anti-spam-spider measure for my site. Too many addresses are getting raked. In once instance, I created a flash page: http://erasethis.glquebec.org/English/contact.htm But I just don't have the time to create a flash image for every single instance, most of which come from dynamically

Re: [PHP] echo text - anti-spam-spider measure

2007-02-27 Thread John Taylor-Johnston
it, you would use preg_replace_callback('~([\d\w])~', create_function('$a', 'return #.ord($a[0]).;;'), $theEmail); Hopefully that works? On 2/27/07, John Taylor-Johnston [EMAIL PROTECTED] wrote: How do I encode it? And would the href tag work? Casey Chu wrote: ^ So put that into a a href tag

Re: [PHP] echo text - anti-spam-spider measure

2007-02-28 Thread John Taylor-Johnston
Can I PHP generate a flash *.swf? How? If not how do I PHP generate a *.png or gif? Jochem Maas wrote: Stut wrote: Of course the best way is to use an image and don't link it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] echo date('Y-m-d', $mydata-timestamp);

2007-04-22 Thread John Taylor-Johnston
$mydata-timestamp = 20070419162123; echo date('Y-m-d', $mydata-timestamp); result: 2038-01-18 ?? What is wrong?? Should be 2007-04-19? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] echo date('Y-m-d', $mydata-timestamp);

2007-04-22 Thread John Taylor-Johnston
It is actually a generated timestamp in MySQL. timestamp(14) Now what? I was hoping to avoid: |echo substr(|$mydata-timestamp|, 0, 8); John |Richard Lynch wrote: On Sun, April 22, 2007 1:05 am, John Taylor-Johnston wrote: $mydata-timestamp = 20070419162123; echo date('Y-m-d', $mydata

[PHP] make a gif

2007-04-23 Thread John Taylor-Johnston
I want to print [EMAIL PROTECTED] into a gif or png. How do I do this? Thanks. It seems too simple to ask. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] make a gif

2007-04-24 Thread John Taylor-Johnston
Excellent. I was trying to figure out how to use colour from the example in the manual. This is easier. Thanks! John Richard Lynch wrote: On Mon, April 23, 2007 12:01 pm, John Taylor-Johnston wrote: I want to print [EMAIL PROTECTED] into a gif or png. How do I do this? Thanks. It seems too

[PHP] Object of class stdClass could not be converted to string

2009-11-30 Thread John Taylor-Johnston
Good grief. It doesn't like printing an INT field like as if it were a string?? I looked at: http://php.ca/manual-lookup.php?pattern=stringtoint like I might of in Delphi :)p echo td$mydata-2010/td\n; echo td$mydata-2009/td\n; Is this something new in PHP? Geez. John -- PHP

[PHP] Newbie needs help

2010-01-07 Thread John Taylor-Johnston
$content = ... a bunch of text with some !--protected--protected information!--/protected-- with some more text with some more !--protected--tabletrtdmore protected text/td/tr/table!--/protected-- and even !--protected--bsome protected contentb!--/protected--; I want to replace any content

Re: [PHP] Newbie needs help

2010-01-07 Thread John Taylor-Johnston
' ~viraj On Thu, Jan 7, 2010 at 2:16 PM, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: $content = ... a bunch of text with some!--protected--protected information!--/protected-- with some more text with some more !--protected--tabletrtdmore protected text/td/tr/table

[PHP] parse date field

2010-01-14 Thread John Taylor-Johnston
How do I parse a date field from mysql? I was hoping this would work: $mydata-birthday = 2007-02-13; #What month is it? echo date(F, $mydata-birthday); #What year is it? echo date(Y, $mydata-birthday); What am I missing? All I get is December 1969. Hmmm? I am looking at the manual:

Re: [PHP] parse date field

2010-01-14 Thread John Taylor-Johnston
, John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca mailto:john.taylor-johns...@cegepsherbrooke.qc.ca wrote: How do I parse a date field from mysql? I was hoping this would work: $mydata-birthday = 2007-02-13; #What month is it? echo date(F, $mydata-birthday

[PHP] strtotime

2010-01-14 Thread John Taylor-Johnston
Hello, In a mysql date() field, I set the default to -00-00. Therefore, $mydata-birthday = -00-00; But when I run this next line, $then = 1969. $then=date(Y, strtotime($mydata-birthday)); Why 1969, and not 0 or nothing? If I echo strtotime(-00-00); Nothing appears. So $then

Re: [PHP] strtotime

2010-01-14 Thread John Taylor-Johnston
My thanks to all! Adam Richardson wrote: I've not read this, but if the first valid date is Jan. 1st, 1970, then passing that date back in the case of errors would lead to ambiguity. Is it a valid date or is it an error. Passing back the date of the day just before (in terms of time, I

[PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
Ok, I think this is a MySQl question. Take pity on me? $sql = SELECT * FROM $db.`mailinglist` WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY `rollnumber` ASC; rollnumber is a varchar(50). I need it to be a text field. ASC does not order the way I want. 1000 1001 998 999

Re: [PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
. Cheers, Rob. John Taylor-Johnston wrote: Ok, I think this is a MySQl question. Take pity on me? $sql = SELECT * FROM $db.`mailinglist` WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY `rollnumber` ASC; rollnumber is a varchar(50). I need it to be a text field. ASC does not order

Re: [PHP] order by ASC

2010-01-16 Thread John Taylor-Johnston
Did some googling. This worked: ORDER BY CAST(`rollnumber` AS SIGNED) What is the difference? My problem in the meanwhile must be my version of MySQL? John Taylor-Johnston wrote: It hates me: SELECT * FROM ... WHERE `type` IN ('Member', 'Affiliated', 'Life Member') ORDER BY CAST(rollnumber

[PHP] If the first four characters are 0000, then do {}

2010-01-25 Thread John Taylor-Johnston
I am reading the manual: http://ca.php.net/manual/en/ref.strings.php $mydata-restored = -00-00; How do I express this? If the first four characters are , then do {} What I am looking for is in strpos(), no? if () { } -- PHP General Mailing List (http://www.php.net/) To

[PHP] strtotime

2010-10-16 Thread John Taylor-Johnston
$now=date(Y-m-d); A = $mydata-birthday = 1928-02-12; B = $mydata-birthday = 1965-03-18; C = $mydata-birthday = 1976-04-11; I'm doing a demographic sort. How do I calculate whether $mydata-Birthday falls into these categories below? I'm working my way right now through the manual:

[PHP] Re: strtotime

2010-10-16 Thread John Taylor-Johnston
(d) - $day; if ($day_diff 0 || $month_diff 0) $year_diff--; return $year_diff; } echo birthday ($birthday); John Taylor-Johnston wrote: I'm working my way right now through the manual: http://ca.php.net/manual/en/function.strtotime.php. -- PHP General Mailing List (http

Re: [PHP] Re: strtotime

2010-10-17 Thread John Taylor-Johnston
Yaay, I'm 45 now :). Here is another nifty piece of code I found. How does this work? What is 31556926? function calculateAge($birthday){ return floor((time() - strtotime($birthday))/31556926); } echo calculateAge('1965-10-17'); http://ca.php.net/manual/en/function.floor.php

[PHP] 9970318527584

2011-02-18 Thread John Taylor-Johnston
9970318527584 Could this number refer to a date()? In late 2009? How could I calculate it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Connect to Google

2012-02-16 Thread John Taylor-Johnston
I'm a teacher. I want to use PHP to interface with Google and see if a student has plagiarized. I don't see many open-source projects on the subject, so I want to create my own script. How can I use PHP to interface with Google and see if this text exists on the internet? If this is

Re: [PHP] Connect to Google

2012-02-16 Thread John Taylor-Johnston
intuitive.) Thanks Ash. John Ashley Sheridan wrote: On Wed, 2012-02-15 at 21:56 -0500, John Taylor-Johnston wrote: How can I use PHP to interface with Google and see if this text exists on the internet? Wow, that's a pretty big project you're chewing there. A quick search shows

Re: [PHP] Connect to Google

2012-02-16 Thread John Taylor-Johnston
I'm a top quoter. I would parse the text first. Phrase by phrase, or phrase segments. Then spit out a report. Marc Guay wrote: If that's not good enough, can you explain how you would like it to function? Would the whole paper be scanned phrase-by-phrase for matches and then spit out a report?

[PHP] How do I do count the occurrence of each word?

2012-08-18 Thread John Taylor-Johnston
I want to parse this text and count the occurrence of each word: $text = http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.html; #Can I do this? $stripping = strip_tags($text); #get rid of html $stripping = strtolower($stripping); #put in lowercase First of all I

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-08-20 Thread John Taylor-Johnston
This is usually a first-year CS programming problem (word frequency counts) complicated a little bit by needing to extract the text. You've started off fine, stripping tags, converting to lower case, you'll want to either convert or strip HTML entities as well, deciding what you want to do

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-09-01 Thread John Taylor-Johnston
See: http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps In $mystring, I need to extract everything between |News Releases| and -30. The thing now is $mystring might contain many instances of |News Releases| and

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-09-02 Thread John Taylor-Johnston
On Sun, Sep 2, 2012 at 6:23 AM, John Taylor-Johnston jt.johns...@usherbrooke.ca wrote: See: http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps In $mystring, I need to extract everything between |News Releases

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-09-02 Thread John Taylor-Johnston
Frank Arensmeier wrote: See: http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps In $mystring, I need to extract everything between |News Releases| and -30. My approach would be to split the hole text into

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-09-02 Thread John Taylor-Johnston
See: http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps In $mystring, I need to extract everything between |News Releases| and -30. The thing now is $mystring might contain many instances of |News Releases| and -30.

[PHP] array_push

2012-09-02 Thread John Taylor-Johnston
How can I clean this up? My approach would be to split the hole text into smaller chunks (with e.g. explode()) and extract the interesting parts with a regular expression. Maybe this will give you some ideas: $chunks = explode(-30-, $mystring); foreach($chunks as $chunk) {

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-09-02 Thread John Taylor-Johnston
tamouse mailing lists wrote: Just to prove me right, our mail clients start quoting from the top too :)p tamouse mailing lists wrote: On Sun, Sep 2, 2012 at 11:31 AM, John Taylor-Johnston jt.johns...@usherbrooke.ca wrote: I'll never get it. Newest work on top of the pile, instead of digging

Re: [PHP] extract Occurrences AFTER ... and before -30-

2012-09-02 Thread John Taylor-Johnston
tamouse mailing lists wrote: On Sun, Sep 2, 2012 at 7:57 PM, John Taylor-Johnston jt.johns...@usherbrooke.ca wrote: Just to prove me right, our mail clients start quoting from the top too :)p Exactly. The quoting starts from the *top*. The problem is that the cursor to start typing is also put

Re: [PHP] array_push

2012-09-02 Thread John Taylor-Johnston
Frank Arensmeier wrote: 2 sep 2012 kl. 19.48 skrev John Taylor-Johnston: Why not add two lines of code within the first loop? $chunks = explode(-30-, $mystring); foreach($chunks as $chunk) { preg_match_all(/News Releases\n(.+)/s, $chunk, $matches); foreach($matches[1

[PHP] load rtf file

2012-09-02 Thread John Taylor-Johnston
I have a big giant RTF file. I could convert it to plain text. BUT can PHP do it for me? Also: I want to read the text file into a string. This does the job well, right? http://php.net/manual/en/function.file-get-contents.php This is it? Not more complicated? |?php $homepage =

[PHP] ksort by value

2012-09-03 Thread John Taylor-Johnston
Hi, ?php ... $words = preg_split('/[[:space:]]+/',$mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? If I have my terminology right, ksort($freq) sorts the array by the key. And that works fine. But I would also like to sort by value to see

Re: [PHP] ksort by value

2012-09-03 Thread John Taylor-Johnston
?php ... $words = preg_split('/[[:space:]]+/',$mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? ksort($freq) sorts the array by the key. And that works fine. But I would also like to sort by value to see which words are more frequent. There is

Re: [PHP] ksort by value

2012-09-03 Thread John Taylor-Johnston
?php ... $words = preg_split('/[[:space:]]+/',$mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? ksort($freq) sorts the array by the key. And that works fine. But I would also like to sort by value to see which words are more frequent. There is

Re: [PHP] ksort by value

2012-09-03 Thread John Taylor-Johnston
Serge Fonville wrote: Have you looked at http://php.net/manual/en/array.sorting.php? 2012/9/3 John Taylor-Johnston jt.johns...@usherbrooke.ca mailto:jt.johns...@usherbrooke.ca ?php ... $words = preg_split('/[[:space:]]+/',$mynewstring

Re: [PHP] ksort by value

2012-09-03 Thread John Taylor-Johnston
?php ... $words = preg_split('/[[:space:]]+/',$mynewstring); foreach ($words as $word) { $freq[$word]++; } ksort($freq); print_r ($freq); ? Sort does not work seamlessly. I have my key

Re: [PHP] ksort by value

2012-09-03 Thread John Taylor-Johnston
groet, Serge Fonville http://www.sergefonville.nl Convince Microsoft! They need to add TRUNCATE PARTITION in SQL Server https://connect.microsoft.com/SQLServer/feedback/details/417926/truncate-partition-of-partitioned-table 2012/9/3 John Taylor-Johnston jt.johns...@usherbrooke.ca

[PHP] array.sorting.php

2012-09-04 Thread John Taylor-Johnston
Hi, Sorting question. http://www.php.net/manual/en/array.sorting.php I'm using ksort, which sorts like this. I don't want to use strolower. Is there a function/switch in one of the sort functions where I could get another aphabetical sort? http://www.php.net/manual/en/array.sorting.php has a

Re: [PHP] array.sorting.php

2012-09-04 Thread John Taylor-Johnston
The problem is I'm sorting the key. The alphabetical thing is in the key. David OBrien wrote: On Tue, Sep 4, 2012 at 1:15 PM, John Taylor-Johnston jt.johns...@usherbrooke.ca mailto:jt.johns...@usherbrooke.ca wrote: Hi, Sorting question. http://www.php.net/manual/en

Re: [PHP] array.sorting.php

2012-09-04 Thread John Taylor-Johnston
David OBrien wrote: On Tue, Sep 4, 2012 at 1:15 PM, John Taylor-Johnston jt.johns...@usherbrooke.ca mailto:jt.johns...@usherbrooke.ca wrote: Hi, Sorting question. http://www.php.net/manual/en/array.sorting.php I'm using ksort, which sorts like this. I don't want to use

Re: [PHP] array.sorting.php

2012-09-04 Thread John Taylor-Johnston
Matijn Woudt wrote: Taken from the natsort manual page comments: ?php /** * keyNatSort does a natural sort via key on the supplied array. * * @param $array The array to natural sort via key. * @param $saveMemory If true will delete values from the original array as it builds the

[PHP] base64_decode

2012-10-02 Thread John Taylor-Johnston
Without anyone infecting their machines, can someone tell me what this is? I found a phishing site on my DreamHost server. DreamHost has been very helpful. We found a file containing this code. What is it? What does it contain? ?php

[PHP] Re: {ATTENTION} Re: [PHP] base64_decode

2012-10-02 Thread John Taylor-Johnston
to be* http://web-hosting-click.com/; title=Web hostingWeb hosting/a !-- 27 queries. 0.561 seconds. -- /div ?php wp_footer(); ? /body /html ? Appears that is nothing dangerous, only unauthorized advertising. Em 02-10-2012 14:27, John Taylor-Johnston escreveu: Without anyone infecting their machines

[PHP] parsing select multiple=multiple

2013-02-18 Thread John Taylor-Johnston
I am capable with select name=DPRpriority. (I suppose I did it correctly? :p ) But I haven't the first clue how to parse a select multiple and multiply select name=DPRtype. Would anyone give me a couple of clues please? :) Thanks, John Priority: select name=DPRpriority

Re: [PHP] parsing select multiple=multiple

2013-02-18 Thread John Taylor-Johnston
select multiple=multiple name=DPRtype form=DPRform option value=1. Crimes Against Persons1. Crimes Against Persons/option option value=2. Disturbances2. Disturbances/option option value=3. Assistance / Medical3. Assistance / Medical/option

Re: [PHP] parsing select multiple=multiple

2013-02-19 Thread John Taylor-Johnston
tamouse mailing lists wrote: I hate arrays. :D Here's a small snippet showing how it works, I hope: foreach ($DPRpriority as $item = $value) { echo li .$item.: .$value['name']. selected: .$value['selected']. /li\n; } Question 1: when did we have to add [] to a input name to turn it into

[PHP] phpinfo()

2013-02-19 Thread John Taylor-Johnston
I cannot find button2 in phpinfo() when I click it. I was hoping to find a $_POST[button2] value. What am I doing wrong? input type=button name=button2 id=button2 value=Print Mode onclick=formSubmit() I really wanted to use a button to pass a different condition than a input type=submit

[PHP] if (empty versus if (isset

2013-02-19 Thread John Taylor-Johnston
What is the difference between? if (empty... http://www.php.net/manual/en/function.empty.php Determine whether a variable is empty and if (isset... http://php.net/manual/en/function.isset.php Determine if a variable is set and is not *|NULL|* I have an input type=radio value=something. If

[PHP] stripped \n

2013-02-20 Thread John Taylor-Johnston
Hi, I have a textarea when submitted creates a new form with the textarea data in a hidden field: input name=DPRnarration type=text hidden form=DPRform value=Enter call narration here. But when this new form gets resubmitted, the \n get stripped? input name=DPRnarration type=text hidden

Re: [PHP] phpinfo()

2013-02-20 Thread John Taylor-Johnston
Design in Motion Webdesign wrote: John Taylor-Johnston john.taylor-johns...@cegepsherbrooke.qc.ca wrote: I cannot find button2 in phpinfo() when I click it. I was hoping to find a $_POST[button2] value. What am I doing wrong? input type=button name=button2 id=button2 value=Print Mode

[PHP] Open form in new window

2013-03-03 Thread John Taylor-Johnston
I have many different submit button. input value=Update type=submit input name=DPRmode value=Enter Data type=submit When php processes value=Enter Data, I would like to open a new window, but only if I click this one. Possible? I knw ther is an HTML target= thingy. Can PHP do anything magic?

Re: [PHP] Re: Open form in new window

2013-03-04 Thread John Taylor-Johnston
You could echo HTML code e.g. Which is still purely HTML and has nothing whatsoever to do with PHP. form action=result.php method=post Number: input id=quantity type=text / button type=button onclick=OpenWindow()Submit/button /form or include it as one of

Re: [PHP] Open form in new window

2013-03-04 Thread John Taylor-Johnston
If you want to open a new page in response to a submit button press (using PHP) you may be out of luck. I don't know of a way to do it without involving another language. Opening a different page in the *same* window, yes. Otherwise, no. But watch the other replies. Maybe someone knows

[PHP] Populate input from another form

2013-03-08 Thread John Taylor-Johnston
I have a form form action=CRTP_Query.php id=CRTP_Query method=post target=_CRTPinput value=Query form=CRTP_Query type=submit/form OnSubmit, I want to include data from another form (form=DPRform). input name=DPRsurname type=text form=DPRform size=20 value=?php echo

[PHP] Re: Populate input from another form

2013-03-08 Thread John Taylor-Johnston
Scratch that, IE does not like form elements outside the /form!!?? :,( I can't a form within a form either, unless ... I float a div??. John Taylor-Johnston wrote: I have a form form action=CRTP_Query.php id=CRTP_Query method=post target=_CRTPinput value=Query form=CRTP_Query type=submit

[PHP] isset empty or ...?

2013-03-30 Thread John Taylor-Johnston
I'm using if($mydata-DPRresponselocationaddress1 != ) is this the same as if (!isset($mydata-DPRresponselocationaddress)) http://php.net/manual/en/function.isset.php or if (!empty($mydata-DPRresponselocationaddress)) http://php.net/manual/en/function.empty.php or is there another function I

<    1   2   3   4   5   6