I'm getting this error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/golpos5/public_html/articles.php on line 442

and I can't figure out how to fix it. Please help!

thanks in advance

    if the picture is too small, here is the text:

    <div class="CommentRows_Content_DN"></div>
    </div>

          <div class="CommentRows_Right">
            <div class="CommentRows_Right_UP"></div>
            <div class="CommentRows_Right_CN"></div>
            <div class="CommentRows_Right_DN"></div>          
          </div>      
        </div> 
    
      </div>
    1. <div id="RightColumn">
    2. <div id="PicSlideshow">
    3. ';
    4. include "includes/picslideshow.php";
      446.

      echo '
      <!-- Sample generated code from the include above
      <div id="MainImage">
      <a href="#" onclick="SwapMainImage(\''.$mainprofileimage1.'\')" ><img src="'.$webpath.'/uploads/'.$mainprofileimage1.'" id="LargeImage" alt="Member Pictures" /></a>
      </div>

        <div id="Thumbnails">
          <span class="Thumbnail"><a href="#" onclick="SwapMainImage(\''.$imagefullsize.'\')" ><img src="'.$webpath.'/uploads/'.$imagethumbnail.'" /></a></span>  
        </div>

      post the whole script inside the boards php tags.

        first part out of 3:

        <?
        require_once 'classes/access.class.php';
        $user = new flexibleAccess();
        
        if ( $_GET['logout'] == 1 ) 
        	$user->logout('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
        if ( !$user->is_loaded() )
        {
        	//Login stuff:
        	if ( isset($_POST['uname']) && isset($_POST['pwd'])){
        	  if ( !$user->login($_POST['uname'],$_POST['pwd'],$_POST['remember'] )){//Mention that we don't have to use addslashes as the class do the job
        	    $loginstatus = 'Wrong username and/or password';
        	  }else{
        	    //user is now loaded
        	     switch ($user->is_active()){
          	       case 1:
           	         //user is now loaded
        	         header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
          	         break;
          	       case 2:
          	         $user->logout(); //Log the user out automatically
        		     $loginstatus = 'Your account is suspended! Please contact support to resolve the issue.';
          	         break;
         	       default:
           	         $user->logout(); //Log the user out automatically
        		     $loginstatus = 'Your account is not active! Activate your account using the instructions on your welcome email.';
        	      }
        
          }
        }
        
        
        // If not loggedin display signin box   
        include 'includes/signin.php';  
        
        
        }else{
        
        //--------------Connection related code--------Begin
        
        include ("classes/manipulateDB.php");
        $mdbclass = new manipulateDB();
        //$cdb = $mdbclass->connect_db();
        
        //We retrive settings data drom DB
        $query = "select * from settings WHERE settingID=1 LIMIT 1";
        $result = mysql_query($query);
        $useridconverted = 0; 
        
        while ($r = mysql_fetch_array($result)) { 
        $webpath = $r["webpath"];
        $serverpath = $r["serverpath"];    
        } //--------------Connection related code--------End //--------------Regularly Used Functions--------Begin require_once 'functions/getimgthumbnail.php'; //--------------Regularly Used Functions--------End //--------------Insert related code--------Begin if ($user->is_loaded() ) { $userID=$user->get_property('userID'); } if ($_GET['owneruserid'] != "") { $owneruserid=$_GET['owneruserid']; } else { $owneruserid=$userID; //Incase the owner of the profile wants to view his profile, post on his own wall or reply to comments } if(isset($_POST['add'])){ //We will upload the images and get $uploadedlink values before inserting data in DB include('includes/upload_actions.php'); //$d = date('d m y H:i:s'); //System Date $d = gmdate("d m y H:i:s"); //GMT $postdate = $d{6}.$d{7}.$d{3}.$d{4}.$d{0}.$d{1}.$d{9}.$d{10}.$d{12}.$d{13}.$d{15}.$d{16}; //convert the date to MySQL format //Check if the check boxes has been checked ot not if (isset($_POST['reviewed'])) { $reviewed = 1; }else{ $reviewed = 0; } if (isset($_POST['privacy'])) { $privacy = 1; }else{ $privacy = 0; } if (substr_count($_POST['targeturl'],"http://")==0) { $Convertedtargeturl = "http://".$_POST['targeturl']; } else { $Convertedtargeturl = $_POST['targeturl']; } $data = array( 'articles_catid' => $_POST['articles_catid'], 'type' => $_POST['type'], 'userid' => $userID, 'article' => $_POST['article'], 'description' => $_POST['description'], 'targeturl' => $Convertedtargeturl, 'image1' => $uploadedlink1, /* If all image fields and Youtube video upload is to be used 'video1' => $uploadedlink1, 'video2' => $uploadedlink2, 'image1' => $uploadedlink3, 'image2' => $uploadedlink4, 'image3' => $uploadedlink5, 'image4' => $uploadedlink6, */ 'privacy ' => '0', 'reviewed' => '1', 'rating' => '1', 'tag1' => $_POST['tag1'], 'tag2' => $_POST['tag2'], 'tag3' => $_POST['tag3'], 'tag4' => $_POST['tag4'], 'postdate' => $postdate, /* Not used 'youtubevid1' => $_POST['video1'], 'youtubevid2' => $_POST['video2'], */ ); $idb = $mdbclass->insertDB("articles",$data); //We will use the following code instead of mysql_insert_id() becuase it does not work correctly on bigint type fields $query = "SELECT LAST_INSERT_ID()"; $result = mysql_query($query); if ($result) { $nrows = mysql_num_rows($result); $row = mysql_fetch_row($result); $lastID = $row[0]; } //Update User rating $HowMuchToAdd=5; $userIDToRate = $userID; include('includes/updateuserrating.php'); if ($idb) { print "<b>Record saved successfully!</b>"; }else{ print "<b>Record did not get saved!</b>"; } //Uncomment if youtube video upload is enabled so to stop redirect and finish upload //if ($uploadedlink1 == "" AND $uploadedlink2 == "") { echo "<meta http-equiv= \"refresh\" content=\"0;URL=articles.php\">"; //} } //--------------Insert related code--------End include "includes/get_leagues_teams_players.php"; echo' <!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" /> <link rel="stylesheet" type="text/css" href="styles/style.css" /> <link rel="stylesheet" type="text/css" href="styles/reversecolumns.css" /> <!--[if IE 6]> <link rel="stylesheet" href="styles/ie6.css" type="text/css" /> <![endif]--> <title>GolPosts.com</title> <script language="JavaScript" type="text/javascript" src="js/adjustdesigns5.js" ></script> <script language="JavaScript" type="text/javascript" src="js/dhtmlcombo.js" ></script> <script src="ajax/ajaxactions.js"></script> <script src="js/showhidesubnav2.js"></script> <script type="text/javascript"> function Show(divelement) { getElementByClass(\'PostComment_Reply\',5,"none"); //Close all post reply comments forms document.getElementById(divelement).style.display="block"; setdiv(); } function Hide(divelement) { document.getElementById(divelement).style.display="none"; } </script> <script language="javascript"> function popddmenu(form,selectname){ type=form.type[form.type.selectedIndex].value; text=form.type[form.type.selectedIndex].text; //Not used loc="'.$_SERVER['PHP_SELF'].'"+"?type="+type; window.location=loc; } function selectOption(ddm, num) { var selObj = document.getElementById(ddm); selObj.selectedIndex = parseInt(num)+1; } </script> <!-- Left and Right columns are reversed on this page by using reversecolumns.css --> </head> <body> <div id="Wrapper"> <div id="LeftSpacing"> </div> <div id="MainDesign"> <div id="Header"> <a href="index.php"> <div id="Logo"> </div> </a> <div id="MainNav_Con"> '; include "includes/mainnav.php"; echo' </div> <div id="SearchBox"> '; include "includes/searchform.php"; echo' </div> </div> <div id="SubHeader"> <div id="LeftArea"> '; include "includes/logout.php"; echo' </div> <div id="SubNav_Con"> '; include "includes/subnav_profile.php"; echo' </div> <div id="LanguageSelector"> '; include "includes/LanguageSelector.php"; echo' </div> </div> <div id="SubNav2_Con" onmouseleave="hidesubnav2()" onmouseout="hidesubnav2()" onmouseover="showsubnav2()"> <!--2 exit mouse events one for IE and one for FF--> <!--Menu Generated Using Ajax--> </div> <noscript> <b>JavaScript in not Enabled! JavaScript is necessary for the normal operation of the website. Please enable JavaScript by <a href="http://www.google.com/support/bin/answer.py?answer=23852">following these directions</a>.</b> </noscript> <div id="Alerts"> <span id="LoginStatus"></span> </div>

          second part:

          <div id="LeftColumn">
                  <div id="TopSpacing2">
                  </div>
                  ';
          
          	//Get User Info
          	$query = "select * from users where userID='$owneruserid' LIMIT 1";
          	$result = mysql_query($query); 
          
          	 while ($r = mysql_fetch_array($result)) {$username = $r["username"];}
          
          	echo '
              <div class="CommentRows">
                <div class="CommentRows_Left">
                  <div class="CommentRows_Left_UP"></div>
                  <div class="CommentRows_Left_CN"></div>
                  <div class="CommentRows_Left_DN"></div>
                </div>
          
                <div class="CommentRows_Content">
                  <div class="CommentRows_Content_UP">Add a New Article</div>
          
                  <div class="CommentRows_Content_CN">
          
          			<div id="FormFieldBox">
          			  <div id="StndBoxContent">
                           <form method = "post" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'" name="signupform" id="signupform"><br/>  
                            <fieldset  id="loginfields">
                              <legend><b>ARTICLE INFORMATION</b></legend>
          					<br/>
          					<label for="choice" class="signupfieldtitle">Type : </label>
                              <div class="WideDropMenuBG"><select name="type" class="widedropmenu" id="TDM" onchange="popddmenu(this.form)" >
                                <option value="" selected>[choose type]
          					  <option value="0">Article
          					  <option value="1" style="display:none;">Images(Soon)
          					  <option value="2">Video
          					  <option value="3">Transfer Rumors
          					  <option value="4">Off The Field
                              </select></div>
          					';
          					if (isset($_GET['type'])) {echo '<script type="text/javascript">selectOption("TDM",'.$_GET['type'].');</script>';}
          					echo '
          					<br />
          					<label for="choice" class="signupfieldtitle">Category : </label>
                              <div class="WideDropMenuBG"><select name = "articles_catid" class="widedropmenu" >
          		              <option value="" selected>[choose category]
          					';
          
          					  //Populate bodypart drop down menu
                  		      $query = "select * from articles_cat where type='".$_GET['type']."'";
          		 		      $result = mysql_query($query); 
          
                   		       while ($r = mysql_fetch_array($result)) { 
                   		       $categoryID = $r["categoryID"]; 
                     		       $category = $r["category"];  
          					   echo "<option value=$categoryID>$category";
                    		       }	
          
          					echo '
                              </select></div>
          					<br />
          					<label for="article" class="signupfieldtitle">Title : </label> 
                              <div class="WideFieldBG"><input name="article" id="article" type="text" class="widefield" tabindex="2" /></div>
                              <br />
          					<label for="lastname" class="signupfieldtitle">Description : </label> 
                              <div class="TextBoxBG"><textarea name="description" cols="40" rows="3" id="desc" class="TextBox" tabindex="3"></textarea></div>
                              <br />
          					<br />
          					<label for="lastname" class="signupfieldtitle">Target URL : </label> 
          					<div class="WideFieldBG"><input name="targeturl" id="targeturl" type="text" class="widefield" tabindex="8" /></div>
                              <br />
          		    		<!--
          					For Youtube Video upload
          					<label for="lastname" class="signupfieldtitle">Video (Main) : </label> 
          					<input type="file" size="22" name="my_field[]" value="" tabindex="8" />
          					<input name="youtubevid1" id="video1" type="text" tabindex="8" title="Alternatively you can input a YouTube video ID"/>		
                              <br />
          					<label for="lastname" class="signupfieldtitle">Video 2 : </label> 
          					<input type="file" size="22" name="my_field[]" value="" tabindex="9" />
          					<input name="youtubevid2" id="video2" type="text" tabindex="8"/>
                              <br />
          					<br />
          					-->
          					<label for="lastname" class="signupfieldtitle">Image 1 (Main) : </label>
          					<div class="WideFieldBG"><input type="file" size="22" name="my_field[]" value="" tabindex="10" /></div>
          					<!--
                              <br />
          					<label for="lastname" class="signupfieldtitle">Image 2 : </label> 
          					<input type="file" size="22" name="my_field[]" value="" tabindex="11" />						
                              <br />
          					<label for="lastname"  class="signupfieldtitle" hidden>Image 3 : </label>
          					<input type="file" size="22" name="my_field[]" value="" tabindex="12" /> 
                              <br />
          					<label for="lastname" class="signupfieldtitle">Image 4 : </label> 
          					<input type="file" size="22" name="my_field[]" value="" tabindex="13" />
          					-->
                              <br />
          					<br />
          					<label for="lastname" class="signupfieldtitle">Search Tag 1 : </label> 
                              <div class="FieldBG" id="tag1"><input name="tag1" id="tag1" type="text" class="signupfield" tabindex="14" />
          					<span class="FieldMoreInfo1"><a href="#" onclick="hidefield(\'tag1\',\'favleagues\');return false;">Insert League</a></span></div>
          					'; get_leagues_teams_players("tag1", "favleagues", "league"); echo '
                              <br />
          					<label for="lastname" class="signupfieldtitle">Search Tag 2 : </label> 
                              <div class="FieldBG" id="tag2"><input name="tag2" id="tag2" type="text" class="signupfield" tabindex="15" />						                        <span class="FieldMoreInfo1"><a href="#" onclick="hidefield(\'tag2\',\'favteams\');return false;">Insert Team</a></span></div>
          					'; get_leagues_teams_players("tag2", "favteams", "team"); echo '
                              <br />
          					<label for="lastname" class="signupfieldtitle">Search Tag 3 : </label> 
                              <div class="FieldBG" id="tag3"><input name="tag3" id="tag3" type="text" class="signupfield" tabindex="16" />
                              <span class="FieldMoreInfo1"><a href="#" onclick="hidefield(\'tag3\',\'favplayers\');return false;">Insert Player</a></span></div>
          					'; get_leagues_teams_players("tag3", "favplayers", "player"); echo '
                              <br />
          					<label for="lastname" class="signupfieldtitle">Search Tag 4 : </label> 
                              <div class="FieldBG" id="tag4"><input name="tag4" id="tag4" type="text" class="signupfield" tabindex="17" /></div>
                              <br />
          					<br />
                            </fieldset> 
          				  <input type="hidden" name="action" value="multiple" />
                            <input id="button1" type="submit" name="add" value="Submit" class="SubmitButton" />
          				</form>
          				<script language="JavaScript" src="js/gen_validatorv31.js" type="text/javascript"></script>
          	    		<script language="JavaScript" type="text/javascript">
           		        var frmvalidator = new Validator("signupform");
            		        frmvalidator.EnableMsgsTogether();
          
                          //frmvalidator.addValidation("articles_catid","dontselect=0");
          	            //frmvalidator.addValidation("articles_catid","req");
          
             		        frmvalidator.addValidation("article","req");
             		        frmvalidator.addValidation("article","maxlen=55","Max length for Title is 55");
          				frmvalidator.addValidation("article","alphanumeric_space_plus")
          
          				frmvalidator.addValidation("description","req");
             		        frmvalidator.addValidation("description","maxlen=4000","Max length for Description is 4000");
          				frmvalidator.addValidation("description","alphanumeric_space_plus");
          				';
          				if ($_GET['type'] != 3 && $_GET['type'] != 4) {
          				echo '
             		        frmvalidator.addValidation("targeturl","req");
             		        frmvalidator.addValidation("targeturl","maxlen=200","Max length for Target URL is 200");
          				';
          				}
          				echo ' 
             		        frmvalidator.addValidation("tag1","maxlen=20","Max length for Tag1 is 20");
          				frmvalidator.addValidation("tag1","alphanumeric_space_plus");
          
             		        frmvalidator.addValidation("tag2","maxlen=20","Max length for Tag2 is 20");
          				frmvalidator.addValidation("tag2","alphanumeric_space_plus");
          
             		        frmvalidator.addValidation("tag3","maxlen=20","Max length for Tag3 is 20");
          				frmvalidator.addValidation("tag3","alphanumeric_space_plus");
          
             		        frmvalidator.addValidation("tag4","maxlen=20","Max length for Tag4 is 20");
          				frmvalidator.addValidation("tag4","alphanumeric_space_plus");
          
                         </script> 
          			  </div>
          			</div>
          
                  </div>

            third part:

            <div class="CommentRows_Content_DN"></div>
                      </div> 
            
                  <div class="CommentRows_Right">
                    <div class="CommentRows_Right_UP"></div>
                    <div class="CommentRows_Right_CN"></div>
                    <div class="CommentRows_Right_DN"></div>          
                  </div>      
                </div> 
            
              </div>
            
            
            
               <div id="RightColumn">
                <div id="PicSlideshow">
                ';
                 include "includes/picslideshow.php";
            
                  echo '
            	  <!-- Sample generated code from the include above
                  <div id="MainImage">
                    <a href="#" onclick="SwapMainImage(\''.$mainprofileimage1.'\')" ><img src="'.$webpath.'/uploads/'.$mainprofileimage1.'" id="LargeImage" alt="Member Pictures" /></a>
                  </div>
            
                  <div id="Thumbnails">
                    <span class="Thumbnail"><a href="#" onclick="SwapMainImage(\''.$imagefullsize.'\')" ><img src="'.$webpath.'/uploads/'.$imagethumbnail.'" /></a></span>  
                  </div>
            	  -->
            
                  <div id="Extras"><a href="photoalbum.php?owneruserid='.$owneruserid.'">(Show All Images)</a></div>
                </div>
                ';
            
                include "includes/getfavplayerteam_profile.php";
            
                echo '    
                <div id="Favorites">
                  <div class="FavoritesBox">
                    <div id="TopPlayer"></div>
                    <div class="BoxContent">
                      <div class="ContentInfo">
                        <div class="Preview">
                          <a href="#"><img src="'.$webpath.'/uploads/'.$favplayerimage1.'" alt="Player pic" /></a>
                        </div>
            
                        <div class="Title">
                          '.$player.'
                        </div>  
            
                        <div class="Flag">
                          <a href="#"><img src="'.$webpath.'/uploads/'.$favplayerimage2.'" alt="Flag pic" /></a>
                        </div>
            
                        <div class="Actions">
                          <span id="'.$playerID.'" class="Score">'.$playerrating.'</span>
                          <a href="#" onclick="PlayerMoveUP('.$playerID.','.$userID.','.$owneruserid.');return false;" Title="Each Gol will Add 1"><span class="ButtonUp"></span></a>
                          <a href="#" onclick="PlayerMoveDown('.$playerID.','.$userID.','.$owneruserid.');return false;" Title="Each penalty will deduct 1"><span class="ButtonDown"></span></a>
                          <span class="Comment"><a href=javascript:postcomment("postcomment_player.php?owneruserid='.$owneruserid.'&userID='.$userID.'&playerID='.$playerID.'")>Comment</a></span>
                        </div>  
                      </div>
            
                    </div>
                    <div class="BoxFooter"></div>                        
                  </div>
            
                  <div class="FavoritesBox">
                    <div id="TopTeam"></div>
                    <div class="BoxContent">
                      <div class="ContentInfo">
                        <div class="Preview">
                          <a href="#"><img src="'.$webpath.'/uploads/'.$favteamimage1.'" alt="Player pic" /></a>
                        </div>
            
                        <div class="Title">
                          '.$team.'
                        </div>  
            
                        <div class="Flag">
                          <a href="#"><img src="'.$webpath.'/uploads/'.$favteamimage2.'" alt="Flag pic" /></a>
                        </div> 
            
                        <div class="Actions">
                          <span id="'.$teamID.'" class="Score">'.$teamrating.'</span>
                          <a href="#" onclick="TeamMoveUP('.$teamID.','.$userID.','.$owneruserid.');return false;" Title="Each Gol will Add 1"><span class="ButtonUp"></span></a>
                          <a href="#" onclick="TeamMoveDown('.$teamID.','.$userID.','.$owneruserid.');return false;" Title="Each penalty will deduct 1"><span class="ButtonDown"></span></a>
                          <span class="Comment"><a href=javascript:postcomment("postcomment_team.php?owneruserid='.$owneruserid.'&userID='.$userID.'&teamID='.$teamID.'")>Comment</a></span>
                        </div>
                      </div>
            
            
                    </div>
                    <div class="BoxFooter"></div>                        
                  </div>
                </div>
            
                <div id="Favorites">
                  <div class="FavoritesBox">
                    <div id="TopFriends"></div>
                    <div class="BoxContent">
                      <div class="ContentInfo2">
                      ';
            		   include "includes/getfriends.php";
            
            		   echo '
            		    <!-- Sample generated code from the include above
            			<div class="Friend">
                          <a href="pitch.php?owneruserid='.$friendid.'"><img src="'.$webpath.'/uploads/'.$friendprofilepic.'" alt="Member Pic" /></a>
                          <div class="Title"><a href="pitch.php?owneruserid='.$friendid.'">'.$username.'</a></div>
                        </div>
            			-->
            
                        <span class="SeeAll"><a href="friends.php?owneruserid='.$owneruserid.'">('.$NoofFriends.') See All</a></span>
                      </div>
                    </div>
                    <div class="BoxFooter"></div>                        
                  </div>
            
                  <div class="FavoritesBox">
                    <div id="TopWorld"></div>
                    <div class="BoxContent3">
                      <div class="ContentInfo3">
                      ';
            		   include "includes/getworld11.php";
            
            		   echo '
            		    <!-- Sample generated code from the include above
                        <div id="world11p1" class="world11">forward1</div>
            			<div id="world11p2" class="world11">forward2</div>
            			<div id="world11p3" class="world11">forward3</div>
            			<div id="world11p4" class="world11">midfielder1</div>
            			<div id="world11p5" class="world11">midfielder2</div>
            			<div id="world11p6" class="world11">midfielder3</div>
            			<div id="world11p7" class="world11">midfielder4</div>
            			<div id="world11p8" class="world11">defender1</div>
            			<div id="world11p9" class="world11">defender2</div>
            			<div id="world11p10" class="world11">defender3</div>
            			<div id="world11p11" class="world11">keeper1</div>
            			-->
                      </div>
                    </div>
                    <div class="BoxFooter3"></div>                        
                  </div>
                </div>
            
              </div>  
            
            
              <div id="Footer">
                <div id="FooterLeft"></div>
            
            	'; include "includes/footernav.php"; echo'
            
                <div id="FooterRight"></div>   
              </div>
            
              <div id="Credits">
                ';  include 'includes/credits.php'; echo'
              </div>      
            </div>
            
            <div id="RightSpacing">
            </div>
            
            </div>
            
            <script type="text/javascript">
            //This is a workaround to onresize becuase it does not w3c validate when used on tags.
            <!--
            window.onresize=setdiv;
            //-->
            </script>
            </body>
            </html>
            ';
            }
            ?>

              thanks. Can someone please help? I have no idea what is wrong!

              thanks a lot!

                probably not connected, but I did notice that you have a comma at the end of your arrays:

                'postdate' => $postdate,

                when it shouldn't be there.

                I had a look through, but its hard to tell what's going on. maybe its just me, but I'd never echo that much html as I wouldn't be able to follow my own code, let alone someone elses.

                try removing the comma, you never know how it will cascase down

                  thanks a lot. I agree.. It is definitely hard to follow..

                  I tried removing the comma, but unfortunately it didn't work. I'm so frustrated!I have no idea what is wrong!

                    also, I think your value declaration is missing the quotes:

                    echo "<option value=$categoryID>$category";

                    should be

                    echo "<option value='" . $categoryID . "'>$category";

                    there are also quite a few includes - any of which could introduce the problem you're seeing.

                    I definitely recommend rewriting the code so the html is, on the whole, separate. I just took the code into dreamweaver and started to do it, and noticed that the above option construct is missing a closing tag - which is really difficult to tell in the massive echo. the above is a loop, so will all be missing the closing </option> tag.

                      this is the code i used to try and make sense of it:

                      1 of 3

                      
                      <? 
                      require_once 'classes/access.class.php'; 
                      $user = new flexibleAccess(); 
                      
                      if ( $_GET['logout'] == 1 ) 
                          $user->logout('http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); 
                      if ( !$user->is_loaded() ) 
                      { 
                          //Login stuff: 
                          if ( isset($_POST['uname']) && isset($_POST['pwd'])){ 
                            if ( !$user->login($_POST['uname'],$_POST['pwd'],$_POST['remember'] )){//Mention that we don't have to use addslashes as the class do the job 
                              $loginstatus = 'Wrong username and/or password'; 
                            }else{ 
                              //user is now loaded 
                               switch ($user->is_active()){ 
                                   case 1: 
                                      //user is now loaded 
                                   header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); 
                                     break; 
                                   case 2: 
                                     $user->logout(); //Log the user out automatically 
                                   $loginstatus = 'Your account is suspended! Please contact support to resolve the issue.'; 
                                     break; 
                                 default: 
                                      $user->logout(); //Log the user out automatically 
                                   $loginstatus = 'Your account is not active! Activate your account using the instructions on your welcome email.'; 
                                } 
                      
                        } 
                      } 
                      
                      
                      // If not loggedin display signin box    
                      include 'includes/signin.php';   
                      
                      
                      }else{ 
                      
                      //--------------Connection related code--------Begin 
                      
                      include ("classes/manipulateDB.php"); 
                      $mdbclass = new manipulateDB(); 
                      //$cdb = $mdbclass->connect_db(); 
                      
                      //We retrive settings data drom DB 
                      $query = "select * from settings WHERE settingID=1 LIMIT 1"; 
                      $result = mysql_query($query); 
                      $useridconverted = 0; 
                      
                      while ($r = mysql_fetch_array($result)) { 
                      $webpath = $r["webpath"]; 
                      $serverpath = $r["serverpath"];     
                      } //--------------Connection related code--------End //--------------Regularly Used Functions--------Begin require_once 'functions/getimgthumbnail.php'; //--------------Regularly Used Functions--------End //--------------Insert related code--------Begin if ($user->is_loaded() ) { $userID=$user->get_property('userID'); } if ($_GET['owneruserid'] != "") { $owneruserid=$_GET['owneruserid']; } else { $owneruserid=$userID; //Incase the owner of the profile wants to view his profile, post on his own wall or reply to comments } if(isset($_POST['add'])){ //We will upload the images and get $uploadedlink values before inserting data in DB include('includes/upload_actions.php'); //$d = date('d m y H:i:s'); //System Date $d = gmdate("d m y H:i:s"); //GMT $postdate = $d{6}.$d{7}.$d{3}.$d{4}.$d{0}.$d{1}.$d{9}.$d{10}.$d{12}.$d{13}.$d{15}.$d{16}; //convert the date to MySQL format //Check if the check boxes has been checked ot not if (isset($_POST['reviewed'])) { $reviewed = 1; }else{ $reviewed = 0; } if (isset($_POST['privacy'])) { $privacy = 1; }else{ $privacy = 0; } if (substr_count($_POST['targeturl'],"http://")==0) { $Convertedtargeturl = "http://".$_POST['targeturl']; } else { $Convertedtargeturl = $_POST['targeturl']; } $data = array( 'articles_catid' => $_POST['articles_catid'], 'type' => $_POST['type'], 'userid' => $userID, 'article' => $_POST['article'], 'description' => $_POST['description'], 'targeturl' => $Convertedtargeturl, 'image1' => $uploadedlink1, 'privacy ' => '0', 'reviewed' => '1', 'rating' => '1', 'tag1' => $_POST['tag1'], 'tag2' => $_POST['tag2'], 'tag3' => $_POST['tag3'], 'tag4' => $_POST['tag4'], 'postdate' => $postdate ); $idb = $mdbclass->insertDB("articles",$data); //We will use the following code instead of mysql_insert_id() becuase it does not work correctly on bigint type fields $query = "SELECT LAST_INSERT_ID()"; $result = mysql_query($query); if ($result) { $nrows = mysql_num_rows($result); $row = mysql_fetch_row($result); $lastID = $row[0]; } //Update User rating $HowMuchToAdd=5; $userIDToRate = $userID; include('includes/updateuserrating.php'); if ($idb) { print "<b>Record saved successfully!</b>"; }else{ print "<b>Record did not get saved!</b>"; } //Uncomment if youtube video upload is enabled so to stop redirect and finish upload //if ($uploadedlink1 == "" AND $uploadedlink2 == "") { echo "<meta http-equiv= \"refresh\" content=\"0;URL=articles.php\">"; //} } //--------------Insert related code--------End include "includes/get_leagues_teams_players.php"; ?>
                        <!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" /> 
                        <link rel="stylesheet" type="text/css" href="styles/style.css" /> 
                        <link rel="stylesheet" type="text/css" href="styles/reversecolumns.css" /> 
                        <!--[if IE 6]> 
                        <link rel="stylesheet" href="styles/ie6.css" type="text/css" /> 
                        <![endif]--> 
                        <title>GolPosts.com</title> 
                        <script language="JavaScript" type="text/javascript" src="js/adjustdesigns5.js" ></script> 
                        <script language="JavaScript" type="text/javascript" src="js/dhtmlcombo.js" ></script> 
                        <script src="ajax/ajaxactions.js"></script> 
                        <script src="js/showhidesubnav2.js"></script> 
                        
                        <script type="text/javascript"> 
                        function Show(divelement) { 
                        getElementByClass('PostComment_Reply',5,"none"); //Close all post reply comments forms 
                        document.getElementById(divelement).style.display="block"; 
                        setdiv(); 
                        } 
                        
                        function Hide(divelement) { 
                        document.getElementById(divelement).style.display="none";     
                        } </script> <script language="javascript"> function popddmenu(form,selectname){ type=form.type[form.type.selectedIndex].value; text=form.type[form.type.selectedIndex].text; //Not used loc="'.$_SERVER['PHP_SELF'].'"+"?type="+type; window.location=loc; } function selectOption(ddm, num) { var selObj = document.getElementById(ddm); selObj.selectedIndex = parseInt(num)+1; } </script> <!-- Left and Right columns are reversed on this page by using reversecolumns.css --> </head> <body> <div id="Wrapper"> <div id="LeftSpacing"> </div> <div id="MainDesign"> <div id="Header"> <a href="index.php"> <div id="Logo"> </div> </a> <div id="MainNav_Con"> <?php include "includes/mainnav.php"; ?> </div> <div id="SearchBox"> <?php include "includes/searchform.php"; ?> </div> </div> <div id="SubHeader"> <div id="LeftArea"> <?php include "includes/logout.php"; ?> </div> <div id="SubNav_Con"> <?php include "includes/subnav_profile.php"; ?> </div> <div id="LanguageSelector"> <?php include "includes/LanguageSelector.php";?> </div> </div> <div id="SubNav2_Con" onmouseleave="hidesubnav2()" onmouseout="hidesubnav2()" onmouseover="showsubnav2()"> <!--2 exit mouse events one for IE and one for FF--> <!--Menu Generated Using Ajax--> </div> <noscript> <b>JavaScript in not Enabled! JavaScript is necessary for the normal operation of the website. Please enable JavaScript by <a href="http://www.google.com/support/bin/answer.py?answer=23852">following these directions</a>.</b> </noscript> <div id="Alerts"> <span id="LoginStatus"></span> </div> <div id="LeftColumn"> <div id="TopSpacing2"> </div> <?php //Get User Info $query = "select * from users where userID='$owneruserid' LIMIT 1"; $result = mysql_query($query); while ($r = mysql_fetch_array($result)) {$username = $r["username"];} ?> <div class="CommentRows"> <div class="CommentRows_Left"> <div class="CommentRows_Left_UP"></div> <div class="CommentRows_Left_CN"></div> <div class="CommentRows_Left_DN"></div> </div> <div class="CommentRows_Content"> <div class="CommentRows_Content_UP">Add a New Article</div> <div class="CommentRows_Content_CN"> <div id="FormFieldBox"> <div id="StndBoxContent"> <form method = "post" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'" name="signupform" id="signupform"><br/> <fieldset id="loginfields"> <legend><b>ARTICLE INFORMATION</b></legend> <br/> <label for="choice" class="signupfieldtitle">Type : </label> <div class="WideDropMenuBG"><select name="type" class="widedropmenu" id="TDM" onchange="popddmenu(this.form)" > <option value="" selected>[choose type] <option value="0">Article <option value="1" style="display:none;">Images(Soon) <option value="2">Video <option value="3">Transfer Rumors <option value="4">Off The Field </select></div> <?php if (isset($_GET['type'])) {echo '<script type="text/javascript">selectOption("TDM",'.$_GET['type'].');</script>';} ?> <br /> <label for="choice" class="signupfieldtitle">Category : </label> <div class="WideDropMenuBG"><select name = "articles_catid" class="widedropmenu" > <option value="" selected>[choose category] <?php //Populate bodypart drop down menu $query = "select * from articles_cat where type='".$_GET['type']."'"; $result = mysql_query($query); while ($r = mysql_fetch_array($result)) { $categoryID = $r["categoryID"]; $category = $r["category"]; echo "<option value='$categoryID'>$category</option>"; } ?> </select></div> <br /> <label for="article" class="signupfieldtitle">Title : </label> <div class="WideFieldBG"><input name="article" id="article" type="text" class="widefield" tabindex="2" /></div> <br /> <label for="lastname" class="signupfieldtitle">Description : </label> <div class="TextBoxBG"><textarea name="description" cols="40" rows="3" id="desc" class="TextBox" tabindex="3"></textarea></div> <br /> <br /> <label for="lastname" class="signupfieldtitle">Target URL : </label> <div class="WideFieldBG"><input name="targeturl" id="targeturl" type="text" class="widefield" tabindex="8" /></div> <br /> <!-- For Youtube Video upload <label for="lastname" class="signupfieldtitle">Video (Main) : </label> <input type="file" size="22" name="my_field[]" value="" tabindex="8" /> <input name="youtubevid1" id="video1" type="text" tabindex="8" title="Alternatively you can input a YouTube video ID"/> <br /> <label for="lastname" class="signupfieldtitle">Video 2 : </label> <input type="file" size="22" name="my_field[]" value="" tabindex="9" /> <input name="youtubevid2" id="video2" type="text" tabindex="8"/> <br /> <br /> --> <label for="lastname" class="signupfieldtitle">Image 1 (Main) : </label> <div class="WideFieldBG"><input type="file" size="22" name="my_field[]" value="" tabindex="10" /></div> <!-- <br /> <label for="lastname" class="signupfieldtitle">Image 2 : </label> <input type="file" size="22" name="my_field[]" value="" tabindex="11" /> <br /> <label for="lastname" class="signupfieldtitle" hidden>Image 3 : </label> <input type="file" size="22" name="my_field[]" value="" tabindex="12" /> <br /> <label for="lastname" class="signupfieldtitle">Image 4 : </label> <input type="file" size="22" name="my_field[]" value="" tabindex="13" /> --> <br /> <br /> <label for="lastname" class="signupfieldtitle">Search Tag 1 : </label> <div class="FieldBG" id="tag1"><input name="tag1" id="tag1" type="text" class="signupfield" tabindex="14" /> <span class="FieldMoreInfo1"><a href="#" onclick="hidefield(\'tag1\',\'favleagues\');return false;">Insert League</a></span></div> <?php get_leagues_teams_players("tag1", "favleagues", "league");?> <br />
                          <label for="lastname" class="signupfieldtitle">Search Tag 2 : </label> 
                                                  <div class="FieldBG" id="tag2"><input name="tag2" id="tag2" type="text" class="signupfield" tabindex="15" />                                                <span class="FieldMoreInfo1"><a href="#" onclick="hidefield(\'tag2\',\'favteams\');return false;">Insert Team</a></span></div> 
                                                  <?php get_leagues_teams_players("tag2", "favteams", "team"); ?> 
                                                  <br /> 
                                                  <label for="lastname" class="signupfieldtitle">Search Tag 3 : </label> 
                                                  <div class="FieldBG" id="tag3"><input name="tag3" id="tag3" type="text" class="signupfield" tabindex="16" /> 
                                                  <span class="FieldMoreInfo1"><a href="#" onclick="hidefield(\'tag3\',\'favplayers\');return false;">Insert Player</a></span></div> 
                                                  <?php get_leagues_teams_players("tag3", "favplayers", "player"); ?>
                                                  <br /> 
                                                  <label for="lastname" class="signupfieldtitle">Search Tag 4 : </label> 
                                                  <div class="FieldBG" id="tag4"><input name="tag4" id="tag4" type="text" class="signupfield" tabindex="17" /></div> 
                                                  <br /> 
                                                  <br /> 
                                                </fieldset> 
                                                <input type="hidden" name="action" value="multiple" /> 
                                                <input id="button1" type="submit" name="add" value="Submit" class="SubmitButton" /> 
                                              </form> 
                                              <script language="JavaScript" src="js/gen_validatorv31.js" type="text/javascript"></script> 
                                              <script language="JavaScript" type="text/javascript"> 
                                               var frmvalidator = new Validator("signupform"); 
                                                frmvalidator.EnableMsgsTogether(); 
                          
                                          //frmvalidator.addValidation("articles_catid","dontselect=0"); 
                                          //frmvalidator.addValidation("articles_catid","req"); 
                          
                                             frmvalidator.addValidation("article","req"); 
                                             frmvalidator.addValidation("article","maxlen=55","Max length for Title is 55"); 
                                          frmvalidator.addValidation("article","alphanumeric_space_plus") 
                          
                                          frmvalidator.addValidation("description","req"); 
                                             frmvalidator.addValidation("description","maxlen=4000","Max length for Description is 4000"); 
                                          frmvalidator.addValidation("description","alphanumeric_space_plus"); 
                                          '; 
                                          if ($_GET['type'] != 3 && $_GET['type'] != 4) { 
                                          echo ' 
                                             frmvalidator.addValidation("targeturl","req"); 
                                             frmvalidator.addValidation("targeturl","maxlen=200","Max length for Target URL is 200"); 
                                          '; 
                                          } 
                                          echo ' 
                                             frmvalidator.addValidation("tag1","maxlen=20","Max length for Tag1 is 20"); 
                                          frmvalidator.addValidation("tag1","alphanumeric_space_plus"); 
                          
                                             frmvalidator.addValidation("tag2","maxlen=20","Max length for Tag2 is 20"); 
                                          frmvalidator.addValidation("tag2","alphanumeric_space_plus"); 
                          
                                             frmvalidator.addValidation("tag3","maxlen=20","Max length for Tag3 is 20"); 
                                          frmvalidator.addValidation("tag3","alphanumeric_space_plus"); 
                          
                                             frmvalidator.addValidation("tag4","maxlen=20","Max length for Tag4 is 20"); 
                                          frmvalidator.addValidation("tag4","alphanumeric_space_plus"); 
                          
                                         </script> 
                                        </div> 
                                      </div> 
                          
                                  </div> 
                          <div class="CommentRows_Content_DN"></div> 
                                    </div> 
                          
                                <div class="CommentRows_Right"> 
                                  <div class="CommentRows_Right_UP"></div> 
                                  <div class="CommentRows_Right_CN"></div> 
                                  <div class="CommentRows_Right_DN"></div>           
                                </div>       
                              </div> 
                          
                            </div> 
                          
                          
                          
                             <div id="RightColumn"> 
                              <div id="PicSlideshow"> 
                              <?php
                               include "includes/picslideshow.php"; 
                              ?>
                          
                              <div id="Extras"><a href="photoalbum.php?owneruserid='.$owneruserid.'">(Show All Images)</a></div> 
                              </div> 
                              <?php include "includes/getfavplayerteam_profile.php"; ?>
                          
                              <div id="Favorites"> 
                                <div class="FavoritesBox"> 
                                  <div id="TopPlayer"></div> 
                                  <div class="BoxContent"> 
                                    <div class="ContentInfo"> 
                                      <div class="Preview">
                          				<?php echo '<a href="#"><img src="'.$webpath.'/uploads/'.$favplayerimage1.'" alt="Player pic" /></a>';?> 
                                      </div> 
                          
                                      <div class="Title"><?php echo $player;?> 
                                      </div>   
                          
                                      <div class="Flag"> 
                                        <?php echo '<a href="#"><img src="'.$webpath.'/uploads/'.$favplayerimage2.'" alt="Flag pic" /></a>';?> 
                                      </div> 
                          
                                      <div class="Actions"> 
                                        <span id="<?php echo $playerID;?>" class="Score"><?php echo $playerrating; ?></span> 
                                        <?php echo '<a href="#" onclick="PlayerMoveUP('.$playerID.','.$userID.','.$owneruserid.');return false;" Title="Each Gol will Add 1"><span class="ButtonUp"></span></a>';?>
                                        <?php echo '<a href="#" onclick="PlayerMoveDown('.$playerID.','.$userID.','.$owneruserid.');return false;" Title="Each penalty will deduct 1"><span class="ButtonDown"></span></a>';?>
                                        <span class="Comment">
                                        <?php echo '<a href=javascript:postcomment("postcomment_player.php?owneruserid='.$owneruserid.'&userID='.$userID.'&playerID='.$playerID.'")>Comment</a></span>';?> 
                                      </div>   
                                    </div> 
                          
                                  </div> 
                                  <div class="BoxFooter"></div>                         
                                </div> 
                          
                                <div class="FavoritesBox"> 
                                  <div id="TopTeam"></div> 
                                  <div class="BoxContent"> 
                                    <div class="ContentInfo"> 
                                      <div class="Preview"> 
                                        <?php echo '<a href="#"><img src="'.$webpath.'/uploads/'.$favteamimage1.'" alt="Player pic" /></a>';?> 
                                      </div> 
                          
                                      <div class="Title"><?php echo $team; ?></div>   
                          
                                      <div class="Flag"> 
                                        <?php echo '<a href="#"><img src="'.$webpath.'/uploads/'.$favteamimage2.'" alt="Flag pic" /></a>';?> 
                                      </div> 
                          
                                      <div class="Actions"> 
                                        <span id="<?php echo $teamID;?>" class="Score"><?php echo $teamrating; ?></span>
                                        <?php echo '<a href="#" onclick="TeamMoveUP('.$teamID.','.$userID.','.$owneruserid.');return false;" Title="Each Gol will Add 1"><span class="ButtonUp"></span></a>'; ?>
                                        <?php echo '<a href="#" onclick="TeamMoveDown('.$teamID.','.$userID.','.$owneruserid.');return false;" Title="Each penalty will deduct 1"><span class="ButtonDown"></span></a>'; ?>
                                        <span class="Comment">
                                        <?php echo '<a href=javascript:postcomment("postcomment_team.php?owneruserid='.$owneruserid.'&userID='.$userID.'&teamID='.$teamID.'")>Comment</a></span>';?> 
                                      </div> 
                                    </div> 
                          
                          
                                  </div> 
                                  <div class="BoxFooter"></div>                         
                                </div> 
                              </div> 
                          
                              <div id="Favorites"> 
                                <div class="FavoritesBox"> 
                                  <div id="TopFriends"></div> 
                                  <div class="BoxContent"> 
                                    <div class="ContentInfo2"><?php include "includes/getfriends.php";?>
                                      <span class="SeeAll"><a href="friends.php?owneruserid='<?php echo $owneruserid;?>'">(<?php echo $NoofFriends; ?>) See All</a></span> 
                                    </div> 
                                  </div> 
                                  <div class="BoxFooter"></div>                         
                                </div> 
                          
                                <div class="FavoritesBox"> 
                                  <div id="TopWorld"></div> 
                                  <div class="BoxContent3"> 
                                    <div class="ContentInfo3"><?php include "includes/getworld11.php";?> 
                                    </div> 
                                  </div> 
                                  <div class="BoxFooter3"></div>                         
                                </div> 
                              </div>               
                            </div>   
                          
                            <div id="Footer"> 
                              <div id="FooterLeft"></div>
                          	<?php include "includes/footernav.php"; ?>
                              <div id="FooterRight"></div>    
                            </div> 
                            <div id="Credits"><?php include 'includes/credits.php'; ?></div>       
                          </div> 
                          
                          <div id="RightSpacing"> 
                          </div> 
                          
                          </div> 
                          
                          <script type="text/javascript"> 
                          //This is a workaround to onresize becuase it does not w3c validate when used on tags. 
                          <!-- 
                          window.onresize=setdiv; 
                          //--> 
                          </script> 
                          </body> 
                          </html>
                          

                            It's possible to attach files to posts so that you don't need to split them up, requiring those helping to put them back together again.

                            Also, it's helpful to only post the relevant parts of posts so that the volunteers helping don't have to wade through to much irrelevant stuff.

                            Oh, and that comma at the end of the array wouldn't have been a problem, PHP allows that. Besides, was it on line 442?

                              darkgr33n wrote:

                              also, I think your value declaration is missing the quotes:

                              echo "<option value=$categoryID>$category";

                              should be

                              echo "<option value='" . $categoryID . "'>$category";

                              Although the first line won't produce valid HTML, it still isn't invalid PHP code.

                              @: As Weedpacket points out, if you're getting an error on line 445, why post your entire code when we only care about a couple of lines at or around line #445?

                              When dealing with parse errors, your best bet is to focus on the line number given plus a few lines above it (since it may have taken the PHP parser that long to realize you'd made an error).

                                I originally posted a few lines below and above the error line, but a user asked me to post the whole code so that is why I did that.

                                Sorry if that caused confusion. I didn't know you could attach the code. That is helpful, thanks!

                                  Write a Reply...