For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > June 2005 > Re: [PHP-DB] Page refresh question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Page refresh question
mihaifrisan@gmail.com

2005-06-09, 3:56 pm

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 : --
>
>
> <script language="JavaScript">
> <!-- 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;
> }
>
> //-->
> </script>
>
> <script language="JavaScript">
> <!-- 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="http://www.domain.com/cgi-bin/showbasket.cgi?cookievalue="+addme;
> winName="order3";
> features="scrollbars=yes,width=400,height=600";
>
> child = window.open(theURL,winName,features);
> child.focus();
>
> }
>
> //-->
> </script>
> <a href="#"><img src="images/image1.jpg" alt="image1" width="80"
> hspace="5" vspace="3" border="0"
> onClick=" java script:SetCookie('555435,£3,image1')
;">"></a>Hope this helps.
>
>
> Han.
>
>
>
> ----- Original Message ----- From: "Chris Payne" <cjp@planetoxygene.com>
> To: <php-db@lists.php.net>
> Sent: Thursday, June 09, 2005 5:33 AM
> Subject: [PHP-DB] Page refresh question
>
>
>


--
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.

****************************************
********************************
<<<<GWAVAsig>>>>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com