Page 1 of 1

display url in textfield

Posted: Thu Aug 28, 2008 9:16 pm
by alt303
Hello again. I have a php script that allows you to have one url go to multiple urls randomly, one at a time of course.

So, http://mywebsite.com/whatever goes to one of the assigned urls, which is controlled by php. How can I have the url that was chosen be displayed in a textfield? The reason that I want to do this is that you cannot call the url from an iframe (where the random website will be loaded), except for the initial url.

I need the url of the page loaded in the iframe to make other scripts work with the correct page.

I know this sounds somewhat confusing, but I know it is possible somehow. Basically, I need my php script to display the random url in the iframe like it does already, but in addition send the chosen url to a textfield placed outside of the iframe.

Then, I would use the url in the textfield to make other scripts know what page is currently loaded in the iframe.

Thanks a bunch. This forum has been very useful to me. :)

Re: display url in textfield

Posted: Sat Aug 30, 2008 2:03 am
by alt303
Not possible? I've searched, but can't seem to find anything that I can get working.

All I want to do is display the chosen url in a text field out side of the iframe.

Here is the script I'm using if you'd like to take a look at the php:

http://www.ljscripts.com/freescripts/#t ... e%20script

I'm guessing I would have to add a new function in the existing code to tell it to also display the url in the text field. :?

Thanks everyone.

Re: display url in textfield

Posted: Sat Aug 30, 2008 2:29 am
by alt303
Another thing I just thought of; this would have to dynamically update every time the url changes.

So every time the page changes, the url in the text field updates.

Also, how could I pull the url out of the text field? Like for this digg button:

Code: Select all

 
<script type="text/javascript">
digg_url = 'WEBSITE_URL';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script> 
 
How could you tell the 'WEBSITE_URL' to be the one from the text-field?

Sounds very simple, but probably is far from it.