Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/88571-help/
Share on other sites

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 &#8211; The Image Maker</a></li>
</ul>
</div>


</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453448
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453451
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453475
Share on other sites

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');
?>

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453480
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453491
Share on other sites

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 &#8211; The Image Maker</a></li>
</ul>
</div>


</body>

</html>

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453705
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453719
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453723
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453747
Share on other sites

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453763
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/88571-help/#findComment-453777
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.