Page 1 of 1

Undefined variable

Posted: Wed Feb 04, 2004 7:00 pm
by mattmcb
I'm receiving this error:

Notice: Undefined variable: v in c:\program files\apache group\apache\htdocs\index.php on line 19

Code: Select all

// Main
***LINE 19*** switch($v) {
	case "site_mission":
		include("dsp_site_mission.php");
		break;
		
	case "resources":
		include("dsp_resources.php");
		break;
		
	case "surveys":
		include("dsp_surveys.php");
		break;
		
	case "shopping":
		include("dsp_shopping.php");
		break;
		
	case "links":
		include("dsp_links.php");
		break;
	
	case "about":
		include("dsp_about.php");
		break;
		
	case "suggest_topic":
		include("dsp_suggest_topic.php");
		break;
		
	case "search_site":
		include("dsp_search_site.php");
		break;
		
	case "contact":
		include("dsp_contact.php");
		break;
	
	case "report_problem":
		include("dsp_report_problem.php");
		break;
	
	case "wow":
		include("dsp_wow.php");
		break;
		
	case "feedback":
		include("dsp_feedback.php");
		break;
	
	case "faq":
		include("dsp_faq.php");
		break;
		
	default:
	  include("dsp_home.php");
	  break;
  
	case "test":
		include("test1.php");
		break;
}


Can anyone help?

Posted: Wed Feb 04, 2004 7:03 pm
by d3ad1ysp0rk
post whats above line 19 please (ie. all the code up to 19 :P )

The problem is you arent declaring it.

Code: Select all

<?php
$v = $_GET['v'];
OR
$v = $_POST['v'];
?>
depending on the method your form uses..

Code: Select all

&lt;form method="get" action="page.php"&gt;
or 
&lt;form method="post" action="page.php"&gt;