Re: [PHP-DB] mysql_pconnect cannot create two permanent connections to the same machine ?
The code worked perfectly when databases 'bebbicell' and 'asterisk' were in the separate machines. It stopped working, when i copied the website to my machine. Aarno On 17 Jan 2006, at 18:48, Micah Stevens wrote: On Tuesday 17 January 2006 7:57 am, Aarno Syvänen wrote: Hi List, I do not claim that this is bug, but it is not a nice feature either. I do have following: ? /* db.php */ $db_server=127.0.0.1; $db_user = ** $db_pass = ** $db_db = bebbicell; $db_account_server=127.0.0.1; $db_account_user = $db_account_pass = $db_account_db = asterisk; //$level= error_reporting ( 0); $bid=mysql_pconnect($db_server,$db_user,$db_pass); //error_reporting ( $level); mysql_select_db($db_db,$bid); //$level= error_reporting ( 0); $accid=mysql_pconnect($db_account_server,$db_account_user, $db_account_pass); //error_reporting ( $level); mysql_select_db($db_account_db, $accid); ? Note that databases here are totally unrelated. They are on the same machine only because i am developing. I want later to move 'asterisk' to a separate machine, but when i do this, i want just change $db*s, not any other code. Because on this, i want both $bid and $accid to be valid handles. Currently it is not so. Both $res = mysql_query($sql,$accid); $err = mysql_error($accid); will generate error Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php And yes, there are no functions in signup.php. Aarno If you remove the $bid connection code, (comment it out) does your test code with $accid work? -Micah -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Problem with creating parallel connections with mysql_connect
Hi List, decided to try non-permanent connections for now. So now I have: ? /* db.php */ $db_server=127.0.0.1; $db_user = asterisk; $db_pass = bozzo984; $db_db = bebbicell; $db_account_server=127.0.0.1; $db_account_user = asterisk; $db_account_pass = bozzo984; $db_account_db = asterisk; $allow_multiple = true; //$level= error_reporting ( 0); $bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple); //error_reporting ( $level); mysql_select_db($db_db,$bid); //$level= error_reporting ( 0); $accid=mysql_connect($db_account_server,$db_account_user, $db_account_pass, $allow_multiple); //error_reporting ( $level); mysql_select_db($db_account_db, $accid); ? Still I have same error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 212 Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 213 Offending statements are: $res = mysql_query($sql,$accid); $err = mysql_error($accid); Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0 and Macintosh powerpc Aarno
Re: [PHP-DB] Refreshing text question!
Sorry I had misinterpreted your question Jerry.. I thought you were trying to refresh the page, missed that keyword :-) Therefore in context the page refresh would be quite annoying, I was only introducing its concept in order to reload the page at a different location. Again, my apologies for this.. Kind Regards, Julien Bonastre - Original Message - From: Aaron Koning [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, January 18, 2006 5:47 PM Subject: Re: [PHP-DB] Refreshing text question! I think that refreshing the web page with META Refresh every 5 or 10 seconds would surly P.O. anyone actually trying to read your web pages. Anyways: http://www.webreference.com/js/column3/ Or try googling the topic... Aaron On 1/17/06, Julien Bonastre [EMAIL PROTECTED] wrote: Yes I can help you there.. There is a technique you can use which is actually more browser friendly then the Javascript alternative you mentioned.. You can use the META tags in your page as such: META HTTP-EQUIV=refresh CONTENT=10 will refresh page in 10 seconds META HTTP-EQUIV=refresh CONTENT=10;url=http://www.operation-scifi.com; will reload page in 10 seconds and direct browser to one of my first highschool webpages.. For a quick reference I found this via the I'm Feeling Lucky of Google: http://webdesign.about.com/cs/metatags/a/aa080300a.htm Otherwise the good ole' W3C at www.w3c.org will have some great doco's on it too enjoy ;-) ---oOo--- Allowing users to execute CGI scripts in any directory should only be considered if: ... a.. You have no users, and nobody ever visits your server. ... Extracted Quote: Security Tips - Apache HTTP Server ---oOo--- --oOo---oOo-- Julien Bonastre [The_RadiX] The-Spectrum Network CEO ABN: 64 235 749 494 [EMAIL PROTECTED] www.the-spectrum.org --oOo---oOo-- - Original Message - From: JeRRy [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, January 18, 2006 11:51 AM Subject: [PHP-DB] Refreshing text question! Hi, I did a little bit of script that refreshes a text slogan every 5 or so seconds with a new slogans and wraps to each slogan, I had about 5, and loops over and over again. This was done WITHOUT the need of refreshing the page. I think I used JavaScript but not 100% sure of this. Has anyone seen this before I seen a site use it? I can't recall the site I did it for, I know I have done it before. I need the code again without needing to re-do it all again as it took me a while to configure it last time. The site is written in PHP and uses MySQL. Any help would be mostly appreciated. J - Do you Yahoo!? Messenger 7.0: Free worldwide PC to PC calls Incoming mail is certified Virus Free. Checked by AVG Anti-Virus (http://www.grisoft.com). Version: 7.0.148 / Virus Database: 267.14.20 - Release Date: 17/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Refreshing text question!
And in response, i was sort of heading there with my response.. Checkout my sexy 'quotes' engine on www.operation-scifi.com At bottom of page, there's a link HOVER ON THIS LINK (Click to change quote) click it to see the wowness effect Implementing this with a timeout function of JS is quite easy too.. Anyway, back to work for me.. ---oOo--- Allowing users to execute CGI scripts in any directory should only be considered if: ... a.. You have no users, and nobody ever visits your server. ... Extracted Quote: Security Tips - Apache HTTP Server ---oOo--- --oOo---oOo-- Julien Bonastre [The_RadiX] The-Spectrum Network CEO ABN: 64 235 749 494 [EMAIL PROTECTED] www.the-spectrum.org --oOo---oOo-- - Original Message - From: Julien Bonastre [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, January 18, 2006 8:08 PM Subject: Re: [PHP-DB] Refreshing text question! Sorry I had misinterpreted your question Jerry.. I thought you were trying to refresh the page, missed that keyword :-) Therefore in context the page refresh would be quite annoying, I was only introducing its concept in order to reload the page at a different location. Again, my apologies for this.. Kind Regards, Julien Bonastre - Original Message - From: Aaron Koning [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, January 18, 2006 5:47 PM Subject: Re: [PHP-DB] Refreshing text question! I think that refreshing the web page with META Refresh every 5 or 10 seconds would surly P.O. anyone actually trying to read your web pages. Anyways: http://www.webreference.com/js/column3/ Or try googling the topic... Aaron On 1/17/06, Julien Bonastre [EMAIL PROTECTED] wrote: Yes I can help you there.. There is a technique you can use which is actually more browser friendly then the Javascript alternative you mentioned.. You can use the META tags in your page as such: META HTTP-EQUIV=refresh CONTENT=10 will refresh page in 10 seconds META HTTP-EQUIV=refresh CONTENT=10;url=http://www.operation-scifi.com; will reload page in 10 seconds and direct browser to one of my first highschool webpages.. For a quick reference I found this via the I'm Feeling Lucky of Google: http://webdesign.about.com/cs/metatags/a/aa080300a.htm Otherwise the good ole' W3C at www.w3c.org will have some great doco's on it too enjoy ;-) ---oOo--- Allowing users to execute CGI scripts in any directory should only be considered if: ... a.. You have no users, and nobody ever visits your server. ... Extracted Quote: Security Tips - Apache HTTP Server ---oOo--- --oOo---oOo-- Julien Bonastre [The_RadiX] The-Spectrum Network CEO ABN: 64 235 749 494 [EMAIL PROTECTED] www.the-spectrum.org --oOo---oOo-- - Original Message - From: JeRRy [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Wednesday, January 18, 2006 11:51 AM Subject: [PHP-DB] Refreshing text question! Hi, I did a little bit of script that refreshes a text slogan every 5 or so seconds with a new slogans and wraps to each slogan, I had about 5, and loops over and over again. This was done WITHOUT the need of refreshing the page. I think I used JavaScript but not 100% sure of this. Has anyone seen this before I seen a site use it? I can't recall the site I did it for, I know I have done it before. I need the code again without needing to re-do it all again as it took me a while to configure it last time. The site is written in PHP and uses MySQL. Any help would be mostly appreciated. J - Do you Yahoo!? Messenger 7.0: Free worldwide PC to PC calls Incoming mail is certified Virus Free. Checked by AVG Anti-Virus (http://www.grisoft.com). Version: 7.0.148 / Virus Database: 267.14.20 - Release Date: 17/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 /
Re: [PHP-DB] Problem with creating parallel connections with mysql_connect
On Wed, 18 Jan 2006 19:51, Aarno Syvänen wrote: Hi List, decided to try non-permanent connections for now. So now I have: ? /* db.php */ $db_server=127.0.0.1; $db_user = asterisk; $db_pass = bozzo984; $db_db = bebbicell; $db_account_server=127.0.0.1; $db_account_user = asterisk; $db_account_pass = bozzo984; $db_account_db = asterisk; $allow_multiple = true; //$level= error_reporting ( 0); $bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple); echo mysql_error(); //error_reporting ( $level); mysql_select_db($db_db,$bid); echo mysql_error(); //$level= error_reporting ( 0); $accid=mysql_connect($db_account_server,$db_account_user, echo mysql_error(); $db_account_pass, $allow_multiple); //error_reporting ( $level); mysql_select_db($db_account_db, $accid); echo mysql_error(); ? Still I have same error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 212 Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 213 Offending statements are: $res = mysql_query($sql,$accid); echo mysql_error(); $err = mysql_error($accid); Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0 and Macintosh powerpc Aarno Try the above to find exactly where your problem is Cheers -- David Robley If I had anything witty to say, I wouldn't put it here. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Refreshing text question!
google 'rotating banner ad'...basically you hide stuff in divs/layers and show and hide the layers on a set timeout function with js bastien From: JeRRy [EMAIL PROTECTED] To: Julien Bonastre [EMAIL PROTECTED], php-db@lists.php.net Subject: Re: [PHP-DB] Refreshing text question! Date: Wed, 18 Jan 2006 23:41:02 +1100 (EST) Hi, No, no that is not what i am after, I know how to do that but it's not what I want. I wrote some code a year or so ago with words, they refreshed every 5 or so seconds WITHOUT REFRESHING THE PAGE. It was written in JavaScript as i can remember. But I can't find where I did it. I want to have the code or a similar one without the need to re-write it. The code does not require the page refreshing at all, just loops in a script and outputs. I might have to do some web surfing on it, pity I can't remeber where it is. If anyone could help that would be great. It's for a PHP site using MySQL. I am considering having the slogans in a database this time rather than just a text file. J Julien Bonastre [EMAIL PROTECTED] wrote: Yes I can help you there.. There is a technique you can use which is actually more browser friendly then the Javascript alternative you mentioned.. You can use the META tags in your page as such: will refresh page in 10 seconds CONTENT=10;url=http://www.operation-scifi.com; will reload page in 10 seconds and direct browser to one of my first highschool webpages.. For a quick reference I found this via the I'm Feeling Lucky of Google: http://webdesign.about.com/cs/metatags/a/aa080300a.htm Otherwise the good ole' W3C at www.w3c.org will have some great doco's on it too enjoy ;-) ---oOo--- Allowing users to execute CGI scripts in any directory should only be considered if: ... a.. You have no users, and nobody ever visits your server. ... Extracted Quote: Security Tips - Apache HTTP Server ---oOo--- --oOo---oOo-- Julien Bonastre [The_RadiX] The-Spectrum Network CEO ABN: 64 235 749 494 [EMAIL PROTECTED] www.the-spectrum.org --oOo---oOo-- - Original Message - From: JeRRy To: Sent: Wednesday, January 18, 2006 11:51 AM Subject: [PHP-DB] Refreshing text question! Hi, I did a little bit of script that refreshes a text slogan every 5 or so seconds with a new slogans and wraps to each slogan, I had about 5, and loops over and over again. This was done WITHOUT the need of refreshing the page. I think I used JavaScript but not 100% sure of this. Has anyone seen this before I seen a site use it? I can't recall the site I did it for, I know I have done it before. I need the code again without needing to re-do it all again as it took me a while to configure it last time. The site is written in PHP and uses MySQL. Any help would be mostly appreciated. J - Do you Yahoo!? Messenger 7.0: Free worldwide PC to PC calls Incoming mail is certified Virus Free. Checked by AVG Anti-Virus (http://www.grisoft.com). Version: 7.0.148 / Virus Database: 267.14.20 - Release Date: 17/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 - Do you Yahoo!? Find a local business fast with Yahoo! Local Search -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with creating parallel connections with mysql_connect
I go following debug: got error when doing first connection resource id was Resource id #3 got error when selecting first database got error when doing second connection resource id was Resource id #4 got error when selecting second database the code was: $bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple); //error_reporting ( $level); print got error . mysql_error() . when doing first connection\n; print resource id was $bid\n; mysql_select_db($db_db,$bid); print got error . mysql_error() . when selecting first database \n; //$level= error_reporting ( 0); $accid=mysql_connect($db_account_server,$db_account_user, $db_account_pass, $allow_multiple); print got error . mysql_error() . when doing second connection \n; print resource id was $accid\n; //error_reporting ( $level); mysql_select_db($db_account_db, $accid); print got error . mysql_error() . when selecting second database\n; So resource ids seem to be proper, and there is no errors either. Signup.php already tests $err: $err = mysql_error($accid); if($err==) { echo (BRBRp.lfunc (signup_successful).BRBR/p); } else { echo $err; } It branches to $err==, when at same time reporting Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 213 This looks really strange. Aarno On 18 Jan 2006, at 11:14, David Robley wrote: On Wed, 18 Jan 2006 19:51, Aarno Syvänen wrote: Hi List, decided to try non-permanent connections for now. So now I have: ? /* db.php */ $db_server=127.0.0.1; $db_user = asterisk; $db_pass = bozzo984; $db_db = bebbicell; $db_account_server=127.0.0.1; $db_account_user = asterisk; $db_account_pass = bozzo984; $db_account_db = asterisk; $allow_multiple = true; //$level= error_reporting ( 0); $bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple); echo mysql_error(); //error_reporting ( $level); mysql_select_db($db_db,$bid); echo mysql_error(); //$level= error_reporting ( 0); $accid=mysql_connect($db_account_server,$db_account_user, echo mysql_error(); $db_account_pass, $allow_multiple); //error_reporting ( $level); mysql_select_db($db_account_db, $accid); echo mysql_error(); ? Still I have same error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 212 Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 213 Offending statements are: $res = mysql_query($sql,$accid); echo mysql_error(); $err = mysql_error($accid); Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0 and Macintosh powerpc Aarno Try the above to find exactly where your problem is Cheers -- David Robley If I had anything witty to say, I wouldn't put it here. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Refreshing text question!
Two ways I can think of to update part of a page without doing a full refresh: 1. Use an IFRAME so you're technically updating a page, but it's the page within the frame (not my favorite but works ok) 2. Or you can use asynchronous javascript (AJAX) to update just that one section of the page without doing a refresh. Here's Rasmus' great primer on AJAX, should be easy enough to follow: http://www.time.gov/timezone.cgi?Eastern/d/-5/java One note I'd like to make that doesn't seem to be mentioned in a lot of AJAX tutorials. If the page your AJAX is calling doesn't have the standard do not cache tags, you sometimes won't get the results you want.. especially with Internet Explorer (in my experience). Here's a block I copy/pasted from somewhere that seems to work fine (covers most of the bases and all): header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified header(Cache-Control: no-store, no-cache, must-revalidate); // HTTP/1.1 header(Cache-Control: post-check=0, pre-check=0, false); // HTTP/1.1 header(Pragma: no-cache); // HTTP/1.0 good luck! -TG = = = Original message = = = Hi, No, no that is not what i am after, I know how to do that but it's not what I want. I wrote some code a year or so ago with words, they refreshed every 5 or so seconds WITHOUT REFRESHING THE PAGE. It was written in JavaScript as i can remember. But I can't find where I did it. I want to have the code or a similar one without the need to re-write it. The code does not require the page refreshing at all, just loops in a script and outputs. I might have to do some web surfing on it, pity I can't remeber where it is. If anyone could help that would be great. It's for a PHP site using MySQL. I am considering having the slogans in a database this time rather than just a text file. J Julien Bonastre [EMAIL PROTECTED] wrote: Yes I can help you there.. There is a technique you can use which is actually more browser friendly then the Javascript alternative you mentioned.. You can use the META tags in your page as such: will refresh page in 10 seconds CONTENT=10;url=http://www.operation-scifi.com; will reload page in 10 seconds and direct browser to one of my first highschool webpages.. For a quick reference I found this via the I'm Feeling Lucky of Google: http://webdesign.about.com/cs/metatags/a/aa080300a.htm Otherwise the good ole' W3C at www.w3c.org will have some great doco's on it too enjoy ;-) ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with creating parallel connections with mysql_connect
If no connection is made, there is no mysql error. You would need some custom error message output when the mysql_connect fails... Bastien From: Aarno Syvänen [EMAIL PROTECTED] To: David Robley [EMAIL PROTECTED] CC: php-db@lists.php.net Subject: Re: [PHP-DB] Problem with creating parallel connections with mysql_connect Date: Wed, 18 Jan 2006 15:30:44 +0100 I go following debug: got error when doing first connection resource id was Resource id #3 got error when selecting first database got error when doing second connection resource id was Resource id #4 got error when selecting second database the code was: $bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple); //error_reporting ( $level); print got error . mysql_error() . when doing first connection\n; print resource id was $bid\n; mysql_select_db($db_db,$bid); print got error . mysql_error() . when selecting first database \n; //$level= error_reporting ( 0); $accid=mysql_connect($db_account_server,$db_account_user, $db_account_pass, $allow_multiple); print got error . mysql_error() . when doing second connection \n; print resource id was $accid\n; //error_reporting ( $level); mysql_select_db($db_account_db, $accid); print got error . mysql_error() . when selecting second database\n; So resource ids seem to be proper, and there is no errors either. Signup.php already tests $err: $err = mysql_error($accid); if($err==) { echo (BRBRp.lfunc (signup_successful).BRBR/p); } else { echo $err; } It branches to $err==, when at same time reporting Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 213 This looks really strange. Aarno On 18 Jan 2006, at 11:14, David Robley wrote: On Wed, 18 Jan 2006 19:51, Aarno Syvänen wrote: Hi List, decided to try non-permanent connections for now. So now I have: ? /* db.php */ $db_server=127.0.0.1; $db_user = asterisk; $db_pass = bozzo984; $db_db = bebbicell; $db_account_server=127.0.0.1; $db_account_user = asterisk; $db_account_pass = bozzo984; $db_account_db = asterisk; $allow_multiple = true; //$level= error_reporting ( 0); $bid=mysql_connect($db_server,$db_user,$db_pass, $allow_multiple); echo mysql_error(); //error_reporting ( $level); mysql_select_db($db_db,$bid); echo mysql_error(); //$level= error_reporting ( 0); $accid=mysql_connect($db_account_server,$db_account_user, echo mysql_error(); $db_account_pass, $allow_multiple); //error_reporting ( $level); mysql_select_db($db_account_db, $accid); echo mysql_error(); ? Still I have same error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 212 Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/bebbicell.ch/signup.php on line 213 Offending statements are: $res = mysql_query($sql,$accid); echo mysql_error(); $err = mysql_error($accid); Note that I use php-5.1.2RC1 compiled for Darwin Kernel Version 8.3.0 and Macintosh powerpc Aarno Try the above to find exactly where your problem is Cheers -- David Robley If I had anything witty to say, I wouldn't put it here. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Refreshing text question!
js rotating banner system http://www.dyn-web.com/dhtml/banners/ bastien From: [EMAIL PROTECTED] To: php-db@lists.php.net CC: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Refreshing text question! Date: Wed, 18 Jan 2006 11:26:15 -0500 Ooops... here's the real link: http://rajshekhar.net/blog/archives/85-Rasmus-30-second-AJAX-Tutorial.html = = = Original message = = = Two ways I can think of to update part of a page without doing a full refresh: 1. Use an IFRAME so you're technically updating a page, but it's the page within the frame (not my favorite but works ok) 2. Or you can use asynchronous javascript (AJAX) to update just that one section of the page without doing a refresh. Here's Rasmus' great primer on AJAX, should be easy enough to follow: http://www.time.gov/timezone.cgi?Eastern/d/-5/java One note I'd like to make that doesn't seem to be mentioned in a lot of AJAX tutorials. If the page your AJAX is calling doesn't have the standard do not cache tags, you sometimes won't get the results you want.. especially with Internet Explorer (in my experience). Here's a block I copy/pasted from somewhere that seems to work fine (covers most of the bases and all): header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past header(Last-Modified: . gmdate(D, d M Y H:i:s) . GMT); // always modified header(Cache-Control: no-store, no-cache, must-revalidate); // HTTP/1.1 header(Cache-Control: post-check=0, pre-check=0, false); // HTTP/1.1 header(Pragma: no-cache); // HTTP/1.0 good luck! -TG = = = Original message = = = Hi, No, no that is not what i am after, I know how to do that but it's not what I want. I wrote some code a year or so ago with words, they refreshed every 5 or so seconds WITHOUT REFRESHING THE PAGE. It was written in JavaScript as i can remember. But I can't find where I did it. I want to have the code or a similar one without the need to re-write it. The code does not require the page refreshing at all, just loops in a script and outputs. I might have to do some web surfing on it, pity I can't remeber where it is. If anyone could help that would be great. It's for a PHP site using MySQL. I am considering having the slogans in a database this time rather than just a text file. J Julien Bonastre [EMAIL PROTECTED] wrote: Yes I can help you there.. There is a technique you can use which is actually more browser friendly then the Javascript alternative you mentioned.. You can use the META tags in your page as such: will refresh page in 10 seconds CONTENT=10;url=http://www.operation-scifi.com; will reload page in 10 seconds and direct browser to one of my first highschool webpages.. For a quick reference I found this via the I'm Feeling Lucky of Google: http://webdesign.about.com/cs/metatags/a/aa080300a.htm Otherwise the good ole' W3C at www.w3c.org will have some great doco's on it too enjoy ;-) ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How can I solve this?
Hi everyone, I am using PHP_SELF in order to get the current path on a dynamically created webpage. This gives me the following: /my_website/index.php My problem is, ALL I NEED is the directory name - no / or no index.php, how can I strip these out to leave JUST the folder name the file is located in? I need this because the page is dynamically created, and it gets templated information from a database and needs to use the foldername as the identifier between the DB entry to use for grabbing the information and the pages inside the directory. Any help would be really appreciated and I'm certain it's something REALLY obvious. Chris
Re: [PHP-DB] How can I solve this?
try $x =pathinfo($_SERVER['PHP_SELF']); echo $x['dirname']; =C= | | Cal Evans | http://blog.calevans.com | | Chris Payne wrote: Hi everyone, I am using PHP_SELF in order to get the current path on a dynamically created webpage. This gives me the following: /my_website/index.php My problem is, ALL I NEED is the directory name - no / or no index.php, how can I strip these out to leave JUST the folder name the file is located in? I need this because the page is dynamically created, and it gets templated information from a database and needs to use the foldername as the identifier between the DB entry to use for grabbing the information and the pages inside the directory. Any help would be really appreciated and I'm certain it's something REALLY obvious. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] How can I solve this?
Wonderful thank you, it displays a single / before the dir name but I can remove that without too much trouble :-) Thank you. Chris try $x =pathinfo($_SERVER['PHP_SELF']); echo $x['dirname']; =C= | | Cal Evans | http://blog.calevans.com | | Chris Payne wrote: Hi everyone, I am using PHP_SELF in order to get the current path on a dynamically created webpage. This gives me the following: /my_website/index.php My problem is, ALL I NEED is the directory name - no / or no index.php, how can I strip these out to leave JUST the folder name the file is located in? I need this because the page is dynamically created, and it gets templated information from a database and needs to use the foldername as the identifier between the DB entry to use for grabbing the information and the pages inside the directory. Any help would be really appreciated and I'm certain it's something REALLY obvious. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] How can I solve this?
Two alternatives.. dirname(); returns basically just the path, same string as using pathinfo[dirname] but saves that array step.. or back to the love of my life [well, the non-human one]: preg_replace(/^\/?(.*)\/[\w]+\.php$/,$1,$PHP_SELF) that strips that leading forward slash too ;-) by love of my life I mean, Regular Expressions, not that particular one :P ciao - Original Message - From: Chris Payne [EMAIL PROTECTED] To: php-db@lists.php.net Sent: Thursday, January 19, 2006 3:58 AM Subject: RE: [PHP-DB] How can I solve this? Wonderful thank you, it displays a single / before the dir name but I can remove that without too much trouble :-) Thank you. Chris try $x =pathinfo($_SERVER['PHP_SELF']); echo $x['dirname']; =C= | | Cal Evans | http://blog.calevans.com | | Chris Payne wrote: Hi everyone, I am using PHP_SELF in order to get the current path on a dynamically created webpage. This gives me the following: /my_website/index.php My problem is, ALL I NEED is the directory name - no / or no index.php, how can I strip these out to leave JUST the folder name the file is located in? I need this because the page is dynamically created, and it gets templated information from a database and needs to use the foldername as the identifier between the DB entry to use for grabbing the information and the pages inside the directory. Any help would be really appreciated and I'm certain it's something REALLY obvious. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 18/01/2006 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.375 / Virus Database: 267.14.20/234 - Release Date: 18/01/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: is this possible in one query?
Sjef Janssen schrieb: Hi there, I have a table that keeps names for different language codes. In a short example: nameId name languageCode 31 House EN 31 Wohnung DE 32 Piece En 32 Stuck De 33 Car EN 33 PKW DE What I would like is to have a query that returns for example: nameId = 31 Names = House - Wohnung Maybe I can even have a result that consists of an array with nameIds and Names. Or should I fire a bunch of queries after each other to have this result? I use mysql and php 4.3.8 Tnxs!! SELECT nameId, GROUP_CONCAT(name SEPARATOR ' - ') AS names FROM table GROUP BY nameId I think that will do it. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] FTPing within PHP
I am wondering if I may delete a file by FTPing within PHP. I found the followed on the PHP web site: fopen(ftp://user:[EMAIL PROTECTED]/somefile.txt, w); Is there a way for me to delete somefile.txt ? The FTP program on my computer gives the command DELE /path/somefile.txt Is there a way for me to send this command through? I also need to know the command to disconnect --- and wonder if someone could tell me it. Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] FTPing within PHP
On Thu, 19 Jan 2006 14:38, Ron Piggott (PHP) wrote: I am wondering if I may delete a file by FTPing within PHP. I found the followed on the PHP web site: fopen(ftp://user:[EMAIL PROTECTED]/somefile.txt, w); Is there a way for me to delete somefile.txt ? The FTP program on my computer gives the command DELE /path/somefile.txt Is there a way for me to send this command through? I also need to know the command to disconnect --- and wonder if someone could tell me it. Ron All is revealed at http://php.net/ftp Cheers -- David Robley FLOPPY DISK: Serious curvature of the spine. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Refreshing text question!
Hi, Thanks for people that have commented and responsed. One stated my question had nothing to do with PHP and MySQL. Hang on to your horses, 90% oif the people that responded responded in an incorrect method I needed. Hence the appologies soon blooded in but thanks for the meta refresh but I know how to do this but thanks again! Now regarding It's not a PHP/MySQL question You too have FAILED to read my question correctly. It's certainly the funny season. I stated in my posting I will throwing the slogans/quotes in a db, fetching them and handling them in a db. Hence it will be as it's on a PHP page as I stated. In the end I did what I did on the first porject I did something like this and actually re-wrote the code. I have it like this: http://www.tassiedemononline.org.au/~bps/ Click through the alert thing, that is for the owners. The site is way early devolopment. But you'll see a manual picture in the main page, under it is the refreshing text I was talking about and wanted. (Hard to explain) I actually enhanced the code a bit so I could change font size of the text, text colour and lots more. My first attempt at it would only output in plain text. What not ideal for this sort of site. Thanks for peoples assistance though, I am not sure what they call this sort of text refreshing. Jerry - Do you Yahoo!? Yahoo! News: Get the latest news via video today!
[PHP-DB] Re: Refreshing text question!
JeRRy wrote: Hi, Thanks for people that have commented and responsed. One stated my question had nothing to do with PHP and MySQL. Hang on to your horses, 90% oif the people that responded responded in an incorrect method I needed. Hence the appologies soon blooded in but thanks for the meta refresh but I know how to do this but thanks again! Now regarding It's not a PHP/MySQL question You too have FAILED to read my question correctly. It's certainly the funny season. I stated in my posting I will throwing the slogans/quotes in a db, fetching them and handling them in a db. Hence it will be as it's on a PHP page as I stated. Well, seeing you are maybe serving this using apache, perhaps it is more properly an apache question? But wait, apache runs under $OS so really it is a question for the $OS mailing list? :-) Sure, you might be getting the data via php/mysql, but the actual method you use to make the outcome how you want it, is not php. I just had to say that before the real pedants on the list get started :-) Cheers -- David Robley If you're not confused, you're not paying attention. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php