I was wondering if someone could help me out here. I do not have the slightest idea how to code in AJAX.

I need a swf loader for my website that will sit in the footer. The basic idea is to have a titled entry box that takes input and loads a swf with the input

ID
[______________]

and then take that id and load www.thisdomain.com/[ID].swf.

But i also need this box to stay untouched when changing pages. My arcade has over 500 pages (all loaded from three different template pages, so it's easy to add a code to them all) and I want the user to be able to enjoy their .swf without having to restart on every page.

Could someone please help me? I am absolutely clueless about AJAX (I only know that it needs to be ajax because someone told me it can't be done in php).

Member Avatar for langsor

I'm not entirely clear your exact specifications, but you might use cookies to keep the value between pages. If your form needs to query a database then you could use cookies with php and javascript, or send values in the search (?name=value) field with php and javascript both being able to read and write those values...or you can use Ajax to have javascript talk to the php and back ... in which case you should find some really good tutorials online on how to use ajax-type methods (since it's so popular these days).

PHP:
http://us2.php.net/setcookie
or
$value = $_GET;

JS:

http://www.quirksmode.org/js/cookies.html
or
var request = window.location.search.substring(1);
var args = request.split('=');
var name = args[0];
var value = args[1];

Check out these approaches, if you need any more help let us know.

Cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.