Solved

Switch Stopped Working

Posted on 2013-05-13
5
229 Views
Last Modified: 2013-05-13
I have a switch that was rendering my php file, then it stopped.

www.menuhead.com/feedyourhead.php
this is the code on place_serach.php which is triggered when you select one of the buttons.

<?php
include('config.php');
$Alpha=$_POST['Alpha']= mysql_real_escape_string($_POST['Alpha']);
?>
<?php
error_reporting(E_ALL);

switch ($Alpha)
	{
	case "1":
		include ('africa_search.php'); 
		break;
	case "2":
		include ('baltic_search.php');
		break;
	case "3":
		include ('caribbean_search.php'); 
		break;
	case "4":
		include ('centeurope_search.php');
		break;
	case "5":
		include ('downunder_search.php'); 
		break;
	case "6":
		include ('easteurope_search.php');
		break;
	case "7":
		include ('mideast_search.php'); 
		break;
	case "8":
		include ('northamerica_search.php');
		break;
	case "9":
		include ('northasia_search.php'); 
		break;
	case "10":
		include ('northeurope_search.php');
		break;
	case "11":
		include ('southamerica_search.php'); 
		break;
	case "12":
		include ('southasia_search.php');
		break;
	case "13":
		include ('southeurope_search.php'); 
		break;
	case "14":
		include ('westasia_search.php');
		break;
	case "15":
		include ('westeurope_search.php'); 
		break;
}
?>
</div>

Open in new window


And the code on one of the php files....but I don't thinks its this.

<div id="BigPlace">
<?php
include('config.php');
$Alpha=$_POST['Alpha']= mysql_real_escape_string($_POST['Alpha']);
?>
<?php
error_reporting(E_ALL);

$html = <<<EOD
<div id="BigName">BALTIC STATES</div>
<table width="930" border="0" cellpadding="0" cellspacing="0" id="Flags" align="center">
	      
          <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td colspan="9" bgcolor="#FFFFFF"><h1 align="left"><strong>Baltics</strong></h1></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
	      <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="center"><a href="Cuisines/estonia.php"><img src="Images/32_Percent/Estonia.png" border="0" width="80" height="80" title="Click Here For More" alt="Estonian" /></a></div></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF"><h3 align="left">Estonian</h3></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#999999">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="center"><a href="Cuisines/lithiuania.php"><img src="Images/32_Percent/Lituania.png" border="0" width="80" height="80" title="Click Here For More" alt="Lithuanian" /></a></div></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF"><div align="left">
	          <h3>Lithiuanian</h3>
	        </div></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
	      <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="300" valign="top" bgcolor="#FFFFFF"><p class="Place">Traditional <strong>Estonian cuisine</strong> has substantially been based on meat and potatoes, and on fish in coastal and lakeside areas, but is influenced by many other cuisines by now. In the present day, it includes a variety of international foods and dishes, with a number of contributions from the traditions of nearby countries. Scandinavian, German, Russian and other influences have played their part. The most typical foods in Estonia have been rye bread, pork, potatoes and dairy products. 
	          </p>
	          <p class="Place">Soups are traditionally eaten before the main course and most often are made of meat or chicken stock mixed with a variety of vegetables. Soups are also blended with sour cream, milk and yogurt. A very specific type of Estonian soup is <em>leivasupp</em>, which is a type of sweet soup that is made of black bread and apples, normally served with sour cream or whipped cream, often seasoned with cinnamon and sugar.
	          </p>	          
	          <p class="Place">Pork and potatoes accompanied by a rich gravy and often served with sauerkraut or other vegetables has been the traditional Estonian main course. Pork has been the most important meat and is eaten roasted, cured as bacon, in the form of ham, or in pies and sausages. There are many other main dishes too. </p>
	          <p class="Place">Black rye bread accompanies almost every savory food in Estonia. Instead of wishing &quot;bon appetit&quot;, Estonians are prone to say <em>jätku leiba</em> (&quot;may your bread last&quot;). Estonians continue to value their varieties of black rye-based bread. Estonia has not been a land of plenty. If a piece of bread was dropped on the floor, it was good form to pick it up, kiss it to show respect, and eat it. When Estonians live abroad, they often say that they miss black bread the most.</p></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#999999">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="300" valign="top" bgcolor="#FFFFFF"><div align="left">
	          <p class="Place">Lithuanian cuisine is pretty simple but has a variety of interesting dishes. Rye, potatoes, various meat, beet root, mushrooms and diary products are often used when preparing Lithuanian food. Because of their common heritage, Lithuanians, Poles, and Ashkenazi Jews share many dishes and beverages. Thus there are similar Lithuanian, Litvak, and Polish versions of dumplings (<em>koldunai</em>, kreplach or pierogi), doughnuts <em>spurgos</em> or (paczki), and <em>blynai</em> crepes (blintzes). German traditions also influenced Lithuanian cuisine, introducing pork and potato dishes, such as potato pudding (<em>kugelis</em> or kugel) and potato sausages (<em>vedarai</em>), as well as the baroque tree cake known as <em>Šakotis</em>. The most exotic of all the influences is Eastern (Karaite) cuisine, and the dishes <em>kibinai</em> and <em>ceburekai</em> are popular in Lithuania. Torte Napoleon was introduced during Napoleon"'"s passage through Lithuania.</p>
	        </div></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
	      <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#999999">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
	      <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" rowspan="2" valign="top" bgcolor="#FFFFFF"><div align="center"><a href="Cuisines/latvia.php"><img src="Images/32_Percent/Latvia.png" border="0" width="80" height="80" title="Click Here For More" alt="Latvian" /></a></div></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF"><h3 align="left">Latvian</h3></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#999999">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
	      <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="300" valign="top" bgcolor="#FFFFFF"><div align="left">
	          <p class="Place">Latvian cuisine typically consists of agricultural products, with meat featuring in most main meal dishes. Fish is commonly consumed due to Latvia"'"s location on the east coast of the Baltic Sea.          Latvian cuisine has been influenced by neighboring countries in the Baltic region. Common ingredients in Latvian recipes are found locally, such as potatoes, wheat, barley, cabbage, onions, eggs and pork. Latvian food is generally quite fatty, and uses few spices.</p>
	        </div>
            <div align="left"></div></td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#999999">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
	      <tr>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td width="80" bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
	        <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
</table>
EOD;
?>
</div>

Open in new window

0
Comment
Question by:DS928
  • 2
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
ID: 39162759
What is this supposed to be doing.
$Alpha=$_POST['Alpha']= mysql_real_escape_string($_POST['Alpha']);

When debugging ajax calls it helps to call the page directly in your browser.
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 39162808
If you want to facilitate debugging AJAX calls, you can use $_REQUEST instead of $_POST.

This is a bit cryptic: "then it stopped."  Do you have any clues you can give us?  For example, have you used var_dump() to print out the contents of the variables that are in question?
0
 

Author Comment

by:DS928
ID: 39162860
The slider is a select box.  When you select one of the images (they have a value of 1 to 15) this triggers the place_search.php which in turn opens the appropriate php file.  Then the table is built.  This was building the table, then it stopped.  Now nothing is happening.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39162874
Not to put too fine a point on it, but what is different now?  When compared to the working version of the code and data model, what changed?

If you're using version control you can roll back to the last working version and try your next set of changes.
0
 

Author Comment

by:DS928
ID: 39162921
This was missing.  Must have gotten erased when I was cutting and pasting through all of that code.

echo $html;
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question