RE: Re: [PHP] Funny php://stdout behaviour
> I actually was getting prompted to download the .php file sometimes... So, the user would be able to open the file in, say, VI and see your code? Big security hole, no? Of which versions of php4 was this characteristic? Dotan Cohen --- MySQLphp4 50 megs $9.99http://TerribleHost.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sorting an array
I'm trying to sort a listing of albums alphabetically for LyricsList.com, the problem is that I want the initial 'The' and 'A' in some albums (A Hard Days Night, The Wall) to be ignored. So that the list will look like: Abbey Road Dark Side Of the Moon The Final Cut A Hard Days Night Kill 'em All The Wall ABC order, 'A' and 'The' negated. The info comes from a database, in three calls: // call albums that begin with letter $letter $query = "SELECT * FROM albums WHERE album LIKE '$letter%' ORDER BY album"; $result = mysql_query($query) or die(mysql_error()); // call albums that begin with letter A $query_a = "SELECT * FROM albums WHERE album LIKE 'a' ORDER BY album"; $result_a = mysql_query($query_a) or die(mysql_error()); // call albums that begin with letter T $query_t = "SELECT * FROM albums WHERE album LIKE 't' ORDER BY album"; $result_t = mysql_query($query_t) or die(mysql_error()); So I need to get just the albums from $result_t that begin with 'The ' (easy regex) and from $result_a that begin with 'A ' (easy regex), but puting the three of them in order is proving beyond my skill. Thanks in advance for any advise. Dotan Cohen __ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/ -- 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] Chrome 1.0 released
2008/12/12 Richard Heyes : > Well it's not really related to PHP, but certainly web development in > general. Personally, I was surprised by the jump from 0.4 to 1.0. > Judging by other Google betas (eg Gmail) I was expecting it to be in > beta for the next decade or so. > As seen on ./, it seems that Google may be pressing OEMs to include Chrome bundled on new computers. That cannot happen with a beta web browser. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Chrome 1.0 released
2008/12/12 Robert Cummings : > Do you mean "as seen on /." ? > I do, at least.. at least I mean what I say... that's the same thing, you know. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Chrome 1.0 released
2008/12/13 Richard Heyes : >> As long as Chrome is not being bundled with new computers the average >> Windows users will stick to Internet Explorer. I know that from >> customers who are referring to IE as "the program on my computer's >> desktop running the internet". So if Google can manage to transform >> Chrome into the "internet program" M$ might be forced to make IE9 >> support Richard's HTML5 graphing. > > Just to add, you could feasibly use the graphs on a website where IE > compatibility isn't a requirement. So an internal website or intranet > where you can stipulate that people need to be using Firefox, Opera, > Chrome or Safari. > Just to add, you could just stop coding for IE and alert users that IE is not a supported browser. The longer we bend over backwards trying to support that browser, the longer we will make each other suffer. I am in the terrific position of coding websites as a profitable hobby and not as a profession, so I can afford to pick and choose, but I argue that professional web developers can simply leave out non-IE features for the IE-using public. If we stop acting like IE compatibility is the holy grain of web design then our customers will have no reason to think that either. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Chrome 1.0 released
2008/12/13 Richard Heyes : >> Just to add, you could just stop coding for IE and alert users that IE >> is not a supported browser. > > You may want to re-read my post. The graphs work in everything *but* IE. > I did catch that. But you mentioned that it shouldn't be used on the internet because of that limitation, and my argument is that one browser that is _known_ problematic should not be cause to eliminate a feature for everyone else. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Chrome 1.0 released
2008/12/14 Yeti : > I have to defend poor little IE a little now. It supports XHTML and > CSS2 pretty well so far. And those standards came out a couple of > months ago. > How about HTML 4[.1] support? I would have like to see that fixed before adding new features. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] MERRY XMAS
2008/12/24 German Geek : > Merry xmas to everyone! Thanks for the support and fun discussions. > חג חנוכה שמח! Happy Hanuka to those who celebrate it! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] MERRY XMAS
2008/12/24 Richard Heyes : >> word > > Which one? > Open Office 3.0, to be exact. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
[PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME
Is there a compelling reason to use either REQUEST_URI or SCRIPT_NAME in the action of a form that I want to submit to the same URL that it came from (the script parses whether or not there is a Submit to know if it should display the form or the results). I need a portable solution, that is why I am not hardcoding it. Also, the users _may_ save the form to their hard drives, so simply leaving the action blank will not do. I know that REQUEST_URI includes the ?variable=value string and that SCRIPT_NAME does not. This form does not depend upon get variables, so this should never be an issue, but I ask here anyway to know if there are other differences that I did not account for. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHP Help Needed
2008/12/27 Ashley Sheridan : > RTFM > > http://www.php.net > Or STFW http://justfuckinggoogleit.com/search?q=php%20mysql%20file%20download%20script -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME
2008/12/27 Daniel Brown : >Happy Chanukah, Dotan! > And a Merry Christmas! >For portability's sake, especially if you anticipate users saving > the form to their local systems, I would recommend: > > $action = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; > ?> Naturally I have HTTP_HOST in there, but I did not even think about PHP_SELF. >If you use REQUEST_URI and the form is on a page not called > directly (for example, on index.php and called only by directory; a > mod_rewrite /contact page; etc.), using REQUEST_URI gives the actual > request, where PHP_SELF gives the actual file. > That is a good point, and it is rather likely that the form may wind up on an index.php page where the filename is not part of the URI. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHP Help Needed
2008/12/27 Daniel Brown : >If you've already created the UPLOAD page, then the more difficult > of the two tasks is done. Chances are, you (or whomever wrote the > code for you) should know how to do #2 if you (or another) already did > #1, but if not: > >http://www.google.com/search?q=php+mysql+file+download+script >http://www.joeclipart.com/blog/images/2007/06/20070628crack.jpg >http://www.phpbuilder.com/tips/item.php?id=5 > That was subtle :) -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Webhotel structure
2008/12/27 Daniel Brown : >What? > What's not clear? He asked about webhotels, he obviously intends on having extramarital cybersex. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Page name for form submit: REQUEST_URI or SCRIPT_NAME
2008/12/28 tedd : > Dotan: > > Maybe this is too simple, but what I do is to leave the form attribute > action="" blank. > > My understanding (may be wrong) is that forms always submit to themselves > unless directed to do so otherwise. > > Cheers, > > tedd > Thanks, Tedd. That approach seems a bit dangerous for non-standard browsers such as mobile phones and the like who's developers might not have though about it. Also, in the event that a user saves the form locally (likely in this case) I need it to have a place to go! Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Webhotel structure
2008/12/28 tedd : >>> So I would prefer to remove everythink and start all over . > > He's talking about everythink. Whenever I do that, I have problems too. > Interestingly enough, today I opened Dan Kegel's (of Wine fame) website and was greeted with this: "Dan Kegel's Web Hostel" -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Re: Webhotel structure
2008/12/30 Peter Sorensen : > Hi Carlos Thanks for trying to help. > > As a newbie on web design I was looking for help on about everythink, as a > newbie you don't know which questions to ask. > > With help from other sources I found out how to wipe my webhotel and start > over. > After a fresh install of coppermin I still had problems adding pictures. > > I finally solved that problem which turned out to be an error in Surftowns > build in filemanager chmod command. In recursive mode it only changed > permissions on files not on folders. So the coppermine users did not have > the needed file permissions. > I used FileZilla to correct the permissions. > > I anyone want to know more abot this see coppermine forum search for > batch-add > > best regards > Peter, the list had a laugh at your expense, as you used some incorrect words in what turned out to be a funny manner for those fluent in English. 1) "Webhotel" is called "web hosting" in English. 2) "Everythink" should probably be "everything". "Everythink" sounds like you are thying to think about the entire universe at the same second. It also sounds like a term from the book 1984. 3) It is obvious that you are unfamiliar with some basic concepts regarding web servers and the software that runs on them. That is fine- everyone here was at the same stage once and this list in particular is very friendly to newbies. But the way you worded your sentence just turned out funny. I am certain that you would have an even bigger laugh if I were to try asking a question in Bokmal or Nynorsk! You might want to look at the linux commands rm and rmdir if you have SSH access to the server (and if it is a Linux server). Otherwise, I recommend Konqueror (From KDE) as the best graphical tool for managing files on a remote server. Good luck. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Re: Webhotel structure
2008/12/30 Nordstjernealle 10 : > Hi Dotan > > I am glad I can at least be funny. > I must admit I am a bit lazy when it comes to write perfect english in > mails. I believe we can do better with our time. > In this particulary case the result was below acceptable levels. > English is not my native language either, by the way. > No I would not laugh if you where writing in Bokmal or Nynorsk. > Because I would not know the first think about spelling in the Norwedian > languages. I am Danish, we speak and write in Danish. > I apologize! I know little of Scandinavian culture (the letters in your last name were a hint to Scandinavian) and your email address just looked Norwegian to me. > Yes it is a linux server, and I know the basic linux commands, but I do not > know if and how I can get SSH access to my web host. If you can't, then switch hosts. SSH access is a necessity. > It may not be supported or be too basic to be include in the help search at > surftown, I simply do not know. > My web do not have a fixed IP, so I guess it may not > No fixed IP for your web host?!? Change! > It seems like surftown is an okay host, compared to my less than 2$ a month, > but their help is a major candidate for winning the price of the most > useless help ever. > > A google search found a blog where the guy say they do not support ssh on > pivate hosting, so I guess not. > > /Peter > -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Re: Webhotel structure
2008/12/31 tedd : > Everythink about getin' a job? > There's that word again! You keep using that word. I do not think that it means what you think it means. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Re: Webhotel structure
2008/12/31 Peter Sorensen : > Hi again > > Sorry for cutting your name card short Dotan, but I get tired reading the > entire alfabet every time. > I put that there to catch badly-encoded messages so that I can improve http://gibberish.co.il So long as your mail client displays the alephbet correctly, I don't need you to quote it. > Yes ssh and fixed IP is properly a must for you guys who having php > programming as a hobby, but I only want a webside up and running. Just the opposite: the static IP is for the visitors, not for the developer. > The only other thing I would like would be a 100Gbyte remote backup. Here I > only got 10Gbyte. > The price of getting these this is rather high compared to my 2$ a month, > another detail is, that I payed 5 years in advance to get this price, so > that would all be lost. In total I payed 100$ for 5 years including > webhosting and the domain name registration onbe year ago. > Now I finally get some value for the money. I wouldn't exactly call that value, but it is your decision. You seem to know what you are doing, so I won't lecture you! > Today the price for the same has doubled. > I do not mind spending another 100$ if you can do better, but I will not > spend 5 or 10$ a month for this. > > As php programming is not a hobby I properly will be away from this list for > a long time, have fun everyone, before you know you have become too old for > that. > > My retirement will also restore the average age of this list back to normal. > > Best regards > > Granpa > Peter > > nb I can not show you my web, as login is restricted to familie only, but I > guess you all know how coppermine look. > but you are welcome to look at my work homepage www.protelevision.com where > I am a HW engineer. > I cannot see that website as I have flash disabled. When your company puts up an HTML site I would be glad to look over it. Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Since I speak with some of you more than people I see in person....
2008/12/30 Bastien Koert : > Congrats on the new critter to be...they are a lot of fun after the first > year of eating sleeping and pooping ;-) > Sleeping? Why don't mine do that? I am of the opinion that the first year they are little more than a crying digestive system :) To the OP: congrats! You will enjoy this! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Re: Webhotel structure
2008/12/31 tedd : > At 9:47 AM +0200 12/31/08, Dotan Cohen wrote: >> >> 2008/12/31 tedd : >>> >>> Everythink about getin' a job? >>> >> >> There's that word again! You keep using that word. I do not think that >> it means what you think it means. >> >> -- >> Dotan Cohen > > Dotan: > > And perhaps nether of us understand what the other is saying. > > I was using it in a humorous manner, at least that was my intent. > It was a quote from The Princess Bride, also in humorous manner. > Cheers and Happy New Year. > A safe New Year! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Thank you everyone, What a wonderful world
WTF? Isn't it the Gaza government (Hamas) that chooses to build rockets instead of buying food for it's citizens? So long at Hamas is in charge both the Gaza residents and the Israelis will suffer. Let's hope this finally roots them out for good. By the way, of the 400+ killed in Gaza, about 70 were civilians. A six-to-one ratio of terrorists:civilians really is not that bad, especially considering that the Hamas hide among the civilians. Hell, they take kids with them, crying, when they launch rockets just so that they can say that another kid was killed if they get intercepted. According to the Geneva convention, it is _Hamas_ that is responsible for the civilian deaths in Gaza. By the way, Egypt (who knows better than anyone else in the world) blames Hamas fully for what has happened in the past week. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Thank you everyone, What a wonderful world
2009/1/3 Daniel Brown : > On Sat, Jan 3, 2009 at 14:00, Behzad wrote: >> >> Who are we? Vampires or Blinds? > >Worse. We're geeks. > And we have a troll in our midst. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Thank you everyone, What a wonderful world
2009/1/3 Behzad : > since you have modern weapons, equipped > with lasers! Did somebody say sharks with frigin' lasers? -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Because you guys/gals/girls/women/insert pc term here are a smart lot
2009/1/5 Frank Stanovcak : > It's been a while since I've programed (VB was on version 4) I was wondering > if any one could tell me what the diff is between char, varchar, and text in > mysql. > I know this isn't a mysql news group, but since I am using php for the > interaction it seemed like the place to ask. Thanks in advance, and have a > great day! > > Frank > http://justfuckinggoogleit.com/search?q=char+varchar+text+mysql -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Because you guys/gals/girls/women/insert pc term here are a smart lot
2009/1/7 Ashley Sheridan : > Not just that, but aren't there greater overheads if the database is > physically larger in size? I assume that char might be a bit quicker to > work with than varchar, but I am pretty certain that using a fulltext > index on a text field is ridiculously slow compared to the former two. > Especially if the programmer is not taking advantage of the database's built in search / sort and other functions. Those type of functions can run over O(n^2) if the programmer is not careful and frankly, php is a language that is used very often by novices (myself included) who may not know better. Be careful with large databases if you do not have experience with them. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Because you guys/gals/girls/women/insert pc term here are a smart lot
2009/1/8 Richard Heyes : >> until you have to dump it, zip it, ssh it over to another box and then >> import it back in > > That's what fag breaks are for... :-) Well, that and smoking. > http://xkcd.com/303/ -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] How can an elephant count for nothing?
Have you tried with a mouse? -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Opinions needed
> True, but, the website is on a shared host which means someone must setup > and maintain the DB and my code has to create and remove tables, as needed. > Plus, someone must keep the login parms in sync between the DB and my code. > > Al > Sound more like a hosting problem than a database problem. Guess what my suggestion will be... -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
> Anyone care to try this out? Feedback welcome. > > http://dftpcs.com > No. What is it? -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Don't Forget to Punch the Clock, Shorty!
> Sorry for my fragmented thoughts! > In light of this [1] you are forgiven! I think that you will find most list members a bit too jaded to go to a new domain name, suggested by a new poster who's name does not turn up anything php related on Google. I'm not doubting you, just letting you know why many list members won't visit that site. [1] http://en.wikipedia.org/wiki/Richard_Whitney_(financier) -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] for the security minded web developer - secure way to login?
> I think just use a flippin' ssl server and be done with it. > ++$i > When I go to a website that requires me to let them execute JavaScript I > rarely go back. > Many people do this, I hope that the OP realizes this. > You can use SSL for the login and only the login - I know that it means > either using a self signed cert or paying big bucks, for anything with > e-commerce you want to pay big bucks for a cert, there is no other option. > For anything not e-commerce, using a self signed cert seems a lot more > secure to me than having the browser grab some salt off your server, use > javascript to encrypt the pass, and then sending it back. > Have you seen the fit Firefox 3 makes for self-signed certs? So far as the end user is concerned, the site is inaccesible. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Full versus relative URLs
> My casual observation seems to indicate that the former will load faster > than the latter. But has anyone done any benchmarking on it? Did you clear the cache between tests? That could explain the speed difference. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Full versus relative URLs
> Agreed. But here's the real reason, in my case. We develop the pages on > an internal server, which has the URL http://pokey/mysite.com. When we > move the pages to the live server at mysite.com, all the URLs would have > to be rewritten. Ugh. > > Paul > So put it all in one place: "; ?> Full URLs don't break when users save the pages to disk. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Full versus relative URLs
>> So put it all in one place: >> >> > include "path.inc"; >> print""; >> ?> >> >> Full URLs don't break when users save the pages to disk. > > That would be fine if the pages weren't being crafted in Dreamweaver, > where inserting links like that is a pain. > For that you'd have to ask on the Dreamweaver list. I don't really like those tools. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Full versus relative URLs
> I know it's been said before, but beware of relying on this value just > for the sole purpose of deciding where things are located, as without a > bit of error checking on it, it can be used for injection attacks and > what-not, although, sadly, I forget the exact post recently that had the > link that explained this issue on PHP_SELF. > Alternatively, $_SERVER['PHP_SELF']) could be switch()ed for known values, and $path be set accordingly with hardcoded values. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Full versus relative URLs
> > Alternatively, $_SERVER['PHP_SELF']) could be switch()ed for known > > values, and $path be set accordingly with hardcoded values. >> Didn't notice this thread passing from the list. I will look into it. > > But sometimes you need to detect where something is located and that's the > point of the whole conversation. If you hardcode the values then you need to > change them while renaming or moving files and directories > > So what someone should do to accomplish such a behavior? Without being > vulnerable to injection attacks of course. > It's not vulnerable to injection in the sense that the attacker could not redirect the links to his site. At a maximum he could disable the links, but he could not redirect them. That's why I mean by hardcoded. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Full versus relative URLs
> Easy to solve. > > ini_set("include_path", > "/srv/domain/phpinclude:/srv/domain/record_include:/srv/domain/process_include"); > > Then just call it without path - IE > > include('foo.inc'); > > php will first look for foo.inc in /srv/domain/phpinclude, then in > /srv/domain/record_include, etc. > > make directories for your includes, preferably outside the web root, and > define your include path at the top of your script. > > I personally don't like to have . as part of my include path, and relative > include paths (id somedir/foo.inc) are IMHO an even worse practice. > I did not know that his was possible. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
[PHP] PHPers: help KDE wiki, please!
KDE really needs a developer with PHP experience to sort out some issues with their wiki: http://aseigo.blogspot.com/2009/02/php-helper-for-userbase.html I anyone could donate the time, KDE and myself personally would appreciate it. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHPers: help KDE wiki, please!
> Aren't you a php developer? ;) > No, just a hobbyist who likes to tinker :) Hopefully by this time 2011 I will be a mechanical engineer, though! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Which file "Included" me?
> http://www.gfx-depot.com/forum/-php-server-php-self-validation-t-1636.html > > explains a technique to validate the input as well (don't trust that is > clean) > I do not understand the exploit. How is he spoofing any $_SERVER variables? The attack description doesn't make sense. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Which file "Included" me?
> Did you actually try his example? No, I could not understand it. Now I see why: 1) Where would the "experienced hacker" enter the attack? Now I see that it is the URL of the attacked site. That was not clear, I though that it was being entered into some form element that I did not see in the code. 2) I thought that yoursite.com is the attacked site, and mysite.com is the attacking site. Now I see that the author just messed up and they both should have been yoursite.com. Why not just use SCRIPT_NAME then? It doesn't contain the path variables. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Browser timeout
> Hello, I am running a script that process the user's request, which usually > takes about 40 seconds. The problem is that on Internet Explorer 6, it > timeouts - probably because no response was sent. > How do I solve this problem? Since I tried some things and header() > messages, nothing worked. > Run the script in the background, and give the user a page that self-refreshes every 10 seconds. Or, better yet, use AJAX. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Re: Browser timeout
2009/3/2 Rick Lim : > Try > set_time_limit (0); > While technically that would work, the user would likely cancel the request, or send it multiple times, in 40 seconds. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] Long Execution Time - Safe Mode
2009/3/5 דניאל דנון : > Hello. > I have a script which updates some database by loading information from > external websites. > For example, it has a table of website addresses, and it updates their HTML > source on the database. > I am using cronjobs to activate the script every 8 hours. > > The problem is the server I am running my script on has SAFE MODE ON, which > prevents me from changing the max_execution_time or memory limit. > > I talked with the server-owner and he changed the max_execution_time to 120 > seconds, But still - its not enough. Either the time runs out or the memory. > > Do you have any idea how can I solve this problem? I thought about opening > multiple sessions with fsockopen with timeout of one second to the script it > self - but its complicated, so first - is there any better solution? > I have a feeling that PHP might not be the right tool for this job. To avoid a flame war, I won't mention alternatives. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHP Quiz
Actually, I like the site. The pages take a long time to load, it seems like server load. You might want to move your images to Amazon S3 or something similar. There are many spelling errors. Go through the quizes. I like the way the quizzes are broken up into sets. Add more sets on a regular basis and create an RSS feed of the new sets. Which function can we use to creates a new XML parser? xml_parsercreate() xml_parser_create() xmlparser_create() xmlparsercreate() The fact that this question must be asked is a bug in PHP, in my opinion. Oh, and I got it wrong! The grammar is one of PHP's weak points. Whoever designed the HTML did a terrific job. The site displays perfectly when increasing text font size. Give him a compliment. Alright, I signed up! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHP Quiz
> I need your kind help, if possible please visit the site and take some > quizzes, and then let me know your feedback. Should I add any thing > else in that site? > Regarding this question: "Which one is good to use, to send the output?" 1) The question is not well worded 2) The answer is a matter of opinion. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHP Site Security issue
Someone hacked your server. Report it to the server admin. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
Re: [PHP] PHP Site Security issue
...and get it off of GoDaddy's servers. They are notorious for problems! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: So called "PHP Expert"
> Maybe someone else will disagree and say that its a masterpiece, then > I'll bow out gracefully. > Actually, it is a masterpiece and it _should_ be treated like the prize that it is with it's own page on some wiki. Under the title "How not to do it". -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Having trouble with a form to mail script.
2009/3/21 Linda Stark : > > > > > > > > > > Hi there, > > > > Well, after reading the post about "so called experts" and licensing > programming, I > can say that I sure am not licensed or even remotely close to a novice PHP > programmer, just a ‘lil ole PHP beginner trying to get my web page set up and > learn a few things. I’m not sure if I am > in the right forum but thought I would give this a shot… > > > I just > created a new mail form in Dreamweaver for a web site. I’m > working on a form to mail script that I started after reading a few on line > tutorials, and can’t seem to get right. When I run > this little test script (named sendmail2.php) from the tutorial, on my server, > just to make sure PHP is working OK for web email forms: > > > > > $email = $_REQUEST['email'] ; > > $message = $_REQUEST['message'] ; > > mail( "h...@mydomain.com", "Feedback Form Results", > > $message, "From: $email" ); > > header( "Location: http://www.mydomain.com/thankyou.html"; > ); > > ?> > > > > Which takes > input from the following testmail.html page form: > > > > action="sendmail2.php"> > > Email: /> > > Message: > > cols="40"> > > > > > > > > It works > great, I get the senders email address and comment sent to my email address – > account. > But the form > I want to use my final design from Dreamweaver, is: > > > > > > > > name="formEmail" method="post" > action="sendmail2.php"> > > > > Account Info: > > User Name: > > id="emailAddress" tabindex="10" /> > > > > Password > > tabindex="20" /> > > > > Confirm Password: > > id="confirm" tabindex="30" /> > > > > > > > > Personal Info > > > > First Name: > > id="firstname" tabindex="40" /> > > > > > > Last Name: > > id="lastname" tabindex="50" /> > > > > > > What state do you live > in? > > tabindex="60"> > > Alabama > > Indiana > > selected="selected">Michigan > > Ohio > > > > > > How long have u been sawing? > > > > value="newbie" id="WoodLength_0" tabindex="70" > /> > > 0-2 years > > > > > > value="novice" id="WoodLength_1" tabindex="80" > /> > > 3-5 years > > > > > > value="expert" id="WoodLength_2" > tabindex="90"/> > > 6 plus years > > What tools do you use most often? > > > > id="shop" tabindex="100" /> > > Shopping > > > > id="tools" tabindex="120" /> > > Tools > > > > id="saws" tabindex="130" /> > > Saws > > > > > > Additional Comments > > > > cols="50" rows="10" > tabindex="140"> > > > > id="Submit" value="Join Mail List" tabindex="160" > /> > > > > > > > > > > …and when I > use it with the associated sendmail2.php script: > > > > > > > > $emailAddress = $_REQUEST['emailAddress'] ; > > $pwd = $_REQUEST['pwd'] ; > > $confirm = $_REQUEST['confirm'] ; > > $firstname = $_REQUEST['firstname'] ; > > $lastname = $_REQUEST['lastname'] ; > > $region = $_REQUEST['region'] ; > > $WoodLength = $_REQUEST['WoodLength'] ; > > $shop = $_REQUEST['shop'] ; > > $tools = $_REQUEST['tools'] ; > > $saws = $_REQUEST['saws'] ; > > $Comments = $_REQUEST['Comments'] ; > > mail( "h...@mydomain.com", "Feedback Form Results", > > $message, "From: $email" ); > > header( "Location: http://www.mydomain.com/thankyou.html"; > ); > > ?> > > > > The email is > received, but with a blank return email address and an empty message. None of > the comments or form values get through - just a blank email sent to my > address. Can anyone point me in the right direction – what am I doing wrong? > > > > Note: That > password field is not really a login password, I just wanted to use it for > testing purposes. > > > Do I have to > refrence the type and id attributes in the php script as well? > > > > Thanks for > any input. > > > > It looks like you are not using the same variable names in all the places that you want to use a variable. For one thing, $email is not set, but $emailAddress is. That should be enough to get you started. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: So called "PHP Expert"
>> This is why I am pushing for legislation to make this a licensed >> profession. > > Licensed where, and by whom? > > I envision paying M$ for some form of certification -- I can do with out. > Exactly. Programming is an accredited profession, not a licensed profession. Where did the OP's expert study? I should make it know that I'm self-taught, so I do not rule out the possibility that one could teach himself. But I do not play the expert card, either. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] So called "PHP Expert"
> tedd kids you not. I'm standing at the edge of his ignorance and I just > droppped a rock... I've yet to hear it hit the bottom. I'll let you know > when I do. That was you?!? I'm stand right here in the middle of ignorance and BAM! a rock falls out of nowhere. There are people in here, you insensitive clod! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Show the entire browser request
I need to diagnose a web browser problem, and I'd like PHP to return a page that shows the entire browser request, exactly as it was sent. It would naturally contain all the data in the HTTP Headers Information from phpinfo() but formatted exactly as the browser sent it. Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
>> I need to diagnose a web browser problem, and I'd like PHP to return a >> page that shows the entire browser request, exactly as it was sent. It >> would naturally contain all the data in the HTTP Headers Information >> from phpinfo() but formatted exactly as the browser sent it. > > Depending on the specifics of the problem at hand, Dotan, you may > actually be better-served by running the diagnostics locally using > LiveHTTPHeaders[1] (a Firefox addon) or something similar. > > ^1: http://livehttpheaders.mozdev.org/ > Thanks, Daniel, but I am trying to help someone who is writing a text-based web browser but gets "Bad Request" messages from some websites. As he is able to visit http://simplesniff.com (my site) I figured that it would help if I could just reply back with a page that contained the exact request that he made. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
> Roger that. Check out getallheaders() then: > > http://php.net/getallheaders > Well, that seems to be partway there, but it doesn't include the GET request. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
> This should do it, I believe: > > > echo $_SERVER['REQUEST_METHOD'], ' ', $_SERVER['REQUEST_URI'], ' ', > $_SERVER['SERVER_PROTOCOL']; > > ?> > Thanks, Andrew, I'm sure that works for correctly-formed requests. However, I am trying to diagnose a web browser that is _not_ correctly forming it's requests, therefore I need the real request itself, as it was. I am starting to realize that PHP is not the language for this, I may have to look into an Apache module or something lower-level. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
> If its the request from the browser, why not just fire up a packet sniffer > and get it that way? Unless it's using SSL/TLS/VPN/something that would > encrypt it, you should be able to see the request in clear text. > The browser is running on a Symbian cellphone. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
> Run this on a command line and hit the IP on port 8000. All it does is > read the request and send it back as the response. It ignores POST > bodies but it would be pretty simple to modify it so it echo's those > back too. > > http://dev.stut.net/php/httpsrv.phps > Stuart, that is quite a bit of work! Nice! I also learned some really nice tips here, such as your usage of define for the header and footer, and why that is the cleanest solution when you need the content-length. The usage of sockets is new to me too, but this was easy to follow. Thanks! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
Why should this be run on port 8000? Is there a security implication of running this on port 80? Would it be unwise to use this as a public service, for instance? I was considering adding the tool to http://simplesniff, which is why I ask. Of course, that would only be with your permission, and it would give you credit for writing the code as well. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
> There are no risks that I can see in the code. You're welcome to use > it, and a link to http://stut.net/ is always appreciated ;-) > In August when I will have more time to devote to it I will put it on the site. With link, and it is _me_ who appreciates _your_ help. Thanks! Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Show the entire browser request
> Just checked your site in Elinks (works like Lynx) and I'm getting the > headers come back to me. I'm assuming you changed your site code before > me sending this and after you sent the original message? > The individual headers are as they always were. It's the entire request verbatim (valid or not) that I'd like to add. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] This Friday's OT Thread
> I'm self-employed. I don't plan on ever laying myself off. > Wow, I really replaced "laying" with "getting" in my mental eye and that sentence made too much sense. Please, don't ever do that to me again! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] This Friday's OT Thread
>> I'm self-employed. I don't plan on ever laying myself off. > > Mind out of the gutter, Rob. Words like "self," "laying," and > "off" will get you flagged. > How naive I was to think that I might be the only one to make the connection! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does something like this exist?
> I'm wondering if there isn't something out there that crawls through > your codebase and generates a map of (any of) the following: > > * What files are include in which scripts > * The relationships between defined classes (eg A extends B) > * What other classes are utilized by which classes (eg, instantiation) > > I've done some looking around but haven't really been able to find > anything that does even some of this. I could write functionality > that does this but didn't want to reinvent the wheel. > I think that you're looking for Perl! -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot exec in my own directory
I have a script in /home/username/script.sh with permissions 777. I can SSH into the server and execute ./script.sh to run the script, but calling it from exec in PHP does not run it. What should I start checking? Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sanitizing mysql inserts of user data
I am sanitizing user-entered data before storing in mysql with this function: function clean_mysql ($dirty) { $dirty=trim($dirty); $dirty=str_replace ("--", "", $dirty); $dirty=str_replace (";", "", $dirty); $clean=mysql_real_escape_string($dirty); return $clean; } Is this good enough to prevent SQL injection attacks? Should I add anything else? Thanks! Dotan Cohen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
> Check the include path. Try using the complete path to the file. And make > sure the user PHP is running has read permissions to the directories upwards > the hierarchy. > Thanks. I am using the complete path to the script: exec("/home/username/script.sh"); In the /home/username/ directory there are other files, such as database_connection.inc that I regularly include_once in my PHP scripts, so I know that PHP has read access to that directory. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sanitizing mysql inserts of user data
> You should in pretty much all cases be safe with just using the > mysql_real_escape_string, which takes care of the - for you as well. > If I remember correctly, TFM once stated that mysql_real_escape_string does not prevent SQL injection attacks, though I am hard pressed to think of what it _is_ for, then. I now see that the manual has this note: "Note: If this function is not used to escape data, the query is vulnerable to SQL Injection Attacks." Does that necessarily imply this: "If this function is used to escape data, the query is not vulnerable to SQL Injection Attacks."? Logically, it does _not_ mean the same thing. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sanitizing mysql inserts of user data
2009/8/16 Caner Bulut : > > Hi Dotan, > > You can use htmlentities(), htmlspecialchars() and strip_tags() functions > when you show your saved data on your web pages. mysql_real_escape_string > function saved data into mysql DB with a secure way. But when you try to > show data you still have to control it. > Thank you Caner. This is the function that I use to escape HTML after it has been pulled out of the database: function clean_html ($dirty, $noNewlines=0) { $dirty = strip_tags($dirty); $dirty = str_replace("\r\n", "\n", $dirty); $dirty = str_replace("\r", "\n", $dirty); if ($noNewlines==1) { $dirty = str_replace("\n", " ", $dirty); } $dirty = ereg_replace( ' +', ' ', $dirty); $dirty=trim($dirty); $dirty = str_replace("&", "&", $dirty); $dirty = str_replace("&", "&", $dirty); $clean=htmlentities($dirty); return $clean; } It is rather convoluted but straightforward in my opinion. In addition to preventing XSS attacks, it converts newlines to *nix-style and limits them to just two newlines in a row (or none, depending on application). It also limits spaces to a single space and ensures that all ampersands are escaped properly before sanitation with htmlentities. Dotan Cohen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
> Please copy your script in the Linux include paths. Such as /usr/local/bin > and give it neccecary permission and try your script again. > I do not have root access on this machine. That is why I run the script from /home/username/ -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
> see if can run the same php file via CLI. does script.sh run without > any problems ? then, probably something linke SELinux is preventing > httpd from running scripts. you have to contact your system > administrator to get this fixed. > You are right. Running the php script from the CLI in an SSH session results in the expected behaviour: the script specified in the exec command is run. Not so if I call the php script from a web browser. Thanks for the tipoff. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
> Did you check SELinux options ?? > I do not have root access to that server. > I have a similar problem. For some unknown reason scan_dir() is not > able to read /home/user when run as Apache module. but the CLI is > giving expected results. I did not find any work around, but had to > read /var/www which is the home directory of 'apache' (this is the > user under which apache runs by default. hence you script needs 777 to > execute) > Actually, it currently is 777. I thought it might be a permissions problem so I 777ed it as a troubleshooting measure. > So if every thing else fails I'll recommend you to move the script to > /var/ww (usually your server root) instead of /home/user > I have no access to that directory. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
> That's a potential security flaw waiting to happen. A script like this > shouldn't be kept in a web-accessible directory. > Thanks, Ash. That directory is HTTP-password protected. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot exec in my own directory
> Just out of curiosity, have you been able to run even the most basic of > scripts from PHP, like a plain old BASH 'echo' statement or something? I > only ask, because sometimes within the shell scripts themselves are > calls to other command line programs (even something as simple as 'ls') > which need to be called using their full path because Apache has a > different path for shell scripts. ls, pwd, and other commands run fine. The only command in the called shell script is /usr/bin/mysqldump which for some reason out of habit I always type with the full path! > Also, you said you used include files > in that same area. Is it possible that you are also trying to use one of > them inside your shell script, but because the paths are different, the > system cannot find the things you expect it to? > No, there are no other files included in this instance. I only mentioned it to show that PHP can read from that directory. Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sanitizing mysql inserts of user data
>> Logically, it does _not_ mean the same thing. > > Definitely not -- it would be a bit presumptuous to claim "If you do > X, the query is not vulnerable to SQL injection attacks" for just > about any value of X. > That is what I though: no magic bullet. > That said, I would recommend binding parameters if you can. It's a > cleaner way of separating the logic of a query from its data, and > theoretically more reliable than mysql_real_escape_string(): > > http://en.wikipedia.org/wiki/SQL_injection#Parameterized_statements > I fail to understand what is happening here. For the sake of context, here is the PHP code in TFA: $db = new PDO('pgsql:dbname=database'); $stmt = $db->prepare("SELECT priv FROM testUsers WHERE username=:username AND password=:password"); $stmt->bindParam(':username', $user); $stmt->bindParam(':password', $pass); $stmt->execute(); What exactly does bindParam do? I read these pages in TFM but I still do not understand what exactly is being sent to the database: http://il2.php.net/manual/en/function.db2-bind-param.php http://il2.php.net/manual/en/function.maxdb-stmt-bind-param.php http://il2.php.net/manual/en/mysqli-stmt.bind-param.php I do not see how there could possibly be a prepared statement for a user comment. I am not a programmer by trade, so I may be missing something obvious. If so, a link and a friendly RTFM would be great. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sanitizing mysql inserts of user data
>> > That said, I would recommend binding parameters if you can. It's a >> > cleaner way of separating the logic of a query from its data, and >> > theoretically more reliable than mysql_real_escape_string(): >> > >> > http://en.wikipedia.org/wiki/SQL_injection#Parameterized_statements >> > >> >> I fail to understand what is happening here. For the sake of context, >> here is the PHP code in TFA: >> $db = new PDO('pgsql:dbname=database'); >> $stmt = $db->prepare("SELECT priv FROM testUsers WHERE >> username=:username AND password=:password"); >> $stmt->bindParam(':username', $user); >> $stmt->bindParam(':password', $pass); >> $stmt->execute(); >> >> What exactly does bindParam do? I read these pages in TFM but I still >> do not understand what exactly is being sent to the database: >> http://il2.php.net/manual/en/function.db2-bind-param.php >> http://il2.php.net/manual/en/function.maxdb-stmt-bind-param.php >> http://il2.php.net/manual/en/mysqli-stmt.bind-param.php >> >> I do not see how there could possibly be a prepared statement for a >> user comment. I am not a programmer by trade, so I may be missing >> something obvious. If so, a link and a friendly RTFM would be great. > > Typically, prepared statements do a couple of things. First, they ensure > that values sent to the DBMS are properly "quoted". You'd be surprised > how difficult a problem that is. Date and string values must be > surrounded by quotes, but numerics shouldn't be. And how they're quoted > depends on the DBMS you're using. So prepared statements take care of > this for you. > Apparently, I missunderstood the meaning of the term "prepared statements". I thought that it meant using values that only came from my code, and no user-entered values. For instance, if the user had to choose between the windows, linux, and mac forums, the code would look like this: switch ($userForum){ case (linux): $sqlForum="linux"; break; case (windows): $sqlForum="windows"; break; case (mac): $sqlForum="mac"; break; This is what I currently do. However, that approach would not work for comments. > The second thing they do is examine the values you're attempting to pass > into the database, and ensure they don't contain SQL injection type > code. This is hard to explain, but it's relatively simple to insert > "code" in place of an actual value, and do malicious things to your > database, or obtain information you don't want users to see (like credit > card numbers). If you're curious, search for "SQL injection" to get more > information and see examples. > I am familiar with SQL injection, I wrote about it here: http://what-is-what.com/what_is/sql_injection.html -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sanitizing mysql inserts of user data
> Thanks Paul, that was a much better explanation than the one I was > attempting. I'm guessing the OP was being thrown off by the colons in > the SELECT statement above. I can see how those could look like > comments to someone not familiar with PDO and named parameters. > It wasn't the colons being mistaken for comments that threw me off, I realized that they were not comments. But being unfamiliar with PDO and named parameters I did not understand exactly what was happening. I will try to google some more information on PDO now. Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to read cookies set by php?
I'm trying to debug some scripts, and I see that the contents of cookies seems to be encoded (in Firefox2 on Kubuntu, at least). How can one read the cookies stored on his machine? Dotan Cohen http://what-is-what.com/what_is/gmail.html http://datip.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to read cookies set by php?
On 02/01/07, tedd <[EMAIL PROTECTED]> wrote: At 4:16 PM +0200 1/2/07, Dotan Cohen wrote: >I'm trying to debug some scripts, and I see that the contents of >cookies seems to be encoded (in Firefox2 on Kubuntu, at least). How >can one read the cookies stored on his machine? > >Dotan Cohen Dotan: Just a guess, are the cookies serialized? http://us2.php.net/serialize tedd No, the cookies are not serialized. Dotan Cohen http://lyricslist.com/lyrics/artist_albums/106/cantrell_jerry.html http://fiifke.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to read cookies set by php?
On 03/01/07, Peter Lauri <[EMAIL PROTECTED]> wrote: Are you trying to read cookies that are not set by your host? If that is the case you will probably be disappointed. The purpose with cookies is that they should only be table to be read by the one who is setting the cookie. If you want to read cookies on the machine that you are able to view just: echo ""; print_r($_COOKIE); echo ""; Best regards, Peter Lauri Thanks, Paul. I should have asked the question in a firefox community, not a php community. I want to see the cookies stored on my machine. The reason that I want to do that is to debug a php script, but it certainly is not a php issue. Sorry for the noise. Dotan Cohen http://what-is-what.com/what_is/webpage.html http://olnu.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to read cookies set by php?
On 03/01/07, Richard Lynch <[EMAIL PROTECTED]> wrote: Configure the browser to prompt you before saving cookies, and then surf there again? FIrst thing that I did (well, second). The cookies are obfuscated. Turn on LiveHTTPHeaders and see what the browser sends when you surf back to that site? I'll do that. I tried with the web developer's extension. I'm actually surprised that it didn't work for me. Hack your /etc/hosts or \WINDOWS\system32\drivers\etc\hosts to have the other guy's domain re-directed to your localhost, and set up PHP to var_dump($_COOKIES) might work? Seems like an awful lot of work, but it might make you feel like a real hacker :-) :-) :-) Nice. Might just do it for the experience. I've played with /etc/hosts to get rid of advertisements, so I'm comfortable with it. Thanks. Dotan Cohen http://what-is-what.com/what_is/linux_distribution.html http://lyricslist.com/lyrics/lyrics/136/457/spears_britney/britney.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Removing UTF-8 from text
I have many email address that are stored like this: "=?UTF-8?B?15jXqNeR15XXp9eZ16DXlCDXnteo15nXkNeg15Q=?=" <[EMAIL PROTECTED]>, "=?UTF-8?B?15nXoNem158g157XqNeZ15Q=?=" <[EMAIL PROTECTED]>, "=?UTF-8?B?15zXmSDXpNeV15zXmdeg15Q=?=" <[EMAIL PROTECTED]> I'm trying to run a script that will leave the file as so: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] The first step is to remove the UTF-8 names. This code _doesn't_ work, but I think that it should: $text=preg_replace('/\"=\?UTF\-8\?B\?([a-z0-9]+)\?=\"/i', '', $text); I've tried with single and double quotes, and I've tried backslashing and not backslashing the question marks. Where am I erring? Thanks. Dotan Cohen http://technology-sleuth.com/long_answer/what_are_the_advantages_of_lcd_monitors.html http://kubuntu.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Removing UTF-8 from text
On 03/01/07, Al <[EMAIL PROTECTED]> wrote: Why not simply capture what you want, rather than try to remove what you don't want? Because there are also emails in there in this format: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] preg_match_all("%<([EMAIL PROTECTED])>%", $text, $matches); now print_r($matches[1]) and you see your addresses Hey, that's pretty good! Thanks. I'm going to go reread and remind myself why you used % instead of slashes. I should know that, but I don't. Thanks. Dotan Cohen http://dotancohen.com/howto/firefox_password_manager.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing UTF-8 from text
On 03/01/07, Richard Lynch <[EMAIL PROTECTED]> wrote: Instead of trying to strip the UTF stuff out, try to capture the part you want: preg_match_all('|<[^>]>|ms', $emails, $output); var_dump($output); Richard, I do have a working script now, but I'm intrigued by your regex. Why do you surround the needle with pipes, and what is the "ms" for? Dotan Cohen http://lyricslist.com/lyrics/artist_albums/336/mclachlan_sarah.html http://what-is-what.com/what_is/world_wide_web.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to read cookies set by php?
On 03/01/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, January 3, 2007 9:02 am, Dotan Cohen wrote: > On 03/01/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> Configure the browser to prompt you before saving cookies, and then >> surf there again? > > FIrst thing that I did (well, second). The cookies are obfuscated. They won't get any clearer than that... What you see is what you get, which is what you'll see with all these methods. No, I think that if I spoof the server via /etc/hosts then I'll be able to pull content out of the cookie. In my spare time Dotan Cohen http://what-is-what.com/what_is/fedora_core.html http://dotancohen.com/howto/root_email.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing UTF-8 from text
On 03/01/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote: It's for "Did you know that the syntax is described in the manual? Did you know that PHP has a manual on the web? It's at http://www.php.net/";. Thank you Roman. Yes, I am familiar with the php manual. I've referenced the manual hunderds of times, saving list posts. But sometimes (especially in the course of regular expressions for me) one needs to ask on the list. I am also aware that I am not the only one with regex difficulties- they seem to be a sticky point for many noobs like myself in all computer languages, not just php. Also, the Hebrew translation of the manual is very difficult for me to grasp, so I use the English version. That may not be a problem for you, but it is for me. Dotan Cohen http://what-is-what.com/what_is/eula.html http://technology-sleuth.com/short_answer/how_much_memory_will_i_need_for_my_digital_camera.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing UTF-8 from text
On 04/01/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote: Your written English is very good. If you can understand what you wrote and can read replies (in English) from the list, you should have no problems understanding the manual. Thank you. Like said, I do prefer the English manual over the Hebrew one. I'll not argue with you, rather, I was making the point that even people who RTFM and STFA (like myself) need clarification and ask questions. Dotan Cohen http://dotancohen.com/eng/israel_attacks.php http://lyricslist.com/lyrics/lyrics/5/445/sepultura/schizophrenia.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing UTF-8 from text
On 05/01/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Wed, January 3, 2007 2:41 pm, Dotan Cohen wrote: > On 03/01/07, Richard Lynch <[EMAIL PROTECTED]> wrote: >> Instead of trying to strip the UTF stuff out, try to capture the >> part >> you want: >> >> preg_match_all('|<[^>]>|ms', $emails, $output); >> var_dump($output); >> > > Richard, I do have a working script now, but I'm intrigued by your > regex. Why do you surround the needle with pipes, and what is the "ms" > for? The start/end character can be almost anything you want, and which is convenient. If the "pattern" you are looking for has a '|' in it, then '|' would be very inconvenient, as you'd have to escape it. But if it has no '|' in the pattern, '|' is convenient. It's traditional to use '/' but because / is already used in pathnames and HTML tags, I find myself using '|' more often, as I seldom have patterns with '|' in them as a meaningful character that I need to type. You can also (in some versions) use "matching" start/end delimiters, like < with > or { and } and so on. In this particular case, almost anything except < and > would be convenient, so I could have chosen any of these: |(<[^>]*>)| /(<[^>]*>)/ {(<[^>]*>)} [aside] Notice how I subtly corrected my obvious mistakes this time around... :-) [/aside] The 'm' tacked on at the end allow for newline within the pattern and content, so that if your emails are separated by newlines, it should still work. Actually, I think the 'm' might not be needed, as there should be any newlines WITHIN the pattern. The 's' allows the '.' (if I had one, which I don't) to match newlines within the string as well as other characters. It is totally pointless to have included 's' in this case, since I have no '.' in the pattern in the first place. Just habit, I guess. I generally find that if I have a big ol' chunk of text, and I want to do PCRE on it, and it might have newlines, I want 'ms' on the end, and I don't want that if it's just a single line of text. I'm still definitely more in the Cargo Cult, perhaps graduating to Voodoo Programming style, of PCRE pattern composing. Maybe someday I'll *really* understand regex, and graduate to Competent. I doubt it though. Thanks. This is getting filed under my regex-emergencies label. I'll definetly be referencing this again. As usual, I do prefer to be taught to capture fish rather than be handed a fish. Dotan Cohen http://lyricslist.com/lyrics/artist_albums/517/yaz.html http://what-is-what.com/what_is/sitepoint.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing UTF-8 from text
On 05/01/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote: The syntax is very dense which makes it easy to forget if you don't practise. On the other hand, it's very easy to stay in form: regular expressions are everywhere, even the Perl-compatible ones. I suppose it's rather easy to stay physically fit as well, assuming that you run every day. However, I sit too many hours in the university library and not enough running nor coding regexes. So, my abilities in both are not what they should be. Thanks for bearing with me, though. Dotan Cohen http://what-is-what.com/what_is/protocol.html http://lyricslist.com/lyrics/artist_albums/383/o_connor_sinead.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Extracting XMP text from Jpeg
The birth of my first daughter has inpired me to get the photo gallery on my site up to date. To do so, I need to extract XMP data from Jpeg pictures. Here is a test pic: http://dotancohen.com/gili.jpg (beware, it's 1.8 MB) This pic has three tags: TEST MILOTTEST גילי I can see the tags using linux's strings and grep commands, but how can I get them into an array in php? I have been playing with the PHP JPEG Metadata Toolkit but I can't seem to get the XMP tags into an array and I'm getting frustrated! This is time that I should be with Meirav (her name), not googling for hours on end. Any advice, suggestions, and code examples are very, very welcome at this point. Those who know me from the list know that I never ask for code examples (not the best way to learn) but I'm really stumped now, and I've got a little girl to feed / give attention to / take care of the house because the wife is nursing / study / work. Thanks in advance. Dotan Cohen http://lyricslist.com/lyrics/artist_albums/655/fozzy.html http://what-is-what.com/what_is/spyware.html
Re: [PHP] Re: Extracting XMP text from Jpeg
On 13/01/07, zerof <[EMAIL PROTECTED]> wrote: Dotan Cohen escreveu: > The birth of my first daughter has inpired me to get the photo gallery > on my site up to date. To do so, I need to extract XMP data from Jpeg > pictures. Here is a test pic: > http://dotancohen.com/gili.jpg > (beware, it's 1.8 MB) >. http://www.ozhiker.com/electronics/pjmt/library/list_contents.php4?show_fn=XMP.php Thanks, Zerof, I have been playing with this with no success. Has anybody successfully used this to extract XMP data? http://www.educar.pro.br/abc/gdlib/index.php?pageNum_rsNVER=22&totalRows_rsNVER=97 I don't see where XMP data is discussed on your site. I'll check back frequently, maybe your intention is to discuss it? Thanks. zerof Dotan Cohen http://essentialinux.com/locale.php http://music-lyriks.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extracting XMP text from Jpeg
On 13/01/07, tedd <[EMAIL PROTECTED]> wrote: At 2:40 AM +0200 1/13/07, Dotan Cohen wrote: >The birth of my first daughter has inpired me to get the photo gallery >on my site up to date. To do so, I need to extract XMP data from Jpeg >pictures. Here is a test pic: >http://dotancohen.com/gili.jpg Dotan: Whoa, when you said "birth of my first daughter " that's not what I expected. :-) tedd Hehehe... Good thing that I didn't post a picture of Gush: http://dotancohen.com/gallery/img-122.html Here's Meirav (proud father, I have to show her off): http://dotancohen.com/gallery/img-7.html Dotan Cohen http://lyricslist.com/lyrics/artist_albums/305/lennon_john.html http://what-is-what.com/what_is/virus.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extracting XMP text from Jpeg
On 13/01/07, tedd <[EMAIL PROTECTED]> wrote: Very cute! Congratulations. :-) Thank you! Have you looked into: exif_read_data() ? Yes, but it won't handle XMP. There is a link in the comments to a user-written function that reads exif data from XMP that PhotoShop CS stores, but I cannot seem to modify it for my purpose. I'm having a hell of a time with the regex and I don't post regex questions until I've fought with them for a few days at least (I usually don't need to post in the end). I wrote something on it, but I needed PHP to be compiled with --enable-exif and my server wouldn't do it. tedd Good luck with that, then. I wish that I could give you SSH access to test, but the server is not my own, and I'm sworn to security! Dotan Cohen http://what-is-what.com/what_is/electromagnet.html http://dapot.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extracting XMP text from Jpeg
On 14/01/07, Bill Guion <[EMAIL PROTECTED]> wrote: At 8:05 PM +0200 1/13/07, Dotan Cohen wrote: > >Hehehe... Good thing that I didn't post a picture of Gush: >http://dotancohen.com/gallery/img-122.html > I presume Gush is an advanced computer mouse? -= Bill =- First wireless model available! Dotan Cohen http://lyricslist.com/lyrics/artist_albums/464/stone_temple_pilots.html http://easy-answers.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing mail file
On 30/01/07, Pierre Pintaric <[EMAIL PROTECTED]> wrote: If somebody uses a great function and want to share, I will please him... :-) Er, could you please define "I will please him"? I think that you've scared off a few potential helpers Dotan Cohen http://lyricslist.com/lyrics/artist_albums/220/gin_blossoms.html http://rorot.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing mail file
On 01/02/07, Richard Lynch <[EMAIL PROTECTED]> wrote: Actually, I suspect most people at least make some kind of attempt to read docs before posting here... Reading does not guarantee comprehension. For that matter, reading WHICH docs is always an interesting challenge. Clearly, nobody can read *ALL* the docs. And it's very very very easy when entering a new domain to read and comprehend what seems like a reasonable amount of documentation, but still be missing some crucial fundamental bit of information. This is often-times, in my experience, because: A) Documentation assumes a certain knowledge level way higher than I actually had. B) Documentation glossed over something "basic" in such a way that did not make it clear just how important/crucial that bit of info was. I have no problem believing that the OP read the php.net IMAP pages but didn't know that a single email could be stored in a file and treated as an mbox. Similarly, knowing that email is MIME encoded does not mean that one should automatically know that MIME is the keyword commonly used to find/describe the software, nor that that's the result you should examine. Most email is in Latin-1, ASCII, or UTF-8 these days, yet you wouldn't search for those when trying to learn something about pasrsing a single email, would you? Throw in some second language difficulties, and I have to say that maybe certain people were a bit hasty in their assumptions about the effort expended by the OP... Perhaps NEXT TIME we could avoid some of this noise?... Excellent point of view, Richard. I bother the php list with a lot less questions now than I did two years ago not because I've learned the language better, but because from reading the list continually I've learned a lot of new keywords to google on. That's the whole trick, and like you said it is impossible to RTFM and comprehend the whole thing in one shot. No matter how many times I read the section on PCRE I sometimes get stuck for hours before I land on one keyword and then I can google properly. Thanks for being considerate, and always helpful. Dotan Cohen http://lyricslist.com/lyrics/artist_albums/20/aerosmith.html http://what-is-what.com/what_is/bluetooth.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Latin letter problem!
On 20/02/07, Delta Storm <[EMAIL PROTECTED]> wrote: Hi, I'm building an simple CMS system. I have built almost everything but one thing buggs me... I have a MySQL database built for publishing news (Id,title,newsContent,timestamp). And I have a php web page that displays that content. The problem is with the charset, in the database the settings are following: character set latin2 collation latin2_croatian_ci; and in the tables character set utf8; I display the data in the php page using utf8 I see all the non-PHP content pure HTML content capable of seeing croatian letter čćžšđ, but in the news section I only see čćđ. But they are on the same page! I tried putting other HTML charsets like iso-8859-1,iso-8859-2 etc... But in all the scenarios I get the HTMl part working but PHP not working vice-versa... Please help me it is a very important web page if you need any other information just ask! Thank you very much in advance! Change it all to utf-8, and watch your problems disappear! I've lots of experience with that in Hebrew website design. Note that you will need the server to specify the utf-8 encoding in the header. The metatag is not enough. Dotan Cohen http://what-is-what.com/what_is/buffer_overflow.html http://lyricslist.com/lyrics/lyrics/47/402/pink_floyd/the_division_bell.html
Re: [PHP] Latin letter problem!
On 20/02/07, Peter Lauri <[EMAIL PROTECTED]> wrote: How are you setting the charset of the web page? Are you using header() or using html head section to set it? First, the header() function. Then again in the tag, and a final time in the meta tag. This way cached pages and pages stored on disk will display properly as well. http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="he" lang="he"> Dotan Cohen http://lyricslist.com/lyrics/artist_albums/5/112.html http://what-is-what.com/what_is/website.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php