ThunderAI Posted November 23, 2008 Share Posted November 23, 2008 I am getting the following error: Parse error: syntax error, unexpected T_VARIABLE xxxxxx on line 67 But I only get the error on GoDaddies server not on my own development server. It is very odd. Here is the source close to the problem area: <?php $mainurl = $mainURL; //echo "<br><br>".$mainurl."<br><br>"; $flink = friendly_url($r_cat1[name]); //echo "<br><br>".$flink."<br><br>"; $productid = $r_cat1[id]; //echo "<br><br>".$productid."<br><br>"; $name = $r_cat1[name]; //echo "<br><br>".$name."<br><br>"; $select = $select."<option value='".$mainurl."products.php?cn=".$flink."&cid=".$productid."'>".$name."</option>"; ?> Line 67 is the last line of code Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/ Share on other sites More sharing options...
gaza165 Posted November 23, 2008 Share Posted November 23, 2008 <?php $mainurl = $mainURL; //echo "<br><br>".$mainurl."<br><br>"; $flink = friendly_url($r_cat1[name]); //echo "<br><br>".$flink."<br><br>"; $productid = $r_cat1[id]; //echo "<br><br>".$productid."<br><br>"; $name = $r_cat1[name]; //echo "<br><br>".$name."<br><br>"; $select = "<option value='".$mainurl."products.php?cn=".$flink." cid=".$productid."'>".$name."</option>"; echo "<select>"; echo $select; echo "</select>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697164 Share on other sites More sharing options...
Mchl Posted November 23, 2008 Share Posted November 23, 2008 This code looks ok. except for $r_cat1[name] that should be $r_cat1['name'] (same for $r_cat1[id]) Also you could simplify things a bit like this $select .= "<option value='{$mainurl}products.php?cn=$flink&cid=$productid'>$name</option>"; But I can see nothing that could cause this error. Which line is the line 67? Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697169 Share on other sites More sharing options...
revraz Posted November 23, 2008 Share Posted November 23, 2008 Does $select contain anything before this code? Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697170 Share on other sites More sharing options...
Mchl Posted November 23, 2008 Share Posted November 23, 2008 Even if it didn't it would not trigger this error. Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697172 Share on other sites More sharing options...
ThunderAI Posted November 23, 2008 Author Share Posted November 23, 2008 Here is the full select code: <?php if ($sub_select=='1') { // Display the sub folders of this catalog as a select function and not as indisual lists // TO do this we highjack the normal process and ensure a proper select statement is created // Start by creating the select statement $select = "<FORM NAME='".$r_cat[name]."' style='margin:0; padding:0'>"; $select = $select." •<select name='select' ONCHANGE='goto(this.form)' style='margin:0; padding:0'>"; $select = $select."<option value='#'>--Select ".$r_cat[name]."--</option>"; // Now loop through the information like we normaly would incerting the information into the select statement do{ //LEVEL 2 $category_style1=''; if($cid==$r_cat1[id]){ $category_style1=" id='show_this_category'"; } $mainurl = $mainURL; $flink = friendly_url($r_cat1[name]); $productid = $r_cat1[id]; $name = $r_cat1[name]; $select = $select."<option value='".$mainurl."products.php?cn=".$flink."&cid=".$productid."'>".$name."</option>"; //echo "<select>"; //echo $select; //echo "</select>"; } while($r_cat1=mysql_fetch_assoc($q_cat1)); $select = $select."</select></form>"; $categories_list = $categories_list.$select; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697182 Share on other sites More sharing options...
Mchl Posted November 23, 2008 Share Posted November 23, 2008 Wich line gives you the error. And pleasse use '' in []. Read here in 'Array do's and don'ts' paragraph Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697184 Share on other sites More sharing options...
ThunderAI Posted November 23, 2008 Author Share Posted November 23, 2008 Wich line gives you the error. And pleasse use '' in []. Read here in 'Array do's and don'ts' paragraph Fixed it Quote Link to comment https://forums.phpfreaks.com/topic/133930-odd-t_var-error/#findComment-697186 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.