Jump to content

Lee

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Everything posted by Lee

  1. Can anyone suggest a way I might be able to continue with my templates without having to make a 2nd set for pages one level down or having to do the re-direct thing? I'm a bit stumped. Thanks
  2. I started here http://www.phpvideotutorials.com/free It has been over a year sice I have touched php so I forgotten most of it, but I found these videos the best of all the beginner tutorials I tried. The guy who made them does go off on a tangent a little at times, but he's actually quite entertaining and does a great job of explaining stuff.
  3. Thanks again flyhoney. I think I need to work out a bit better how to setup these templates. I want to have pages in sub-directories, mainly so that I can direct people easier, for example go to mysite.com/examples or mysite.com/news. However, doing this means that the templates will not work because they are one level above so the images & css will not be called for. I could put copies of them in the same directory, but that will just defeat the object of having an overall header, footer & page body. I guess I could just create these sub-directories with an index page, then just reirect after 0 secs to the relevant page in the root folder. I wonder if there could be a better way?
  4. I just hit a problem. Although I now have a variable to adjust the path to the template files, the image paths also change now. I'm a bit confused how to get around this. I thought perhaps to make a variable such as $imgpath = "images". Then change it to imgpathe = "../images" for sub-directories e.t.c. But how to I code that into the image html? I tried this. <img src="<?php $imgpath ?>/bg_head.jpg" alt="Header Pic" width="836" height="307" />
  5. It took me a while to spot the difference there, just one opening & closing php tag. That's cool thanks flyhoney!
  6. Lol, I just spotted that too thanks! I went a little further with the organising and now have this. Should make life a lot easier for pages in sub-directories e.t.c. <?php // Page name $page = "index"; ?> <?php // Path to the templates folder $path = "templates"; ?> <?php include("{$path}/head-tag1-tpl.php"); ?> <?php include("{$path}/{$page}-meta-tpl.php"); ?> <?php include("{$path}/head-tag2-tpl.php"); ?> <?php include("{$path}/header-tpl.php"); ?> <?php include("{$path}/{$page}-body-tpl.php"); ?> <?php include("{$path}/footer-tpl.php"); ?>
  7. WooHoo! Yes, that works thanks wildteen. Now I can just paste that same tpl list on every page and edit only the variable to call for the relevant templates. Hopefully this should set my site up for a good starting point as I learn more php. Very Merry Xmas to you!
  8. Hi, I am building my first site using php templates. I'm just a beginner so Its just a chopped up html page where I include a header & footer, then only edit the page body & meta for each page. My index page looks like this <?php include("templates/head-tag1-tpl.php"); ?> <?php include("templates/index-meta-tpl.php"); ?> <?php include("templates/head-tag2-tpl.php"); ?> <?php include("templates/header-tpl.php"); ?> <?php include("templates/index-body-tpl.php"); ?> <?php include("templates/footer-tpl.php"); ?> I wonder is it possible to create a variable at the top of this code to alter the name of the template to be called for. For example the above cose is for the index page so it calls for index-meta and index-body. Can I do a variable at the top of the page, then call that variable in the page includes. I tried the following. It doesn't work, but hopefully explains what I'm trying to achieve. <?php $page = "index"; ?> <?php include("templates/head-tag1-tpl.php"); ?> <?php include("templates/$page-meta-tpl.php"); ?> <?php include("templates/head-tag2-tpl.php"); ?> <?php include("templates/header-tpl.php"); ?> <?php include("templates/$page-body-tpl.php"); ?> <?php include("templates/footer-tpl.php"); ?>
  9. Well today I have just built my first ever page using a header, content & footer & using php to call for images e.t.c. And now the copyright too thanks to your help. Totally chuffed
  10. I want to echo out the copyright at the footer of my page (still a noob). Here's what I have in my vars page. $copyright = '<span class="smallwhite">© 2007 Stone Island Records </span>'; Then I just echo.. <?php echo $copyright; ?> What I really want to do is have php adjust the year for me. So do I have to make 3 variables, one for the copyright symbol, one to display the current year & another to display our name, or is there a simpler way of doing this? Thanks in advance.
  11. I hope its ok to ask this in here. I need a php mailing list script, can anyone recommend one? preferably OS if possible. Thanks
  12. Thanks Ken. I just wanted to understand how to make the program work using variables & arrays. I just used this text to practice using them in different ways. Does anyone know of any other simple programs like this to practice with? Or slightly more progressive? Next I want to ty to do it using strtolower & ucwords functions, but I'm not sure where & how to format/write the function. Thanks for your help guys
  13. I can't believe it, I tried doing the same thing using an array & it worked first time! I'm so happy with myself I had to tell someone & my missus just wouldn't understand what the hell I'm on about So here's what I wrote, is there a better/alternative way to do this array? <?php $ar_rhyme = array ('green bottles hanging on the wall ','and if one ', 'green bottle should accidentally fall, there\'ll be ', 'green bottles left on the wall.'); for ($a = 100; $a >= 1; $a--) echo "$a"." $ar_rhyme[0]"."$ar_rhyme[1]"."$ar_rhyme[2]".($a-1)." $ar_rhyme[3] <br>" ?>
  14. I automatically assumed that $a-1 would always output 99 for some reason. Thanks very much for the replies, another lesson learned Is it ok to ask these types of noob questions in here? Some things I am learning from books & videos confuse me a bit. Thanks again.
  15. Hi, this is a boring noob question. I'm practicing loops & tried the following code but it outputs in an odd way, I just want to see where I have gone wrong. Thanks <?php $start = 'green bottles hanging on the wall'; $and = 'and if one'; $fall = 'green bottle should accidentally fall, there\'ll be'; $end = 'green bottles left on the wall'; ?> <?php for ($a = 100; $a >= 1; $a--) for ($b = 99; $b >=1; $b--) echo "$a $start $and $fall $b $end <br>" ?>
  16. What I am trying to achieve is having a button as a table cell background and have it swap on hover using css. I have set the css class as below to have white text (the button is black) but I want the whole table cell to be a link rather than just the text. The reason I want to do this is because I want it to work like a rollover button so you can click anywhere on the button. I find that small text displays better from the browser rather than writing the text on the image in photoshop. Here is the code I did below. So far the rollover is working, but I can't get the link to work. Any ideas? CSS .button { background-color: #000000; background-image: url(images/button.gif); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF; text-decoration: none; } .button:hover { background-color: #000000; background-image: url(images/button-over.gif); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF; text-decoration: none; } a.button { background-color: #000000; background-image: url(images/button.gif); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF; text-decoration: none; } a.button:hover { background-color: #000000; background-image: url(images/button-over.jpg); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF; text-decoration: none; } HTML <table width="276" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <a href="page1.html"><td width="69" height="27" align="center" valign="middle" class="button">Link 1</td></a> <a href="page2.html"><td width="69" height="27" align="center" valign="middle" class="button">Link 2</td></a> <a href="page3.html"><td width="69" height="27" align="center" valign="middle" class="button">Link 3 </td></a> <a href="page4.html"><td width="69" height="27" align="center" valign="middle" class="button">Link 4</td></a> </tr> </table>
  17. Lee

    Upward scrolling

    I can't remember now to be honest, I know it was used to scroll upcoming events & I thought that it would be really handy for my "latest products" box for my shop. Thanks
  18. Lee

    Upward scrolling

    Vertical -up. I tried adding the tag in the opening table tag but it doesnt work. <table width="240" border="0" cellspacing="0" cellpadding="0" marquee scrollamount="5" direction="up"> Basically I want to put images in a table & have them scroll continuously. Thanks
  19. Lee

    Upward scrolling

    I have nested a table inside a table & I want it to scroll upwards. Here is the code I used, but it doesn't scroll. Does anyone have a solution? Thanks in advance. <table width="240" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="20" align="center" valign="middle" background="images/sub-section-top.gif" class="WhiteHeader">Latest Products </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> <table width="240" border="0" cellspacing="0" cellpadding="0" marquee scrollamount="5" direction="up"> <tr> <td height="198" align="center" valign="middle" class="sub-bg"><img src="images/products/Unicum_pot200.jpg" width="200" height="187" /></td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"><p> <span class="maintext">New Unicum gel......A true all-in one gel<br /> <a href="products/uvgel/unicum/index.php" class="links">MORE..</a></span></p> </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> </td> </tr> <tr> <td align="center" valign="middle" class="sub-bg"> </td> </tr> </table></td> </tr> <tr> <td height="10" align="center" valign="middle" background="images/sub-bottom.gif"></td> </tr> </table>
  20. Yes I could do, but I am just learning & practicing with arrays so I'm trying to discover what I can do with them & how to manipulate them. Thanks.
  21. Wonderful, thank you. So where now would I insert the asort function to get them to echo in alphabetical order? Thanks.
  22. I'm a bit lost about how to echo all the values in an array. Here is what I wrote, but the first method only echoes out the last value, & the second method just gives an error. Can anyone tell me what I am doing wrong? Also, where would I insert the asort function to get them to display in alphabetical order? Thanks in advance. <?php $genres = array ( '1' => 'reggae', '2' => 'ska', '3' => 'country', '4' => 'jazz', '5' => 'metal', '6' => 'folk', '7' => 'acoustic', '8' => 'disco'); foreach ($genres as $genres_value); echo ($genres_value); ?> <?php $genres = array ('reggae', 'ska', 'country', 'jazz', 'metal', 'folk', 'acoustic', 'disco') foreach ($genres as $genres_value); echo ($genres_value); ?>
  23. I am trying to import an sql database into wamp that I have backed up from a phpBB board. The database is over 3MB, but WAMP on my local machine will only allow me to import a database of a max size of 2048kb. Is there any way I can get rid of this limit? Why is there a limit? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.