Re: [PHP-DB] Page refresh question
Hi, I can think of 2 solutions: 1 is an old one I used ages ago, and it was to use javascript to put their choices (onclick, field.value=£3 type of thing) and when they click the OK button it gets sent to php script that sends it to mysql, etc. 2 is pretty much the same but using cookies with javascript. Example : -- <!-- Hide from old browsers //Hide from Java Script function cookieVal(cookieName) { thisCookie = document.cookie.split("; "); for (i=0; i<thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } //--> <!-- Hide from old browsers //Hide from Java Script function SetCookie(value1,value2,value3){ var greetName = cookieVal("mysession"); if(greetName == 0){ document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme= value +":1%"; } else{ document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme = value +":1%"; } theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; winName="order3"; features="scrollbars=yes,width=400,height=600"; child = window.open(theURL,winName,features); child.focus(); } //--> ">Hope this helps. Han. - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> To: Sent: Thursday, June 09, 2005 5:33 AM Subject: [PHP-DB] Page refresh question > Hi there everyone, > > > > I'm using PHP and MySQL in a shopping cart system but the client wants it > so > that when you add an item to the cart the page doesn't refresh and we all > know with PHP the page MUST refresh in order to execute the MySQL query. > Is > it possible, maybe with javascript? That I can talk to MySQL without > having > to have the page itself refresh when they add the items to the cart? This > is really a pain as the system was basically finished and now I'm told > they > don't want the page to refresh and they see other sites that don't > refresh - > sigh. If it can be done with Javascript, do you have a sample of how I > can > use PHP, Javascript and MySQL together to achieve this please? > > > > Any help would not only be appreciated, but would save my life. > > > > Thank you. > > > > Chris > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. <<<>>>AdmID:2C0189DC9073A0C27125545E07598202 ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and t
Re: [PHP-DB] Page refresh question
i think that the best solution is to use XMLHttpRequest mihai ps. i don't think is a good idea to save the shopping cart in a cookie on client side (i can alter, as a client, the prices from shopping cart) Han wrote: > Hi, > > I can think of 2 solutions: > > 1 is an old one I used ages ago, and it was to use javascript to put > their choices (onclick, field.value=£3 type of thing) and when they > click the OK button it gets sent to php script that sends it to mysql, etc. > > 2 is pretty much the same but using cookies with javascript. > > > Example : -- > > > > <!-- Hide from old browsers > //Hide from Java Script > > function cookieVal(cookieName) { > thisCookie = document.cookie.split("; "); > for (i=0; i<thisCookie.length; i++) { > if (cookieName == thisCookie[i].split("=")[0]) { > return thisCookie[i].split("=")[1]; > } >} > return 0; >} > > //--> > > > > <!-- Hide from old browsers > //Hide from Java Script > > function SetCookie(value1,value2,value3){ > var greetName = cookieVal("mysession"); > > if(greetName == 0){ > document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + > value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme= value +":1%"; > } > else{ > document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 > + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme = value +":1%"; > } > > theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; > winName="order3"; > features="scrollbars=yes,width=400,height=600"; > > child = window.open(theURL,winName,features); > child.focus(); > > } > > //--> > > hspace="5" vspace="3" border="0" > onClick="javascript:SetCookie('555435,£3,image1');">">Hope this helps. > > > Han. > > > > - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> > To: > Sent: Thursday, June 09, 2005 5:33 AM > Subject: [PHP-DB] Page refresh question > > >> Hi there everyone, >> >> >> >> I'm using PHP and MySQL in a shopping cart system but the client wants >> it so >> that when you add an item to the cart the page doesn't refresh and we all >> know with PHP the page MUST refresh in order to execute the MySQL >> query. Is >> it possible, maybe with javascript? That I can talk to MySQL without >> having >> to have the page itself refresh when they add the items to the cart? >> This >> is really a pain as the system was basically finished and now I'm told >> they >> don't want the page to refresh and they see other sites that don't >> refresh - >> sigh. If it can be done with Javascript, do you have a sample of how >> I can >> use PHP, Javascript and MySQL together to achieve this please? >> >> >> >> Any help would not only be appreciated, but would save my life. >> >> >> >> Thank you. >> >> >> >> Chris >> >> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. *
Re: [PHP-DB] Page refresh question
Hi, I can think of 2 solutions: 1 is an old one I used ages ago, and it was to use javascript to put their choices (onclick, field.value=£3 type of thing) and when they click the OK button it gets sent to php script that sends it to mysql, etc. 2 is pretty much the same but using cookies with javascript. Example : -- <!-- Hide from old browsers //Hide from Java Script function cookieVal(cookieName) { thisCookie = document.cookie.split("; "); for (i=0; i<thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } //--> <!-- Hide from old browsers //Hide from Java Script function SetCookie(value1,value2,value3){ var greetName = cookieVal("mysession"); if(greetName == 0){ document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme= value +":1%"; } else{ document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme = value +":1%"; } theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; winName="order3"; features="scrollbars=yes,width=400,height=600"; child = window.open(theURL,winName,features); child.focus(); } //--> ">Hope this helps. Han. - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> To: Sent: Thursday, June 09, 2005 5:33 AM Subject: [PHP-DB] Page refresh question > Hi there everyone, > > > > I'm using PHP and MySQL in a shopping cart system but the client wants it > so > that when you add an item to the cart the page doesn't refresh and we all > know with PHP the page MUST refresh in order to execute the MySQL query. > Is > it possible, maybe with javascript? That I can talk to MySQL without > having > to have the page itself refresh when they add the items to the cart? This > is really a pain as the system was basically finished and now I'm told > they > don't want the page to refresh and they see other sites that don't > refresh - > sigh. If it can be done with Javascript, do you have a sample of how I > can > use PHP, Javascript and MySQL together to achieve this please? > > > > Any help would not only be appreciated, but would save my life. > > > > Thank you. > > > > Chris > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. <<<>>>AdmID:2C0189DC9073A0C27125545E07598202 ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and t
Re: [PHP-DB] Page refresh question
i think that the best solution is to use XMLHttpRequest mihai ps. i don't think is a good idea to save the shopping cart in a cookie on client side (i can alter, as a client, the prices from shopping cart) Han wrote: > Hi, > > I can think of 2 solutions: > > 1 is an old one I used ages ago, and it was to use javascript to put > their choices (onclick, field.value=£3 type of thing) and when they > click the OK button it gets sent to php script that sends it to mysql, etc. > > 2 is pretty much the same but using cookies with javascript. > > > Example : -- > > > > <!-- Hide from old browsers > //Hide from Java Script > > function cookieVal(cookieName) { > thisCookie = document.cookie.split("; "); > for (i=0; i<thisCookie.length; i++) { > if (cookieName == thisCookie[i].split("=")[0]) { > return thisCookie[i].split("=")[1]; > } >} > return 0; >} > > //--> > > > > <!-- Hide from old browsers > //Hide from Java Script > > function SetCookie(value1,value2,value3){ > var greetName = cookieVal("mysession"); > > if(greetName == 0){ > document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + > value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme= value +":1%"; > } > else{ > document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 > + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme = value +":1%"; > } > > theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; > winName="order3"; > features="scrollbars=yes,width=400,height=600"; > > child = window.open(theURL,winName,features); > child.focus(); > > } > > //--> > > hspace="5" vspace="3" border="0" > onClick="javascript:SetCookie('555435,£3,image1');">">Hope this helps. > > > Han. > > > > - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> > To: > Sent: Thursday, June 09, 2005 5:33 AM > Subject: [PHP-DB] Page refresh question > > >> Hi there everyone, >> >> >> >> I'm using PHP and MySQL in a shopping cart system but the client wants >> it so >> that when you add an item to the cart the page doesn't refresh and we all >> know with PHP the page MUST refresh in order to execute the MySQL >> query. Is >> it possible, maybe with javascript? That I can talk to MySQL without >> having >> to have the page itself refresh when they add the items to the cart? >> This >> is really a pain as the system was basically finished and now I'm told >> they >> don't want the page to refresh and they see other sites that don't >> refresh - >> sigh. If it can be done with Javascript, do you have a sample of how >> I can >> use PHP, Javascript and MySQL together to achieve this please? >> >> >> >> Any help would not only be appreciated, but would save my life. >> >> >> >> Thank you. >> >> >> >> Chris >> >> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. *
Re: [PHP-DB] Page refresh question
i think that the best solution is to use XMLHttpRequest mihai ps. i don't think is a good idea to save the shopping cart in a cookie on client side (i can alter, as a client, the prices from shopping cart) Han wrote: > Hi, > > I can think of 2 solutions: > > 1 is an old one I used ages ago, and it was to use javascript to put > their choices (onclick, field.value=£3 type of thing) and when they > click the OK button it gets sent to php script that sends it to mysql, etc. > > 2 is pretty much the same but using cookies with javascript. > > > Example : -- > > > > <!-- Hide from old browsers > //Hide from Java Script > > function cookieVal(cookieName) { > thisCookie = document.cookie.split("; "); > for (i=0; i<thisCookie.length; i++) { > if (cookieName == thisCookie[i].split("=")[0]) { > return thisCookie[i].split("=")[1]; > } >} > return 0; >} > > //--> > > > > <!-- Hide from old browsers > //Hide from Java Script > > function SetCookie(value1,value2,value3){ > var greetName = cookieVal("mysession"); > > if(greetName == 0){ > document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + > value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme= value +":1%"; > } > else{ > document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 > + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme = value +":1%"; > } > > theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; > winName="order3"; > features="scrollbars=yes,width=400,height=600"; > > child = window.open(theURL,winName,features); > child.focus(); > > } > > //--> > > hspace="5" vspace="3" border="0" > onClick="javascript:SetCookie('555435,£3,image1');">">Hope this helps. > > > Han. > > > > - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> > To: > Sent: Thursday, June 09, 2005 5:33 AM > Subject: [PHP-DB] Page refresh question > > >> Hi there everyone, >> >> >> >> I'm using PHP and MySQL in a shopping cart system but the client wants >> it so >> that when you add an item to the cart the page doesn't refresh and we all >> know with PHP the page MUST refresh in order to execute the MySQL >> query. Is >> it possible, maybe with javascript? That I can talk to MySQL without >> having >> to have the page itself refresh when they add the items to the cart? >> This >> is really a pain as the system was basically finished and now I'm told >> they >> don't want the page to refresh and they see other sites that don't >> refresh - >> sigh. If it can be done with Javascript, do you have a sample of how >> I can >> use PHP, Javascript and MySQL together to achieve this please? >> >> >> >> Any help would not only be appreciated, but would save my life. >> >> >> >> Thank you. >> >> >> >> Chris >> >> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. *
Re: [PHP-DB] Page refresh question
Hi, I can think of 2 solutions: 1 is an old one I used ages ago, and it was to use javascript to put their choices (onclick, field.value=£3 type of thing) and when they click the OK button it gets sent to php script that sends it to mysql, etc. 2 is pretty much the same but using cookies with javascript. Example : -- <!-- Hide from old browsers //Hide from Java Script function cookieVal(cookieName) { thisCookie = document.cookie.split("; "); for (i=0; i<thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } //--> <!-- Hide from old browsers //Hide from Java Script function SetCookie(value1,value2,value3){ var greetName = cookieVal("mysession"); if(greetName == 0){ document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme= value +":1%"; } else{ document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme = value +":1%"; } theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; winName="order3"; features="scrollbars=yes,width=400,height=600"; child = window.open(theURL,winName,features); child.focus(); } //--> ">Hope this helps. Han. - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> To: Sent: Thursday, June 09, 2005 5:33 AM Subject: [PHP-DB] Page refresh question > Hi there everyone, > > > > I'm using PHP and MySQL in a shopping cart system but the client wants it > so > that when you add an item to the cart the page doesn't refresh and we all > know with PHP the page MUST refresh in order to execute the MySQL query. > Is > it possible, maybe with javascript? That I can talk to MySQL without > having > to have the page itself refresh when they add the items to the cart? This > is really a pain as the system was basically finished and now I'm told > they > don't want the page to refresh and they see other sites that don't > refresh - > sigh. If it can be done with Javascript, do you have a sample of how I > can > use PHP, Javascript and MySQL together to achieve this please? > > > > Any help would not only be appreciated, but would save my life. > > > > Thank you. > > > > Chris > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. <<<>>>AdmID:2C0189DC9073A0C27125545E07598202 ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in i
Re: [PHP-DB] Page refresh question
You may also open a sized new window where the update takes place and the user has a confirmation and a close button. Stéphane On Thu, 2005-06-09 at 04:32, Bobo Wieland wrote: > ...or if everything else fail, do it the ugly-hack style and us a > frameset with an 1 px wide frame where you update the db... just target > the update to the "invisible" frame and only that gets updated... > > _bobo www.bitbob.biz > > Chris Payne wrote: > > >Hi there everyone, > > > > > > > >I'm using PHP and MySQL in a shopping cart system but the client wants it so > >that when you add an item to the cart the page doesn't refresh and we all > >know with PHP the page MUST refresh in order to execute the MySQL query. Is > >it possible, maybe with javascript? That I can talk to MySQL without having > >to have the page itself refresh when they add the items to the cart? This > >is really a pain as the system was basically finished and now I'm told they > >don't want the page to refresh and they see other sites that don't refresh - > >sigh. If it can be done with Javascript, do you have a sample of how I can > >use PHP, Javascript and MySQL together to achieve this please? > > > > > > > >Any help would not only be appreciated, but would save my life. > > > > > > > >Thank you. > > > > > > > >Chris > > > > > > > > > > -- > > _bobo wieland _ [EMAIL PROTECTED] _ > winamp >> aphex twin cd 2 | -ziggomatic v17 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. <<<>>>AdmID:2C0189DC9073A0C27125545E07598202 ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. <<<>>> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Page refresh question
Hi, I can think of 2 solutions: 1 is an old one I used ages ago, and it was to use javascript to put their choices (onclick, field.value=£3 type of thing) and when they click the OK button it gets sent to php script that sends it to mysql, etc. 2 is pretty much the same but using cookies with javascript. Example : -- <!-- Hide from old browsers //Hide from Java Script function cookieVal(cookieName) { thisCookie = document.cookie.split("; "); for (i=0; i<thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } //--> <!-- Hide from old browsers //Hide from Java Script function SetCookie(value1,value2,value3){ var greetName = cookieVal("mysession"); if(greetName == 0){ document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme= value +":1%"; } else{ document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; var addme = value +":1%"; } theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; winName="order3"; features="scrollbars=yes,width=400,height=600"; child = window.open(theURL,winName,features); child.focus(); } //--> ">Hope this helps. Han. - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> To: Sent: Thursday, June 09, 2005 5:33 AM Subject: [PHP-DB] Page refresh question > Hi there everyone, > > > > I'm using PHP and MySQL in a shopping cart system but the client wants it > so > that when you add an item to the cart the page doesn't refresh and we all > know with PHP the page MUST refresh in order to execute the MySQL query. > Is > it possible, maybe with javascript? That I can talk to MySQL without > having > to have the page itself refresh when they add the items to the cart? This > is really a pain as the system was basically finished and now I'm told > they > don't want the page to refresh and they see other sites that don't > refresh - > sigh. If it can be done with Javascript, do you have a sample of how I > can > use PHP, Javascript and MySQL together to achieve this please? > > > > Any help would not only be appreciated, but would save my life. > > > > Thank you. > > > > Chris > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. <<<>>>AdmID:2C0189DC9073A0C27125545E07598202 ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it
Re: [PHP-DB] Page refresh question
i think that the best solution is to use XMLHttpRequest mihai ps. i don't think is a good idea to save the shopping cart in a cookie on client side (i can alter, as a client, the prices from shopping cart) Han wrote: > Hi, > > I can think of 2 solutions: > > 1 is an old one I used ages ago, and it was to use javascript to put > their choices (onclick, field.value=£3 type of thing) and when they > click the OK button it gets sent to php script that sends it to mysql, etc. > > 2 is pretty much the same but using cookies with javascript. > > > Example : -- > > > > <!-- Hide from old browsers > //Hide from Java Script > > function cookieVal(cookieName) { > thisCookie = document.cookie.split("; "); > for (i=0; i<thisCookie.length; i++) { > if (cookieName == thisCookie[i].split("=")[0]) { > return thisCookie[i].split("=")[1]; > } >} > return 0; >} > > //--> > > > > <!-- Hide from old browsers > //Hide from Java Script > > function SetCookie(value1,value2,value3){ > var greetName = cookieVal("mysession"); > > if(greetName == 0){ > document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + > value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme= value +":1%"; > } > else{ > document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 > + ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; > var addme = value +":1%"; > } > > theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; > winName="order3"; > features="scrollbars=yes,width=400,height=600"; > > child = window.open(theURL,winName,features); > child.focus(); > > } > > //--> > > hspace="5" vspace="3" border="0" > onClick="javascript:SetCookie('555435,£3,image1');">">Hope this helps. > > > Han. > > > > - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> > To: > Sent: Thursday, June 09, 2005 5:33 AM > Subject: [PHP-DB] Page refresh question > > >> Hi there everyone, >> >> >> >> I'm using PHP and MySQL in a shopping cart system but the client wants >> it so >> that when you add an item to the cart the page doesn't refresh and we all >> know with PHP the page MUST refresh in order to execute the MySQL >> query. Is >> it possible, maybe with javascript? That I can talk to MySQL without >> having >> to have the page itself refresh when they add the items to the cart? >> This >> is really a pain as the system was basically finished and now I'm told >> they >> don't want the page to refresh and they see other sites that don't >> refresh - >> sigh. If it can be done with Javascript, do you have a sample of how >> I can >> use PHP, Javascript and MySQL together to achieve this please? >> >> >> >> Any help would not only be appreciated, but would save my life. >> >> >> >> Thank you. >> >> >> >> Chris >> >> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** IMPORTANT NOTICE This communication is for the exclusive use of the intended recipient(s) named above. If you receive this communication in error, you should notify the sender by e-mail or by telephone (+44) 191 224 4461, delete it and destroy any copies of it. This communication may contain confidential information and material protected by copyright, design right or other intellectual property rights which are and shall remain the property of Piranha Studios Limited. Any form of distribution, copying or other unauthorised use of this communication or the information in it is strictly prohibited. Piranha Studios Limited asserts its rights in this communication and the information in it and reserves the right to take action against anyone who misuses it or the information in it. Piranha Studios Limited cannot accept any liability sustained as a result of software viruses and would recommend that you carry out your own virus checks before opening any attachment. *
Re: [PHP-DB] Page refresh question
You may also open a sized new window where the update takes place and the user has a confirmation and a close button. Stéphane On Thu, 2005-06-09 at 04:32, Bobo Wieland wrote: > ...or if everything else fail, do it the ugly-hack style and us a > frameset with an 1 px wide frame where you update the db... just target > the update to the "invisible" frame and only that gets updated... > > _bobo www.bitbob.biz > > Chris Payne wrote: > > >Hi there everyone, > > > > > > > >I'm using PHP and MySQL in a shopping cart system but the client wants it so > >that when you add an item to the cart the page doesn't refresh and we all > >know with PHP the page MUST refresh in order to execute the MySQL query. Is > >it possible, maybe with javascript? That I can talk to MySQL without having > >to have the page itself refresh when they add the items to the cart? This > >is really a pain as the system was basically finished and now I'm told they > >don't want the page to refresh and they see other sites that don't refresh - > >sigh. If it can be done with Javascript, do you have a sample of how I can > >use PHP, Javascript and MySQL together to achieve this please? > > > > > > > >Any help would not only be appreciated, but would save my life. > > > > > > > >Thank you. > > > > > > > >Chris > > > > > > > > > > -- > > _bobo wieland _ [EMAIL PROTECTED] _ > winamp >> aphex twin cd 2 | -ziggomatic v17 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Page refresh question. .
Chris Payne wrote: I'm using PHP and MySQL in a shopping cart system but the client wants it so that when you add an item to the cart the page doesn't refresh and we all know with PHP the page MUST refresh in order to execute the MySQL query. Is it possible, maybe with javascript? That I can talk to MySQL without having to have the page itself refresh when they add the items to the cart? This is really a pain as the system was basically finished and now I'm told they don't want the page to refresh and they see other sites that don't refresh - sigh. If it can be done with Javascript, do you have a sample of how I can use PHP, Javascript and MySQL together to achieve this please? Ask them if they're willing to lose any business at all, because any solution (XMLHttpRequest, hidden frame, cookies to store it until page refresh, etc.) will or could run into compatibility problems, and it's possible users won't be able to check out if they're using older browsers. Also, it's really too late now, but you should try to demo these things early and be firm about having things stated as early in the process as possible, so you can change to meet their final request (which always differs from their initial) earlier rather than later. Bottom line is this is probably a new request, but you may have to eat it depending on your situation / relationship / contract. cheers, -- - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Page refresh question
use a hidden frame to do the submission bastien From: "Chris Payne" <[EMAIL PROTECTED]> To: Subject: [PHP-DB] Page refresh question Date: Thu, 9 Jun 2005 00:33:12 -0400 Hi there everyone, I'm using PHP and MySQL in a shopping cart system but the client wants it so that when you add an item to the cart the page doesn't refresh and we all know with PHP the page MUST refresh in order to execute the MySQL query. Is it possible, maybe with javascript? That I can talk to MySQL without having to have the page itself refresh when they add the items to the cart? This is really a pain as the system was basically finished and now I'm told they don't want the page to refresh and they see other sites that don't refresh - sigh. If it can be done with Javascript, do you have a sample of how I can use PHP, Javascript and MySQL together to achieve this please? Any help would not only be appreciated, but would save my life. Thank you. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Page refresh question
...or if everything else fail, do it the ugly-hack style and us a frameset with an 1 px wide frame where you update the db... just target the update to the "invisible" frame and only that gets updated... _bobo www.bitbob.biz Chris Payne wrote: Hi there everyone, I'm using PHP and MySQL in a shopping cart system but the client wants it so that when you add an item to the cart the page doesn't refresh and we all know with PHP the page MUST refresh in order to execute the MySQL query. Is it possible, maybe with javascript? That I can talk to MySQL without having to have the page itself refresh when they add the items to the cart? This is really a pain as the system was basically finished and now I'm told they don't want the page to refresh and they see other sites that don't refresh - sigh. If it can be done with Javascript, do you have a sample of how I can use PHP, Javascript and MySQL together to achieve this please? Any help would not only be appreciated, but would save my life. Thank you. Chris -- _bobo wieland _ [EMAIL PROTECTED] _ winamp >> aphex twin cd 2 | -ziggomatic v17 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Page refresh question
i think that the best solution is to use XMLHttpRequest mihai ps. i don't think is a good idea to save the shopping cart in a cookie on client side (i can alter, as a client, the prices from shopping cart) Han wrote: Hi, I can think of 2 solutions: 1 is an old one I used ages ago, and it was to use javascript to put their choices (onclick, field.value=£3 type of thing) and when they click the OK button it gets sent to php script that sends it to mysql, etc. 2 is pretty much the same but using cookies with javascript. Example : -- <!-- Hide from old browsers //Hide from Java Script function cookieVal(cookieName) { thisCookie = document.cookie.split("; "); for (i=0; i<thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } //--> <!-- Hide from old browsers //Hide from Java Script function SetCookie(value1,value2,value3){ var greetName = cookieVal("mysession"); if(greetName == 0){ </pre><tt>document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + </tt><tt>value3 +":1%" + "; path=/; expires=19 January 2038 03:14:07"; </tt><pre style="margin: 0em;"> var addme= value +":1%"; } else{ </pre><tt>document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 </tt><tt>+ ":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; </tt><pre style="margin: 0em;"> var addme = value +":1%"; } theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; winName="order3"; features="scrollbars=yes,width=400,height=600"; child = window.open(theURL,winName,features); child.focus(); } //--> hspace="5" vspace="3" border="0" onClick="javascript:SetCookie('555435,£3,image1');">">Hope this helps. Han. - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> To: Sent: Thursday, June 09, 2005 5:33 AM Subject: [PHP-DB] Page refresh question Hi there everyone, I'm using PHP and MySQL in a shopping cart system but the client wants it so that when you add an item to the cart the page doesn't refresh and we all know with PHP the page MUST refresh in order to execute the MySQL query. Is it possible, maybe with javascript? That I can talk to MySQL without having to have the page itself refresh when they add the items to the cart? This is really a pain as the system was basically finished and now I'm told they don't want the page to refresh and they see other sites that don't refresh - sigh. If it can be done with Javascript, do you have a sample of how I can use PHP, Javascript and MySQL together to achieve this please? Any help would not only be appreciated, but would save my life. Thank you. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Page refresh question
Hi, I can think of 2 solutions: 1 is an old one I used ages ago, and it was to use javascript to put their choices (onclick, field.value=£3 type of thing) and when they click the OK button it gets sent to php script that sends it to mysql, etc. 2 is pretty much the same but using cookies with javascript. Example : -- <!-- Hide from old browsers //Hide from Java Script function cookieVal(cookieName) { thisCookie = document.cookie.split("; "); for (i=0; i<thisCookie.length; i++) { if (cookieName == thisCookie[i].split("=")[0]) { return thisCookie[i].split("=")[1]; } } return 0; } //--> <!-- Hide from old browsers //Hide from Java Script function SetCookie(value1,value2,value3){ var greetName = cookieVal("mysession"); if(greetName == 0){ </pre><tt>document.cookie = "mysession" + "=" + value1 + ":" + value2 + ":" + value3 </tt><tt>+":1%" + "; path=/; expires=19 January 2038 03:14:07"; </tt><pre style="margin: 0em;"> var addme= value +":1%"; } else{ </pre><tt>document.cookie = "mysession" + "=" + greetName + value1 + ":" + value2 + </tt><tt>":" + value3 + ":1%" + "; path=/; expires=19 January 2038 03:14:07"; </tt><pre style="margin: 0em;"> var addme = value +":1%"; } theURL="<a rel="nofollow" href="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme">http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme</a>; winName="order3"; features="scrollbars=yes,width=400,height=600"; child = window.open(theURL,winName,features); child.focus(); } //--> vspace="3" border="0" onClick="javascript:SetCookie('555435,£3,image1');">">Hope this helps. Han. - Original Message - From: "Chris Payne" <[EMAIL PROTECTED]> To: Sent: Thursday, June 09, 2005 5:33 AM Subject: [PHP-DB] Page refresh question Hi there everyone, I'm using PHP and MySQL in a shopping cart system but the client wants it so that when you add an item to the cart the page doesn't refresh and we all know with PHP the page MUST refresh in order to execute the MySQL query. Is it possible, maybe with javascript? That I can talk to MySQL without having to have the page itself refresh when they add the items to the cart? This is really a pain as the system was basically finished and now I'm told they don't want the page to refresh and they see other sites that don't refresh - sigh. If it can be done with Javascript, do you have a sample of how I can use PHP, Javascript and MySQL together to achieve this please? Any help would not only be appreciated, but would save my life. Thank you. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Page refresh question
Hi there everyone, I'm using PHP and MySQL in a shopping cart system but the client wants it so that when you add an item to the cart the page doesn't refresh and we all know with PHP the page MUST refresh in order to execute the MySQL query. Is it possible, maybe with javascript? That I can talk to MySQL without having to have the page itself refresh when they add the items to the cart? This is really a pain as the system was basically finished and now I'm told they don't want the page to refresh and they see other sites that don't refresh - sigh. If it can be done with Javascript, do you have a sample of how I can use PHP, Javascript and MySQL together to achieve this please? Any help would not only be appreciated, but would save my life. Thank you. Chris