p3rky2005 Posted January 30, 2008 Share Posted January 30, 2008 Hi, im kinda new to php, thought it might have been easier than it is anyway ive messed up and could really do with help if you can help, ive been working on a site and i had to change one image to another no big problem so i whent into the ftp got the page open the source in notepad and changed the image code to the one i wanted, worked great, but having got rid of the backup as what i wanted worked, none of the links at the bottom of the page work any more anyone got any ideas, any one someone can help me straighten out my mess. if you want to have a look at the site, it is www.greatnessoil.co.uk, at the top of the page there are links they all work fine but the ones on the recipes page there are links on the bottom for another 10 pages but only the one i edited shows up any ideas and help much appreciated James Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/ Share on other sites More sharing options...
trq Posted January 30, 2008 Share Posted January 30, 2008 Sounds more like a html issue than that of php. Anyways, well need to see some code. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453434 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 do you want me to copy and past the code into this page here, i dont think it will work propperly, all of the pages are saves as php files not htm or html this is very confusing Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453438 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 this is a copy of the source for the page, wouldnt let me upload .php to just saved it as .txt [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453440 Share on other sites More sharing options...
trq Posted January 30, 2008 Share Posted January 30, 2008 Just paste the relevent parts here within tags. I'm at work so won't download any attachments. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453444 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 oh ok i will paste the whole code im here then: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="en-gb" /> <meta name="Author" content="Alpha Design and Marketing. http://www.adm-group.co.uk" /> <meta name="Copyright" content="Great Ness" /> <meta name="Keywords" content="Great Ness, Rapeseed, Oil, Cold Pressed, Culinary, Cooking, Farm, Extra Virgin, Shropshire, Salopia, Shrewsbury, England, Nutritious, Food Oil, heart healthy, Olive Oil, drizzling, dipping, basting, blending, frying, Nutty, Flavour, smooth, Vitamin E, Vitamin E, Omega 3, Omega 6, delicious, grown locally, ." /> <meta name="Description" content="Great Ness Cold Pressed Extra Virgin Rapeseed Oil. Farmed, Pressed and Bottled in the Heart of England. The Perfect Replacement for Olive Oil" /> <meta name="robots" content="index,follow" /> <meta name="zipcode" content="SY4" /> <meta name="city" content="Shrewsbury" /> <meta name="state" content="Shropshire" /> <meta name="County" content="Shropshire" /> <title>Great Ness - Cold Pressed Extra Virgin Rapeseed Oil</title> <style type="text/css" media="all"> /*<![CDATA[*/ @import url(stylesheets/template.css); /*]]>*/ </style> <script src="x.js" type="text/javascript"> </script> </head> <body> <div id="masthead"> <div id="logo"> <a href="index.php"><img src="images/great_ness.jpg" alt="Great Ness Oil" /></a> </div> <div id="navContainer"> <div id="navigation"> <ul> <li><a href="about_us.php" >ABOUT US</a></li> <li><a href="news.php" >NEWS</a></li> <li><a href="nutrition.php" >NUTRITION</a></li> <li><a href="recipes.php" class="active" >RECIPES</a></li> <li><a href="stockists.php" >STOCKISTS</a></li> <li><a href="contact.php" >CONTACT US</a></li> <li><a href="index.php" >HOME</a></li> </ul> </div> </div> </div> <div id="content"> <img src="images/michellobster.gif" alt="recipe image" /><h3>Great Ness Lemon Oil Aioli <br />with Roast Garlic and Saffron</h3><h4>Ingredients</h4> <ul> <li>3 free-range egg yolks</li> <li>4 cloves garlic</li> <li>salt and freshly ground black pepper</li> <li>150ml/5fl oz Great ness rapeseed lemon oil</li> <li>1 tsp English mustard, optional</li> <li>juice of 1 lemon, a few saffron strands, </li> </ul><p>Aioli is a variant of mayonnaise with added garlic and lemon juice, originally from Provence in France.<br /> This particular Aioli goes well with fish, eggs and vegetables, but shellfish such as prawns, crab and lobster are ideal. Depending on the dish, chopped herbs such as basil, chives or parsley can make a good addition to this basic aioli recipe.</p><h4>Method</h4> <p>Roast cloves of garlic with skin on for few minutes in hot oven, leave to cool then peel.<br /> Blend the garlic, egg yolk, lemon juice, saffron and seasoning and a little mustard, in a food processor, then pour the oil into the blender in a steady stream, until it forms a thick sauce. <br /> The mixture, once blended, should be vibrant and yellow in colour. Leave to infuse for at least 1 hour in a fridge, check seasoning.</p> </div> <a href="/recipes.php?page=1" class="nav">FIRST PAGE</a> <a href="/recipes.php?page=1" class="nav">PREVIOUS</a> <a href="/recipes.php?page=1" class="nav">1</a> 2 <a href="/recipes.php?page=3" class="nav">3</a> <a href="/recipes.php?page=4" class="nav">4</a> <a href="/recipes.php?page=5" class="nav">5</a> <a href="/recipes.php?page=6" class="nav">6</a> <a href="/recipes.php?page=7" class="nav">7</a> <a href="/recipes.php?page=8" class="nav">8</a> <a href="/recipes.php?page=9" class="nav">9</a> <a href="/recipes.php?page=10" class="nav">10</a> <a href="/recipes.php?page=3" class="nav">NEXT</a> <a href="/recipes.php?page=10" class="nav">LAST PAGE</a> <div id="footer"> <img src="images/Floreat_text.jpg" alt="FLOREAT SALOPIA MMVII" /> <ul> <li><a href="http://www.adm-group.co.uk">Designed and created by Alpha</a></li> <li>Registered in England No. 6260275 </li> <li><a href="http://www.the-imagemaker.net">All Product and Food Images Copyright © 2007 Vic Rowling – The Image Maker</a></li> </ul> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453448 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 This is the contents of the recipe.php file? Or the HTML generated by it? Based on the fact that the links add a ?page=# to the URL, I would assume the original version looked at that information and then displayed the appropriate recipe, either getting the data from a database or some file. If this is the actual contents of the recipe.php file AND there is no way to get the original, you got a lot of work ahead of ya. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453451 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 well if i right click the php file and go to edit it brings what you see there up, yeah your exactly rite different recipies come up with the links, no origional wasnt backed up , any ideas Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453453 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 So, I am guessing you did a View Source on the page, made you changes, and then pasted that code into recipes.php? Where are the recipes stored? Can you paste the code from index.php? Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453462 Share on other sites More sharing options...
trq Posted January 30, 2008 Share Posted January 30, 2008 So, I am guessing you did a View Source on the page, made you changes, and then pasted that code into recipes.php? If that is indeed what you have done, its safe to say you have fubared the application. PHP runs server side and outputs html. Simply replacing the php script with the outputted html will stop the site being dynamic in nature. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453475 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 so what your saying there then is ive completely fouled it up as requested index.php txt <?php require_once ('header.php'); $path = $_SERVER['PHP_SELF']; $page = basename($path); $page = basename($path, '.php'); ?> <div id="index"> <p class="script">When quality matters</p> <h3>Great Ness<br /> <span class="subh3">RAPESEED OIL</span></h3> <div id="body_text"> <p>Cold pressed, extra virgin rapeseed oil</p> <p>Provides the perfect answer to roasting, stir-frying, drizzling, dipping and marvellous marinades.</p> <p>With its superb nutty taste, high burn point and genuine versatility, Great Ness Rapeseed Oil is the ultimate companion to those who love good healthy food with great taste</p> </div> <p class="script">The only oil you will ever need</p> </div> <?php require_once ('footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453480 Share on other sites More sharing options...
trq Posted January 30, 2008 Share Posted January 30, 2008 Can you use tags as I said earlier? You'll also need to tell us what you've changed (which lines) and what exactly isn't working. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453484 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 sorry chap, with the code for index.php ive not changed a thing, recipe <img src="images/michellobster.gif" alt="recipe image" /><h3>Great Ness Lemon Oil Aioli <br />with Roast Garlic and Saffron</h3><h4>Ingredients</h4> thats all i changed, this bit of text (images/michellobster.gif) then uploaded it again then the links at the bottom of the page didnt work Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453491 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 What are you using to edit these files? And you still didn't answer where these recipes are stored? Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453500 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 like i said it was only that one thing that i changed so i used note pad, as for the actuall recipes i really dont know where thay are stored, sorry im really no help at this Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453503 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 What is the contents of footer.php? Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453508 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 sorry for the late reply Footer.php <div id="footer"> <img src="images/Floreat_text.jpg" alt="FLOREAT SALOPIA MMVII" /> <ul> <li><a href="http://www.adm-group.co.uk">Designed and created by Alpha</a></li> <li>Registered in England No. 6260275 </li> <li><a href="http://www.the-imagemaker.net">All Product and Food Images Copyright © 2007 Vic Rowling – The Image Maker</a></li> </ul> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453705 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 Well....good/bad news Good news: I (we) should be able to help you fix this page Bad news: Until you figure out where the Recipes are, there is nothing I can do. There is only 3 ways they can be stored. In a database. Do you have a database for this? In a separate file somewhere. Look around in your directories, see if you can find something. Worst secenario: They aren't in either of the above two, meaning they were hard coded into the PHP file and are now gone forever. In this case, you will have to start from scratch with your recipes and we will pick one of the above methods to store them. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453719 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 would the database file be a css file?? all i have in the web server folder are all the php page files, there is a folder called images explains itself lol, then there is stylesheets and that has a file in it called template.css and then there is a templates folder with just one template in it. does this help at all Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453723 Share on other sites More sharing options...
laffin Posted January 30, 2008 Share Posted January 30, 2008 nope, look it's probably mysql based. u have to check the files for mysql_connect or similar db connection strategies with. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453741 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 No, a database would be something like a MySQL server. Unless one of the PHP files has the recipes in it, you are starting from scratch with the recipes. My personal preference for storing these would be in an XML file. Are you ready to start redoing your recipes? Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453747 Share on other sites More sharing options...
p3rky2005 Posted January 30, 2008 Author Share Posted January 30, 2008 thankyou for this yeah im going to have too do them again, this is gonna sound really stupid but how will i do it once youve fixed it if you would please, and how do i edit the pages without messing them up again Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453752 Share on other sites More sharing options...
laffin Posted January 30, 2008 Share Posted January 30, 2008 depends on preference really. MySQL, XML files, FlatFile DB, FlatFiles plenty of ways ya can go about doing something like this. Just really depends how many features u wud like on such a script. I prefer using MySQL, but it may be a bit hard for someone new to setup. if thats the case using FlatFiles will be the way to go for the time being. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453763 Share on other sites More sharing options...
rhodesa Posted January 30, 2008 Share Posted January 30, 2008 Again, my recommendation is to do an XML file. Here is a sample structure: <recipes> <recipe> <title>Great Ness Lemon Oil Aioli with Roast Garlic and Saffron</title> <ingredients> <ingredient>3 free-range egg yolks</ingredient> <ingredient>4 cloves garlic</ingredient> <ingredient>salt and freshly ground black pepper</ingredient> <ingredient>150ml/5fl oz Great ness rapeseed lemon oil</ingredient> <ingredient>1 tsp English mustard, optional</ingredient> <ingredient>juice of 1 lemon, a few saffron strands</ingredient> </ingredients> <description>Aioli is a variant of mayonnaise with added garlic and lemon juice, originally from Provence in France. This particular Aioli goes well with fish, eggs and vegetables, but shellfish such as prawns, crab and lobster are ideal. Depending on the dish, chopped herbs such as basil, chives or parsley can make a good addition to this basic aioli recipe.</description> <method>Roast cloves of garlic with skin on for few minutes in hot oven, leave to cool then peel. Blend the garlic, egg yolk, lemon juice, saffron and seasoning and a little mustard, in a food processor, then pour the oil into the blender in a steady stream, until it forms a thick sauce. The mixture, once blended, should be vibrant and yellow in colour. Leave to infuse for at least 1 hour in a fridge, check seasoning.</method> </recipe> <recipe> ... </recipe> </recipes> Everything between the open/close recipe tags gets repeated for each recipe. The only big thing is you can't use the characters < and > because they represent the start & end of tags. Instead, use < and > respectively. So, to put "300 < 400" inside a tag, you would do: <tag>300 < 400</tag> Get started with that, save the file as recipes.xml and once the XML file is done, we can work out the PHP code. Quote Link to comment https://forums.phpfreaks.com/topic/88571-help/#findComment-453777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.