[PHP] masters thesis
Hi, Not your usual question. Sort of off-topic, but not really. I'm doing a masters thesis on the interdisciplinary study of the use of computer technology (especially MySQL, PHP PHPMyAdmin) in the study of and research on Comparative Canadian Literature. http://compcanlit.ca/ ... Humanities prof :o) I'm looking for other university academics, that might pop by, who can help me find academic discussions, articles in academic journals or even magazines of what, how, why researchers have used databasing, especially PHP MySQL, how it has improved their work, etc. I would even consider a good article from the e-commerce world. I'm not so concerned about the technical or coding side as I am the discussion of how, why, where, when PHP, MySQL (OBDC, Oracle, etc.) were implanted in your research. I can't be the only one out there using PHP, PHPMyAdmin, MySQL, etc.? Thanks for being a little off-topic. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: redirection
Renaldo, Of course, I use: ?php header('Location: http://www.whereIWantToGo.com'); ? A less simple way is to creatre an .htaccess file (Apache server) redirect /MyCurrentWebDirectory http://www.whereIWantToGo.com There is no slash at the end of that line. Careful, John Renaldo De Silva wrote: is there any way other than header(Location: http://www.php.net/;); to redirect to another page. -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem
Yes. I had something similar. Try putting 'Reply-To: [EMAIL PROTECTED]' in the fourth argument for mail. For some reason some systems balk without a reply address, I'm not certain why? I questioned my ISP on that. They had something in their sendmail.exe which prevented outgoing mail (scripts using smtp) that did not have a from: or reply-to: - something to do with stopping clients from spamming without correctly identifying themselves. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Alocating file in memory...
I did something like that in Perl by creating a .tmp file? Not enough experi3ence with PHP, but should be do-able? Paulo Cesar wrote: Hi, I'd like to know if there is a way to keep a file alocated in the server memory, so when the users access a page that includes the file the server doesn't need to alocate it in memory each time. Thanks Paulo Cesar -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Apache Module AND command Line
I can. I did it once in windows on a dos command line. I believe I used print ; instead of echo aaa; Steve Buehler wrote: Is there doc somewhere to would tell how to install PHP as a command line interpreter (like perl) without messing up the installation of PHP that is installed as a module in/for Apache? Basically, I want to have both on the same server. Or can this even be done? Thank You Steve -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Passing variable to new page and pulling the rest of info from database
Should find enough code for displaying graphics (and sending by smtp) in this code. You'll find some session stuff too. HTH J http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/index.html.phps http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/display_image.phps http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/display_postcard.phps http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/postcard.phps http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/send_mail.phps http://www.collegeSherbrooke.qc.ca/languesmodernes/postcard/include_images.inc.phps Igor Portnoy wrote: I am passing a variable to the new page, when user clicks on the link. Something like that: a href=showimage.php?ID=38img src=/some/image.jpg/a -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Finding out how a variable was registered
If you change your header to pragma-nocache, he should not be able to see the source to know what elements he needs for a method=get. Or you could also use a session to hide the variables? Joe Pemberton wrote: Is there a function call to figure out how a variable was registered? I am writing a page that handles a form and I need to know whether or not a variable was created using the GET or POST method (I don't want the user to be able to to 'foo.php?var=value' and mess with the results) - - Joe [EMAIL PROTECTED] -- John Taylor-Johnston - ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text file
I want to open a text file which has 12 lines and (1) insert a new line at line[0] (2) re-save the text file only with 12 lines (Therefore line[12] gets chopped out. I had some code to do this with Perl. open (NEW, $filepath\\$file); print NEW $something; for ($i = 2; $i 12; $i++) { print NEW $lines[$i]; print $lines[$i]; } How can I do it now with PHP? Open the file (http://www.php.net/manual/en/function.fopen.php) Suck a text file into an array. ---?? Insert at line[0] ---?? and rewrite the file. (http://www.php.net/manual/en/function.fopen.php) John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHPMyAdmin Alternative?
Are there alternatives to PHPMyAdmin available? www.mysql.com/ is supposed to have one, no? -- John Taylor-Johnston - - Université de Sherbrooke: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date?
? echo date (l., .F. .d., .Y); ? Sunday, June 09, 2002 But I would use: ?php echo date (l., .F. .d., .Y); ? Don't know why, but someone told me once it had something to do with versions. John Jeremy Bowen wrote: I am having nothing but trouble with the date function. I want it to print out a date like this: Saturday June 8, 2002 but as soon as I put spaces or comma's in the string I get parse errors. I can get it to print SaturdayJune082002 with ? echo date (lFdY); ? I have tried escaping with \ but it seems to make no difference. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Javascript PHP cookies
Absolutely. I've done it. Cookies are cookies. What I don't like is that the cookie is not saved unitl after a submit. In Javascript, I have JS code that will assign a value and save it to a cookie and then recall the cookie value and document.write(myvalue), over and over if I want, without EVER submitting. It works as the page loads. Need JS code? [EMAIL PROTECTED] www.tececo.com
[PHP] Re: Date?
I added a comment to the FAQ: http://www.php.net/manual/en/function.date.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHPMyAdmin Alternative?
This a binary? I was hoping for a web-based (PHP, Perl, ASP, etc.) alternative - like PHPMyAdmin - to analyse. César l . aracena wrote: Look in http://www.mysql.com/downloads/gui-mycc.html and download the The problem is that you can't issue multiple SQL queries, but that will be solved. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] alternatives? (Was: Shot in the dark)
Sorry Chris, It's set at June 20th here? Maybe my NNTP server? John Chris Garaffa wrote: Hello, any chance you could set your clock to the correct date? It says July 6, and is really screwing up my sorting order for mail... thanks On Saturday, July 6, 2002, at 04:49 PM, jtjohnston -- Chris Garaffa [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Looking for a forum
Hi, I'm looking for some forum script, a bit like this: http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi Can anyone post a link to something useful? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Owner
Hi, Who is the forum's owner? I want to post questions using [EMAIL PROTECTED] and [EMAIL PROTECTED] in my from: and reply-to: I post infrequently to this list using news://news.php.net/php.general NOT [EMAIL PROTECTED] This is about the only list I post to. I've been receiving a lot of spam from Korea lately and what to put a stop to it, or at least slow it down. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Owner
Justin, Best advice is to post strictly to the newsgroup with a dud email address, Unfortunately, that doesn't work. I had a hotmail address, but not acceptable. Someone did not put it on the accepted' list. Someone back there needs to accept that address to allow that poster to post when using news://news.php.net/php.general. Been through that. That's what I want to do now. Who is he? I would like to work something out with him. filter out anything to that address which doesn't have [PHP] in the subject I've been filtering :) Using 'nospam' in your address' prolly doesn't help as much as it used to, True, But I could work around that too, when I talk with the chap in charge :) Fun huh? Giggle loads :p Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GURU HELP: session_unset
http://www.CollegeSherbrooke.qc.ca/~languesmodernes/course/test_session.phps I'm trying to session_unset() - it worked I thought. session_unset(postcard); unset($postcard); unset($MyImage); Go to: http://www.CollegeSherbrooke.qc.ca/~languesmodernes/course/test_session.php and click me. It sets a session, displays an image, and then is supposed to destroy itself so that when I go back to http://www.CollegeSherbrooke.qc.ca/~languesmodernes/course/test_session.php (and or reload http://www.CollegeSherbrooke.qc.ca/~languesmodernes/course/test_session.php) I should see the text/html header and not an image/png header. The only way to right myself is to exit Netscape altogether. I have tried session_destroy() session_unregister and even session_write_close - not that any of those worked. I consulted the online manual and thought this would be enough: session_unset(postcard); unset($postcard); unset($MyImage); I have even used the echo on line 3 to prove to myself that my session terminated itself. I believe the session terminates, but for what ever reason, http://www.CollegeSherbrooke.qc.ca/~languesmodernes/course/test_session.php is still receiving header(Content-type: image/png) and not header(Content-type: text/html) Can someone help? John (Post reply would be helpful please.) -- 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]
[PHP] Re: GURU HELP: session_unset
Source is here: http://www.CollegeSherbrooke.qc.ca/~languesmodernes/course/test_session.phps -- 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]
[PHP] Session help
Start at index.html. It goes to postcard.php. When I click on submit in postcard.php, if I change any of the values in the form, the session values received in send_mail.php do not change. Anyone have an idea what I have done wrong now? http://www.CollegeSherbrooke.qc.ca/~languesmodernes/postcard/index.html.phps http://www.CollegeSherbrooke.qc.ca/~languesmodernes/postcard/postcard.phps http://www.CollegeSherbrooke.qc.ca/~languesmodernes/postcard/display_image.phps http://www.CollegeSherbrooke.qc.ca/~languesmodernes/postcard/send_mail.phps John -- 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] IP Address Variable
It may not work, if you are running Windows PHP on your localhost at home. I'll bet you are trying to log getenv('REMOTE_HOST'). Been there done that. I use http://www.indigostar.com/microweb.htm to create a localhost to develop and debug and then upload to the server. (I pay for modem time.) I remember this not working if I used it at home. Are you sure you are not looking for getenv('REMOTE_HOST') in addition to getenv('REMOTE_ADDR'} You may want this instead. Here's some of my code: ?php $machine = getenv('REMOTE_HOST'); if(!strpos($machine, collegesherbrooke.qc.ca)) { include exterior.html; }else{ echo FRAMESET cols=\200,*\ FRAME src=\index_tree.html\ name=\treeframe\ FRAME SRC=\college.html\ name=\basefrm\ /FRAMESET; } ? -- 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]
[PHP] calculate a varchar
Is there a calculation function? I'm using an e-commerce shopping cart. I want to tweak the code. The author is using a varchar(100) field to store prices. Taking advantage of there being a varchar, instead of entering a price, I would like to enter a calculation. (24*2.2)+(24*2.2*.1) 24 is my unit price in British pounds. 2.2 is the exchange rate into Canadian dollars. etc. The exchange rate changes frequently. Instead of recalculating and entering a new price every few days, it would be useful to enter a calculation in any price field. I had a look at: http://ca3.php.net/manual-lookup.php?pattern=calc http://ca3.php.net/manual-lookup.php?pattern=calculate http://ca3.php.net/manual-lookup.php?pattern=calculation but I see no function, although I'm sure there is one. So how could I do this? $price = (24*2.2)+(24*2.2*.1); if $price is not an integer, verify if it is a calculation. If so, give me an integer and round it off to two decimal points: $price = 58.08; Do-able? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array problem with a zencart shipping module
I'm desperately going outside the forum, seeking help. Does anyone have any experience with Zencart shipping modules, or understand arrays? http://www.zen-cart.com/forum/showthread.php?t=87831 Its borrowed code and I,m not good at arrays to begin with. Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] shopping carts
zencart is giving me every possible custom field I can dream of. John Jason Pruim wrote: On Feb 6, 2008, at 5:56 PM, Eric Butera wrote: On Feb 6, 2008 4:18 PM, nihilism machine [EMAIL PROTECTED] wrote: Does anyone know of a shopping cart which allows you to add multiple custom fields to each product? --e -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Please do not use osCommerce. Umm, Can I ask why? I just downloaded it a few days ago to play with it on my server. I don't need it myself, but something good to have in the arsenal :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Source code protection
I'm not sure where PHP stands on this politically. But I believe in Open Source, which allows you to encode your code. But why? At heart I'm a purist GNU. Stallman was right when he first tried to fix a faulty printer. * The freedom to run the program, for any purpose (freedom 0). * The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this. * The freedom to redistribute copies so you can help your neighbor (freedom 2). * The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this. Thankfully there is little that cannot be reversed engineered. If you want to keep the recipe, host it yourself and let others use an interface. This is stepping in a nest of hornets. :p C.R.Vegelin wrote: See also: http://www.ioncube.com/ - Original Message - From: Bastien Koert [EMAIL PROTECTED] To: Zoran Bogdanov [EMAIL PROTECTED]; php-general@lists.php.net Sent: Wednesday, February 06, 2008 2:27 PM Subject: RE: [PHP] PHP Source code protection zend encoder? http://sourceforge.net/projects/php-screw/ google for more bastien To: php-general@lists.php.net From: [EMAIL PROTECTED] Date: Wed, 6 Feb 2008 12:28:12 +0100 Subject: [PHP] PHP Source code protection Hi, I'm building a C# application that connects to a server that has PHP scripts on it. We need to deliver the complete solution to a firm, the C# is no problem because it is compiled... But PHP is a problem bacause it is interpreted and we will have to deliver pure, unprotected script... Is htere a way to secoure my code so when they put it on the server, they can't see it! Thank You! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array problem with a zencart shipping module
Thanks for the reply and checking it out. I was hoping my problem lies only in the class. I do have a Paypal account and at this point in time, it is a question of time - I've got to get my site in production and shut off the old cart. Nathan Nobbe wrote: On Feb 6, 2008 11:11 PM, John Taylor-Johnston [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm desperately going outside the forum, seeking help. Does anyone have any experience with Zencart shipping modules, or understand arrays? http://www.zen-cart.com/forum/showthread.php?t=87831 maybe you should stick w/ that ajeh guy; he seems like he knows what hes talking about. also, people here dont typically just hand out help on generic questions such as this; if you can get a specific question about php or a more focused question than please help i dont know much about arrays, then maybe we can help out.. Its borrowed code and I,m not good at arrays to begin with. ouch, maybe you need to hire someone ? besides this has more to do than just arrays; there is the rest of the application and clearly anyone whos going to help out must understand at least some of it.. -nathan
[PHP] /?feed=rss2
It used to have a feed, by accident. Now someone munches up too much bandwidth. http://www.foo.com//?feed=rss2 How can I divert this to 127.0.0.1 or something to convince this one to leave my bandwidth alone? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: /?feed=rss2
I do. CPanel too. How would I write that into an htaccess ? Shawn McKenzie wrote: John Taylor-Johnston wrote: If you have apache, I would use a rewrite rule to return not found. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: /?feed=rss2
Any other inspiration? Thanks, John John Taylor-Johnston wrote: It used to have a feed, by accident. Now someone munches up too much bandwidth. http://www.foo.com/?feed=rss2 How can I divert this to 127.0.0.1 or something to convince this one to leave my bandwidth alone? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opensource CPanel
Does anyone recommend a decent server panel, one like cpanel? Something made from PHP preferably? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing Poor XML into to PHP
Pour examples of xml, but this is what I want to do. I have a quiz. BASICALLY How do EXTRACT THE Contents and Values of these tags into strings and arrays I can work with. Depending upon the students answer, compared to the criterion below, I need to calculate a value = x/1. The score could very well be rounded down to 1/1, but at least each student will get the feedback, if a particular piece of feedback applies to the, If not, it will not appear on their evaluation sheet. I can pseudo cod ehtis in my head, but am wondering where to get started. Can someone help me take Instructions/Instrudtions into a string for example? Then take Criterion[0] through nmax = [5] into two arrays: CriterionValue and CriterionComment, as well as feedback 0=5 and organised the into arrays. The rest, I think I can do. John InstructionsTake the sentence below and transform it into a Information Question./Instructions QuestionHarry Potter went to Hogwarts School of Wizardry./Question AnswerWhere did Harry Potter go? /Answer Criterion name=Criterion[0] value=1Where did Harry Potter go to school?Criterion FeedbackThe answer was the exact answer we expected.)/Feedback Criterion name=Criterion[1] value=.9Where did Harry Potter go to school ?Criterion FeedbackThere was a syntax error using the ? question mark.)/Feedback Criterion name=Criterion[2] value=.2Where Criterion FeedbackThe answer contained the correct Question word. $Criterion[2]./Feedback Criterion name=Criterion[3] value=.2Where didCriterion FeedbackThe answer contained in $Criterion[3]./Feedback Criterion name=Criterion[4] value=.2Where did HarryCriterion FeedbackThe answer contained in $Criterion[4]./Feedback Criterion name=Criterion[5] value=.2Where did Harry goCriterion FeedbackThe answer contained in $Criterion[5]./Feedback Unforgivable stuff: Criterion name=Criterion[6] value=-.2Hogwarts School of WizardryCriterion FeedbackNo need to include the complement in a question that requires a complement./Feedback Criterion name=Criterion[7] value=-.2go at schoolCriterion FeedbackGo to school not go at school/Feedback -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compose MP3 from a php enabled flash page.
I have an educational web site. I want to create an interface where my students can record their voices client side and then save messages server side. I thought Odeo would solve my problems. (The have their own problems now.) Then I tried: MyChingo and Mobasoft. COme on $6,000 for a site licence. Are there any php alternatives? Or do you know an flash code I can find in sourceforge, that I might hack, or combine PHP Flash so they can record me messages in mp3 and submit them? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing RSS
Is there something already created to open an rss file, parse it, and include() the useful stuff into an html file? Not all my students have an rss reader. http://jtjohnston.ca/jtjohnston.rss jt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] proxy server
I have a bulk emailing list to a select group (I never spam, only to those who want it). Sometimes their imap/pop servers block my mail. I know I can assign another smtp over-riding what is in the php.ini file. I can likely find enough code here: http://ca3.php.net/manual/en/ref.mail.php So, where can I find another smtp server that will send my mail (using php) and certify that it comes from me? Is a proxy server the way to go? Costly? John || -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ''' Cégep de Sherbrooke: ô¿ô http://www.cegepsherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064
Re: [PHP] Parsing RSS
I've gotten some excellent responses. Thanks! Anything I can implement in PHP 4 - until i get IT to update to PHP 5? John Dave Goodchild wrote: Yep. The PEAR XML_RSS class.
[PHP] Rasmus: [PHP] Parsing RSS
Thanks. P.S. excellent interview with Leo Laporte! http://www.twit.tv/floss12 Your interview made me think of Cathedrals Bazaars and the notion of free riders. I've been much of a php free rider myself, but try to find ways to give back, usually through phpmyadmin.net Thanks to everyone who give their time, and responses to my queries! John Rasmus Lerdorf wrote: John Taylor-Johnston wrote: Is there something already created to open an rss file, parse it, and include() the useful stuff into an html file? Not all my students have an rss reader. http://jtjohnston.ca/jtjohnston.rss RSS is just XML. Use SimpleXML to map it to a PHP object and just print out whatever you want from it directly. eg. ?php $rss = simplexml_load_file('http://jtjohnston.ca/jtjohnston.rss'); $channel = $rss-channel; echo EOB img src={$channel-image-url} style=float: right;/ h1{$channel-title}/h1 h2{$channel-description}/h2 EOB; foreach($channel-item as $item) { echo EOB h3a href={$item-link}{$item-title}/a ({$item-pubDate})/h3 {$item-description} br clear=left / hr / EOB; } ? Very ugly HTML markup there, of course, but add a bit of CSS and make it prettier. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing RSS
Richard, Found this: http://www.phpclasses.org/browse/package/2263.html Real small and works in PHP4. Time for a little CSS tweaking ;) and it will look great! Thanks, John http://jtjohnston.ca/news/news.php Richard Lynch wrote: I'm willing to bet that if you check Google or even just http://phpclasses.org you can find something specifically for RSS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] proxy server
I have a bulk emailing list to a select group (I never spam, only to those who want it). Sometimes their imap/pop servers block my mail. I know I can assign another smtp over-riding what is in the php.ini file. I can likely find enough code here: http://ca3.php.net/manual/en/ref.mail.php So, where can I find another smtp server that will send my mail (using php) and certify that it comes from me? Is a proxy server the way to go? Costly? Unless you know for 100% certain it is being filtered out based on the IP address being logged as a spammer somewhere, changing SMTP servers won't do diddly-squat... I'm sure. CGI proxy I think is the key word I'm looking for. I would even pay $10 per year for an SMTP access account if it fixed my problems. John -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. '''Cégep de Sherbrooke: ô¿ôhttp://www.cegepsherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064
[PHP] RSS Creator
Has anyone created an RSS feed creator in PHP? I could make one fast enough, but ... John -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. '''Cégep de Sherbrooke: ô¿ôhttp://www.cegepsherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Alternative to FCKeditor
Anyone know of a good alternative to FCKeditor? Or a decent file uploader? Even after paying for a little help, I get zip for FCK. I need another solution, another editor with an active forum or support, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing quotes
Someone kindly gave me this once. I now need to reverse engineer it to remove the quotes and plus signs from $searchenquiry. Is it as simple as this? // FINAL RESULT: [+john +johnston] $sEnquiry = preg_replace(/\s+/, +, $sEnquiry); // RESULT: [john johnston] $sEnquiry = preg_replace(/\s+/, \, $sEnquiry); // RESULT: [john johnston] original code--- $sEnquiry = preg_replace(/\s+/, , $sEnquiry); // remove whitespace from beginning end // RESULT: [johnjohnston] $sEnquiry = preg_replace(/\s+/, , $sEnquiry); // replace internal whitespace with single spaces // RESULT: [john johnston] $sEnquiry = str_replace( , \ +\, $sEnquiry); // replace each space with quote-space-plus-quote // RESULT: [john +johnston] $sEnquiry = +\ . $sEnquiry . \; // add beginning ending delimiters // FINAL RESULT: [+john +johnston] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] If array()
How can I use if to see an array contains something? if ($array()) does not work, of course. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] _SERVER[HTTP_ACCEPT_LANGUAGE] en-us
This is what http_accept_language gives me depending on which browser. Depending on the visitor in my region, it will either be French or English. _SERVER[HTTP_ACCEPT_LANGUAGE] en-us,en;q=0.8,fr;q=0.5,fr-ca;q=0.3 _SERVER[HTTP_ACCEPT_LANGUAGE] fr-ca,en-us;q=0.5 Is this a reasonable approach? if(stristr($_SERVER[HTTP_HOST],fr)) { include(french.htm);}else{ include(english.htm);} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _SERVER[HTTP_ACCEPT_LANGUAGE] en-us
Stut, Richard, Thanks for the feedback! Quebec has a language law, so I'm obligated to serve French first. I can wiggle around that if the preferred language is other. John Is this a reasonable approach? if(stristr($_SERVER[HTTP_HOST],fr)) { include(french.htm);}else{ include(english.htm);} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] input type=checkbox
Am coding something. Cannot quite clear my head. I know what my SQL looks like. I just cannot see clearly to input it. What is $_POST[checkregion] going to look like? Is it going to have all the convenient commas I will need in my SQL? Or do I have to parse God knows how many checkboxes? John input type=text name=Name labelinput type=checkbox name=checkregion value=KnowltonA/label labelinput type=checkbox name=checkregion value=Thetford MinesA/label $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', 'Knowlton,Thetford Mines') '; CREATE TABLE IF NOT EXISTS `GLApplications` ( `Name` varchar(200) NOT NULL, set(''Knowlton','Thetford Mines','Clarenceville','Sawyerville','Laval') NOT NULL, `dummy` int(10) NOT NULL auto_increment, PRIMARY KEY (`dummy`) ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: input type=checkbox
http://www.glquebec.org/English/test.php When I check Knowlton and Thetford Mines or others, only Thetford Mines shows up in phpinfo(). $_POST[checkregion] only sees Thetford Mines. What am I doing wrong? How do I parse value checkregion? Or set this up differently? input type=text name=Name labelinput type=checkbox name=checkregion value=KnowltonA/label labelinput type=checkbox name=checkregion value=Thetford MinesA/label CREATE TABLE IF NOT EXISTS `GLApplications` ( `Name` varchar(200) NOT NULL, set(''Knowlton','Thetford Mines','Clarenceville','Sawyerville','Laval') NOT NULL, `dummy` int(10) NOT NULL auto_increment, PRIMARY KEY (`dummy`) ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: input type=checkbox
$_POST[checkregion] is supposed to be an array, no? John Taylor-Johnston wrote: http://www.glquebec.org/English/test.php When I check Knowlton and Thetford Mines or others, only Thetford Mines shows up in phpinfo(). $_POST[checkregion] only sees Thetford Mines. What am I doing wrong? How do I parse value checkregion? Or set this up differently? input type=text name=Name labelinput type=checkbox name=checkregion value=KnowltonA/label labelinput type=checkbox name=checkregion value=Thetford MinesA/label CREATE TABLE IF NOT EXISTS `GLApplications` ( `Name` varchar(200) NOT NULL, set(''Knowlton','Thetford Mines','Clarenceville','Sawyerville','Laval') NOT NULL, `dummy` int(10) NOT NULL auto_increment, PRIMARY KEY (`dummy`) ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: input type=checkbox
Ah! ok, Array ( [0] = Hemmingford [1] = Huntingdon ) How do I set up my $sql? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.implode(',', $_POST['myvalues'].') '; ... Hey!! What is this? Diagnostic-Code: smtp; 550-5.7.1 mail rejected by policy. SURBL hit 550-Spammy URLs in your message 550 See http://master.php.net/mail/why.php?why=SURBL Robert Cummings wrote: On Fri, 2008-03-14 at 23:14 -0400, John Taylor-Johnston wrote: $_POST[checkregion] is supposed to be an array, no? You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[] value=Thetford Mines / Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: input type=checkbox
Will this do it? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.implode(',', serialise($_POST['checkregion']).') '; http://ca.php.net/manual/en/function.serialize.php Array ( [0] = Hemmingford [1] = Huntingdon ) input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[] value=Thetford Mines / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: input type=checkbox
Sorry, will this work? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.serialise($_POST['checkregion']).') '; John Taylor-Johnston wrote: Will this do it? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.implode(',', serialise($_POST['checkregion']).') '; http://ca.php.net/manual/en/function.serialize.php Array ( [0] = Hemmingford [1] = Huntingdon ) input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[] value=Thetford Mines / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: input type=checkbox
Robert, Array ( [0] = Hemmingford [1] = Huntingdon ) You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[] value=Thetford Mines / How would you proceed? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '. ?? .') '; I'm just guessing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: input type=checkbox
Robert Cummings wrote: On Sat, 2008-03-15 at 00:33 -0400, John Taylor-Johnston wrote: Robert, Array ( [0] = Hemmingford [1] = Huntingdon ) You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[] value=Thetford Mines / How would you proceed? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '. ?? .') '; I'm just guessing. It depend son what you want to do with the data. It may be that you want a row for every selected entry or it may be that you can just serialize the data. Do you want to just have a snapshot of what the user chose? Or do you want to be able to query the database about who selected Knowlton? If the former, then you can get away with just serializing the data, but if you want to be able to do queries, then you need to store each entry in its own row. Cheers, Rob. It would look like: $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', 'Montreal,Knowlton,anything') '; checkregion[5] = Montreal; checkregion[7] = Knowlton; checkregion[55] = anything; I need to unarray checkregion[] and break it up into separate words and then separate them by commas. Hmm? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Group?
Does anyone know of a good MySQL group? I want to make a relational link from `data` to `shopping` so when I insert a new record in `shopping`, I will see the contents of `data`.`name` and `data`.`email` as a drop-down menu in `shopping`. Where does one go to get this kind of help? Thanks, John DROP TABLE IF EXISTS `data`; CREATE TABLE `data` ( `id` int(5) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; INSERT INTO `data` VALUES(1, 'Allen, Carolyn', '[EMAIL PROTECTED]'); INSERT INTO `data` VALUES(2, 'Atwood, Margaret', '[EMAIL PROTECTED]'); DROP TABLE IF EXISTS `shopping`; CREATE TABLE `shopping` ( `id` int(5) NOT NULL auto_increment, `name` varchar(100) NOT NULL, `address` varchar(100) NOT NULL, `email` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL Group?
John Taylor-Johnston wrote: Does anyone know of a good MySQL group? Found it: http://lists.mysql.com/mysql/ Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MySQL Group?
Thanks for getting me started. (Sorry, I'm a top quoter.) Below is some working code for the archives. What I've learned so far is that : 1) what I'm referring to in `person` has to be a key. 2) if I want to refer to more than one field from person in shopping, I have to use unique keys. I'm still discovering what keys are for. John DROP TABLE IF EXISTS `person`; CREATE TABLE `person` ( `person_id` int(11) NOT NULL auto_increment, `name` varchar(255) default NULL, `email` varchar(255) default NULL, PRIMARY KEY (`person_id`), KEY `email` (`email`), KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; INSERT INTO `person`( `person_id`, `name`, `email` ) VALUES ( 1, 'Name', '[EMAIL PROTECTED]' ) ; INSERT INTO `person`( `person_id`, `name`, `email` ) VALUES ( 2, 'second Name', '[EMAIL PROTECTED]' ) ; DROP TABLE IF EXISTS `shopping`; CREATE TABLE IF NOT EXISTS `shopping` ( `shopping_id` int(11) NOT NULL, `email` varchar(255) default NULL, `name` varchar(255) default NULL, PRIMARY KEY (`shopping_id`), UNIQUE KEY `email` (`email`), UNIQUE KEY `name` (`name`), FOREIGN KEY (`email`) REFERENCES `person` (`email`), FOREIGN KEY (`name`) REFERENCES `person` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; You end up with something like this: create table person ( person_id int primary key, name varchar(255), email varchar(255) ) engine=innodb; create table shopping ( shopping_id int primary key, person_id int, foreign key (person_id) references person(person_id) ) engine=innodb; insert into person(person_id,name,email) values(1,'Name','[EMAIL PROTECTED]'); insert into shopping(shopping_id, person_id) values(1, 1); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] string
$name = John Taylor; I want to verify if $name contains john, if yes echo found; Cannot remember which to use: http://ca.php.net/manual/en/ref.strings.php Sorry, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] string
Excellent. Thanks all! John Daniel Brown wrote: On Mon, Apr 7, 2008 at 9:25 AM, John Taylor-Johnston [EMAIL PROTECTED] wrote: $name = John Taylor; I want to verify if $name contains john, if yes echo found; Cannot remember which to use: http://ca.php.net/manual/en/ref.strings.php Sorry, John ?php if(stristr($name,'john')) { // True } ? Since you said you wanted to know if it contains 'john', this will find if 'john' (insensitive) matches any part of the name. So in your case, it would match on both John and Johnston.
[PHP] PHP Code I Must find
A web site deploys what I think are UTF characters to mask email addresses. Is there there a php function I can use to generate this? Or was this hand-done? It is crackable, but a darned good stab at the problem of spiders at the same. Any feedback, info or code would be appreciated, John John Taylor-Johnston wrote: My source is this page: http://www.grandlodge.mb.ca/contact.html John /div align=centerTo report a technical problem with this site please a href=mailto:#119;#101;#098;#109;#097;#115;#116;#101;#114;#064;#103;#114;#097;#110;#100;#108;#111;#100;#103;#101;#046;#109;#098;#046;#099;#097;;contact the webmaster/a./div/ /In UTF code: mailto:#119;#101;#098;#109;#097;#115;#116;#101;#114;#064;#103;#114;#097;#110;#100;#108;#111;#100;#103;#101;#046;#109;#098;#046;#099;#097; would be this in latin characters: mailto:[EMAIL PROTECTED]/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Code I Must find
Ok. ?php $mystring = [EMAIL PROTECTED]; #How can I generate $mystring in ascii characters? echo ??($mystring); ? lists-php wrote: that's not UTF, rather just the html representation of the ascii codes for the characters. [someone else has already pointed you to an ascii table.] when put in the context of the mailto:; it's actually fairly easy for a bot to identify and decode (i'm not saying that they do, but it's not hard). if you're going to use this approach you may want to make the e-mail addresses user-readable, but unlinked. while still easily decoded, most bots won't waste time trying to decode every string like that that they encounter (at least not yet). - Rick Original Message Date: Thursday, May 29, 2008 07:08:34 PM -0400 From: John Taylor-Johnston [EMAIL PROTECTED] To: PHP-General php-general@lists.php.net Subject: [PHP] PHP Code I Must find A web site deploys what I think are UTF characters to mask email addresses. Is there there a php function I can use to generate this? Or was this hand-done? It is crackable, but a darned good stab at the problem of spiders at the same. Any feedback, info or code would be appreciated, John John Taylor-Johnston wrote: My source is this page: http://www.grandlodge.mb.ca/contact.html John /div align=centerTo report a technical problem with this site please a href=mailto:#119;#101;#098;#109;#097;#115;#116;#101;#11 4;#064;#103;#114;#097;#110;#100;#108;#111;#100;#103;#1 01;#046;#109;#098;#046;#099;#097;contact the webmaster/a./div/ /In UTF code: mailto:#119;#101;#098;#109;#097;#115;#116;#101;#114;#06 4;#103;#114;#097;#110;#100;#108;#111;#100;#103;#101;#0 46;#109;#098;#046;#099;#097; would be this in latin characters: mailto:[EMAIL PROTECTED]/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- End Original Message --
Re: [PHP] PHP Code I Must find
Seen that in the manual. I'll need a routine of some sort I guess. I'll get my cookie cutters out tomorrow and see what I can create. I make cool gingerbread men, for a dude. **htmlentities() does most of what I want, sort of. **lists-php wrote: you might try looking at the php manual. start with: http://www.php.net/manual/en/function.ord.php and go from there. ?php $mystring = [EMAIL PROTECTED]; # How can I generate $mystring in ascii characters? echo ($mystring in ascii charachters); ? lists-php wrote: that's not UTF, rather just the html representation of the ascii codes for the characters. [someone else has already pointed you to an ascii table.] when put in the context of the mailto:; it's actually fairly easy for a bot to identify and decode (i'm not saying that they do, but it's not hard). if you're going to use this approach you may want to make the e-mail addresses user-readable, but unlinked. while still easily decoded, most bots won't waste time trying to decode every string like that that they encounter (at least not yet). - Rick Original Message Date: Thursday, May 29, 2008 07:08:34 PM -0400 From: John Taylor-Johnston [EMAIL PROTECTED] To: PHP-General php-general@lists.php.net Subject: [PHP] PHP Code I Must find A web site deploys what I think are UTF characters to mask email addresses. Is there there a php function I can use to generate this? Or was this hand-done? It is crackable, but a darned good stab at the problem of spiders at the same. Any feedback, info or code would be appreciated, John John Taylor-Johnston wrote: My source is this page: http://www.grandlodge.mb.ca/contact.html John /div align=centerTo report a technical problem with this site please a href=mailto:#119;#101;#098;#109;#097;#115;#116;#101;# 11 4;#064;#103;#114;#097;#110;#100;#108;#111;#100;#103; #1 01;#046;#109;#098;#046;#099;#097;contact the webmaster/a./div/ /In UTF code: mailto:#119;#101;#098;#109;#097;#115;#116;#101;#114;# 06 4;#103;#114;#097;#110;#100;#108;#111;#100;#103;#101; #0 46;#109;#098;#046;#099;#097; would be this in latin characters: mailto:[EMAIL PROTECTED]/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- End Original Message -- -- End Original Message -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FImage $aSubDir
I have http://www.flash-here.com/downloads/fhimage.html installed. I like it just the way it is. But instead of displaying (see function below). Instead of displaying the file name under the photo, weak excuse for a caption, I would like to open and nl2br the contents of a like named text file. $chopped= strlen($aFn) - 4; $openthis = $chopped..txt; How do I proceed? John ---original code echo brcenter; if($aSubDir == ) { $l = strlen($aFn) - 4; echo substr($aFn, 0, $l); } else { echo $aSubDir.[dir]; } echo /center; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: FImage $aSubDir
Could it be this easy? $chopped= strlen($aFn) - 4; $filename = $chopped..txt; printbrfont face='Arial, Helvetica, sans-serif' size=2 color='#99'; include($filename); print/font; John Taylor-Johnston wrote: I have http://www.flash-here.com/downloads/fhimage.html installed. I like it just the way it is. But instead of displaying (see function below). Instead of displaying the file name under the photo, weak excuse for a caption, I would like to open and nl2br the contents of a like named text file. $chopped= strlen($aFn) - 4; $openthis = $chopped..txt; How do I proceed? John ---original code echo brcenter; if($aSubDir == ) { $l = strlen($aFn) - 4; echo substr($aFn, 0, $l); } else { echo $aSubDir.[dir]; } echo /center; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] if(($mydata-address
This should be easy, but refuses to work: if( ($mydata-address != ) and ($mydata-addresspublic == yes) ) { } But in other combinations, they work? if($mydata-address != ){} or if($mydata-addresspublic == yes){} So what new lesson am I to learn now? :) John -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if(($mydata-address
Jay, Thanks. Sth new learned :) Thought mine was working. It wasn't I guess. I received no errors. I have other scripts to revise :) if( = $mydata-foo) // an error is thrown. If I come back in and finish the comparison operator (which I needed to know was broken) it fixes the conditional statement at this point. Appreciated. John Jay Blanchard wrote: [snip] if( ($mydata-address != ) and ($mydata-addresspublic == yes) ) { } But in other combinations, they work? if($mydata-address != ){} or if($mydata-addresspublic == yes){} So what new lesson am I to learn now? :) [/snip] Always put the value first in case you accidentally try an assignment operator. Now, on to your code...(with my recommendations) if(( != $mydata-address) (yes == $mydata-addresspublic)){ ...stuff... } if(( != $mydata-address) || (yes == $mydata-addresspublic)){ ...stuff... } Those should work. Now, why do I recommend the value first? Easy. Consider... if($mydata-foo = ) // always true, $mydata-foo is now equal to blank If I do this... if( = $mydata-foo) // an error is thrown. If I come back in and finish the comparison operator (which I needed to know was broken) it fixes the conditional statement at this point. -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mozilla urlencode
I seem to have a problem with Mozilla or with IE? echo a name=\.urlencode($mydata-district).\/a; a name=Montr%E9al+District+%234/a http://foo.org/_private/directory.php#Montr%E9al+District+%234 works in IE6, but Mozilla will not accept it. Mozilla does not work. Am I approaching this wrong? Should I create my HTML this way? echo a name=\.$mydata-district.\/a; a name=Montréal District #4/a If I do, Mozilla prferes this: http://foo.org/_private/directory.php#Montr%E9al%20District%20#4 or http://foo.org/_private/directory.php#Montr%E9al%20District%20%234 IE refuses it and prefers: http://foo.org/_private/directory.php#Montr%E9al+District+%234 What's my work around? Complain to Mozilla? Same for Firefox BTW. I cannot change my field. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mozilla urlencode
I sent this to Mozilla groups. I'm beginning to wonder if Mozilla supports a name=? I think re-asked my question clearer below. John i dont think having a + in an achor tag is standard.. but i could be wrong. I'm truly hoping this is a reported bug already. This URL does not work in most recent upgrades of Mozilla or FF: http://www.glquebec.org/_private/directory.php#District+of+St.+Francis I generate the link using PHP: if ( != $mydata-district){ echo - a href=\#.urlencode($mydata-district).\$mydata-district/a/h1; }else{ echo /h1; } The link is named: echo hr size=1a name=\.urlencode($mydata-district).\/ah2$mydata-district/h2\n; Unless you're going to tell me a name= is outdated, (it is kind of in xhtml) there is a bug! Otherwise, how do I name an anchor now? This works in IE6, even in NS4.8 but not Moz or FF. What's up Moz? http://www.glquebec.org/_private/directory.php#District+of+St.+Francis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mozilla urlencode
This works: District of St. Francis http://www.glquebec.org/tezt.php#District+of+St.+Francis a name=District+of+St.+Francis/a This does not: Montréal District #2 http://www.glquebec.org/tezt.php#Montr%E9al+District+%232 a name=Montr%E9al+District+%232/a I'm beginning to see the problem lies with the French character é. I don't see it being #. In any case, I cannot change existing fields. How can I get this working? Pablo Gosse wrote: I'm not sure, but I see two things that might be causing this. First, why are spaces, which should be translated as %20, being represented as a '+'? Second, you have a # in the actual bookmark name, which I would assume is not valid since the # denotes the beginning of a bookmark. So perhaps IE compensates for this, but Mozilla reads the bookmark as looking for a name=4/a because of the #4 at the end of the bookmark name. I generate the link using urlencode. if ( != $mydata-district){ echo - a href=\#.urlencode($mydata-district).\$mydata-district/a/h1; }else{ echo /h1; } The link is named: echo hr size=1a name=\.urlencode($mydata-district).\/ah2$mydata-district/h2\n; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $date(l-m);
$mydata-lastinsalled = 2004-05; How can I determne if $mydata-lastinsalled is one year or more older than the current $date(l-m); Anyting simple and over looked? I have been browsing the manual:: http://ca.php.net/manual/en/function.strtotime.php http://ca.php.net/manual/en/function.date.php John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mozilla urlencode
Egads!! But thank you for the research. Back to the drawing board. John Jochem Maas wrote: John Taylor-Johnston wrote: a name=District+of+St.+Francis/a a name=Montr%E9al+District+%232/a I'm beginning to see the problem lies with the French character é. I don't see it being #. In any case, I cannot change existing fields. How can I get this working? http://www.w3.org/TR/REC-html40/struct/links.html#h-12.2.1 in short; only strings passing this regexp: [A-Za-z][A-Za-z0-9:_.-]* you will have to either change the data you have in the DB or transform the text so that all non-ascii chars are replaced with and you can totally forget using the '#' in the value of a name attribute! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] replace striing éèêà
Can someone show me how to get rid of international characters in $string? Is there a function already made? You cannot use accented characters in a name reference : a name=montréal. I guess this below is a start. Is there a better way? John http://ca.php.net/manual/en/function.str-replace.php $string = àâéèç; |$find = array(à, â, é, è, ç); ||$||replacewith|| = array(a, a, e, e, c);|| $onlyconsonants = str_replace($vowels, $replacewith, $string); | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $mydata-StampDate
I created my own counter. I have a varchar (10) field that resembles a date: 2005-06-26. Now I would like to parse out $mydata-StampDate to find how many hits per day I have had since 2003-08-23. Where do I start? while ($mydata = mysql_fetch_object($news)) { } John -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $mydata-StampDate
I could just change the field type. But how do you calculate it? I don't see much to inspire a start. I'm not a full-time coder either. More of a tinkerer. I don't want someone to do it for me, but need to get my head around how to do it. http://ca3.php.net/manual/en/function.strtotime.php John Jasper Bryant-Greene wrote: John Taylor-Johnston wrote: I created my own counter. I have a varchar (10) field that resembles a date: 2005-06-26. Now I would like to parse out $mydata-StampDate to find how many hits per day I have had since 2003-08-23. Where do I start? while ($mydata = mysql_fetch_object($news)) { } You can use strtotime() to convert your string date to a PHP date. and then calculate it from that. However, I'd strongly recommend using a real MySQL date field to store the date. There's no reason not to, and then you can use MySQL native functions to do a lot of the calculation. Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date field
I have a field 'updated' How can I tell if the date is older than 1 year ago (or should I think of 365 days)? `updated` date NOT NULL default '1999-12-12' I've looked at: http://ca3.php.net/manual/en/function.getdate.php Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IP Geographical
I have a field in my counter that collects IP addresses. Now the powers that be want be to collect that data and sort it geographically etc. Is there anyone who has done this? Where would I find some OS code? I've heard of it done. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: date field
Thanks Ben! John Ben Ramsey wrote: In PHP, you could do something like: $updated = strtotime($db_result['updated']); $one_year_ago = strtotime('-1 year'); if ($updated $one_year_ago) { // updated date is older than a year ago } John Taylor-Johnston wrote: I have a field 'updated' How can I tell if the date is older than 1 year ago (or should I think of 365 days)? `updated` date NOT NULL default '1999-12-12' I've looked at: http://ca3.php.net/manual/en/function.getdate.php Thanks, John -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] wrapping text
Folks are complaining mail arrives and text will not wrap. $message comes directly from a textarea. Old mail readers, I guess? How can I make their life better and make the text wrap? mail([EMAIL PROTECTED], stripslashes($subject), stripslashes($message), Return-Path: [EMAIL PROTECTED]\r\nFrom: \[foo] foo\ [EMAIL PROTECTED]\r\nbcc: $bcc \r\nReply-To: [EMAIL PROTECTED] \r\n.X-Mailer: PHP/ . phpversion()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: wrapping text
wordwrap(stripslashes($message), 72). Thanks! Another reason why I gave up on Perl :) A fucntion made already since 4.0.2.! :) Matthew Weier O'Phinney wrote: Folks are complaining mail arrives and text will not wrap. $message comes directly from a textarea. Old mail readers, I guess? Yep. Investigate http://php.net/wordwrap: mail([EMAIL PROTECTED], stripslashes($subject), stripslashes($message), Return-Path: [EMAIL PROTECTED]\r\nFrom: \[foo] foo\ [EMAIL PROTECTED]\r\nbcc: $bcc \r\nReply-To: [EMAIL PROTECTED] \r\n.X-Mailer: PHP/ . phpversion()); Make stripslashes($message) into wordwrap(stripslashes($message), 72). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php explained in sql
In php, if I wanted to know if $mydata-email contained something, I would do this, right? if ($mydata-email) {} How would I express this in SQL (MySQL)? Thanks. Sorry to be off-topic, if I am, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php explained in sql
varchar: colname'' Thanks, John Jasper Bryant-Greene wrote: John Taylor-Johnston wrote: In php, if I wanted to know if $mydata-email contained something, I would do this, right? if ($mydata-email) {} How would I express this in SQL (MySQL)? That doesn't tell you if $mydata-email contains something. It tells you whether the value of $mydata-email, when cast to boolean, equals TRUE. If $mydata-email equaled zero or the string 0, it would still contain something, but that if statement would not get executed. In MySQL, it would depend on the datatype. You could do any of the following, depending on what you actually want to do: colname'' colname0 colname IS NOT NULL Or, if you're in MySQL = 5.0.2 and are using true boolean values: colname IS TRUE or, if you just want to check if it's TRUE or UNKNOWN: colname IS NOT FALSE Jasper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] AND OR NOT
input TYPE=text NAME=searchenquiry VALUE= size=30 Any suggestion on how to swap AND OR NOT for mysql fulltext syntax in $searchenquiry? A simple parse for AND and then str_replace? Is str_replace appropriate for case? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP/MySQL offline
This is maybe what you want: http://www.indigostar.com/ http://www.indigostar.com/microweb.htm Runs an apache server, php all, from a CD. (windows app.) John Mario netMines wrote: Hi all I have a project where I'm using PHP/Mysql. The client wants to run that project to a cd. Does anyone know of a trick either by using javascript, XML or an automated script that creates a static site that will allow me to do that? Many Thanks M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Scary nonsense form submissions
For badness, you could have an automated gif with a couple of numbers the user has to authenticate the form. If not complete or correct, add a header and send them to http://localhost/404.htm. Real nasty and will tie up their machine long enough. John Brian Dunning wrote: Hi all - I have forms on a number of unrelated web sites that just send me an email for one purpose or another. There are 2 to 6 fields: name, email, comment, etc. No big deal. Recently I've been getting a lot of weird submissions. I'll receive half a dozen at a time, with all the fields filled with some kind of garbage contents. Here is one example from a form on my americansubstandard.com site: ---snip--- COMMENT: [EMAIL PROTECTED] NAME: [EMAIL PROTECTED] ---/snip--- Other times one of the fields will contain a complete multipart submission, like this: ---snip--- COMMENT: [EMAIL PROTECTED] NAME: [EMAIL PROTECTED] Content-Type: multipart/mixed; boundary=\===1655480186==\ MIME-Version: 1.0 Subject: e8df6b7 To: [EMAIL PROTECTED] bcc: [EMAIL PROTECTED] From: [EMAIL PROTECTED] This is a multi-part message in MIME format. --===1655480186== Content-Type: text/plain; charset=\us-ascii\ MIME-Version: 1.0 Content-Transfer-Encoding: 7bit xqofli --===1655480186==-- ---/snip--- I wonder if this is some kind of automated attack attempt. Does anyone recognize this type of thing, and is it potentially dangerous? Should I do something about it? - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: AND OR NOT
Any ideas? Post kind of lost in there since Saturday. Is str_replace the best choice for case sensitive and for swapping AND ? input TYPE=text NAME=searchenquiry VALUE= size=30 Any suggestion on how to swap AND OR NOT for mysql fulltext syntax in $searchenquiry? A simple parse for AND and then str_replace? Is str_replace appropriate for case? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: AND OR NOT
David, I'm under pressure to permit AND, OR NOT. My research group insists that MySQL 4 syntax is not good enough. An idea of what one might enter is here (on the bottom): http://compcanlit.usherbrooke.ca/advanced.html I was hoping to get away with replacing AND with +, NOT with - and OR with . I use this as SQL: SELECT *,MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB) AGAINST ('$mydata-searchenquiry' IN BOOLEAN MODE) AS relevancy FROM ccl_main WHERE MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB) AGAINST ('$mydata-searchenquiry' IN BOOLEAN MODE) ORDER BY relevancy DESC;-- John David Robley wrote: John Taylor-Johnston wrote: Any ideas? Post kind of lost in there since Saturday. Is str_replace the best choice for case sensitive and for swapping AND ? input TYPE=text NAME=searchenquiry VALUE= size=30 Any suggestion on how to swap AND OR NOT for mysql fulltext syntax in $searchenquiry? A simple parse for AND and then str_replace? Is str_replace appropriate for case? John I think you have a slightly more complex situation than just replacing text between what I assume is a LIKE or multiple WHERE situation and a fulltext search. Perhaps if you can give an idea of the type of string you are likely to get in $searchenquiry, and to what you wish to convert it, we might be better placed to give advice. I can envisage that you might get 'bananas NOT pears AND apples' in the variable; I guess you would currently manipulate that to a query such as WHERE x = 'bananas' AND x 'pears' AND x = 'apples' (OK that's not a good example) but if you were to feed that to a fulltext search you might want WHERE MATCH (x) AGAINST ('+bananas -pears -apples' IN BOOLEAN MODE) or maybe something else depending on the version of Mysql and exactly what you are trying to do with your fulltext search. -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064
[PHP] Re: AND OR NOT
David, I'm under pressure to permit AND, OR NOT. My research group insists that MySQL 4 syntax is not good enough. An idea of what one might enter is here (on the bottom): http://compcanlit.usherbrooke.ca/advanced.html I was hoping to get away with replacing AND with +, NOT with - and OR with . I use this as SQL: SELECT *,MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB) AGAINST ('$mydata-searchenquiry' IN BOOLEAN MODE) AS relevancy FROM ccl_main WHERE MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB) AGAINST ('$mydata-searchenquiry' IN BOOLEAN MODE) ORDER BY relevancy DESC;-- John David Robley wrote: John Taylor-Johnston wrote: Any ideas? Post kind of lost in there since Saturday. Is str_replace the best choice for case sensitive and for swapping AND ? input TYPE=text NAME=searchenquiry VALUE= size=30 Any suggestion on how to swap AND OR NOT for mysql fulltext syntax in $searchenquiry? A simple parse for AND and then str_replace? Is str_replace appropriate for case? John I think you have a slightly more complex situation than just replacing text between what I assume is a LIKE or multiple WHERE situation and a fulltext search. Perhaps if you can give an idea of the type of string you are likely to get in $searchenquiry, and to what you wish to convert it, we might be better placed to give advice. I can envisage that you might get 'bananas NOT pears AND apples' in the variable; I guess you would currently manipulate that to a query such as WHERE x = 'bananas' AND x 'pears' AND x = 'apples' (OK that's not a good example) but if you were to feed that to a fulltext search you might want WHERE MATCH (x) AGAINST ('+bananas -pears -apples' IN BOOLEAN MODE) or maybe something else depending on the version of Mysql and exactly what you are trying to do with your fulltext search. -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. ' ' 'Collège de Sherbrooke: ô¿ôhttp://www.collegesherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064
Re: [PHP] Re: AND OR NOT
Jasper Bryant-Greene wrote: John Taylor-Johnston wrote: I'm under pressure to permit AND, OR NOT. My research group insists that MySQL 4 syntax is not good enough. An idea of what one might enter is here (on the bottom): http://compcanlit.usherbrooke.ca/advanced.html I was hoping to get away with replacing AND with +, NOT with - and OR with . I use this as SQL: SELECT *,MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB) AGAINST ('$mydata-searchenquiry' IN BOOLEAN MODE) AS relevancy FROM ccl_main WHERE MATCH (YR,AU,ST,SD,SC,BT,BD,BC,AT,AD,AC,JR,KW,AUS,TUS,GEO,AN,SA,RB) AGAINST ('$mydata-searchenquiry' IN BOOLEAN MODE) ORDER BY relevancy DESC;-- Please don't top-post [1]. Nice cryptic column names, by the way :) Your research group obviously haven't researched very carefully, as +term is exactly equal to AND term, -term to NOT term and simply term to OR term. So there's no point in complicating the syntax. Not only that, but MySQL's boolean mode fulltext search offers many more great possibilities like truncation (app* will match apple, application...) and in-query relevance altering. Take a look at the BOOLEAN MODE section of the MySQL manual [2]; maybe print it and give it to your research group :) [1] http://en.wikipedia.org/wiki/Top-posting [2] http://dev.mysql.com/doc/mysql/en/fulltext-boolean.html Jasper, God only knows I have tried. They're old school, what more can I say. If you knew how hard it was to sell them on using PHP-MySQL, when the project was floundering on a MS-Access ASP server ! They insist on AND, OR NOT - I have tried. Heck, I have an advanced page with it all spelled out. But it is a good project to hone my owns skills on. So ... a simple str_replace will work. str_replace is case sensitive, if I read the manual correctly? I can get away with: AND with +, NOT with - and OR with ? Top-posting? Oh, sorry. I guess I'm old school and stubborn myself. Ok, I'll try working on the bottom of the page. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [php]: monthly statistics
Hi, Where could I find a monthly statistic plugin that can take my `StampDate` field and generate monthy graphs of my primary key `id`? I'm sure I,m not the first to ask? ;-) CREATE TABLE `counter` ( `id` int(10) NOT NULL auto_increment, `StampDate` date NOT NULL default '1999-12-31', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=26050 ; John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: E-Mail
Show me your example.. I think you have to assign your smtp server in your php.ini too. All PTC wrote: Hi, Ive recently installed the php script on my website. It all works perfectly well except e-mails don't get through. E-mails don't ever get sent to new members, and when I try sending messages from my admin section they don't send either. Ive set-up the correct e-mail accounts and all details were entered correctly when I set-up the database. Have you any ideas how I could fix this. Thanks Alot. Regards, Chris Satchwell. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Javscript embedding problem
Try \countdown.js\ instead of single quotes ? //INCLUSION OF COUNTDOWN TIMER .trtd colspan=2SCRIPT language='JavaScript' SRC='countdown.js'/SCRIPTcenterscript type='text/javascript'countdown_clock(05, 11, 19, 08, 00, 1);/script/center/td/tr\n ./table\n -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql table row updation based on user input.
Me thinks you have to name the checkboxes differently, otherwise the post variable will only take the last value it found, overwriting previous values. Otherwise they act like radioboxes. print TD style='border: 1pt solid black cell-padding: 3px'input type='checkbox' name=\id[]\ value=\.$row[id].\ /TD; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [php]: monthly statistics
Tim Van Wassenhove wrote: On 2005-09-18, John Taylor-Johnston [EMAIL PROTECTED] wrote: Hi, Where could I find a monthly statistic plugin that can take my `StampDate` field and generate monthy graphs of my primary key `id`? I'm sure I,m not the first to ask? ;-) CREATE TABLE `counter` ( `id` int(10) NOT NULL auto_increment, `StampDate` date NOT NULL default '1999-12-31', PRIMARY KEY (`id`) ) TYPE=MyISAM AUTO_INCREMENT=26050 ; All you need to do is SELECT .. GROUP BY YEARMONTH(StampDate) and you're ready to go.. How will I draw a graph img src=reddot.gif width=2 height=$mydate-number_of_hits_per_day? Anything in the manual to look at? http://www.mysql.com/search/?q=YEARMONTHcharset=utf-8 http://ca3.php.net/manual-lookup.php?pattern=YEARMONTH John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] testing 234
Are any of my posts getting through? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] making a tutorial
I'm making a tutorial and don't really understand how to do this myself :) pWhich of the following pets do have at home: br /input type=checkbox name=favourite[] value=dogdog br /input type=checkbox name=favourite[] value=catcat br /input type=checkbox name=favourite[] value=snakesnake br /input type=checkbox name=favourite[] value=othersnake br /input type=checkbox name=favourite[] value=nonenone of these /p How do I parse favourite[]? I might have 2 or 5, so I need to parse ^0] - nMax. It is a checkbox. I might use favourite[] with mail() or store it in a mysql field. If mysql, would I store it in a varchar(20) or an enum() and how? John
Re: [PHP] testing 234
Are any of my posts getting through? They don't appear to be. This one only made it halfway :P Yeah, it doesn't seem to accept my email from another address. Thanks Rob. I was trying to post something last night and it never got through. This email seems acceptable to the group Gods. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP post data
Scrolling back and forward through my PHP generated search engine, my browser (FF) alerts to remind me that I have post data. What kind of header can I add to avoid it doing that? Else what is the problem? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Faking Boolean
How can I take enquiry: input name=searchenquiry type=text value=john or input name=searchenquiry type=text value=john johnston and parse its value to come up with this to do a boolean search +john or +john +johnston Does there exist a function yet :) ? I suppose I could explode $searchenquiry for spaces and reassemble the bits? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Faking Boolean
Thanks! Your first appraoch seems to make clearer sense for me. Great pinch hit, John Paul Novitski wrote: If you're splitting your search string into discrete words, most search engine logic doesn't require quotes. Typically, quotation marks combine multiple words into single expressions, which makes sense with John Johnston but not with John Johnston. But since you requested the quotes I'll include them: Here's one way to convert an incoming word series for a search: // get the entered text $sEnquiry = $_GET[searchenquiry]; RESULT: [ johnjohnston ] // protect against input attacks here ... // remove whitespace from beginning end $sEnquiry = trim($sEnquiry); RESULT: [johnjohnston] // replace internal whitespace with single spaces $sEnquiry = preg_replace(/\s+/, , $sEnquiry); RESULT: [john johnston] // replace each space with quote-space-plus-quote $sEnquiry = str_replace( , \ +\, $sEnquiry); RESULT: [john +johnston] // add beginning ending delimiters $sEnquiry = +\ . $sEnquiry . \; RESULT: [+john +johnston] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hosting reselling
Kind of off-topic. My current ISP has problems with quality control: especially offering php 5 mysql. Also rates keep going up per account. Reselling is beginning to look very interesting. Anyone have any recommendations for a reseller where I can host 5 sites myself with very low bandwidth and minimum harddrive space. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 404 errors
I get a lot of 404 errors. Is there a way in PHP to redirect them in such a way as it does not burn my bandwidth? Or (an Apache trick I learned once) to discourage them by referring them to localhost? Or something? Something I can embed in PHP. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Notice: Undefined index
Any idea why this bit of code if(yes == $_POST['submitter']) { mysql_select_db($db,$myconnection); $sql = INSERT INTO `$db`.`$table` (name,email,comments,entrydate) values ('$name','$email','$comments','$entrydate'); mysql_query($sql) or die(print mysql_error()); } is provoking this message in my Apache error log? [Fri May 19 19:05:10 2006] [error] PHP Notice: Undefined index: submitter in /home/jtjohnston/domains/jtjohnston.ca/public_html/comments.php on line 29 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php