[PHP] Is it possible???
$item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Karl
Re: [PHP] Is it possible???
On 24 Jun 2013, at 12:59, Karl-Arne Gjersøyen karlar...@gmail.com wrote: $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Because you're using $item_amount_in_store and $update_item_amount_in_store as if PHP should know you mean the same thing. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible???
Hi, Shouldn't it be: $item_amount_in_store = 223; $update_amount = 7; $item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; The 3rd line seems wrong as you didn't use the same variable. -- Raphaël Khaïat 06.72.89.57.29 On Mon, Jun 24, 2013 at 1:59 PM, Karl-Arne Gjersøyen karlar...@gmail.comwrote: $item_amount_in_store = 223; $update_amount = 7; $update_item_amount_in_store += $update_amount; $update_amoint_in_store is now 227; Why? That should be 230! Karl
Re: [PHP] Is it possible to click download button,and run 2 tasks downloading a file and show number of downloads(ajax)simultaneously?
Thanks Tedd, ajax works fine now,when submiting a button it will show the number and it doesn't have any problem $(function() { $(.button).click(function(){ var id=$(this).attr('id'); var dataString = 'id='+ id ; $.ajax({ type: POST, url: download_number.php, data: dataString, cache: false, success: function(html) { $(#div_+id).html(html); } }); } button: input type = button value=Download class=button id=?php echo $id; ? div: div id=div_?php echo $id; ? ?php echo $downloadcount;?/div by the way* I totally will refuse this approach* because,although the ajax is working,but I can't do anything for click to download the related file because when I go to my php page I can't redirect it to a page for download and besides echo the output to be written in div element,so that,the best solution is just redirect to a page and download the file in first place. after submiting write a $_POST['submit'] and just store the download count,update the table and if user refreshed the page,can see the number of downloads,*as sure there isn't anything better than this.* Marco suggested me iframe,reloading it,like a manual ajax but I think it has much of troubles. by the way thanks for all helps.
Re: [PHP] Is it possible to click download button,and run 2 tasks downloading a file and show number of downloads(ajax)simultaneously?
oh my bad:)! there is a cool solution,I forgot the blank page!:) yep! solved:) window.open('download.php', '_blank' ); now I can count up,and download:) $(.button).click(function(){ var id=$(this).attr('id'); var dataString = 'id='+ id ; $.ajax({ type: POST, url: download_number.php, data: dataString, cache: false, success: function(html) { $(#div_+id).html(html); } }); window.open('download.php', '_blank' ); }); so cool!!:) On Mon, Oct 15, 2012 at 7:42 PM, Negin Nickparsa nickpa...@gmail.comwrote: Thanks Tedd, ajax works fine now,when submiting a button it will show the number and it doesn't have any problem $(function() { $(.button).click(function(){ var id=$(this).attr('id'); var dataString = 'id='+ id ; $.ajax({ type: POST, url: download_number.php, data: dataString, cache: false, success: function(html) { $(#div_+id).html(html); } }); } button: input type = button value=Download class=button id=?php echo $id; ? div: div id=div_?php echo $id; ? ?php echo $downloadcount;?/div by the way* I totally will refuse this approach* because,although the ajax is working,but I can't do anything for click to download the related file because when I go to my php page I can't redirect it to a page for download and besides echo the output to be written in div element,so that,the best solution is just redirect to a page and download the file in first place. after submiting write a $_POST['submit'] and just store the download count,update the table and if user refreshed the page,can see the number of downloads,*as sure there isn't anything better than this.* Marco suggested me iframe,reloading it,like a manual ajax but I think it has much of troubles. by the way thanks for all helps.
Re: [PHP] Is it possible to click download button,and run 2 tasks downloading a file and show number of downloads(ajax)simultaneously?
On Oct 14, 2012, at 7:41 AM, Negin Nickparsa nickpa...@gmail.com wrote: I wanted to refresh the download count when clicking the button first is it possible? Yes, it is possible. The following is an example of a server-side php script refreshing a Web page via a javascript client-side action: http://php1.net/a/zipcode-states/ The action is triggered by simply using the selection control, which in turn activates an onchange javascript routine that causes a slave php script to run retrieving data from a database returning the data thereby causing an ajax script to update the selection control. All the code (html, javascript) is there except for the php script, which should be trivial to write. Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is it possible to change the html title from the WYSIWYG editor?
you may find it weird, actually very weird, but is the following possible load up a post or page into the admin panel and place something like this in to the editor; ?php //assume exec-PHP already active $current_page_url_here = get_current_url(); echo a href='{$current_page_url_here}?var1=val1'click me/a; if ( $_GET['var1']=='val1' ) { //change the current post's html title to titleval1/title without using javascript/jquery } ? so when the visitor, clicks on the click me, same page reloads but this time, the title reads val1, and that's what search engines see too. and if it is also possible to change, the_title() to be equal to val1, that's even better. But, is such a thing technically possible? Or is it too late at that time to make those changes? Could ob_start in any shape or form be deployed here to achieve this goal? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to change the html title from the WYSIWYG editor?
Based on the terms you're using it sounds like this is a Wordpress question. You'd have a lot better chances of getting an answer if you query a group of WP gurus/geeks. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to change the html title from the WYSIWYG editor?
On Mon, Feb 13, 2012 at 15:50, Haluk Karamete halukkaram...@gmail.com wrote: you may find it weird, actually very weird, but is the following possible load up a post or page into the admin panel and place something like this in to the editor; ?php //assume exec-PHP already active $current_page_url_here = get_current_url(); echo a href='{$current_page_url_here}?var1=val1'click me/a; if ( $_GET['var1']=='val1' ) { //change the current post's html title to titleval1/title without using javascript/jquery } ? so when the visitor, clicks on the click me, same page reloads but this time, the title reads val1, and that's what search engines see too. and if it is also possible to change, the_title() to be equal to val1, that's even better. But, is such a thing technically possible? Or is it too late at that time to make those changes? Could ob_start in any shape or form be deployed here to achieve this goal? This is not a WYSIWYG editor question; WYSIWYG editors are things like KompoZer, Dreamweaver, FrontPage, and even web-based things like TinyMCE, et al. That aside, try this very basic example (and expounded) and see if it's what you're trying to achieve: ?php echo 'title'; if (isset($_GET['title'])) { echo $_GET['title']; } else { echo 'The title has not been set!'; } echo '/title'.PHP_EOL; echo 'a href=http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?title=Enter+your+title+hereChange Title/a'.PHP_EOL; ? -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to change the html title from the WYSIWYG editor?
On Mon, Feb 13, 2012 at 17:15, Haluk Karamete halukkaram...@gmail.com wrote: Please keep the replies on the list for all to benefit, including the archives. Isn't it TinyMCE considered a WYSIWYG one? but, anyway, that's beside the main point. Indeed. Hence: even web-based things like TinyMCE, et al. To your suggestion... I don't think your snippet would do any good as far as search engines... search engines would still take the title in the head. here, we are already in the the_content(). Did you understand what I meant by very basic example? You'd need to modify your title.*/title tag in the head, as well, obviously. That's all quite logical, and well beyond the scope of the initial question. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to change the html title from the WYSIWYG editor?
Yeah, but n the context of wordpress, that does not fly. If I do a die; in the middle of wp's tinymce editor, and check back the page, the title is already out there. first 5 lines would be something like !DOCTYPE html html dir=ltr lang=en-US head meta charset=UTF-8 / titlethe wordpress page title we were trying toi change is already here.../title link rel=profile href=http://gmpg.org/xfn/11; / But this question is a wp question. I accidentally dropped it in the PHP group. On Mon, Feb 13, 2012 at 2:24 PM, Daniel Brown danbr...@php.net wrote: On Mon, Feb 13, 2012 at 17:15, Haluk Karamete halukkaram...@gmail.com wrote: Please keep the replies on the list for all to benefit, including the archives. Isn't it TinyMCE considered a WYSIWYG one? but, anyway, that's beside the main point. Indeed. Hence: even web-based things like TinyMCE, et al. To your suggestion... I don't think your snippet would do any good as far as search engines... search engines would still take the title in the head. here, we are already in the the_content(). Did you understand what I meant by very basic example? You'd need to modify your title.*/title tag in the head, as well, obviously. That's all quite logical, and well beyond the scope of the initial question. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to change the html title from the WYSIWYG editor?
Bastien Koert On 2012-02-13, at 5:34 PM, Haluk Karamete halukkaram...@gmail.com wrote: Yeah, but n the context of wordpress, that does not fly. If I do a die; in the middle of wp's tinymce editor, and check back the page, the title is already out there. first 5 lines would be something like !DOCTYPE html html dir=ltr lang=en-US head meta charset=UTF-8 / titlethe wordpress page title we were trying toi change is already here.../title link rel=profile href=http://gmpg.org/xfn/11; / But this question is a wp question. I accidentally dropped it in the PHP group. On Mon, Feb 13, 2012 at 2:24 PM, Daniel Brown danbr...@php.net wrote: On Mon, Feb 13, 2012 at 17:15, Haluk Karamete halukkaram...@gmail.com wrote: Please keep the replies on the list for all to benefit, including the archives. Isn't it TinyMCE considered a WYSIWYG one? but, anyway, that's beside the main point. Indeed. Hence: even web-based things like TinyMCE, et al. To your suggestion... I don't think your snippet would do any good as far as search engines... search engines would still take the title in the head. here, we are already in the the_content(). Did you understand what I meant by very basic example? You'd need to modify your title.*/title tag in the head, as well, obviously. That's all quite logical, and well beyond the scope of the initial question. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Any reason you can't just use JS to alter the title tag on the page loading? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to change the html title from the WYSIWYG editor?
Search engines would still be indexing the original page's title. I need each unique URL to have its own unique, robot friendly title. Again, this question is strictly within WP context. On Mon, Feb 13, 2012 at 6:49 PM, Bastien phps...@gmail.com wrote: Bastien Koert On 2012-02-13, at 5:34 PM, Haluk Karamete halukkaram...@gmail.com wrote: Yeah, but n the context of wordpress, that does not fly. If I do a die; in the middle of wp's tinymce editor, and check back the page, the title is already out there. first 5 lines would be something like !DOCTYPE html html dir=ltr lang=en-US head meta charset=UTF-8 / titlethe wordpress page title we were trying toi change is already here.../title link rel=profile href=http://gmpg.org/xfn/11; / But this question is a wp question. I accidentally dropped it in the PHP group. On Mon, Feb 13, 2012 at 2:24 PM, Daniel Brown danbr...@php.net wrote: On Mon, Feb 13, 2012 at 17:15, Haluk Karamete halukkaram...@gmail.com wrote: Please keep the replies on the list for all to benefit, including the archives. Isn't it TinyMCE considered a WYSIWYG one? but, anyway, that's beside the main point. Indeed. Hence: even web-based things like TinyMCE, et al. To your suggestion... I don't think your snippet would do any good as far as search engines... search engines would still take the title in the head. here, we are already in the the_content(). Did you understand what I meant by very basic example? You'd need to modify your title.*/title tag in the head, as well, obviously. That's all quite logical, and well beyond the scope of the initial question. -- /Daniel P. Brown Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Any reason you can't just use JS to alter the title tag on the page loading? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to install PHP on IIS?
On 16 November 2010 13:30, Jay Blanchard jblanch...@pocket.com wrote: [snip] http://www.wampserver.com/en/ [/snip] And yes, I know that this is Apache - I am just not a fan of IIS. I quite like it. It probably does way so much more than I need or want and I think I can do everything that I can on Apache. IIS7 is certainly a massive leap ahead of the PWS I first tried to use. IIS+FastCGI+PHP. Add the Rewrite plugin and the PHP extensions WinCache and SQLSvr (PDO if you want it) and you have a well defined simple setup. Obviously, getting to grips with the administration UI is a bit different to just editing a plain text config file, but IIS does use an XML file for its config, so, once you know the xsd, you can do that by hand also. Full docs on the xsd are available online, so really, I'd guess in terms of ability, IIS and Apache are on-par. Richard. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to install PHP on IIS?
On 16 November 2010 06:46, Himani Aggarwal incrediblehim...@gmail.com wrote: Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks PHP on IIS. Certainly. http://docs.php.net/manual/en/install.windows.iis7.php : IIS7 specific instructions. http://docs.php.net/manual/en/install.windows.manual.php : General instructions for installing PHP manually. http://docs.php.net/manual/en/install.windows.commandline.php : Additional instructions for better integration of PHP into the commandline. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to install PHP on IIS?
On 2010-11-16, at 6:55 AM, Richard Quadling rquadl...@gmail.com wrote: On 16 November 2010 06:46, Himani Aggarwal incrediblehim...@gmail.com wrote: Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks PHP on IIS. Certainly. http://docs.php.net/manual/en/install.windows.iis7.php : IIS7 specific instructions. http://docs.php.net/manual/en/install.windows.manual.php : General instructions for installing PHP manually. http://docs.php.net/manual/en/install.windows.commandline.php : Additional instructions for better integration of PHP into the commandline. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The windows web platform installer is also an option and will install php/Mysql and other apps like moodle, sugarcrm and others. Bastien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to install PHP on IIS?
[snip] Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks [/snip] http://www.wampserver.com/en/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to install PHP on IIS?
On 16 November 2010 13:21, Jay Blanchard jblanch...@pocket.com wrote: [snip] Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks [/snip] http://www.wampserver.com/en/ Jay, if that had been wimpserver ... -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to install PHP on IIS?
[snip] http://www.wampserver.com/en/ [/snip] And yes, I know that this is Apache - I am just not a fan of IIS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to install PHP on IIS?
On Tue, 16 Nov 2010 12:16:25 +0530 Himani Aggarwal incrediblehim...@gmail.com wrote: Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks Now, why would you wanna do something crazy like that?! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to install PHP on IIS?
Richard Quadling wrote: On 16 November 2010 13:21, Jay Blanchard jblanch...@pocket.com wrote: [snip] Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks [/snip] http://www.wampserver.com/en/ Jay, if that had been wimpserver ... I think it's a good point. Windows + IIS + MySQL + PHP == WINP(y) server :-P KDK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to install PHP on IIS?
Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks
Re: [PHP] Is it possible to install PHP on IIS?
Himani, See http://blogs.iis.net/bills/archive/2006/09/19/how-to-install-php-on-iis7-_2800_rc1_2900_.aspx?WT.mc_id=soc-c-in-loc--cfp. Also, see http://blogs.iis.net/donraman/archive/2009/10/07/installing-php-on-windows.aspx?WT.mc_id=soc-c-in-loc--cfp On Tue, Nov 16, 2010 at 12:16 PM, Himani Aggarwal incrediblehim...@gmail.com wrote: Hi Folks, is it possible to install PHP on IIS? If yes, can someone please guide me on how to go about doing it? Thanks
[PHP] Is it possible to create a global namespace alias?
Is it possible to create a global namespace alias in PHP or does the alias have to be defined in EVERY file that I use? Here is an example: file: main.php ?php use \this\is\my\custom\namespace\Item as nsItem; ? file: index.php ?php require_once “main.php”; // Attempt to use namespace alias defined in main.php file nsItem::test(); ? The above code doesn’t work for me. The namespace alias defined in the main.php file isn’t accessible in the index.php file. Is there a way to make the “nsItem” alias a “global” one, so that I don’t have to define it in EVERY file that I want to use? -Matt
[PHP] Is it possible to create a global namespace alias?
Is it possible to create a global namespace alias in PHP or does the alias have to be defined in EVERY file that I use? Here is an example: file: main.php ?php use \this\is\my\custom\namespace\Item as nsItem; ? file: index.php ?php require_once “main.php”; // Attempt to use namespace alias defined in main.php file nsItem::test(); ? The above code doesn’t work for me. The namespace alias defined in the main.php file isn’t accessible in the index.php file. Is there a way to make the “nsItem” alias a “global” one, so that I don’t have to define it in EVERY file that I want to use? -Matt
[PHP] pecl/oauth - possible to send HTTP request myself?
The typical way to use pecl/oauth seems to use OAuth::fetch which does everything including sending the HTTP request using curl or php streams. I'd like to be able to use pecl/oauth to do everything up to and including calculating the signature but then send the request using different code. The reason for this is that I am using a web framework (internal) that can aggregate requests using curl_multi and do them asynchronously (Rasmus surely knows what I'm referring to :-)). I imagine this could be useful also for others who need to make their requests go through proxies. I know that I can call oauth_get_sbs to get the sbs which is probably the most error-prone part of doing OAuth so that's good. But is it possible to take it a step further and get pecl/oauth to return the curl handle it would've used (with OAuth stuff already stuffed in the url or request headers) without executing it? Basically I want to decouple OAuth signature calculation from network communication. Possible? -Marc http://marc-abramowitz.com Sent from my iPhone 3G
RE: [PHP] Is it possible to send POST vars through a header redirect?
I thought the question was pretty straight forward. Sorry about that. As someone mentioned, yes I'm just trying to hide the var from the user. What I meant by I don't want it to stick with the session, is that I don't want it to be available from page to page. I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header(Location: http://domain/?somevar=somevalue;) I'll try some of the previous responses thanks for the help. -Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Wednesday, February 04, 2009 12:58 PM To: Mike Roberts Cc: TS; php-general@lists.php.net Subject: RE: [PHP] Is it possible to send POST vars through a header redirect? Just look at the headers of EVERY email that comes from the mailing list, as they contain the unsubscribe email address. On Wed, 2009-02-04 at 09:47 -0500, Mike Roberts wrote: Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Senior Recruitment Strategist Corporate Staffing Services 150 Monument Road, Suite 510 Bala Cynwyd, PA 19004 P 610-771-1084 F 610-771-0390 E mrobe...@jobscss.com -Original Message- From: TS [mailto:sunnrun...@gmail.com] Sent: Tuesday, February 03, 2009 5:47 PM To: php-general@lists.php.net Subject: [PHP] Is it possible to send POST vars through a header redirect? I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to send POST vars through a header redirect?
At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header(Location: http://domain/?somevar=somevalue;) That would, by definition, allow the user to see it. If you want to pass a variable to another script, I know of four choices, namely: 1. Use POST; 2. Use GET; 3. Write the variable to a database; 4. Include the next script. HTH's tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a headerredirect?
tedd wrote: At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header(Location: http://domain/?somevar=somevalue;) That would, by definition, allow the user to see it. If you want to pass a variable to another script, I know of four choices, namely: 1. Use POST; 2. Use GET; 3. Write the variable to a database; 4. Include the next script. HTH's tedd 5. Stick it in the session -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a headerredirect?
At 1:18 PM -0600 2/5/09, Shawn McKenzie wrote: tedd wrote: At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header(Location: http://domain/?somevar=somevalue;) That would, by definition, allow the user to see it. If you want to pass a variable to another script, I know of four choices, namely: 1. Use POST; 2. Use GET; 3. Write the variable to a database; 4. Include the next script. HTH's tedd 5. Stick it in the session -- Thanks! -Shawn Duh! Thanks, I should wait a day before posting anything. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through aheaderredirect?
tedd wrote: At 1:18 PM -0600 2/5/09, Shawn McKenzie wrote: tedd wrote: At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header(Location: http://domain/?somevar=somevalue;) That would, by definition, allow the user to see it. If you want to pass a variable to another script, I know of four choices, namely: 1. Use POST; 2. Use GET; 3. Write the variable to a database; 4. Include the next script. HTH's tedd 5. Stick it in the session -- Thanks! -Shawn Duh! Thanks, I should wait a day before posting anything. tedd Only a day? Sometimes I click send before I'm even finished ty -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a header redirect?
2009/2/3 TS sunnrun...@gmail.com: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. I'm not sure what you mean by stick with the session. What exactly are you trying to achieve? -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a header redirect?
2009/2/4 Jônatas Zechim zechim@gmail.com: Try curl 1) I really wish people would look at other replies to a post before sending their own. Duplicates are rarely useful. 2) CURL cannot perform a header redirect as the OP is asking for, so the more useful response is to ask what they're actually trying to achieve because they're wanting to know how to do something that's not possible so the question is flawed. Rant over. -Stuart -Mensagem original- De: Stuart [mailto:stut...@gmail.com] Enviada em: quarta-feira, 4 de fevereiro de 2009 07:52 Para: TS Cc: php-general@lists.php.net Assunto: Re: [PHP] Is it possible to send POST vars through a header redirect? 2009/2/3 TS sunnrun...@gmail.com: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. I'm not sure what you mean by stick with the session. What exactly are you trying to achieve? -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to send POST vars through a header redirect?
Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Senior Recruitment Strategist Corporate Staffing Services 150 Monument Road, Suite 510 Bala Cynwyd, PA 19004 P 610-771-1084 F 610-771-0390 E mrobe...@jobscss.com -Original Message- From: TS [mailto:sunnrun...@gmail.com] Sent: Tuesday, February 03, 2009 5:47 PM To: php-general@lists.php.net Subject: [PHP] Is it possible to send POST vars through a header redirect? I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to send POST vars through a header redirect?
At 9:47 AM -0500 2/4/09, Mike Roberts wrote: Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Have you tried? To unsubscribe, visit: http://www.php.net/unsub.php It's at the bottom of every post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] Is it possible to send POST vars through a header redirect?
Try curl -Mensagem original- De: Stuart [mailto:stut...@gmail.com] Enviada em: quarta-feira, 4 de fevereiro de 2009 07:52 Para: TS Cc: php-general@lists.php.net Assunto: Re: [PHP] Is it possible to send POST vars through a header redirect? 2009/2/3 TS sunnrun...@gmail.com: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. I'm not sure what you mean by stick with the session. What exactly are you trying to achieve? -Stuart -- http://stut.net/ -- 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] Is it possible to send POST vars through a header redirect?
Not possible to send POST in header if your aim is to hide vars from users. Could think about dynamically send POST using Javascript. form.send(); This requires some JS knowledge about how to exchange data between PHP and JS 2009/2/4 tedd tedd.sperl...@gmail.com At 9:47 AM -0500 2/4/09, Mike Roberts wrote: Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Have you tried? To unsubscribe, visit: http://www.php.net/unsub.php It's at the bottom of every post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] Is it possible to send POST vars through a header redirect?
U can do it by using a session, or using a XML request via JS to save the vars. -Mensagem original- De: Morris [mailto:morris...@gmail.com] Enviada em: quarta-feira, 4 de fevereiro de 2009 16:00 Para: tedd Cc: Mike Roberts; php-general@lists.php.net Assunto: Re: [PHP] Is it possible to send POST vars through a header redirect? Not possible to send POST in header if your aim is to hide vars from users. Could think about dynamically send POST using Javascript. form.send(); This requires some JS knowledge about how to exchange data between PHP and JS 2009/2/4 tedd tedd.sperl...@gmail.com At 9:47 AM -0500 2/4/09, Mike Roberts wrote: Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Have you tried? To unsubscribe, visit: http://www.php.net/unsub.php It's at the bottom of every post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- 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] Is it possible to send POST vars through a header redirect?
Stuart wrote: 2009/2/4 Jônatas Zechim zechim@gmail.com: Try curl 1) I really wish people would look at other replies to a post before sending their own. Duplicates are rarely useful. 2) CURL cannot perform a header redirect as the OP is asking for, so the more useful response is to ask what they're actually trying to achieve because they're wanting to know how to do something that's not possible so the question is flawed. Rant over. -Stuart -Mensagem original- De: Stuart [mailto:stut...@gmail.com] Enviada em: quarta-feira, 4 de fevereiro de 2009 07:52 Para: TS Cc: php-general@lists.php.net Assunto: Re: [PHP] Is it possible to send POST vars through a header redirect? 2009/2/3 TS sunnrun...@gmail.com: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. I'm not sure what you mean by stick with the session. What exactly are you trying to achieve? -Stuart -- http://stut.net/ Well, since the OP can't POST using header, then maybe alternatives to help them out? If you want to use sessions or are already using them (i.e. session_start() on each of the pages), you can just use session vars: session_start(); $_SESSION['var'] = 3; header(Location: http://domain/index.php;); exit; Then in the next page you have the var: session_start(); $var = $_SESSION['var']; -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to send POST vars through a header redirect?
Just look at the headers of EVERY email that comes from the mailing list, as they contain the unsubscribe email address. On Wed, 2009-02-04 at 09:47 -0500, Mike Roberts wrote: Ladies and Gentlemen. I am a recruiter who joined this list to understand a little about PHP. I respected the boundaries, and never tried to recruit you. Now I am asking for a courtesy in return. I have tried several ways and several times to be excluded from the list, but I still get emails. Can somebody who is 'in charge' please remove me from the list. Thank you. Michael Roberts Senior Recruitment Strategist Corporate Staffing Services 150 Monument Road, Suite 510 Bala Cynwyd, PA 19004 P 610-771-1084 F 610-771-0390 E mrobe...@jobscss.com -Original Message- From: TS [mailto:sunnrun...@gmail.com] Sent: Tuesday, February 03, 2009 5:47 PM To: php-general@lists.php.net Subject: [PHP] Is it possible to send POST vars through a header redirect? I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a header redirect?
On Tue, Feb 3, 2009 at 2:54 PM, Jim Lucas li...@cmsws.com wrote: TS wrote: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T No, it is not possible. You will need to look into cURL or something else. But it cannot be done via the header() function. -- 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 You could always create major overhead and stick it in the database. Ha... -- Kyle Terry | www.kyleterry.com Help kick start VOOM (Very Open Object Model) for a library of PHP classes. http://www.voom.me | IRC EFNet #voom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a header redirect?
TS wrote: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T No, it is not possible. You will need to look into cURL or something else. But it cannot be done via the header() function. -- 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] Is it possible to send POST vars through a header redirect?
On Tue, Feb 3, 2009 at 2:54 PM, Jim Lucas li...@cmsws.com wrote: TS wrote: I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T No, it is not possible. You will need to look into cURL or something else. But it cannot be done via the header() function. I second that you need to use curl: $header = array( MIME-Version=1.0, Content-type=text/html; charset=utf-8 ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this-elqPosturl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, $this-curlOptTimeOut); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); curl_setopt($ch, CURLOPT_PROXY, $this-proxyServer); curl_setopt($ch, CURLOPT_PROXYPORT, $this-proxyPort); curl_setopt($ch, CURLOPT_POSTFIELDS, $inputArray); curl_setopt($ch, CURLOPT_USERAGENT, 'MSIE'); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HEADER, 1); $data = curl_exec($ch); Thanks, V
[PHP] Is it possible to send POST vars through a header redirect?
I'm trying to send vars via POST somehow. Is this possible? Currently I'm doing header(Location: http://domain/index.php?var=3;); but, want to send POST or some other method that doesn't stick with the session. Thanks, T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
You could try using exec to set up an AT job with a short delay which will then run 'net apache restart' - I'm not a total windows guru so I can't give you the exact recipe... Something like exec('AT 12:00 net apache restart'); Check the documentation on the AT command... One possible extra advantage is that you could cancel the 'AT' job during the delay period if you clicked restart by accident :) Louie Miranda wrote: Thanks for your suggestions. But, both did not worked. Louie On 10/19/07, Philip Thompson [EMAIL PROTECTED] wrote: On 10/19/07, Robert Degen [EMAIL PROTECTED] wrote: Why don't you try a passthru('net apache restart') perhabs another parameter order, but I think It won't work. Stopping it might work, but restarting... On Fr, Okt 19, 2007 at 04:32:45 +0800, Louie Miranda wrote: Is it possible to restart Windows Apache (service) on a PHP script? i have installed PHP/Apache on a Windows machine. Added the ext windows32 service. But could not find any how to or information online. Please help! -- Louie Miranda ([EMAIL PROTECTED]) This reminds me of the time I was remoting into a machine (using Altiris, I think) to do some work on it. I then needed to restart it... so I did. Well, class, what happens when you turn off Mr. Computer? Not saying that this is the same thing... b/c if you push a restart command, then it *should* come back up. =/ Sorry, I don't know the exact command, but consider using exec(). Good Luck, ~Philip PS... Yay, it's Friday! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
What we do is setup 'sudo' to run certain commands (or a shell/ruby script for example), then have PHP/Apache exec() the script via sudo (or use a DBUS call to a 'root' enabled ruby daemon), which then restarts apache or whatever we want. Be VERY careful with the way you do this or you can give crackers all kinds of ways to cause you pain. For example: [EMAIL PROTECTED]:/etc# cat /etc/sudoers Cmnd_Alias CHMOD = /bin/chmod Cmnd_Alias REBOOT = /sbin/reboot, /sbin/shutdown rootALL=(ALL) ALL www-dataALL=NOPASSWD: /bin/date, /sbin/hwclock, REBOOT, /usr/bin/dpkg, /usr/sbin/chpasswd, /usr/bin/passwd, /usr/sbin/srvwatch, /usr/sbin/srvtalk Then in the PHP web page: exec(/usr/bin/sudo /sbin/reboot); D.Vin Voice or no voice, the people can alway be brought to the bidding of the leaders. This is easy. All you have to do is tell them that they are being attacked, and denounce the pacifists for a lack of patriotism and exposing the country to danger. It works the same in every country. --Hermann Goering, Hitler's Reich Marshall at the Nuremberg Trials After WWII Sound like G.W.Bush?
RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
DOH!. I'm sorry I didn't read the fact that this was on Windows. My bad... Um. Out of curiosity, why would you run LAMP as WAMP? It just seems so wrong. Not to start an OS religion war, I use XP all day long, but I would never use it as my dedicated web server -- that's why God invented Unix/Linux. Best tool for the job and all that stuff... You're just asking for all kinds of headaches and limitations (such as the one you're encountering now) by using the back of a screwdriver to hammer a nail IYKWIM. You'll poke your eye out! :) -Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Monday, October 22, 2007 1:26 PM To: php-general@lists.php.net Subject: RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script? What we do is setup 'sudo' to run certain commands (or a shell/ruby script for example), then have PHP/Apache exec() the script via sudo (or use a DBUS call to a 'root' enabled ruby daemon), which then restarts apache or whatever we want. Be VERY careful with the way you do this or you can give crackers all kinds of ways to cause you pain. For example: [EMAIL PROTECTED]:/etc# cat /etc/sudoers Cmnd_Alias CHMOD = /bin/chmod Cmnd_Alias REBOOT = /sbin/reboot, /sbin/shutdown rootALL=(ALL) ALL www-dataALL=NOPASSWD: /bin/date, /sbin/hwclock, REBOOT, /usr/bin/dpkg, /usr/sbin/chpasswd, /usr/bin/passwd, /usr/sbin/srvwatch, /usr/sbin/srvtalk Then in the PHP web page: exec(/usr/bin/sudo /sbin/reboot); D.Vin Voice or no voice, the people can alway be brought to the bidding of the leaders. This is easy. All you have to do is tell them that they are being attacked, and denounce the pacifists for a lack of patriotism and exposing the country to danger. It works the same in every country. --Hermann Goering, Hitler's Reich Marshall at the Nuremberg Trials After WWII Sound like G.W.Bush? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
Thanks for your suggestions. But, both did not worked. Louie On 10/19/07, Philip Thompson [EMAIL PROTECTED] wrote: On 10/19/07, Robert Degen [EMAIL PROTECTED] wrote: Why don't you try a passthru('net apache restart') perhabs another parameter order, but I think It won't work. Stopping it might work, but restarting... On Fr, Okt 19, 2007 at 04:32:45 +0800, Louie Miranda wrote: Is it possible to restart Windows Apache (service) on a PHP script? i have installed PHP/Apache on a Windows machine. Added the ext windows32 service. But could not find any how to or information online. Please help! -- Louie Miranda ([EMAIL PROTECTED]) This reminds me of the time I was remoting into a machine (using Altiris, I think) to do some work on it. I then needed to restart it... so I did. Well, class, what happens when you turn off Mr. Computer? Not saying that this is the same thing... b/c if you push a restart command, then it *should* come back up. =/ Sorry, I don't know the exact command, but consider using exec(). Good Luck, ~Philip PS... Yay, it's Friday! -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :)
Re: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
On 10/19/07, Robert Degen [EMAIL PROTECTED] wrote: Why don't you try a passthru('net apache restart') perhabs another parameter order, but I think It won't work. Stopping it might work, but restarting... On Fr, Okt 19, 2007 at 04:32:45 +0800, Louie Miranda wrote: Is it possible to restart Windows Apache (service) on a PHP script? i have installed PHP/Apache on a Windows machine. Added the ext windows32 service. But could not find any how to or information online. Please help! -- Louie Miranda ([EMAIL PROTECTED]) This reminds me of the time I was remoting into a machine (using Altiris, I think) to do some work on it. I then needed to restart it... so I did. Well, class, what happens when you turn off Mr. Computer? Not saying that this is the same thing... b/c if you push a restart command, then it *should* come back up. =/ Sorry, I don't know the exact command, but consider using exec(). Good Luck, ~Philip PS... Yay, it's Friday!
Re: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
Why don't you try a passthru('net apache restart') perhabs another parameter order, but I think It won't work. Stopping it might work, but restarting... On Fr, Okt 19, 2007 at 04:32:45 +0800, Louie Miranda wrote: Is it possible to restart Windows Apache (service) on a PHP script? i have installed PHP/Apache on a Windows machine. Added the ext windows32 service. But could not find any how to or information online. Please help! -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to restart Windows Apache (service) on a PHP script?
Is it possible to restart Windows Apache (service) on a PHP script? i have installed PHP/Apache on a Windows machine. Added the ext windows32 service. But could not find any how to or information online. Please help! -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :)
[PHP] Is it possible to create a php.so
I have several background processes written in PHP. In our design, we have the parent process which check if there is work to process, and if so launch a child process via exec() to do actual work. By design, we want the child process to do just what it was told to do and gracefully terminate. We don't want the child process to live longer than 10 minutes. My coworker looked at ZendPlatform, and APC, but he found that these does not do anything for PHP program that are run from command line. I know at this point ZendPlatform does not support command line. Is this true with APC? Is there any other caching implementation that we can use? Is it possible to compile PHP so that the core of it is in a dynamically linked library (I am running in a Linux/Unix environment)? Can I turn my PHP code into a dynamic link library ? Thanks Khai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to disable eval()?
Thank you. It is already enough for me. It works. On 8/16/07, Steffen Ebermann [EMAIL PROTECTED] wrote: On Thu, Aug 16, 2007 at 09:50:30PM +0800, hshh wrote: I try to disable eval() function in php script, but failed. In php.ini disable_functions=eval is not work, but other functions. So, is it possible to disable eval()? Thanks. It don't work because eval() isn't a function. The Suhosin protection system would let you do so. If an option: http://www.hardened-php.net/suhosin/configuration.html#suhosin.executor.disable_eval -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to disable eval()?
Hi, I try to disable eval() function in php script, but failed. In php.ini disable_functions=eval is not work, but other functions. So, is it possible to disable eval()? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to disable eval()?
On Thu, Aug 16, 2007 at 09:50:30PM +0800, hshh wrote: I try to disable eval() function in php script, but failed. In php.ini disable_functions=eval is not work, but other functions. So, is it possible to disable eval()? Thanks. It don't work because eval() isn't a function. The Suhosin protection system would let you do so. If an option: http://www.hardened-php.net/suhosin/configuration.html#suhosin.executor.disable_eval -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
Dan wrote: ... You should also look at this: http://www.mnot.net/cache_docs/ Very informative. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to stop an image from being cached?
Solution 1: Send a header() that avoids caching (can't remember it exactly) Solution 2: Call the image like this: img src=image.jpg?arandomstringhereeachtime Or if you were creating it with a php script: img src=image.php?img=image.jpgarandomstringhereeachtime My preferred way of doing it, and making sure its reloaded each time is to do it this way... the U variable pretty much guarantees a random string each time its loaded. image.jpg?.date(U). Regards Chris Aitken The Web Hub Designer and Programmer Phone : 02 4648 0808 Mobile : 0411 132 075 - Making The Web Work The Web Hub http://www.thewebhub.com.au/ [EMAIL PROTECTED] - Confidentiality Statement: This message is intended only for the use of the Addressee and may contain information that is PRIVILEDGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) You can try: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
Well, this is only one specific image that constantly changes, the rest of the page is handled regularly. From what you've said if I go with this header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past That will effect only the one specific image I use this on when generating it right? - Dan Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, Dan [EMAIL PROTECTED] wrote: Is this header you're refering to the header of the page which contains the image, or the image itself? - Dan The image itself. Also note, that if you use my solution 2, you still might get problems, as the page that is calling might be cached, and in the cached page, it refers to the image with the same unique code, and it will use the cached image again. Also, if you use solution 2, the image will still stay forever in the temp folder of the browser(unless the user is cleaning it). If you use solution 1, the browser will keep it only for this page, and will remove it afterwards. Tijnema Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) You can try: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
Is this header you're refering to the header of the page which contains the image, or the image itself? - Dan Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) You can try: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
On 7/27/07, Chris Aitken [EMAIL PROTECTED] wrote: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? But wouldn't that make every image on the page be uncached and reloaded each time? Not very efficient if the shell of the site keeps getting loaded if only 1 or 2 images need to be forced. Regards Chris Aitken The Web Hub Designer and Programmer Phone : 02 4648 0808 Mobile : 0411 132 075 Yes, that depends on which way it is used, I wouldn't recommend loading images from the database that don't get changed... And you can of course also use an if-statement/switch-statement/in_array function in your image.php script, like this: $img = $_GET['img']; if($img == test_a.jpg || $img == test_b.jpg) { header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past } OR: $img = $_GET['img']; switch($img) { case test_a.jpg: case test_b.jpg: header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past } OR: $img = $_GET['img']; $noncached_images = array(test_a.jpg,test_b.jpg); if(in_array($img,$noncached_images)) { header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past } Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to stop an image from being cached?
I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) Solution 2: Call the image like this: img src=image.jpg?arandomstringhereeachtime Or if you were creating it with a php script: img src=image.php?img=image.jpgarandomstringhereeachtime Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
Awesome, seems to work. Thanks Tijnema! - Dan Dan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well, this is only one specific image that constantly changes, the rest of the page is handled regularly. From what you've said if I go with this header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past That will effect only the one specific image I use this on when generating it right? - Dan Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, Dan [EMAIL PROTECTED] wrote: Is this header you're refering to the header of the page which contains the image, or the image itself? - Dan The image itself. Also note, that if you use my solution 2, you still might get problems, as the page that is calling might be cached, and in the cached page, it refers to the image with the same unique code, and it will use the cached image again. Also, if you use solution 2, the image will still stay forever in the temp folder of the browser(unless the user is cleaning it). If you use solution 1, the browser will keep it only for this page, and will remove it afterwards. Tijnema Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) You can try: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
On 7/27/07, Dan [EMAIL PROTECTED] wrote: Is this header you're refering to the header of the page which contains the image, or the image itself? - Dan The image itself. Also note, that if you use my solution 2, you still might get problems, as the page that is calling might be cached, and in the cached page, it refers to the image with the same unique code, and it will use the cached image again. Also, if you use solution 2, the image will still stay forever in the temp folder of the browser(unless the user is cleaning it). If you use solution 1, the browser will keep it only for this page, and will remove it afterwards. Tijnema Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) You can try: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use header('Content-Type: image/jpeg'); passthru($file); to send the image to the user. My problem is once they view the image their browser helpfully caches it so they don't have to download it again. Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? - Dan Solution 1: Send a header() that avoids caching (can't remember it exactly) You can try: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
On Thu, July 26, 2007 6:32 pm, Tijnema wrote: Also, if you use solution 2, the image will still stay forever in the Not forever. Just until something else being downloaded shoves it out due to the folder size restriction. The browser might even be smart and keep oft-used resources in the cache in favor of others rather than be strictly FIFO. So a random URL makes browsers that were dumb enough to cache something they shouldn't have cached (if you sent no cache headers) clog up their cache with the un-re-usable files that it shouldn't have saved anyway. Oooh, hurt me. :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to stop an image from being cached?
On Thu, July 26, 2007 4:56 pm, Dan wrote: Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? You can try to use all the zillion header calls people will send you. Somewhere out there is a really stupid browser that will insist on caching it. src=somebody.jpg??php echo uniqid()? will make it very difficult for any halfway-decent browser to cache. However, that can lead to some issues when the URL of the image is embedded elsewhere, as some folks will strip off the GET arg on the assumption that it's invalid for a JPEG. Embedding the random bit so that it LOOKS like a directory, but isn't, will avoid that problem. I blogged about how to do this kind of thing (in another context) over here: http://richardlynch.blogspot.com/2006/06/php-downloads-content-disposition.html There are shorter / better explanations out there, but I don't know where without Googling, and you know how to Google, right? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to stop an image from being cached?
header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ? But wouldn't that make every image on the page be uncached and reloaded each time? Not very efficient if the shell of the site keeps getting loaded if only 1 or 2 images need to be forced. Regards Chris Aitken The Web Hub Designer and Programmer Phone : 02 4648 0808 Mobile : 0411 132 075 - Making The Web Work The Web Hub http://www.thewebhub.com.au/ [EMAIL PROTECTED] - Confidentiality Statement: This message is intended only for the use of the Addressee and may contain information that is PRIVILEDGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to get the name of the top most calling script?
Hello, I know that __FILE__ and __LINE__ report on the file and line that they occur in. What I want is to be able to get the file name and line of the calling script. The only way I can do this so far is by passing the values through function arguments. Is there any way around this? Thanks, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to get the name of the top most calling script?
On 6/10/07, barophobia [EMAIL PROTECTED] wrote: Hello, I know that __FILE__ and __LINE__ report on the file and line that they occur in. What I want is to be able to get the file name and line of the calling script. The only way I can do this so far is by passing the values through function arguments. Is there any way around this? Thanks, Chris. You could also use the the suberglobal $GLOBALS Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to get the name of the top most calling script?
On Sat, June 9, 2007 7:18 pm, barophobia wrote: I know that __FILE__ and __LINE__ report on the file and line that they occur in. What I want is to be able to get the file name and line of the calling script. The only way I can do this so far is by passing the values through function arguments. Is there any way around this? If you want the main file, var_dump($_SERVER); If you want the whole backtrace, search php.net for backtrace function. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is it possible to manipulate vars here..
.. to build a url like http://devil.server.com/vitims_page.php?? // a,b,c,d are coming from a form // and are defined in a dropdown of the form // there are no form fields which can be filled by the user // a maybe Germany, England // b maybe Support, Training // register_globals = on function build_url(a,b,c,d) { $urlpart[a] = parta; // $urlpart[Germany] = Stuttgart; $urlpart[b] = partb; $urlpart[c] = partc; $urlpart[d] = partd; $url = ; if($a!=) $url.= $url+$urlpart[a]; if($b!=) $url.= $url+$urlpart[b]; if($c!=) $url.= $url+$urlpart[c]; if($d!=) $url.= $url+$urlpart[d]; return $url; } $link = build_url($a,$b,$c,$d); echo $link; -- Jochen Kaechelin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to manipulate vars here..
On 02/08/06, Jochen Kaechelin [EMAIL PROTECTED] wrote: .. to build a url like http://devil.server.com/vitims_page.php?? Not sure what you're trying to do, but switch register_globals OFF. Also, if you are trying to concatenate strings inside the function, use ., not +. -- http://www.web-buddha.co.uk http://www.projectkarma.co.uk
[PHP] Is this possible with php
Hi, I really don't think this is possible from what I know of php, but I thought I would as the experts. Is it possible to have php create directories and move files on a local machine. I have created a web portal for a client and now they would like it to upload files to an server, no a problem. But they would like it to also move temp files on the users computer to new directories and then upload the file to the server with no user interation other than clicking go. I have thought of doing this in vb or c# but I have done very little with these languages, and php just rocks. Thanks Scandog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is it possible to use header() to POST form data?
[snip] Does anyone know if it's possible to use the header() function to POST form data to a URL? If so what syntax needs to be used? [/snip] You will want to check out http://www.php.net/curl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to use header() to POST form data?
Hello, Does anyone know if it's possible to use the header() function to POST form data to a URL? If so what syntax needs to be used? Thanks, Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to use header() to POST form data?
Does anyone know if it's possible to use the header() function to POST form data to a URL? If so what syntax needs to be used? No, but a quick search for HTTP POST PHP example will get you the code you need. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to use header() to POST form data?
Philip Hallstrom wrote: Does anyone know if it's possible to use the header() function to POST form data to a URL? If so what syntax needs to be used? No, but a quick search for HTTP POST PHP example will get you the code you need. Thanks, I googled and, as you said, there was code there. 'sendToHost' Hopefully it's current enough to work for me. Thanks again, Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to use header() to POST form data?
On Thu, Dec 15, 2005 at 03:02:01PM -0800, pw wrote: Philip Hallstrom wrote: Does anyone know if it's possible to use the header() function to POST form data to a URL? If so what syntax needs to be used? No, but a quick search for HTTP POST PHP example will get you the code you need. Thanks, I googled and, as you said, there was code there. 'sendToHost' I've always disliked this well known function, mostly because it is prone to to many unexepcted errors, and that for the fact that it is very old. You would be best off using on of the following solutions: http:://php.net/curl http://php.net/fsockopen (note the ability to handle errors in Example 1) http://us3.php.net/manual/en/ref.stream.php (if you want to write your own) Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP CLI - possible for mass mailing?
Denis Gerasimov wrote: We are working on a PHP project that implements mass mailing to a large number of its subscribers (expected 100,000-200,000 users; not spam mailing BTW). So I am wondering if it is possible to use PHP CLI binary for this purpose and if there are any problems with PHP in this case. No problems that I can think of as long as you use a custom php.ini file to avoid such things as safe_mode, max_execution_time, and various other nasties that you might bump into if you run it on various servers. I was said that using Perl script is more suitable for such task since PHP scripts have problems with sending large amount of mail. Bah humbug. PHP CLI works just fine, and, it is quite easy to do both ncurses and text positioning/coloring for both Windows and Linux, and it is a lot easier to run it either from the web or shell. It's not the PHP script that has the problem, in reality, it's just an issue of making sure that you're sending the mails in batches, which you can do if you make sure that there's no maximum execution time set for the PHP script. Is that true or not? Any success/failure stories? It is false. And, I am sure that someone can dig up a success story, but, I know for a fact that I'd rather use PHP for sending large amounts of email, especially if there's to be MIME parts and or HTML included in it. There are already several well-coded PEAR packages that do this for you out of the box. Warm Regards, Torgny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP CLI - possible for mass mailing?
-Original Message- From: Denis Gerasimov [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 1:45 AM To: PHP General Mailing List Subject: [PHP] PHP CLI - possible for mass mailing? Hello List, We are working on a PHP project that implements mass mailing to a large number of its subscribers (expected 100,000-200,000 users; not spam mailing BTW). So I am wondering if it is possible to use PHP CLI binary for this purpose and if there are any problems with PHP in this case. I was said that using Perl script is more suitable for such task since PHP scripts have problems with sending large amount of mail. Is that true or not? Any success/failure stories? While I don't handle nearly that volume, I routenely use the CLI binary to mail a weekly newsletter to ~200 subscribers. I have never had any problem with it. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP CLI - possible for mass mailing?
Hello List, We are working on a PHP project that implements mass mailing to a large number of its subscribers (expected 100,000-200,000 users; not spam mailing BTW). So I am wondering if it is possible to use PHP CLI binary for this purpose and if there are any problems with PHP in this case. I was said that using Perl script is more suitable for such task since PHP scripts have problems with sending large amount of mail. Is that true or not? Any success/failure stories? Have a great day, Denis S Gerasimov Web Developer Team Force LLC Web:http://www.team-force.org/ www.team-force.org RU Int'l: +7 8362-468693 email:[EMAIL PROTECTED]
[PHP] Domain Info Possible?
Hello, I was wondering if there was way to generate domain statistics by any PHP script? I just need some basic info like: Monthly Traffic( Sites, Kbytes, Visits, Pages, Files, Hits ) Example: http://server18.internetserver.com/stats/1800homecare/ If it is possible can I also create a Log In for that page? I would appreciate any direction. Thanks, C. Ghosh
Re: [PHP] Domain Info Possible?
do you have log files? the page you linked to was generated by webalizer. is there a reason you can't use that (or Awstats, or something similar)? you probably don't need to reinvent the wheel here... though you may need to tweak your webserver to put more information in the log files so you can see all the stats you desire. Jordan On Sep 15, 2005, at 11:07 AM, Chirantan Ghosh wrote: Hello, I was wondering if there was way to generate domain statistics by any PHP script? I just need some basic info like: Monthly Traffic( Sites, Kbytes, Visits, Pages, Files, Hits ) Example: http://server18.internetserver.com/stats/1800homecare/ If it is possible can I also create a Log In for that page? I would appreciate any direction. Thanks, C. Ghosh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is it possible.
hello group, i have a problem and hope anybody here will be able to hep me out. i have a downloads folder in my server which contains all the files in zipped form to be downloaded by members.members are authenticated by entering username and password.and when they click to download the files ,they are forwarded to the the full file url by using header function of php.But the problem is that ,when the users click once to download a file ,they can see the whole url and so next time they can easily download the file by entering the full url in the browser ,so there is no use of authentication next time and this leads to bandwidth theft and the urls of files are circulating in the emails and users are downloading the files without becoming the user of the site and without authenticating themselves.I know there are many professionals in this group who are very experienced and have helped me earlier.this is a very serious problem and i need a solution to this.What are your views? Is there any solution for it? waiting for your replies. Thanks, Jenny
Re: [PHP] is it possible.
When deppending on authentication, never link the files directly. You can create a download.php file that gets an ID through the URL, checks if the user is authenticated and then read the file. You will need these functions: http://pt.php.net/file_get_contents http://pt.php.net/header Header() is to send the mime type, and file_get_contents is to read the file's contents (DOH). If you run into trouble, you can (in the order given ;): 1) Read the user's comments on both functions. They're pretty helpful sometimes 2) Mail the ML :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible.
i used following code for downloading file.whenever the members cicked the file for downloading ,the download request (with the variable containing file id) was send to download.php .The download.php on recieving the file id fetches the url of the fileand redirects to the file url using Header(location:$url); where $url is the full url of file such as http://www.abc.com/downloads/file1.zip. so finally the url is exposed to the members who circulates the url in mails and everybody downloads the files.I want that only members can download the file.is http://file.is there any solution. On 7/29/05, André Medeiros [EMAIL PROTECTED] wrote: When deppending on authentication, never link the files directly. You can create a download.php file that gets an ID through the URL, checks if the user is authenticated and then read the file. You will need these functions: http://pt.php.net/file_get_contents http://pt.php.net/header Header() is to send the mime type, and file_get_contents is to read the file's contents (DOH). If you run into trouble, you can (in the order given ;): 1) Read the user's comments on both functions. They're pretty helpful sometimes 2) Mail the ML :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible.
You could copy the file to a temp-file file_id.zip and delete it after download. But perhaps it is possible to just have the file in cache ? jenny mathew wrote: i used following code for downloading file.whenever the members cicked the file for downloading ,the download request (with the variable containing file id) was send to download.php .The download.php on recieving the file id fetches the url of the fileand redirects to the file url using Header(location:$url); where $url is the full url of file such as http://www.abc.com/downloads/file1.zip. so finally the url is exposed to the members who circulates the url in mails and everybody downloads the files.I want that only members can download the file.is http://file.is there any solution. On 7/29/05, André Medeiros [EMAIL PROTECTED] wrote: When deppending on authentication, never link the files directly. You can create a download.php file that gets an ID through the URL, checks if the user is authenticated and then read the file. You will need these functions: http://pt.php.net/file_get_contents http://pt.php.net/header Header() is to send the mime type, and file_get_contents is to read the file's contents (DOH). If you run into trouble, you can (in the order given ;): 1) Read the user's comments on both functions. They're pretty helpful sometimes 2) Mail the ML :) -- 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] is it possible.
jenny mathew wrote: hello group, i have a problem and hope anybody here will be able to hep me out. i have a downloads folder in my server which contains all the files in zipped form to be downloaded by members.members are authenticated by entering username and password.and when they click to download the files ,they are forwarded to the the full file url by using header function of php.But the problem is that ,when the users click once to download a file ,they can see the whole url and so next time they can easily download the file by entering the full url in the browser ,so there is no use of authentication next time and this leads to bandwidth theft and the urls of files are circulating in the emails and users are downloading the files without becoming the user of the site and without authenticating themselves.I know there are many professionals in this group who are very experienced and have helped me earlier.this is a very serious problem and i need a solution to this.What are your views? Is there any solution for it? waiting for your replies. Thanks, Jenny Route the email link through a script that checks for availability based on a user name, or email address; have the link as such: http://www.somesite.org/download.php?file=filenameuser=login name When this user clicks this email, it will direct them to download.php, where you could setup a call to a database. If this is the first time this user has accessed this file, set a flag in the database that this link is no longer valid, and redirect the user's browser to the file (check out the header function). The link in the email will only be valid once (or as many times as you allow). You could even tie this in with a login/password form. HTH! Matt Darby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is this possible in PHP?
I want a script that can display a list of all the websites currently hosted on my server.. (i have root access to the server) Say I have a page sitesonmyserver.php..it shud show a list of all the websites hosted on my server..eg: abc.com xyz.om And any additional info if possible? I'd make a script that went through the httpd.conf file with DOM and pulled out all the virtual hosts. Either that or looked at the home directory listings for each site. If this is what you were getting at (seeing as you mentioned root access and what-not), then read the next paragraph. If not, you can skip the next paragraph. This is quite a dangerous thing to do. Giving PHP root access to your server is like giving a homeless guy your credit card. Anyone can access the resources that PHP uses if they try hard enough. You might as well just hand every hacker on the web a little Post-It note with your root password on it. Is such a thing possible in PHP.. or does any such script exists? Definitely. If you take the right approach! I'd use a database. You could certainly find a class or script that could accomplish the database lookup that would get what you wanted. I'd start by reading the manual sections on mySQL database queries. http://us4.php.net/mysql Hope this helps! -- The Disguised Jedi [EMAIL PROTECTED] Now you have my $0.02. Or .01 Pounds, .014 Euros, or $0.025 CAN. I'm world-wide BABY! PHP rocks! Knowledge is Power. Power Corrupts. Go to school, become evil Disclaimer: Any disclaimer attached to this message may be ignored. However, I must say that the ENTIRE contents of this message are subject to other's criticism, corrections, and speculations. This message is Certified Virus Free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is this possible in PHP?
[EMAIL PROTECTED] wrote: I'd make a script that went through the httpd.conf file with DOM and pulled out all the virtual hosts. Either that or looked at the home directory listings for each site. If this is what you were getting at (seeing as you mentioned root access and what-not), then read the next paragraph. If not, you can skip the next paragraph. This is quite a dangerous thing to do. Giving PHP root access to your server is like giving a homeless guy your credit card. Anyone can access the resources that PHP uses if they try hard enough. You might as well just hand every hacker on the web a little Post-It note with your root password on it. Indeed it is. Why don't you have the httpd.conf then the virtual domains in another file (which is included into the httpd.conf). You can then use a cron to copy this (the vir doms) to another file (say the dir above webroot) and chown it to www:www for use with apache. PHP can then read this parse the ServerNames without having it read the root dirs or giving it special access rights. Cheers Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to save a file with UTF-8 encoding and noBOMusing PHP?
(Rasmus wrote:) If you fwrite UTF-8 data to the file, then it is a UTF-8 file. Thanks Rasmus! Honestly, that is REALLY helpful! I was just coming back here to post that I had found that very same answer. But I am glad to hear it confirmed by the experts. Bottom line: I was just being silly/ignorant. I went and downloaded a simple HEX editor and compared the actual binary output of several files that I had created using both PHP, and my favorite text editor (emeditor from emeditor.com). I then realized what probably everyone else here already knew: that (most of the time) the actual binary output from Windows 1252 and ISO-8859-1 and UTF-8 without the byte order mark -are completely identical! I had the false impression that when a file was saved in UTF-8, that there was an actual binary marker that specified this (e.g. binary marker = This file is saved in UTF-8!) -there simply is no such thing. The only thing that would set UTF-8 apart -binarilly speaking- is the BOM, and I had stripped that out, making the file exactly the same as plain old ANSI (since I didn't have any characters that required UTF-8, like from other languages etc.). My text editor displays the current character encoding in the status bar, but since there was no way for it to tell whether it was saved with Windows 1252 or UTF-8, it just displayed that the file was encoded windows default - ISO-8859-1. This is where I got confused. It turned out that my PHP script has been faithfully saving the file in UTF-8 the whole time, and everything was fine. I was just not educated enough about what actually changed when you save a file in UTF-8 but didn't have any characters that differed from ANSI (which in my case, the change was nothing, since ALL of the characters in my test document where interchangeable with ANSI). Well, this has been a learning experience! I hope that this post will help some poor ignoramus like myself, sometime in the future! :) And hopefully I am right about what I said above, and not flaunting my ignorance once again -lol Thanks again, to everyone who helped me! You guys really got me on the right track. Not the least of which was simply causing me to think about what I was asking more deeply. -Jon Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jon M. wrote: No matter what I do to the strings to encode them in whatever format before using fwrite, it ALWAYS seems to end up writing the actual file in iso-8859-1. Isn't the encoding of the characters in PHP's strings, and the encoding of the actual binary file on your hard drive, two totally different things? Or am I just misinformed? A file is completely defined by its contents. If you fwrite UTF-8 data to the file, then it is a UTF-8 file. Whether your editor, or whatever it is you are using to determine the file is being written as iso-8859-1 is smart enough to pick this up is a completely different question. Why don't you try creating the same contents with PHP and with your preferred text editor and then compare the contents. Perhaps your editor is dropping a hint somewhere in it that you are not writing to the file from PHP. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is this possible in PHP?
Hi! I want a script that can display a list of all the websites currently hosted on my server.. (i have root access to the server) Say I have a page sitesonmyserver.php..it shud show a list of all the websites hosted on my server..eg: abc.com xyz.om And any additional info if possible? Is such a thing possible in PHP.. or does any such script exists? Thanks in advance! Dasmeet SayOrange.com How to choose the best web hosting? http://www.sayorange.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] is this possible in PHP?
-Original Message- From: Dasmeet Singh [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 03, 2005 9:03 AM I want a script that can display a list of all the websites currently hosted on my server.. (i have root access to the server) Say I have a page sitesonmyserver.php..it shud show a list of all the websites hosted on my server..eg: abc.com xyz.om And any additional info if possible? Is such a thing possible in PHP.. or does any such script exists? If You´re running Apache, parse the httpd.conf and echo the line containing ServerName? -- Med venlig hilsen / best regards ComX Networks A/S Kim Madsen Systemudvikler/Systemdeveloper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to save a file with UTF-8 encoding and noBOM using PHP?
Thanks also, Richard! You were right on. Just a note: I just visited the W3C validation service again, and it seems they have recently updated it. It no longer complains if it finds a BOM in your document binary. So it would appear that it's no longer an issue with enough XML parsers to be relevant anymore. Still, it is nice to have a program -like I do- that has that flexibility. -Jon Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, April 28, 2005 4:14 am, Jon M. said: No matter what I do to the strings to encode them in whatever format before using fwrite, it ALWAYS seems to end up writing the actual file in iso-8859-1. How do you know? What are you using to determine the format of the file? We are contending that either you are *not* writing UTF-8 data, but are writing iso-8859-1 data, or the software telling you that it's not UTF-8 is just plain *wrong* fwrite just takes your data and dumps it on the hard drive. It doesn't know UTF-8 from U2. Isn't the encoding of the characters in PHP's strings, and the encoding of the actual binary file on your hard drive, two totally different things? Or am I just misinformed? You are mis-informed. How do you actually control the way the binary file itself is written, and not just the text that is saved in the file? If you are using Windows, then *WINDOWS* is, perhaps, guessing on the binary format based on the file 'extension' (.txt) and on the contents. First, try renaming the file to, err, whatever Windows thinks UTF-8 file extensions should be... .utf8 ??? Whatever Notepad uses. Next, forget what Windows desktop tells you. It's bull. When you get the data back out of the file, what format is it? PS You may be confusing Windows by writing UTF-8 without the BOM, and so Windows then thinksit's iso-8859-1, because it's no longer a valid UTF-8 file! You can make Windows happy; or you can make W3c happy. Not both. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is this possible in PHP?
Dasmeet Singh wrote: Hi! I want a script that can display a list of all the websites currently hosted on my server.. (i have root access to the server) Say I have a page sitesonmyserver.php..it shud show a list of all the websites hosted on my server..eg: abc.com xyz.om And any additional info if possible? Is such a thing possible in PHP.. or does any such script exists? Generally, no. You would need some black magic that probed the guts of your web server for this information. And by black magic I mean some low-level C code. A bit of grey magic I wrote almost exactly 9 years ago now! (May 1, 1996) in the form of Apache's mod_info module might help you out a little bit. If you define all your vhosts in your httpd.conf file and not in included files, then you can enable mod_info in your Apache config, and restrict access to the information to localhost with something like: Location /server-info SetHandler server-info Order deny,allow Deny from all Allow from 127.0.0.1 /Location Then your PHP code would hit your server's local /server-info link and parse it with something along the lines of: $info = file_get_contents('http://localhost/server-info?http_core.c'); preg_match_all('/.*servername .*?(\S+?).*/i',$info,$reg); $vhosts = $reg[1]; You may need to doublecheck that regex. I didn't actually test it. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to save a file with UTF-8 encoding and noBOM using PHP?
Jon M. wrote: No matter what I do to the strings to encode them in whatever format before using fwrite, it ALWAYS seems to end up writing the actual file in iso-8859-1. Isn't the encoding of the characters in PHP's strings, and the encoding of the actual binary file on your hard drive, two totally different things? Or am I just misinformed? A file is completely defined by its contents. If you fwrite UTF-8 data to the file, then it is a UTF-8 file. Whether your editor, or whatever it is you are using to determine the file is being written as iso-8859-1 is smart enough to pick this up is a completely different question. Why don't you try creating the same contents with PHP and with your preferred text editor and then compare the contents. Perhaps your editor is dropping a hint somewhere in it that you are not writing to the file from PHP. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to save a file with UTF-8 encoding and noBOM using PHP?
Wow, nice to hear from the guy who created PHP! :) I need to make 2 things clearer though: 1. First I want to know how to make the actual binary file that is written, to be encoded as UTF-8. This is my PRIMARY question. 2. How to have fwrite write the file without the BOM. (to make it more compatible with certain XML parsers -per the W3C's recommendation). No matter what I do to the strings to encode them in whatever format before using fwrite, it ALWAYS seems to end up writing the actual file in iso-8859-1. Isn't the encoding of the characters in PHP's strings, and the encoding of the actual binary file on your hard drive, two totally different things? Or am I just misinformed? Example: When I open up Windows Notepad, then I type some stuff into it, and then I choose file, save as, encoding: UTF-8, then I click save. So how do I do this SAME thing using PHP? Could someone give me a actual code example of how to do that? I'm just s lost. How do you actually control the way the binary file itself is written, and not just the text that is saved in the file? Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jon M. wrote: Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, April 21, 2005 5:07 pm, Jon M. said: I am trying to have a file that I generated with PHP saved as UTF-8 without the BOM (Byte Order Mark). Does PHP do anything like this? I am a beginner with PHP, but very technically experienced otherwise. I'm talking about the FILE encoding here -just to be clear. e.g. fopen(what_ever_file, a+) now I want PHP save the file itself with UTF-8, NOT system default. I have searched for hours to find an answer, but have not found any info on the subject. Does PHP have any ability to create a text file saved in UTF-8 encoding??? Maybe I'm just being dumb, but I think if you UTF-8 encode your data, and http://php.net/fwrite it, you're gonna get what you want... Dunno about the Byte-Order-Mark part, but I guess you could strip it out of the UTF-8 encoded data before writing, if you wanted to. -- Like Music? http://l-i-e.com/artists.htm That was the first thing I tried, and it doesn't seem to work (it always saves in windows default encoding). Unless I missing something about what you can do with fwrite. Did you actually test that before you replied, and found that it would? If so, how? The Byte Order Mark is a part of the binary file that is written, how would one go about stripping it out?? BTW, note to PHP developers: If fwrite had a encoding parameter, e.g. UTF-8, that would be REALLY handy. Strings in PHP are binary-safe and character-encoding neutral. fwrite doesn't have a clue what it is writing, it just writes what is in memory. I'd question why you would want to strip the BOM. Any modern system deals with the byte-order-mark correctly. But you can simply strip it manually if it is present in the first 2 bytes before your fwrite if you really need to get rid of it. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to save a file with UTF-8 encoding and noBOM using PHP?
1. First I want to know how to make the actual binary file that is written, to be encoded as UTF-8. This is my PRIMARY question. I think this part is the key. If the string originated from your text editor, then your text editor needs to be in UTF-8 mode. If you are importing the data from a file or database then you need to be sure that the data is UTF-8 encoded. If you know that the encoding is instead ISO-8859-1 then you can convert it to UTF-8 with the php function utf_encode. fwrite will then write out the bytes that you presented to it. I guess the same applies in reverse when you read the file back in to the application that will view the text. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php