Jump to content

linking pages


dukxud

Recommended Posts

I'm really new to this and i've read all threw the html xhtml and java script trying to figure out how to link two html pages together. I know its prolly the newbiest question ever but it really getting to me and i'm really getting tired of reading chapters upon chapters of diffrent scripts and not getting where i want to go. plz help! :)

Link to comment
Share on other sites

It would be in the HTML tutorial: http://w3schools.com/html/html_links.aspJust write <a href="http://www.google.com">Google</a>It will show something like this: GoogleChange the URL ( what's within the quotes after href) to whatever your page is and put whatever text you like between the opening and closing <a> tags.

Link to comment
Share on other sites

It would be in the HTML tutorial: http://w3schools.com/html/html_links.aspJust write <a href="http://www.google.com">Google</a>It will show something like this: GoogleChange the URL ( what's within the quotes after href) to whatever your page is and put whatever text you like between the opening and closing <a> tags.
yes i got that part but i was wondering if you set up a button that said "next" and you wanted it to simply go to another page in your own site how would you do that?? or am i looking over the obvious?
Link to comment
Share on other sites

You could wrap it in a form and submit is to a server side script to process and redirect for youHTML

<form action="redirect.php" method="post">  <input type="submit" name="mybutton" id="mybutton" value="Next"/></form>

redirect.php

<?php  if(isset($_POST['mybutton'])) {	header("Location: yoururl.html");  }?>

or more simply you could use javascripthtml

<input type="button" name="mybutton" id="mybutton" value="Next" onclick="window.location='yoururl.html';"/>

or you could use an image that looked like a button and put it into an anchorhtml

<a href="yoururl.html"><img src="buttonimage.gif" alt="" style="border-width:0"/></a>

Link to comment
Share on other sites

Guest RobinG34

This all looks very interesting, but would you mind terribly expounding on when and why you would use each of these?I'm another newbie and I'm getting really confused because it looks like there are five different ways to do the same thing in HTML and web design, but each seems to have its own nuance and nobody's explaining the nuances, just how to code things.Anne B.

You could wrap it in a form and submit is to a server side script to process and redirect for youHTML
<form action="redirect.php" method="post">  <input type="submit" name="mybutton" id="mybutton" value="Next"/></form>

redirect.php

<?php  if(isset($_POST['mybutton'])) {	header("Location: yoururl.html");  }?>

or more simply you could use javascripthtml

<input type="button" name="mybutton" id="mybutton" value="Next" onclick="window.location='yoururl.html';"/>

or you could use an image that looked like a button and put it into an anchorhtml

<a href="yoururl.html"><img src="buttonimage.gif" alt="" style="border-width:0"/></a>

Link to comment
Share on other sites

You'd use the form method when there was additional data you wanted to pass through, say for a search form. The JavaScript option with <input type="button" /> if for when you want the link to look like a button, and the image one when you want to have link with a completely controlled image (it could be a picture, button, etc).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...