gibrst Posted March 13, 2008 Share Posted March 13, 2008 Hi, what im trying to do, is make pictures change, after X seconds, but without refreshing the page? So i thought ill use a inline frame, of a php file doing such! BUT the pictures being shows all depends on info sent over the URL, using the $_GET command? but obviously that URL is not inline frame one, so in others words: Im trying to get info from the MAIN url from a php file in a frame? Do you understand? Cheers Andy Quote Link to comment Share on other sites More sharing options...
teng84 Posted March 13, 2008 Share Posted March 13, 2008 have you tried ajax? Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 13, 2008 Share Posted March 13, 2008 yes deff use ajax. its sooo much nicer. Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 13, 2008 Share Posted March 13, 2008 here is just an example of one way to use ajax. example pictureDisplay.php <script> function ajax_do (url) { var jsel = document.createElement('SCRIPT'); jsel.type = 'text/javascript'; jsel.src = url; document.body.appendChild (jsel); } </script> <form name='form1'> <input type='text' name='textbox'><br> <input type='button' name='button' value='press' onclick="ajax_do('AjaxGetPicture.php?picture=' + document.form1.textbox.value);"> </form> <div id="contentdiv"> </div> example AjaxGetPicture.php type the path and name of your picture and click the button <? $picture = $_REQUEST['picture']; ?> div = document.getElementById('contentdiv'); div.innerHTML = "<img src='<?php echo $picture; ?>' alt='Some Picture' hieght='150' width='150'>"; Quote Link to comment Share on other sites More sharing options...
gibrst Posted March 13, 2008 Author Share Posted March 13, 2008 Ok, im a bit confused to how that does what im after! It may do, but i just not done much Ajax. Ill just explain again, and let me know if this ajax does it. Main page URL example: www.domainame.co.uk/index.php?a=info In that page is a inline frame and i want the page thats in the frame to be able to $_GET the a (info) from the url. Cheers Gib Quote Link to comment Share on other sites More sharing options...
gibrst Posted March 13, 2008 Author Share Posted March 13, 2008 Anyone?? Quote Link to comment Share on other sites More sharing options...
l0ve2hat3 Posted March 13, 2008 Share Posted March 13, 2008 you have to be a bit more detailed. a=info????? give me a real example of EXACTLY what you want to do Quote Link to comment Share on other sites More sharing options...
gibrst Posted March 13, 2008 Author Share Posted March 13, 2008 Hmm well i cant give you a real example as i cant get it working? The info doesnt matter what it is, i was just saying how i was getting the info You know how you can get info from the URL using the &_GET commad. So... www.domainname.com/index.php?a=info I could then within my php page do $a=$_GET['a']; Well... instead of the php file doing the $a=$_GET['a']; i want a php file in a frame to do the $a=$_GET['a']; and retrive it? Does that help? Cheers Gib Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.