# \[PHP\] string error

**URL:** <https://forum.kirupa.com/t/php-string-error/190258>\
**Category:** programming\
**Created:** [June 9, 2006, 7:56pm UTC](https://forum.kirupa.com/t/php-string-error/190258 "2006-06-09T19:56:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [June 9, 2006, 7:56pm UTC](https://forum.kirupa.com/t/php-string-error/190258/1 "2006-06-09T19:56:32Z")

</div>

This line is giving me an error.

```php
$theSec = "$_GET['sec']" . ".php";

```

```auto
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /homepages/27/d115946677/htdocs/index.php on line 68

```

What does it mean? The whole snippet is:

```php

	<?php
		//homepage code
		function secCode()
		{
			echo("homepage");
		}
	
		//default to homepage
		if(!$_GET['sec'])
		{
			$theSec = "index.php";
		}
		
		//choose the right section code
		else
		{
			$theSec = "$_GET['sec']" . ".php";
		}
		include($theSec);
		secCode();
	?>

```
