Hello there,
I am using iframes for my login page. When you login it sets cookies. The problem is you have to refresh the main page(index) yourself for you to see the logged in links. What I would like is if theres a way I can use Header() to refresh the main page(index), if I use header() it opens the main page(index) in the iframe, I need it to refresh the main page(index) itself and not just the iframe.
I hope you understand!
Header()
Moderator: General Moderators
You can't use header() to change what page is being displayed in a seperate iframe. However, what you could do is use the header() function to send a get variable to the script that is being displayed in the iframe, then use javascript to look for that variable and if it exists use javascript to alter the script that is being displayed in the other iframe.
Ask if you need clarification.
Ask if you need clarification.
this will probably be changed to client side but here goes.
you will need to something like in your IFRAME
I'm almost sure this won't work but it should get you going in the right direction. going up from the IFRAME is easier to reference then going down to the elements in the iframe.
you will need to something like in your IFRAME
Code: Select all
<script language="e;javascript"e;>
window.parent.getElementByIdї'idOfThingToChange'].innerHTML='somevalue';
</script>Have you tried putting in your login form tag?
Code: Select all
target="e;_parent"e;-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
and if javascript is disabled your whole site ceases to function....phpScott wrote:this will probably be changed to client side but here goes.
you will need to something like in your IFRAMEI'm almost sure this won't work but it should get you going in the right direction. going up from the IFRAME is easier to reference then going down to the elements in the iframe.Code: Select all
<script language="e;javascript"e;> window.parent.getElementByIdї'idOfThingToChange'].innerHTML='somevalue'; </script>
...people need to start thinking about this
I'm aware people turn javascript off, but unless i'm missing something there is no other way to do this in an iframe which was what the question was about.malcolmboston wrote:and if javascript is disabled your whole site ceases to function....phpScott wrote:this will probably be changed to client side but here goes.
you will need to something like in your IFRAMEI'm almost sure this won't work but it should get you going in the right direction. going up from the IFRAME is easier to reference then going down to the elements in the iframe.Code: Select all
<script language="e;javascript"e;> window.parent.getElementByIdї'idOfThingToChange'].innerHTML='somevalue'; </script>
...people need to start thinking about this
Yes, best practice would be to check to see if javascript is enabled and if it is then use your javascript functions to do what you need and if it isn't then provide an alternative.
The sad part is that it seems like going back to the days of the browser wars when standards where loosely implamented, not like now of course where they are kinda implemented.
Are they any stats being kept on how many people have turned off js in there browsers?
-
davidjwest
- Forum Commoner
- Posts: 67
- Joined: Sat Nov 06, 2004 5:26 am
- Location: Leeds, Yorkshire, England
http://www.w3schools.com/browsers/browsers_stats.aspphpScott wrote: Are they any stats being kept on how many people have turned off js in there browsers?
The figures given aren't all that representative as I think they only include visitors to the W3C sites. After working on the phones as tech support for an internet bank, I'd estimate less than 10% of "normal" people have js turned off. In fact probably less than 10% of "normal" people know what js is.
No offence, by "normal" I mean non-technical people, so I'm considering myself abnormal!