Jump to content


more php help


4 replies to this topic

#1 TheUnforgiven512

    Young Padawan

  • Members
  • Pip
  • 102 posts

Posted 12 March 2006 - 01:10 PM

okay ill explain what im trying to do. I have over 500 pages that use the same text. I put that text in a seperate file and made it into an iframe on every page. Now i am switching to php and I use a php include statement, it messes the page up. but if I make it an iframe again, it works. im thinking its because iframe's width cant get bigger but table's and div's width can. is there any other code that has a cut off? like if I type and it reaches the maximum width, it will cut it off and go to the next line. with div and table, you type and it goes with the text. thats what messing my page up

Edited by TheUnforgiven512, 12 March 2006 - 01:11 PM.


#2 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 12 March 2006 - 03:36 PM

everything: divs, tables .. umm.. spans, paragrahs... they all go with the flow unless you add with="<number>" to it.

iframes might be the ONLY exception, but then again, you HAVE to give them a defined with and height.... and iframes are ugly and a no-no.

you should learn how to use the include() correctly, and i'll show you how!

lets say you created a complete working template in html.
but you want to remove the navigation from it, what you do is copy paste that html code for the nav into another file.

then you remove that EXACT same code from the main document, and REPLACE it with <? include("file.html"); ?>.

#3 TheUnforgiven512

    Young Padawan

  • Members
  • Pip
  • 102 posts

Posted 12 March 2006 - 07:00 PM

yeah thats what I did but when the code is inside a div, it doesnt have a width limit. code:
<div id="affiliate"><br /><br /><br /><br>
			<br><iframe src="affiliate.htm" frameborder="0" height="500" scrolling="no" width="112"></iframe>
		</div>
The above code makes the page flow nicely but this code will delete any content in the previous div
<div id="affiliate"><br /><br /><br /><br>
			<br><?php include ("affiliate.html"); ?>
		</div>

Edited by TheUnforgiven512, 12 March 2006 - 07:03 PM.


#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 13 March 2006 - 04:22 PM

One common mistake for newbie php coders using include is that they have to much html in the included file (by to much, i mean everything from the opening <html> tag to the closing one).
Remove ALL of the html except what is in between the <body> tags in affiliate.html (remove the <body> tags also). See if that works a little better.

If not, then you can either try adding the width property to your #affiliate selector in your CSS, or post the contents of affiliate.html so we can see if anything in there is throwing you off.

#5 TheUnforgiven512

    Young Padawan

  • Members
  • Pip
  • 102 posts

Posted 13 March 2006 - 08:27 PM

ok I did that but it still wouldnt work. What I did was delete the javascript scrolling text and made it a maquee and now it works. I have no idea why but it does. Hate using marquees but if it works, ill stay with it





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users