Re: [PHP] Newbie Form Question
Richard Lynch wrote: ?php if (isset($_REQUEST['email'])){ $success = mail($_REQUEST['action'], 'un/subscribe', 'un/subscribe', From: $_REQUEST[email]\r\nReply-to: $_REQUEST[email]); if ($success) echo Status Change Sent; else echo Unable to send Status Change; } ? What if someone submitted: action = [EMAIL PROTECTED] email = [EMAIL PROTECTED] long winded evil spam message here ? -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Simulating a POST
Man-wai Chang wrote: I hit the script by http://server/netgeo.post.php?ip=192.168.1.1 But the script entered an endless loop. What's wrong? Either there is a bug in the script, or you put in unexpected data, or both. (Since server isn't a host we can access, and since you haven't shown us the script, that's all that can really be said). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: METHOD=POST not worikng
IraqiGeek wrote: I'm learning PHP on a Debian Etch with Apache 2.0.54 and PHP 4.3.10, and using Firefox 1.5.3 on a Windows XP box to browse the sample site. I wrote a small form to get user input. If I use METHOD=GET, then the form works fine, without any glitches. However, if I use METHOD=POST in the form, I don't get the data back to the script. The most likely explanation is that there is something wrong with your script or with your form. It would help if you showed the code (a minimal test case by preference) you are trying to use. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problem with greek language
Rosen wrote: I have one very big problem: I create website with english and greek language. I use iso-8859-1 encoding for my website. I show the greek language text with encoded chars like tau;eta;lambda;epsilon;#972;rho;alpha;si; Representing such characters as HTML entities is fine. On the website I have no problems - everything shows ok, but when I pass this greek encoded string to javascript - i.e. alert('tau;eta;'); the browser doesn't decode the greek symbols and the alert shows me the same :tau;eta; The data between script and /script is, in HTML documents, CDATA, so HTML entities are not decoded. You either have to encode the document using a character encoding which supports the characters you want (such as UTF-8), configure your server to emit a suitable HTTP header, and use literal versions of those characters or represent those characters as \u (where is the Unicode character specified by four hexadecimal digits), or \XXX (three octal digits representing the Latin-1 character), or \xXX (two hexadecimal digits representing the Latin-1 character). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP, SQL, AJAX, JS and populating a SelectBox?
Daevid Vincent wrote: I need to dynamically update a select box with results from a SQL database using AJAX, but I can't find a single example of how to do this. Break it down in to stages. 1. Make the request to the server 2. Have the PHP gather the data from the database 3. Return the data to the client (I'd use JSON for this) 4. Populate the select I can fill in a DIV (as per the ten million examples out there) and that's all fine and dandy, So you can already do the first three stanges then? That just leaves stage 4. One quick google later: http://www.google.com/search?q=JavaScript+dynamically+populate+select And the first hit is: http://www.petenelson.com/aspwatch/ASPWatch%20%20Using%20Javascript%20to%20Dynamically%20Populate%20Select%20Lists.htm Which tells you how to do it (ignore the ASP mention, the article is all JavaScript). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Hidding HTML Input Elements values approach
pedro mpa wrote: So the value attribute contains an encrypted representation of the country name ... which is transmitted in clear text right next to it? If you want encryption, why not just use SSL? The value attribute contains an encrypted value of a row id in the database table for countries. How would I know which country the user has selected if I don't know its row id to insert on a members table (either plain, masked or encrypted)? Obviously you need to relate the data to your database - but why encrypt it? And if you do encrypt it, why not use SSL to do so? name ... which is transmitted in clear text right next to it? What is posted is the value attribute of the option elements not the country text (do a print_r($_POST)). When the client sends the entered data to the server, yes. However, that isn't the case when the server sends the form to the client in the first place. Suppose you are on a Private Area on a website after login and you might have links such as: a href=page.php?changeprefsPreferences/a a href=page.php?op=3Change Password/a a href=site/changeemailChange E-mail/a In my approach these links would be like: a href=page.php?ad6467ae6757Preferences/a a href=page.php?op=97874bd86a4a5Change Password/a a href=site/97874bd86a4a5Change E-mail/a Why? for this you need htaccess on apache -I think- No. .htaccess files just allow you to reconfigure Apache on a per directory basis without restarting the server. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Hidding HTML Input Elements values approach
pedro mpa wrote: So, for example a typical country select box, its option values are encrypted with the previous created key on page request and decrypted (after form submission f.ex.) on the validation code: So the value attribute contains an encrypted representation of the country name ... which is transmitted in clear text right next to it? If you want encryption, why not just use SSL? -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: What am I missing?
Gustav Wiberg wrote: I have this code: bAdd manufacturer:/bbr Bold then a line break? Shouldn't this be a heading? action=admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=?php The requested URL /mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found on this server. Why is there TWO admins? Why isn't the path like this...? Presumably because the resource with that form on it is found at the URL /mobilkamera/admin/SOMETHING and your URL is relative to that. http://www.iusmentis.com/technology/www/relativeurls/ -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+ ajax
--- Kim Christensen [EMAIL PROTECTED] wrote: On 2/21/06, Jochem Maas [EMAIL PROTECTED] wrote: Kim do the escaped sqaure brackets work in all majors browsers as far as you know? Major browsers as in Firefox and IE for PC/Mac works great, yes - Many browsers are amazing at being able to compensate by errors made by authors, but that shouldn't be taken as an excuse to not treat the errors as anything other than something that should be fixed. You can't test in every browser out there - there are too many. You can't test in any browser that hasn't be written yet. Writing code that ignores the standards is just asking for maintainance headaches and other troubles down the line. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Square Brackets [was: php+ ajax]
--- Jochem Maas [EMAIL PROTECTED] wrote: From a php developer point of view there is one big problem with 'follow the standards' mantra as far as square brackets go (with regard to use in the value of name attributes of form fields) ... Nope. The names of form controls MAY contain square brackets, it is the ids that may not (and the name and id attributes do NOT need to have the same value). -- David Dorward http://dorward.me.uk/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+ ajax
--- tedd [EMAIL PROTECTED] wrote: I have to agree with David on this -- but, future browser's compliance to standards with is certainly not guaranteed. I find it less trouble to code to standards and then deal with bugs in browsers, then to code to bugs in browsers and then deal with more bugs in browsers PLUS browsers rejecting the code on the basis of it not meeting the standard. :) -- David Dorward http://dorward.me.uk/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Page validation: Un-wanted PHP session ID added to links????
Michael Hulse wrote: I just finished a website for client - I just uploaded the site to their server space - when I went to go validate my pages using the W3C XHTML validator I get several errors due to an un-encoded ampersand in the link URL... For some reason, a session ID is getting added to the end of all my menu links: /start.php?page=homePHPSESSID=45142bb20b8b2e800be5359b667237 http://www.w3.org/QA/2005/04/php-session details how to fix the problem (without breaking the session tracking for users without cookies supported and enabled). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php+ ajax
Kim Christensen wrote: On 2/20/06, blackwater dev [EMAIL PROTECTED] wrote: The problem is js seems to get confused trying to look this up by id and I don't think I can use an array like this with a GET, how can I use arrays for all this?? You have to escape the brackets with backslashes, so that the JS really interprets it as an element ID Element ids may not contain square brackets in HTML documents. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: image location hiding techniques
hbeaumont hbeaumont wrote: I have a site with images that I want people to download but not have the direct path to. ie. I do not want them to be able to just view the source, find the dir and then download everything or direct link to them. Turn off directory indexes or put an index.html file in there. Use mod_rewrite to reject requests from referers starting with http but not being your site. P.S. I also realize I could use .htaccess to stop direct linking and turn off directory indexes. Still I think there might be some other problems with .htaccess Problems like what? -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Missing characters
Fernando Anchorena wrote: I need a helping hand to solve this $name_pro = VC++ V2.4 print td width='200' class='texto2' a href='page2.php?page=value=$name_pro' $name_pro /a /td; 1: Ampersands have special meaning in HTML and must be represented by entities (for the same reason you have to escape $ signs within double quotes in PHP). 2: Plus signs have special meaning in URLs (they represent spaces). You need to URL encode them. 3: Raw spaces are not allowed in URLs. You need to URL encode them. So: $name_pro = VC++ V2.4; $name_pro_url = urlencode($name_pro); $url = page2.php?page=value=$name_pro_url; $html_url = htmlentities($url); // Not actually needed in this example as the data doesn't include // any characters with special meaning in HTML. You do need this if // you can't ensure that in advance though. $html_name_pro = htmlentities($name_pro); print HERE td width=200 class=texto2 a href=$html_url$html_name_pro/a /td HERE; echo $value ; //Prints out VC V2.4 and I need VC++ V2.4 You need to run this through htmlentities too, otherwise its very likely (I can't see your code so I can't say for certain) that you are opening yourself up to a cross site scripting attack. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hide email addresses from spam bots
tedd wrote: B) to read it via text contained within your web site. C) Run it through a regular HTML parser. And where does the HTML parser get it's text to parse if not from the web site? I was distinguishing between greping text looking for something that looked like an email address and parsing the HTML (which would do such things as convert character references to normal characters). works for me and others -- sorry you had problems -- will look into it. Seems to be working now, although it isn't clear what you were proposing. Requiring the user to pass a CAPTCHA test before giving them the email address? That has the usual drawbacks of such tests (as I referenced before). Hiding the email address within a CAPTCHA style obfuscation? Same problem, with the extra issue that the user has to transcribe a much longer piece of text and failue is less obvious. One way is to use Enkoder (it's javascript): Which requires the end user to have JavaScript turned on, Yes, that's the reason I said it's javascript. Which could mean The end user must have JavaScript turned on OR You must have JavaScript turned on to generate some non-JavaScript that obfuscates your email address. and assumes that bots can't parse JavaScript (they can, maybe not all, but certainly some). The point isn't that it can't be done, but rather that you create enough trouble for them to pass on your address. That point is that JavaScript isn't too much trouble for some bots. If you think writing a parsing routine is simple, then write a routine to parses this: snip Oh what fun. I've never played with reading JavaScript programatically before. It can't be that hard ... #!/usr/bin/perl use strict; use warnings; use JavaScript::SpiderMonkey; my $js = JavaScript::SpiderMonkey-new(); $js-init(); my $document = $js-object_by_path(document); my $extracted_html; $js-function_set(write, sub { $extracted_html .= join ('', @_) }, $document); my $rc = $js-eval(q! function hiveware_enkoder(){var i,j,x,y,x= // etc etc etc while(x=eval(x));}hiveware_enkoder(); !); print $extracted_html; at last count less than 9 percent of surfers don't have javascript. There is no way to reliably gather such statistics. Reliable? You can rely on whatever you feel comfortable with. For me: I could be comfortable relying on Del Boy to deliver quality merchandise at a good price. That doesn't make him reliable. PHP won't provide you with a way to display an email address to a human but not to a spambot. I'm not talking about displaying an email address. I'm talking about creating a mailto: So you generate a mailto: using PHP ... and the email address is in the source, displayed to anybody who can find their view menu. I'm not going to buy a book so I can explain why the technique won't work. Your choice OR you could visit a book store. Assuming they have it in stock, I'm sure the staff would be more than happy for me to stand then with merchandise open jotting down notes. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hide email addresses from spam bots
tedd wrote: There are only two ways for a spambot to get your email address from a web site: A) to read it via a screen reader, which is exceedingly slow. I may be wrong, but I doubt that any serious harvester would consider this method; B) to read it via text contained within your web site. C) Run it through a regular HTML parser. A) With the first you could use CAPTCHA, see: Argle. http://www.w3.org/TR/turingtest/ http://xn--ovg.com The requested URL /www.xn--ovg.com/captcha was not found on this server. B) With the second, you need to disguise your email address such that spambots don't understand it. One way is to use Enkoder (it's javascript): http://automaticlabs.com/enkoderform/ Which requires the end user to have JavaScript turned on, and assumes that bots can't parse JavaScript (they can, maybe not all, but certainly some). Using javascript isn't bad -- at last count less than 9 percent of surfers don't have javascript. There is no way to reliably gather such statistics. Another way is to use PHP, but it is involved. PHP won't provide you with a way to display an email address to a human but not to a spambot. I direct you to PHP Cookbook O'Reilly by Sklar page 188. I'm not going to buy a book so I can explain why the technique won't work. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help retrieving an HTML array
Mauricio Pellegrini wrote: I have a HTML page with a form in which there are some inputs like these: input type=text name=xname value=3303 input type=text name=xname value=9854 input type=text name=xname value=n... That isn't an array, it is just a series of inputs with the same name. Most query string / post data processing libraries will present it as an array though (but in HTML its just data). How do I retrieve that array from within PHP ? PHP is ... odd. Unlike every other query string / post data library I've ever encountered, PHP will only present such data as an array if the name ends in the characters []. This has a minor advantage in that you can play with multidimensional arrays (I've never found it useful myself), but demands that you alter your input to suit its requirements. The other option is to bypass PHP's query string / post data parser and write your own (you can get access to the raw query string / post data). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help retrieving an HTML array
Robert Cummings wrote: input type=text name=xname[] value=n... I also took the liberty of adding double quotes to your attributes. There's no excuse for writing slop. Slop? authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). -- http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2 -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help retrieving an HTML array
Richard Lynch wrote: There's no excuse for writing slop. We recommend using quotation marks even when it is possible to eliminate them. Presumably because its less hassle to do so then to try to remember the exceptions. It doesn't make code that ignores that suggestion slop. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reading variables?
William Stokes wrote: For each printed document there's a check box Delete for marking that document for deletion. The document info from DB is printed using 'while' loop. The only problem I have is that I don't know how to handle/read the Delete checkbox values because the checkbox name is different for each file. Checkboxes are printed whit this line:echo td colspan=\5\input type=\checkbox\ name=\del_$id\Delete/td; Well, it is possible to look at all the fields which match the regular expression /del_[0-9]+/, but you would probably be better off just doing something like this: input type='checkbox' name='del[]' value='$id' id='del_$id' label for='del_$id'Delete/label/td And then accessing the $_POST['del'][] array that PHP will represent that as. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Email Form
Thomas Bonham wrote: I don't remember how to do email with php. I have all of it done, except for I can't get it to show the senders email address. All I get it from [EMAIL PROTECTED] If some one has a example that they can post that would be great. http://uk.php.net/manual/en/function.mail.php Note additional_headers in the Parameters section. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Perl script passing variables to a PHP script
John Meyer wrote: Hi, If I have a perl script to rip off the mp3 tag information, can I have that script then pass them into the PHP file? PHP::Interpreter looks like it will do the job. http://www.annocpan.org/~GSCHLOSS/PHP-Interpreter-1.0.1/lib/PHP/Interpreter.pm -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: array of checkbox values
Sjef Janssen wrote: I have a form with a number of checkboxes grouped together. The value of these boxes is stored in an array: $used[]. Now I found that the value of checked boxes (value = 'Y') are stored in the array while non checked boxes are not stored at all. This makes the array incomplete as I want to have all checkbox values in the array. That's how HTML forms work. The general solution is to set the value of the checkbox to describe what the checkbox is (for example, the row id of the database record that the checkbox is associated with). Then you can loop through and see which values were submitted. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to pass an array to Java script
Johny John wrote: How to pass an array (from php ) to java script http://www.json.org/ is a good choice. PHP implementations include http://mike.teczno.com/json.html and http://www.aurore.net/projects/php-json/ and display it using javascript?... That depends on how you want to display it (and if you just want to display it, why aren't you rendering HTML with the PHP in the first place?). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Javscript embedding problem
Iggep wrote: countdown.js looks like this: script type=\text/javascript\ Its a JavaScript file, not an HTML fragment file. Don't put any HTML in it. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: howto send a whole smarty page to a printer
Steven wrote: I basically want to print the output of the page directly to the printer. I find using the Internet Explorer Print Page button, prints extra text on the top and bottom of the page, which i dont want, also it seems to effect my page formatting a little. Presumably you want your HTML to be *rendered* (i.e. you don't want a print out of the HTML source)? I'm not aware of any tool better then a browser for doing that (although MSIE would not be my first choice). I'm yet to see a browser which doesn't allow you to specify which (if any) headers and footers should be added to the page. Look in your browser's preferences. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: wrapping text
John Taylor-Johnston wrote: wordwrap(stripslashes($message), 72). Thanks! Another reason why I gave up on Perl :) A fucntion made already since 4.0.2.! :) Oh look, Perl has something almost as old (possibly older, that's just what I found in 30 seconds of searching). http://search.cpan.org/~muir/Text-Tabs+Wrap-2001.0929/lib/Text/Wrap.pm -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: input type=file problem (Maybe 0T)
Ryan A wrote: The problem is, if she has tried to upload a pic at the same time and screwed up on the date of birth I am unable to send back the value of the FILE box so that too get populated... I tried setting a VALUE=path/file but that does not work. As has already been pointed out, you can't set the value of the file input. What you can do though is to keep the image uploaded the first time round, and send back a form adding a Keep existing upload (perhaps along with a thumbnail of the image), thus saving the user from uploading the image over and over until they fill in the rest of the form correctly. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: css/html expertise??
bruce wrote: i'm playing around with css (classes/ids/etc...) does anybody here have any experience with this or could answer a few questions?? http://www.css-discuss.org/ http://groups-beta.google.com/group/comp.infosystems.www.authoring.stylesheets -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How do I create an Outlook calendar entry?
Daevid Vincent wrote: I was on Avis' car rental site the other day and booked a reservation, then they had a button that automatically added an entry into MS Outlook for the details, dates, times, etc. it was very nice! I am guessing I have to use COM Wouldn't that require the webserver to be running on your workstation? :) Its most likely just giving you a datafile in some standard calendar format that Outlook understands. Possibly iCal (I don't know if Outlook supports it, but lots of calendar software seems to these days). Google should help you find a way to generate iCal files. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: browser detect and redirect
Ross wrote: I want to redirect anyone not using ie 4+ as there browser. Is this possible with php? You could examine the user agent string, but that can be (and is in many cases) spoofed. Its generally better to just write code which doesn't depend on the use of a specific browser. Its very rare that something really needs IE (At least I assume that + means higher rather that better). -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why is the default value for arg_separator.output ''?
Jared Williams wrote: Given this, why is the default value of arg_separator.output '' and not 'amp;'? URLs don't have amp; in them. The amp; is specific escaping for _only_ XML. No, XML and SGML which includes XHTML and HTML. How often are PHP sessions used to generate output for languages other then those? And even if you want to generate for other languages, why not set arg_separator.output to ; instead? Its already in arg_separator.input and doesn't need escaping to be represented in an HTML or XHTML document. The HTML specification even goes so far as to explicitly recommend it. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is the default value for arg_separator.output ''?
Richard Lynch wrote: But if it's going to break a billion scripts, it's probably not gonna happen to follow a standard that isn't the only game in town. XHTML is not ubiquitous. [shrug] Representing characters as amp; has been a requirement of SGML and XML based languages, HTML included, since long before XHTML appeared on the scene. What scripts would making this change be likely to break? I have difficulty believing it could cause problems for other then a very small proprotion of users - unlike the change in register_globals a few years ago. Since there are still browsers in use that will choke on amp; in the URL, last time I checked, you're pretty much fighting for a lost cause, as far as I'm concerned. We aren't talking about in the URL, we're talking about in the href attribute. Browsers convert amp; in HTML documents (including in href attributes) to before they think about them being part of URLs. Can you name any browser that gets it wrong? I stress that typing http://www.example.com/?foo=baramp;baz=baa into the address bar is not how the issue should be tested. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is the default value for arg_separator.output ''?
Jochem Maas wrote: Representing characters as amp; has been a requirement of SGML and XML based languages you might be able to put this func to use somewhere: Not really, since my concern is with URLs modified by the session handling code and that can be fixed by changing the arg_separator.output ini directive. I'm just trying to work out if the default value for that directive is (rather then amp; or ;) due to a bug or if there is a good reason for it. -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why is the default value for arg_separator.output ''?
For documents to conform to the XHTML recommendation, ampersand characters much be encoded as amp;. The documentation for PHP recognises this. The same applies to HTML (with some exceptions that the session code will never encounter), although the PHP documentation makes no mention of this. Given this, why is the default value of arg_separator.output '' and not 'amp;'? -- David Dorward http://blog.dorward.me.uk/ http://dorward.me.uk/ Home is where the ~/.bashrc is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php