FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Pass varible with out URL and SESSION
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Pass varible with out URL and SESSION [message #179991 is a reply to message #179990] Tue, 25 December 2012 10:31 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 25/12/12 10:03, Andy wrote:
>
>
> "Denis McMahon" <denismfmcmahon(at)gmail(dot)com> wrote in message
> news:kbakra$lmv$1(at)dont-email(dot)me...
>> On Mon, 24 Dec 2012 13:56:17 -0500, Jerry Stuckle wrote:
>>
>>> On 12/24/2012 11:40 AM, Denis McMahon wrote:
>>>> On Mon, 24 Dec 2012 08:30:45 -0500, Jerry Stuckle wrote:
>>>>
>>>> > On 12/24/2012 4:30 AM, Andy wrote:
>>>> >>> well exactly. There are only three ways to keep track of a browser
>>>> >>> state between pages: cookie, GET or POST.
>>>> >>
>>>> >> In the words of Yoda "There is another"...
>>>> >>
>>>> >> You guys won't like it but I thought it worth mentioning that you can
>>>> >> also use a hidden frame and store any variable to be passed back to
>>>> >> the next content page.
>>>>
>>>> > Which still comes back in the GET or POST values, as applicable.
>>>>
>>>> I think Andy is suggesting a client side method that uses javascript to
>>>> store a variable in a higher level frame between page loads. This could
>>>> be used to pass data between the javascript code running in two pages
>>>> on a client without passing the data through the server.
>>>>
>>>> It's a similar approach to using js to create a cookie on the client
>>>> side that can be read by js in another page on the client side, to pass
>>>> data between pages on the client side without relying on the server.
>>>>
>>>> However, as we already agreed (I think), until we have more information
>>>> about what the OP actually wants to do, and specifically whether he's
>>>> trying to pass state information between pages on the client or on the
>>>> server, it's a bit pointless debating the ins and outs of the various
>>>> possible methods.
>>
>>> But it's still passed back to the server via POST or GET. All he's
>>> suggesting is a different way of storing it on the client (i.e. instead
>>> of a hidden field in a form).
>>
>> No, he's suggesting a way to pass data from a client side script running
>> in one page on the client to a client page script running in another page
>> on the client *without* going back through the server at all.
>>
>> Scenario:
>>
>> A frameset has javascript methods set( param, value ) and get(param)
>>
>> Any pages loaded into a subframe of that frameset, from the same host
>> (xss
>> restrictions will apply if the page is from a different host) can call
>> the set and get methods in the parent frameset to store / retrieve values
>> that will never be passed through the server.
>>
>> I once wrote a shopping catalogue that ran 100% in client side javascript
>> doing this, for someone who was running on a hosting provider that only
>> made a basic mailform cgi available. Customers could browse the
>> catalogue, pick out their goods, and then mail their shopping list to the
>> company using the mailform cgi.
>>
>> The (mom & pop) company would then contact the customer, confirm the
>> requirement, put it on their van and deliver it, collecting payment when
>> they delivered.
>>
>> The only time that any "data" apart from plain page requests got sent to
>> the server was after the complete order had been assembled, when it was
>> sent to the mailform cgi on the server, and that could have been avoided
>> by generating a mail uri that would have launched the default mail
>> application on the client computer and populate the message text.
>>
>> The same can be done with a javascript cookie, although the cookie in
>> that case does get sent to the server the server just discards it, but
>> the javascript in different pages from the same host (again security
>> constraints apply) on the client can read and write the cookie and use it
>> to pass data values between themselves.
>>
>> --
>> Denis McMahon, denismfmcmahon(at)gmail(dot)com
>
> Hi,
>
> Dennis is correct.
>
> In fact, I too use this frame method in an ecommerce site so that if the
> customer browses back to the shopping cart after filling in some/all
> details on the checkout page, the information is restored when they
> decide to proceed to the checkout.
>
> No data is sent to the server other than fetching the checkout page and
> no data is stored on the client's computer. The information is stored in
> the 'header' frame as javascript variables and recalled by the checkout
> page loaded into the 'content' frame...
>
> onBlur="parent.HEADING.mydetails_firstname=mydetails_firstname.value;
>
> if (parent.HEADING.mydetails_firstname!=''){
> document.getElementById('mydetails_firstname').value=parent.HEADING.mydetai ls_firstname;
>
> }
>
> If you want to see it in action, visit the following link which will
> land on the shopping cart page with a product (a PC) already added to
> your order...
>
> https://www.microbuild.com/microbuild/catalog/shopping_cart.php?action=buy_ now&products_id=181
>
>
> ... Then click the 'Place Order' button to take you to the checkout page
> and fill in any test information you like. Click the 'Back to My Order'
> button to return to the shopping cart and then click the 'Place Order'
> button again to return to the checkout page. You'll see that any
> information you entered previously has been magically preserved :)
>

But not if you switch off the client computer. Or stop and restart its
browser. Which cookies WILL cater for.


> Andy
>
> Ps Merry Christmas everyone.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: simple dating site
Next Topic: Current PHP implementation
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 05:25:17 GMT 2024

Total time taken to generate the page: 0.04951 seconds