Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Switch Stopped Working

Posted on 2013-05-13
5
Medium Priority
?
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 1000 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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 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 111

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

722 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