I know this is possible, but i can't find the tiny bit of coding.
If i have 'Page1.html' Included Into My Webpage Using PHP Include
How Do I make a link, so i can put Page2.Html there instead just like and iframe
I thinks its PHP.
I know this is possible, but i can't find the tiny bit of coding.
If i have 'Page1.html' Included Into My Webpage Using PHP Include
How Do I make a link, so i can put Page2.Html there instead just like and iframe
I thinks its PHP.
It'd have to reload the page or use ajax. Heres for it to reload the page:
The above is assuming you have the basic knowledge of switch()PHP Code:<?php
switch($_GET['changePage']) { //switch is just like a bunch of if()s
default: //default case
case 'default': //default case
include('page1.html'); //include page.html
break; //break, witch means stop
case 'page2': // page2, if changePage has the value of page2
include('page2.html'); //include page2.html
break; //stop it
} //end the switch
?>
Now to change it:
Now, your wondering why I just don't do this:HTML Code:<a href="page.php?changePage=page2">Page2</a>
Its unsecure, for example if that page is protected by htaccess files, it won't protect the include.PHP Code:include($_GET['changePage']);
If you don't understand the first script I gave you, please lemme know.
Jeremy | jfein.net
That last one was it, i remember when i saw it.
but after reading that, i'll use the first script.
But my site is an online radio so.
So the page cant refresh or my radi owill stop.
is there a way of doing it silently
Ajax, I suggest taking a look at this:
http://www.dynamicdrive.com/forums/s...highlight=ajax
There are so many ways to do it without PHP, but then if the browser doesn't support javascript, the code will fail.
Jeremy | jfein.net
Swaydo (08-11-2008)
Ok i will have a look at that.
Its not Majorly important, it actually to change the background color.
i cnt do it via style switcher as i use that to change skin color.
So Thanks.
So then why not use javascript:
HTML Code:<a href="javascript:void(0);" onClick="document.body.style.background='lightgreen';">Light Green</a>
Jeremy | jfein.net
Swaydo (08-11-2008)
Becuase i didnt know you could.
Thanks alot!
Im gonna use the ajax script for content now.
Tysm
And can i use them links to set background images?
Indeed you can:
BTW:HTML Code:<a href="javascript:void(0);" onClick="document.body.style.background='url(http://www.dynamicdrive.com/forums/designfiles/logo.gif)';">BG</a>
You can use buttons too:
I hope this helps,HTML Code:<button onClick="document.body.style.background='url(http://www.dynamicdrive.com/forums/designfiles/logo.gif)';">BG</button>
Nile
Jeremy | jfein.net
Swaydo (08-11-2008)
Bookmarks