Jump to content

is this possible? php and inline frames?


gibrst

Recommended Posts

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

Link to comment
Share on other sites

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'>";

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.