php new content, php help please |
![]() ![]() |
php new content, php help please |
![]()
Post
#1
|
|
![]() AIDS at RAVES. ![]() ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 2,386 Joined: Dec 2007 Member No: 598,878 ![]() |
i'll try to be as descriptive as possible if i get confusing please pm me
okay so I made a template but because it was html, i made a new php file for my html so when I appilied to all my pages the navigation was fine but the content are all the same because in my html document the div tag for content is included in it, I was thinking about strings but Im not sure how it would work with my php, please help me:]]] |
|
|
![]()
Post
#2
|
|
![]() Offline. ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 609 Joined: Mar 2007 Member No: 507,591 ![]() |
Can you post your code... I know how to use php a little and i might be able to help.
I don't know if you're using CODE <?php include("") ?> but thats the easies php includer their is.
|
|
|
![]()
Post
#3
|
|
![]() muffin D= ![]() ![]() ![]() Group: Member Posts: 55 Joined: Feb 2008 Member No: 618,651 ![]() |
I dont know I've always used ConvertToPhp there is a great tutorial on it Here
|
|
|
![]()
Post
#4
|
|
![]() AIDS at RAVES. ![]() ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 2,386 Joined: Dec 2007 Member No: 598,878 ![]() |
Can you post your code... I know how to use php a little and i might be able to help. I don't know if you're using CODE <?php include("") ?> but thats the easies php includer their is.okay thank u by the way for helping me so I made my html template: <br> CODE <html> <head> <!-- TemplateBeginEditable name="doctitle" --> <title>KEVINJO.NET - The Best of Kevin</title> <!-- TemplateEndEditable --> <meta name="keywords" content="stuff for your myspace page and more! get tons of layouts and participate in controversial issues in kevin's blog!" /> <meta name="description" content="Kevinjo.net offers tons of different things to do and talk about, you can get myspace layouts or when your bored, check out our music section, or web templates or even particiapte in blogs! " /> <LINK REL=stylesheet TYPE="text/css" HREF="http://www.kevinjo.net/mp.css"> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body bgcolor="#669966" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- ImageReady Slices (Untitled-1.psd) --> <table id="Table_01" width="800" height="800" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="images/Untitled-1_01.gif" width="800" height="337" colspan="5"> </td> </tr> <tr> <td width="269" height="134" colspan="3" align="center" valign="top" background="images/Untitled-1_02.gif"><center> </center> <div align="center"> <p><br> </p> <p><a href="http://www.amazingcounter.com"><img border="0" src="http://cb.amazingcounters.com/counter.php?i=2157716&c=6473461" alt="Traffic Counter"></a><bR> online <!-- Start FastOnlineUsers.com --> <a href="http://www.fastonlineusers.com"> <script type="text/javascript" src="http://fastonlineusers.com/on4.php?d=www.kevinjo.net"></script> !</a><br><!-- Begin rnd.today=new Date(); rnd.seed=rnd.today.getTime(); function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); }; function rand(number) { var result = Math.ceil(rnd()*number); if (!result)result++; return result }; var ad_cnt1 = 2; var ad1 = rand(ad_cnt1); var link1; var adBanner1; var width1 var height1 if (ad1==1) { link1="http://kevinjo.net"; adBanner1="http://i175.photobucket.com/albums/w155/kevinjo_2007/Untitled-1-1.gif"; width1="88"; height1="31"; alt1="kevinjo "; } if (ad1==2) { link1="http://kevinjo.net"; adBanner1="http://i175.photobucket.com/albums/w155/kevinjo_2007/thd5bc51b2.gif"; width1="88"; height1="31"; alt1="have ur banner here"; } document.write('<center><a href="' + link1 + '" target="_top">'); document.write('<img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '"></a>'); document.write('</center>'); // End --> </SCRIPT></a> </p> <!-- End FastOnlineUsers.com --></td> <td width="495" rowspan="2" valign="baseline" background="images/Untitled-1_03.gif"><div class="MP"> <p><b>THIS IS WHERE THE CONTENT IS GOING TO GO </p><Br> <center>© 2007-2008 Kevinjo.net. All rights reserved<Br> We are in no way affiliated with myspace </div></td> <td background="images/Untitled-1_04.gif" width="36" rowspan="2"> </td> </tr> <tr> <td background="/images/Untitled-1_05.gif" width="9"> </td> <td width="226" valign="top" background="/images/Untitled-1_06.gif"><div class="MP"> <p>THIS IS WHERE NAVIGATION IS GOING TO GO </p> </div></td> <td background="images/Untitled-1_07.gif" width="34"></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html> then i named this template.html so when I made my index page [index.php], i want to use this template so all i did was put <?php include "template.html" ?> however I realized that if I do this then for every new page I make with template.html, that the content on every page will be the same, so I was wondering how to change that oo and my index.php only has the code CODE <?php include "template.html" ?> , there is nothing else on my index.php page:] |
|
|
![]()
Post
#5
|
|
t-t-t-toyaaa ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Official Member Posts: 19,821 Joined: Apr 2004 Member No: 11,270 ![]() |
When using includes you should use them for the overall outlook of the page. Don't put any content in the includes. That way you can allow each page to have different content while keeping the same design. If you will have the same sidebar for each one , then go ahead and add the sidebar to the template.
I think this tutorial explains PHP includes pretty well, so you should read it. http://pixelfx.org/tuts/php/phpincludes.html If you do it in that format, your content won't be the same. Either way though don't add content that way. I'd just add the basic coding in the include, then on each page put the DIV manually along with the content. If that makes since. |
|
|
![]()
Post
#6
|
|
![]() Offline. ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 609 Joined: Mar 2007 Member No: 507,591 ![]() |
I added a new page for you. here is the code for everything. hope it helps.
For each new page you created you will need to create a new body and the page that you want, make sure you change the body1.txt to the page name that you create. Code for index.php CODE <?php include("abovebody.txt") ?> <?php include("body1.txt") ?> <?php include("belowbody.txt") ?> Code for body1.txt CODE <p><b>THIS IS WHERE THE CONTENT IS GOING TO GO </p> Code for abovebody.txt CODE <head> <!-- TemplateBeginEditable name="doctitle" --> <title>KEVINJO.NET - The Best of Kevin</title> <!-- TemplateEndEditable --> <meta name="keywords" content="stuff for your myspace page and more! get tons of layouts and participate in controversial issues in kevin's blog!" /> <meta name="description" content="Kevinjo.net offers tons of different things to do and talk about, you can get myspace layouts or when your bored, check out our music section, or web templates or even particiapte in blogs! " /> <LINK REL=stylesheet TYPE="text/css" HREF="http://www.kevinjo.net/mp.css"> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body bgcolor="#669966" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- ImageReady Slices (Untitled-1.psd) --> <table id="Table_01" width="800" height="800" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="images/Untitled-1_01.gif" width="800" height="337" colspan="5"> </td> </tr> <tr> <td width="269" height="134" colspan="3" align="center" valign="top" background="images/Untitled-1_02.gif"><center> </center> <div align="center"> <p><br> </p> <p><a href="http://www.amazingcounter.com"><img border="0" src="http://cb.amazingcounters.com/counter.php?i=2157716&c=6473461" alt="Traffic Counter"></a><bR> online <!-- Start FastOnlineUsers.com --> <a href="http://www.fastonlineusers.com"> <script type="text/javascript" src="http://fastonlineusers.com/on4.php?d=www.kevinjo.net"></script> !</a><br><!-- Begin rnd.today=new Date(); rnd.seed=rnd.today.getTime(); function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); }; function rand(number) { var result = Math.ceil(rnd()*number); if (!result)result++; return result }; var ad_cnt1 = 2; var ad1 = rand(ad_cnt1); var link1; var adBanner1; var width1 var height1 if (ad1==1) { link1="http://kevinjo.net"; adBanner1="http://i175.photobucket.com/albums/w155/kevinjo_2007/Untitled-1-1.gif"; width1="88"; height1="31"; alt1="kevinjo "; } if (ad1==2) { link1="http://kevinjo.net"; adBanner1="http://i175.photobucket.com/albums/w155/kevinjo_2007/thd5bc51b2.gif"; width1="88"; height1="31"; alt1="have ur banner here"; } document.write('<center><a href="' + link1 + '" target="_top">'); document.write('<img src="' + adBanner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '"></a>'); document.write('</center>'); // End --> </SCRIPT></a> </p> <!-- End FastOnlineUsers.com --></td> <td width="495" rowspan="2" valign="baseline" background="images/Untitled-1_03.gif"><div class="MP"> Code for belowbody.txt CODE <Br>
<center>© 2007-2008 Kevinjo.net. All rights reserved<Br> We are in no way affiliated with myspace </div></td> <td background="images/Untitled-1_04.gif" width="36" rowspan="2"> </td> </tr> <tr> <td background="/images/Untitled-1_05.gif" width="9"> </td> <td width="226" valign="top" background="/images/Untitled-1_06.gif"><div class="MP"> <p>THIS IS WHERE NAVIGATION IS GOING TO GO </p> </div></td> <td background="images/Untitled-1_07.gif" width="34"></td> </tr> </table> <!-- End ImageReady Slices --> </body> </html> |
|
|
![]()
Post
#7
|
|
![]() i did your boyfriend ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 3,335 Joined: Feb 2004 Member No: 4,071 ![]() |
it doesnt make sense to have another include for the body...
you're just wasting space at that point because you would have to make two new files for every page. one for the includes, and one for a new body. just do: CODE <?php include("abovebody.php") ?>
PUT YOUR BODY CONTENT HERE BLAH BLAH BLAH BLAH BLAH <?php include("belowbody.php") ?> |
|
|
![]()
Post
#8
|
|
![]() AIDS at RAVES. ![]() ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 2,386 Joined: Dec 2007 Member No: 598,878 ![]() |
thanks everyone for all the replies:]
![]() ![]() |
|
|
![]()
Post
#9
|
|
![]() Offline. ![]() ![]() ![]() ![]() ![]() Group: Official Designer Posts: 609 Joined: Mar 2007 Member No: 507,591 ![]() |
no prob Topic: Closed.
|
|
|
![]() ![]() |