...

View Full Version : 2 Questions



gamefreak11
02-19-2005, 07:44 PM
Question number 1:
Is it possible to use php in a html document?
Question 2:
I have an iframe that is quite large. At the bottom is a link to a diferent part of the site in the iframe. But unfortunatly, it stays at the bottom of the new page, so I have to scroll up to view the page. How do I make it go to the top of the page, while staying inside the iframe?

whizard
02-19-2005, 08:19 PM
question 1:

No. You CAN put HTML in a PHP file. You can switch between php and HTML like this:

<?php

//PHP Code

?>
<!--HTML Code-->
<?php
//More PHP Code
?>

---OR---

You can also echo HTML, like:

<?php
echo("<html><head><title></title></head></html>");
?>

Remeber, quoted attributes need to be escaped.

Dan

gamefreak11
02-19-2005, 08:27 PM
Darn, I hoped it was possible. :(

chilipie
02-19-2005, 08:29 PM
Question 2:
I have an iframe that is quite large. At the bottom is a link to a diferent part of the site in the iframe. But unfortunatly, it stays at the bottom of the new page, so I have to scroll up to view the page. How do I make it go to the top of the page, while staying inside the iframe?

Do you want a page to load in the iframe? To do that you can use the target attribute on an a tag (note that the target attribute is deprecated).

Eg.


<a href="page.htm" target="iframename">Linky link</a>


Please post back if I misunderstood you :) .

gamefreak11
02-19-2005, 08:56 PM
Oh, I see what you thought I meant.
No, the link is accutally inside the iframe. When the user clicks the link in the iframe it goes to the different page inside the iframe, but appears at the bottom.
Example:
http://arcadetest.freecoolsite.com/Example.html

When you go to the link "click here" it goes to a new page with Hello printed. But instead of going to the top it goes to the bottom where the link was. So you have to scroll up to see the text "hello".
How do I fix this?

rmedek
02-19-2005, 09:12 PM
I was going to suggest using


<a href="#here">link</a>

<div id="#here"><p>where the link goes to</p></div>

But I realize it's on different pages, and it might be another issue. I think some of the reason is that there is nothing to tell the page there's any real content on it, so it's not going to display from the top. Try using some tags, <html>, <body>, <p>, for examples.

Oh, and check out this link: awesome link (http://www.codingforums.com/postguide.htm)

gamefreak11
02-19-2005, 09:23 PM
Nope, did not work. I added <html><body> Before the text and </body></html> after the text.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum