php-general Digest 2 Jan 2009 21:14:02 -0000 Issue 5879
php-general Digest 2 Jan 2009 21:14:02 - Issue 5879 Topics (messages 285368 through 285374): Re: IE Problem Detecting Post Variables 285368 by: L. Herbert 285369 by: zerof 285370 by: ceo.l-i-e.com 285371 by: Micah Gersten Re: Sending files via POST 285372 by: Anders Norrbring 285373 by: Daniel Brown Re: Anyone else have trouble with Apple Mail threading this list? 285374 by: phphelp -- kbk Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- I stand corrected. On Jan 1, 2009, at 9:46 AM, Nisse Engström wrote: On Thu, 1 Jan 2009 03:17:01 -0500, L. Herbert wrote: On Dec 31, 2008, at 11:07 PM, Lupus Michaelis wrote: MSIE pushes input_name.x and input_name.y to the server, when the input is an image. Thanks! I see the issue clearly now. Oh well, time to modify my code to compensate for IE's non-standard behavior... Actually, that *is* standard behaviour. http://www.w3.org/TR/html401/interact/forms.html#h-17.4.1 /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- L. Herbert escreveu: Bastien, Thanks for your response. The curious thing is that the value is passed when using FF, but not passed when using IE. Here is the relevant form html: div id=switch-theme form action= method=post It may seem strange, but try using POST instead of post. (I had this same problem when my server was upgraded to Apache 2.2.10) labelFlip It!/label input name=style type=image src=images/switch-button-grey.gif title=Default Theme id=style1 value=default / input name=style type=image src=himages/switch-button-default.gif title=Alternate Theme id=style2 value=alternate / /form /div . -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- http://www.geoticks.com/ Geo Positioning Solutions -- ---End Message--- ---BeginMessage--- My thesis is: Your Javascript that intercepts the .submit and then does whatever it does, is broken in FF but not in MSIE. Post your JS to a JS mailing list and ask there to be sure. ---End Message--- ---BeginMessage--- You might want to consider the button element which allows you to display images, but doesn't send back coordinates. Instead it sends a preset value. http://www.w3.org/TR/html401/interact/forms.html#h-17.5 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com L. Herbert wrote: I find the html/php option simpler and more accessible. I've got it working now. I only needed to use unique input names and test for the posted variable according to w3c standards. Here is the relevant w3c definition: When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where name is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively. PHP modifies the posted variable name to name_x, name_y to comply with PHP's variable naming convention requirements. Thanks to those all responded for pointing me in the right direction. On Jan 1, 2009, at 11:25 AM, Phpster wrote: What about using the onclick to set a js variable to be sent to the server? That should be more cross server compliant. Bastien Sent from my iPod On Dec 31, 2008, at 8:37 PM, L. Herbert lherb...@iluvmydesign.com wrote: Bastien, Thanks for your response. The curious thing is that the value is passed when using FF, but not passed when using IE. Here is the relevant form html: div id=switch-theme form action= method=post labelFlip It!/label input name=style type=image src=images/switch-button-grey.gif title=Default Theme id=style1 value=default / input name=style type=image src=himages/switch-button-default.gif title=Alternate Theme id=style2 value=alternate / /form /div The action attribute is left blank so the form posts to the current page. The theme switcher script is at the top of each page and intercepts the posted
Re: [PHP] IE Problem Detecting Post Variables
I find the html/php option simpler and more accessible. I've got it working now. I only needed to use unique input names and test for the posted variable according to w3c standards. Here is the relevant w3c definition: When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x- value and name.y=y-value where name is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively. PHP modifies the posted variable name to name_x, name_y to comply with PHP's variable naming convention requirements. Thanks to those all responded for pointing me in the right direction. On Jan 1, 2009, at 11:25 AM, Phpster wrote: What about using the onclick to set a js variable to be sent to the server? That should be more cross server compliant. Bastien Sent from my iPod On Dec 31, 2008, at 8:37 PM, L. Herbert lherb...@iluvmydesign.com wrote: Bastien, Thanks for your response. The curious thing is that the value is passed when using FF, but not passed when using IE. Here is the relevant form html: div id=switch-theme form action= method=post labelFlip It!/label input name=style type=image src=images/ switch-button-grey.gif title=Default Theme id=style1 value=default / input name=style type=image src=himages/ switch-button-default.gif title=Alternate Theme id=style2 value=alternate / /form /div The action attribute is left blank so the form posts to the current page. The theme switcher script is at the top of each page and intercepts the posted variables. Any thoughts? On Dec 31, 2008, at 11:02 AM, Phpster wrote: Try checking to see if the value was passed with var_dump($_REQUEST) Also try (!empty($_REQUEST['style'])) Bastien Sent from my iPod On Dec 31, 2008, at 10:24 AM, L. Herbert lherb...@iluvmydesign.com wrote: Hello all, Anyone have insight to share on the following issue: I have a simple theme switcher script that functions as expected in FF, Safari, etc. but does not work in IE 6 or 7. It appears that the posted form variables are not detected in IE. I am using the following check within the script: if(isset($_REQUEST['style'])) { $style = $_REQUEST['style']; } Thanks in advance for your assistance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE Problem Detecting Post Variables
I stand corrected. On Jan 1, 2009, at 9:46 AM, Nisse Engström wrote: On Thu, 1 Jan 2009 03:17:01 -0500, L. Herbert wrote: On Dec 31, 2008, at 11:07 PM, Lupus Michaelis wrote: MSIE pushes input_name.x and input_name.y to the server, when the input is an image. Thanks! I see the issue clearly now. Oh well, time to modify my code to compensate for IE's non-standard behavior... Actually, that *is* standard behaviour. http://www.w3.org/TR/html401/interact/forms.html#h-17.4.1 /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE Problem Detecting Post Variables
L. Herbert escreveu: Bastien, Thanks for your response. The curious thing is that the value is passed when using FF, but not passed when using IE. Here is the relevant form html: div id=switch-theme form action= method=post It may seem strange, but try using POST instead of post. (I had this same problem when my server was upgraded to Apache 2.2.10) labelFlip It!/label input name=style type=image src=images/switch-button-grey.gif title=Default Theme id=style1 value=default / input name=style type=image src=himages/switch-button-default.gif title=Alternate Theme id=style2 value=alternate / /form /div . -- zerof http://www.educar.pro.br/ Apache - PHP - MySQL - Boolean Logics - Project Management -- http://www.geoticks.com/ Geo Positioning Solutions -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE Problem Detecting Post Variables
My thesis is: Your Javascript that intercepts the .submit and then does whatever it does, is broken in FF but not in MSIE. Post your JS to a JS mailing list and ask there to be sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE Problem Detecting Post Variables
You might want to consider the button element which allows you to display images, but doesn't send back coordinates. Instead it sends a preset value. http://www.w3.org/TR/html401/interact/forms.html#h-17.5 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com L. Herbert wrote: I find the html/php option simpler and more accessible. I've got it working now. I only needed to use unique input names and test for the posted variable according to w3c standards. Here is the relevant w3c definition: When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where name is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively. PHP modifies the posted variable name to name_x, name_y to comply with PHP's variable naming convention requirements. Thanks to those all responded for pointing me in the right direction. On Jan 1, 2009, at 11:25 AM, Phpster wrote: What about using the onclick to set a js variable to be sent to the server? That should be more cross server compliant. Bastien Sent from my iPod On Dec 31, 2008, at 8:37 PM, L. Herbert lherb...@iluvmydesign.com wrote: Bastien, Thanks for your response. The curious thing is that the value is passed when using FF, but not passed when using IE. Here is the relevant form html: div id=switch-theme form action= method=post labelFlip It!/label input name=style type=image src=images/switch-button-grey.gif title=Default Theme id=style1 value=default / input name=style type=image src=himages/switch-button-default.gif title=Alternate Theme id=style2 value=alternate / /form /div The action attribute is left blank so the form posts to the current page. The theme switcher script is at the top of each page and intercepts the posted variables. Any thoughts? On Dec 31, 2008, at 11:02 AM, Phpster wrote: Try checking to see if the value was passed with var_dump($_REQUEST) Also try (!empty($_REQUEST['style'])) Bastien Sent from my iPod On Dec 31, 2008, at 10:24 AM, L. Herbert lherb...@iluvmydesign.com wrote: Hello all, Anyone have insight to share on the following issue: I have a simple theme switcher script that functions as expected in FF, Safari, etc. but does not work in IE 6 or 7. It appears that the posted form variables are not detected in IE. I am using the following check within the script: if(isset($_REQUEST['style'])) { $style = $_REQUEST['style']; } Thanks in advance for your assistance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] Sending files via POST
*bump* I'm a bit stuck.. I'm using the PEAR http_Request to send files and data as HTTP POST, which is working fine if I in fact have the files on disk on the server. Just using the method addFile.. Okay But what if the file data is only in a variable? It feels like overkill to first save to disk, and then read it in with addFile... The HTTP POST I'm looking at will need to add files both from disk and variables. then it's not a file, it's data held in RAM (non-TSR). Absolutely true, but the receiving end is expecting the data as a file upload. Are you looking to stream the file content (such as the header or initial $n bytes) from you local system to the server? If so, sorry, but you're in the wrong place. I don't really understand what you're asking for above, but to try to explain... My server is to create a HTTP POST request to another system, with a couple of form variables and also 2-3 files. Much like a manual html form will do, but with no human intervention. Ideas are welcome.. My idea is to ask the question: how is the file data getting into the variable? Well, some of the form values are static, like user name etc. Then one file will be static (and stored on disk as a file) and added with method 'addData' to the POST request. Another file is generated dynamically from data stored in a SQL database and data provided by user input from visiting my site. Of course I can store this dynamically generated data to disk, add it with 'addData' and then delete it after the request is made, but it doesn't really feel like the right thing to do. Anders. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending files via POST
On Fri, Jan 2, 2009 at 14:14, Anders Norrbring li...@norrbring.se wrote: *bump* Please don't bump threads, Anders. This is not a traditional web-based user forum. You've provided no additional data, so there is no need to bring this thread up again. If you want to get more attention to it, you will need to send a reply to the list with updated information. The last response in this thread was from Nathan Rixham. If you didn't receive that message, you can find it in the archives, or I'll be glad to forward it to you. If it didn't solve your problem, you can say so and folks here will be happy to help you further. Thanks! -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anyone else have trouble with Apple Mail threading this list?
On Dec 31, 2008, at 5:55 PM, Brian Dunning wrote: ... When I hit Reply or Reply All in Mail, it wants to reply directly to the poster, and only CC's the list... That is just the way the list works. (If you look at threads, you will see a fairly-constant stream of reminders to reply all to stay on the public listserv). Other lists to which I subscribe don't behave like this. I can't understand why this one does. Even if people remember to reply all the recipient gets 2 copies of the reply. (If only the list admin knew of some programmer who could alter this g) All of this is tolerable for the great information exchanged, but it *is* annoying. Ken (Ironically, I initially forgot to reply all on this one, so I had to re-do it.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] Sending files via POST
On Fri, Jan 2, 2009 at 14:14, Anders Norrbring li...@norrbring.se wrote: *bump* Please don't bump threads, Anders. This is not a traditional web-based user forum. You've provided no additional data, so there is no need to bring this thread up again. If you want to get more attention to it, you will need to send a reply to the list with updated information. The last response in this thread was from Nathan Rixham. If you didn't receive that message, you can find it in the archives, or I'll be glad to forward it to you. If it didn't solve your problem, you can say so and folks here will be happy to help you further. I provided some additional data at 2009-01-01 09:33.. (That would be GMT+1 hour) But after that.. I didn't get *anything* at all, not from Nathan, not from anybody else. And I'm fully aware of the distinctions between a mailing list and a web based forum. After all, I've been in this business (computers and communications) since 1979 (Yeah, I'm that old...). But I didn't get any replies whatsoever, neither in private nor in the list, therefore I felt an urge to do something to draw some attention to this matter. And yes Daniel, I'm fully aware that my specific question isn't a PHP general issue, but a PEAR related issue, more specific it's related to PEAR:HTTP_Request, nevertheless I firmly believe it's of common interest. If you don't share my view, I'll be happy to be flamed in private, not on list. Best regards, and wishes for a happy 2009, Anders. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending files via POST
On Fri, Jan 2, 2009 at 16:32, Anders Norrbring li...@norrbring.se wrote: I provided some additional data at 2009-01-01 09:33.. (That would be GMT+1 hour) But after that.. I didn't get *anything* at all, not from Nathan, not from anybody else. Which is why I asked. And I'm fully aware of the distinctions between a mailing list and a web based forum. After all, I've been in this business (computers and communications) since 1979 (Yeah, I'm that old...). But I didn't get any replies whatsoever, neither in private nor in the list, therefore I felt an urge to do something to draw some attention to this matter. That's understandable, though perhaps more than just *bump* would've been helpful. And yes Daniel, I'm fully aware that my specific question isn't a PHP general issue, but a PEAR related issue, more specific it's related to PEAR:HTTP_Request, nevertheless I firmly believe it's of common interest. That's okay. This general list is general as in broad terms. You're by no means more off-topic than a good portion of things sent. If you don't share my view, I'll be happy to be flamed in private, not on list. Trust me, that was not a flame. I'll forward the email from Nathan directly to you now. Hopefully it will be of some help to you. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: SV: [PHP] Sending files via POST
Nathan Rixham's original email. Hope it helps! On Thu, Jan 1, 2009 at 09:35, Nathan Rixham nrix...@gmail.com wrote: after having a flick through the source it looks like a limitation of http request; http://pear.php.net/package/HTTP_Request/docs/latest/__filesource/fsource_HTTP_Request__HTTP_Request-1.4.4Request.php.html check lines around 600 and 900+ you'd have to set the http request yourself i thinks! (setBody) may be worth contacting they who maintain the package -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Posting Data?
Hi all, I have my own register system and I want to Post my values from my register system and post those values into the punbb register form. I do not want to register my values from the punbb form but rather from my login system. How would i be able to do this? Below is the example of the punbb register form: form class=frm-form id=afocus method=post accept-charset=utf-8 action=http://www.punbb.co.za/Forums/register.php?action=register; div class=hidden input type=hidden name=form_sent value=1 / input type=hidden name=csrf_token value=ad31a4b11b12bbedcc3a4ad7963cd9e0bb96f430 / /div div class=frm-group group1 div class=sf-set set1 div class=sf-box text required label for=fld1Username em(Required)/em smallBetween 2 and 25 characters./small/labelbr / input type=text id=fld1 name=req_username value= size=35 maxlength=25 / /div /div div class=sf-set set2 div class=sf-box text required label for=fld2Password em(Required)/em smallMinimum 4 characters. Case sensitive./small/labelbr / input type=password id=fld2 name=req_password1 size=35 / /div /div div class=sf-set set3 div class=sf-box text required label for=fld3Confirm password em(Required)/em smallRe-enter your password exactly as before./small/labelbr / input type=password id=fld3 name=req_password2 size=35 / /div /div div class=sf-set set4 div class=sf-box text required label for=fld4E-mail em(Required)/em smallA current valid e-mail address./small/labelbr / input type=text id=fld4 name=req_email1 value= size=35 maxlength=80 / /div /div div class=sf-set set5 div class=sf-box select label for=fld5Your timezone/labelbr / select id=fld5 name=timezone option value=-12(UTC-12:00) International Date Line West/option option value=-11(UTC-11:00) Niue, Samoa/option option value=-10(UTC-10:00) Hawaii-Aleutian, Cook Island/option option value=-9.5(UTC-09:30) Marquesas Islands/option option value=-9(UTC-09:00) Alaska, Gambier Island/option option value=-8(UTC-08:00) Pacific/option option value=-7(UTC-07:00) Mountain/option option value=-6(UTC-06:00) Central/option option value=-5(UTC-05:00) Eastern/option option value=-4(UTC-04:00) Atlantic/option option value=-3.5(UTC-03:30) Newfoundland/option option value=-3(UTC-03:00) Amazon, Central Greenland/option option value=-2(UTC-02:00) Mid-Atlantic/option option value=-1(UTC-01:00) Azores, Cape Verde, Eastern Greenland/option option value=0 selected=selected(UTC) Western European, Greenwich/option option value=1(UTC+01:00) Central European, West African/option option value=2(UTC+02:00) Eastern European, Central African/option option value=3(UTC+03:00) Moscow, Eastern African/option option value=3.5(UTC+03:30) Iran/option option value=4(UTC+04:00) Gulf, Samara/option
[PHP] Posting Data?
Hi all, I have my own register system and I want to Post my values from my register system and post those values into the punbb register form. I do not want to register my values from the punbb form but rather from my login system. How would i be able to do this? Below is the example of the punbb register form: form class=frm-form id=afocus method=post accept-charset=utf-8 action=http://www.punbb.co.za/Forums/register.php?action=register; div class=hidden input type=hidden name=form_sent value=1 / input type=hidden name=csrf_token value=ad31a4b11b12bbedcc3a4ad7963cd9e0bb96f430 / /div div class=frm-group group1 div class=sf-set set1 div class=sf-box text required label for=fld1Username em(Required)/em smallBetween 2 and 25 characters./small/labelbr / input type=text id=fld1 name=req_username value= size=35 maxlength=25 / /div /div div class=sf-set set2 div class=sf-box text required label for=fld2Password em(Required)/em smallMinimum 4 characters. Case sensitive./small/labelbr / input type=password id=fld2 name=req_password1 size=35 / /div /div div class=sf-set set3 div class=sf-box text required label for=fld3Confirm password em(Required)/em smallRe-enter your password exactly as before./small/labelbr / input type=password id=fld3 name=req_password2 size=35 / /div /div div class=sf-set set4 div class=sf-box text required label for=fld4E-mail em(Required)/em smallA current valid e-mail address./small/labelbr / input type=text id=fld4 name=req_email1 value= size=35 maxlength=80 / /div /div div class=sf-set set5 div class=sf-box select label for=fld5Your timezone/labelbr / select id=fld5 name=timezone option value=-12(UTC-12:00) International Date Line West/option option value=-11(UTC-11:00) Niue, Samoa/option option value=-10(UTC-10:00) Hawaii-Aleutian, Cook Island/option option value=-9.5(UTC-09:30) Marquesas Islands/option option value=-9(UTC-09:00) Alaska, Gambier Island/option option value=-8(UTC-08:00) Pacific/option option value=-7(UTC-07:00) Mountain/option option value=-6(UTC-06:00) Central/option option value=-5(UTC-05:00) Eastern/option option value=-4(UTC-04:00) Atlantic/option option value=-3.5(UTC-03:30) Newfoundland/option option value=-3(UTC-03:00) Amazon, Central Greenland/option option value=-2(UTC-02:00) Mid-Atlantic/option option value=-1(UTC-01:00) Azores, Cape Verde, Eastern Greenland/option option value=0 selected=selected(UTC) Western European, Greenwich/option option value=1(UTC+01:00) Central European, West African/option option value=2(UTC+02:00) Eastern European, Central African/option option value=3(UTC+03:00) Moscow, Eastern African/option option value=3.5(UTC+03:30) Iran/option option value=4(UTC+04:00) Gulf, Samara/option
Re: [PHP] Posting Data?
Stephen Alistoun wrote: Hi all, I have my own register system and I want to Post my values from my register system and post those values into the punbb register form. I do not want to register my values from the punbb form but rather from my login system. How would i be able to do this? Below is the example of the punbb register form: Well, since you are sending this to a PHP mailing list, I am guessing that you want the php/server to send the request. If so, check out cURL, if you are talking from your own browser, then you should look into the Firebug for FF. It allows you to modify page content and then resubmit it. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE Problem Detecting Post Variables
On Fri, Jan 2, 2009 at 1:15 PM, Micah Gersten mi...@onshore.com wrote: You might want to consider the button element which allows you to display images, but doesn't send back coordinates. Instead it sends a preset value. http://www.w3.org/TR/html401/interact/forms.html#h-17.5 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com If you mean an INPUT element with the type=button, then yes. (Although it will no longer be a submit button, so you'll have to capture the click and perform the submit using Javascript which leads back to accessibility issues, etc.) If you mean a BUTTON element of the type=submit, then not exactly. It *will* send a preset value for sure, but that preset value will differ depending on the browser. I've found that while FF will send the value you set in the value=... attribute, IE will send the actual text of the button. Thus, button name=test value=blueMy Button Text/button will send 'test=blue' in FF, but 'test=My+Button+Text' in IE. I'm assuming this is because for INPUT type=submit buttons, the text content of the button IS the value in the value=... attribute. Whatever the reason, that was a fun lesson to track down the first time I had people tell me a page I wrote didn't work in IE. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to count transfered kBytes in File-Download
Hello *, currently I have a function: [ '/usr/share/tdphp-vserver/includes/02_functions.inc' ] snip function fncPushBinary($type='show', $file, $mime='') { if ( is_file($file) ) { if ($mime == '') { $mime=exec(file -i -b $file); } $STRG=; filename=\ . basename($file) . \; $FSIZE=filesize($file); if ($type == 'show') { header(Content-Disposition: inline . $STRG ); } else { header(Content-Disposition: attachment . $STRG); } header(Content-Type: . $mime); $HANDLER=fopen($file, r); echo fread($HANDLER, $FSIZE); fclose($HANDLER); exit(); } else { $ERRNO=2; $ERRTX=sprintf( T_gettext(The requested binary file does not exist.p%s), $file ); fncError($ERRNO, $ERRTX, $ERRPAGE); } } snip which I want to modify it to count the kBytes a user download and block after a definde amount... (there are too many peoples in the world which want to suck anything for free and unlimited and no one cares who pay the stuff... even if I have 100 TByte free traffic on one of my bigger servers) My problem is now 1) how to count partial downloads 2) how to allow users to make partial downloads any suggestions? Oh, I should note, that the URL's looks like: /?what=musicwhere=hsection=fooname=I_love_php5.ogg and the input to the function is already sanitized. Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # http://www.tamay-dogan.net/ http://www.can4linux.org/ Michelle Konzack Apt. 917 ICQ #328449886 +49/177/935194750, rue de Soultz MSN LinuxMichi +33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
Re: [PHP] Re: Webhotel structure
I don't think you need SSH and fixed IP address. I think you only need to change some file permissions. Most of the shared hosts will provide a control panel for your web account. You change the file permissions. I have some PHP websites without a fixed IP address and SSH. Regards, Michael Leung www.michaelleung.info diary.skynovel.info On Wed, Dec 31, 2008 at 10:11 PM, Peter Sorensen nordstjerneall...@gmail.com wrote: Dotan Cohen dotanco...@gmail.com wrote in message news:880dece00812301337m1cca395cxcb1ef500d8c10...@mail.gmail.com... 2008/12/30 Nordstjernealle 10 nordstjerneall...@gmail.com: 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 Hi again Sorry for cutting your name card short Dotan, but I get tired reading the entire alfabet every time. 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. 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. 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.comwhere I am a HW engineer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Regards, Michael Leung http://www.itblogs.info http://www.michaelleung.info
Re: [PHP] IE Problem Detecting Post Variables
On Fri, 2009-01-02 at 18:06 -0500, Andrew Ballard wrote: On Fri, Jan 2, 2009 at 1:15 PM, Micah Gersten mi...@onshore.com wrote: You might want to consider the button element which allows you to display images, but doesn't send back coordinates. Instead it sends a preset value. http://www.w3.org/TR/html401/interact/forms.html#h-17.5 Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com If you mean an INPUT element with the type=button, then yes. (Although it will no longer be a submit button, so you'll have to capture the click and perform the submit using Javascript which leads back to accessibility issues, etc.) If you mean a BUTTON element of the type=submit, then not exactly. It *will* send a preset value for sure, but that preset value will differ depending on the browser. I've found that while FF will send the value you set in the value=... attribute, IE will send the actual text of the button. Thus, button name=test value=blueMy Button Text/button will send 'test=blue' in FF, but 'test=My+Button+Text' in IE. I'm assuming this is because for INPUT type=submit buttons, the text content of the button IS the value in the value=... attribute. Whatever the reason, that was a fun lesson to track down the first time I had people tell me a page I wrote didn't work in IE. Andrew Lets all march forward and renounce IE as a useful piece of software! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please point me in the right direction
Greetings, I need to create a secure customer section on my site. User name and login would take you to a secured page that displays information like a calendar, downloads, budgets. These sections would be the same but each customer would display custom content (over 100 customers). I browsed php mysql books, but need a jump start. Any ideas? Is php not the best solution? If you can't tell, I'm a newbie. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to count transfered kBytes in File-Download
Michelle Konzack wrote: Hello *, currently I have a function: [ '/usr/share/tdphp-vserver/includes/02_functions.inc' ] snip function fncPushBinary($type='show', $file, $mime='') { Outside your function, or in, I don't care, define a variable/constant that will be used as a buffer size. $buffer = 1024; if ( is_file($file) ) { if ($mime == '') { $mime=exec(file -i -b $file); } $STRG=; filename=\ . basename($file) . \; Don't do the following... $FSIZE=filesize($file); if ($type == 'show') { header(Content-Disposition: inline . $STRG ); } else { header(Content-Disposition: attachment . $STRG); } header(Content-Type: . $mime); $HANDLER=fopen($file, r); Then here, do this... $current_size = 0; while ( !feof($HANDLER) ) { $current_size += $buffer; echo fread($HANDLE, $buffer); } Now, do what you want with $current_size Maybe have a variable that you check it against that contains the users allow amount of transfer... $current_size = 0; while ( !feof($HANDLER) $current_size $allowed_limit ) { $current_size += $buffer; echo fread($HANDLE, $buffer); } Hope this gets you leading down the right path... echo fread($HANDLER, $FSIZE); fclose($HANDLER); exit(); } else { $ERRNO=2; $ERRTX=sprintf( T_gettext(The requested binary file does not exist.p%s), $file ); fncError($ERRNO, $ERRTX, $ERRPAGE); } } snip which I want to modify it to count the kBytes a user download and block after a definde amount... (there are too many peoples in the world which want to suck anything for free and unlimited and no one cares who pay the stuff... even if I have 100 TByte free traffic on one of my bigger servers) My problem is now 1) how to count partial downloads 2) how to allow users to make partial downloads any suggestions? Oh, I should note, that the URL's looks like: /?what=musicwhere=hsection=fooname=I_love_php5.ogg and the input to the function is already sanitized. Thanks, Greetings and nice Day/Evening Michelle Konzack Systemadministrator 24V Electronic Engineer Tamay Dogan Network Debian GNU/Linux Consultant -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thank you everyone, What a wonderful world
I'm sorry for there are no rules in the world no real men to help them. May *Allah* help them as we see what happened in *Iraq* who started war with Iran and just he can! I believe because I can't see any power in men to do that. America is behind Israel and other countries really are too weak and timid to help. just pray for them.. thanks behzad
Re: [PHP] Please point me in the right direction
David Knapp wrote: Greetings, I need to create a secure customer section on my site. User name and login would take you to a secured page that displays information like a calendar, downloads, budgets. These sections would be the same but each customer would display custom content (over 100 customers). The calendar and are a pretty common this in a CMS, but what do you mean by budgets? I browsed php mysql books, but need a jump start. Any ideas? Well, here is a link to a few calendars http://www.filetransit.com/files.php?name=Project_Calendar Here is another http://www.hotscripts.com/PHP/Scripts_and_Programs/Calendars/index.html Here is a link to some dl managers http://webscripts.softpedia.com/cat/File-Management-Perl/Download-Managers-Perl-list-213-1-1-0.html Is php not the best solution? If you can't tell, I'm a newbie. You come to php and ask if it isn't the best solution? David Hope the above helps. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Thank you everyone, What a wonderful world
I find the PHP site to be one of the best resources around. Maybe it can help you with your problem. Cheers, Rob. On Sat, 2009-01-03 at 08:56 +0330, shahrzad khorrami wrote: I'm sorry for there are no rules in the world no real men to help them. May *Allah* help them as we see what happened in *Iraq* who started war with Iran and just he can! I believe because I can't see any power in men to do that. America is behind Israel and other countries really are too weak and timid to help. just pray for them.. thanks behzad -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php