Re: JS prompt -> php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan A wrote:
> Quick question (and hopefully a simple one)
> 
> I have a link on a page, when the client clicks that link it should
> show them a JS prompt and ask for their name (so far I have done
> this)
> 
> When they write their name, I want that data to be sent to my php
> script via AJAX (yes?) so the page does not reload or anything....
> (actually, how can i reload the page to reflect the change?)
> 
> I have googled but I see whole ajax classes and what not, I dont know
> if I am using the correct keywords or what...  you would happen to
> have a working piece of code that you could share with me.. would
> you?

You don't need any Ajax here.

All you need is to take the value entered into the js box and use normal
javascript commands to store this value in a cookie. This cookie will be
sent automatically to your PHP script the next time a user requests a
page from your server.

If you want to provide immediate visual feedback, you can use standard
DOM methods to insert the users name into the page where you want.

No need for any fancy Web 2.0 nonsense here..... move along, nothing to
see... ;)

Disclaimer: this may not work for your needs but I cannot see why not
from the info given :)

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux