# Having a IFRAME resize, depending of space given



## WhiteSuburban (Jul 9, 2012)

Some site changes, again.
I want the IFRAME I have for my viewer to change size, depending on the size of the window or the space given, in this case it being embed into a page within a page.


----------



## WhiteSuburban (Jul 9, 2012)

Also, *HOW THE HELL DO I CHANGE A SIMPLE HTML VARIABLE TO A PHP VARIABLE!?*


----------



## Aden (Jul 9, 2012)

WhiteSuburban said:


> Some site changes, again.
> I want the IFRAME I have for my viewer to change size, depending on the size of the window or the space given, *in this case it being embed into a page within a page.*



Wait, the iframe is inside _another_ embedded page? Inception



WhiteSuburban said:


> HTML VARIABLE



what's that
HTML is markup; it doesn't have variables. Are you talking about some data- attribute whose value you want to put into a PHP variable, or...?


----------



## WhiteSuburban (Jul 9, 2012)

Aden said:


> Wait, the iframe is inside _another_ embedded page? Inception


Yeah, sorta like inception like someone noted.
Go to http://jarrodmaddyhub.clanteam.com/ to see how its being done. Warning: Links maybe NSFW, so opening "Jarrod" should be a good way to present it.



Aden said:


> what's that
> HTML is markup; it doesn't have variables. Are you talking about some data- attribute whose value you want to put into a PHP variable, or...?


The "HTML Variable" was made by a script code, which would be this,

```
<script>      var seconds = 7;      setInterval(        function(){          document.getElementById('seconds').innerHTML = --seconds;        }, 1000      );    </script>
```
, and I want to make into a PHP Variable for other uses, unless you can code up a quick timer that works on PHP.


----------



## Runefox (Jul 9, 2012)

So... A Javascript variable, then.

It's worth mentioning that PHP is server-side, whereas Javascript is client-side. That means that the client never sees your PHP code, and the PHP code never sees that Javascript. So it's nigh impossible to do unless you're going to get into AJAX or HTML5, which is honestly overkill for what you're doing.


----------



## Aden (Jul 9, 2012)

Runefox said:


> So... A Javascript variable, then.
> 
> It's worth mentioning that PHP is server-side, whereas Javascript is client-side. That means that the client never sees your PHP code, and the PHP code never sees that Javascript. So it's nigh impossible to do unless you're going to get into AJAX or HTML5, which is honestly overkill for what you're doing.



what he said

What are you trying to accomplish with your timer thing, ultimately?


----------



## WhiteSuburban (Jul 9, 2012)

Simply display how much time is left in till redirect. The reason for the Javascript to PHP was to detect when the time was exceeding below 0, which would display a message.
Its just to promote my site.
So I can take.
https://www.google.com/
add
http://jarrodmaddyhub.clanteam.com/redirect.php?redirect=
to make
http://jarrodmaddyhub.clanteam.com/redirect.php?redirect=https://www.google.com/

Also,  a strange thing. The skip button seems to be working incorrectly, even if I am echoing the redirect variable.


----------



## Aden (Jul 9, 2012)

WhiteSuburban said:


> Simply display how much time is left in till redirect.



You can do the little displayed countdown independently of the redirect; that is, you don't need the timer to 'trigger' it. Just set the redirect to go in 7 seconds and set the timer to count down from 7 seconds. They'll sync up, I promise. Computers are pretty good at that.


----------



## WhiteSuburban (Jul 9, 2012)

I am aware of that, but that still leaves the...fuck the if less then 0 for now. I need some help with the Skip link, which seems to be given a blank address, which just refreshes the page when clicked. I gave it the <?php echo $_GET['redirect'] ?> for the address.


----------



## Runefox (Jul 10, 2012)

Is that 'redirect' variable set on the PHP side or the Javascript side?


----------



## WhiteSuburban (Jul 10, 2012)

PHP side.
Its grabbing the redirect variable from here
redirect.php?*redirect*=[WWW]


----------



## Ricky (Jul 10, 2012)

Could you do everyone a favor and go get a book on JavaScript (I recommend the Rhino book) and a book on PHP (the bird one perhaps) and READ them.

Also read this (per your last comment).


----------

