coolal Posted November 10, 2010 Share Posted November 10, 2010 Here is my code that the probelm is in the line is 1162 if ($num == '')($num = '1'); $frts = ($num*PPPAGE-PPPAGE); if($siteType == "US"){($siteid = '0&language=en-US') && ($sitenum = 'salic=0');} if($siteType == "UK"){($siteid = '3&language=en-GB') && ($sitenum = 'salic=3');} if($siteType == "AU"){($siteid = '15&language=en-AU') && ($sitenum = 'salic=15');} if($siteType == "CA"){($siteid = '2&language=en-CA') && ($sitenum = 'salic=2');} if($siteType == "AT"){($siteid = '16&language=de-AT') && ($sitenum = 'salic=16');} if($siteType == "BE"){($siteid = '123&language=nl-BE') && ($sitenum = 'salic=23');} if($siteType == "FR"){($siteid = '71&language=fr-FR') && ($sitenum = 'salic=71');} if($siteType == "NL"){($siteid = '146&language=nl-NL') && ($sitenum = 'salic=146');} if($siteType == "IT"){($siteid = '101&language=it-IT') && ($sitenum = 'salic=101');} if($siteType == "ES"){($siteid = '186&language=es-ES') && ($sitenum = 'salic=186');} if($siteType == "SG"){($siteid = '216') && ($sitenum = 'salic=180');} if($siteType == "IN"){($siteid = '203&language=en-IN') && ($sitenum = 'salic=95');} $random = rand(0, 1); if ($cloak == '1'){ if ($random == '0'){ $RSSFEEDS = array( 0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&fss=".$front->fss."&sasl=".$front->sellerid."&sacat=".$front->catid."&ftrt=1&fbd=1&sabdlo=".$front->minbid."&sabdhi=".$front->maxbid."&saprclo=".$front->minprice."&saprchi=".$front->maxprice."&floc=1&saslop=1&fsop=$front->sort&fsoo=$front->fsoo&from=R6&fss=0&sacur=0&afepn=".CJID."&customid=".$front->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($front->q)."+".urlencode($sitewidequery)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$front->bin."&fspt=".$front->local."&fpos=".$front->zip."&sadis=".$front->miles."&frts=$frts", );} else { $RSSFEEDS = array( 0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&fss=".$front->fss."&sasl=".$front->sellerid."&sacat=".$front->catid."&ftrt=1&fbd=1&sabdlo=".$front->minbid."&sabdhi=".$front->maxbid."&saprclo=".$front->minprice."&saprchi=".$front->maxprice."&floc=1&saslop=1&fsop=$front->sort&fsoo=$front->fsoo&from=R6&fss=0&sacur=0&afepn=".$cjid2."&customid=".$front->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($front->q)."+".urlencode($sitewidequery)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$front->bin."&fspt=".$front->local."&fpos=".$front->zip."&sadis=".$front->miles."&frts=$frts", ); } else { if ($random == '0'){ $RSSFEEDS = array( 0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&fss=".$front->fss."&sasl=".$front->sellerid."&sacat=".$front->catid."&ftrt=1&fbd=1&sabdlo=".$front->minbid."&sabdhi=".$front->maxbid."&saprclo=".$front->minprice."&saprchi=".$front->maxprice."&floc=1&saslop=1&fsop=$front->sort&fsoo=$front->fsoo&from=R6&fss=0&sacur=0&afepn=".CJID."&customid=".$front->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($front->q)."+".urlencode($sitewidequery)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$front->bin."&fspt=".$front->local."&fpos=".$front->zip."&sadis=".$front->miles."&frts=$frts", ); } else { $RSSFEEDS = array( 0 => "http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=".$siteid."&output=RSS20&fss=".$front->fss."&sasl=".$front->sellerid."&sacat=".$front->catid."&ftrt=1&fbd=1&sabdlo=".$front->minbid."&sabdhi=".$front->maxbid."&saprclo=".$front->minprice."&saprchi=".$front->maxprice."&floc=1&saslop=1&fsop=$front->sort&fsoo=$front->fsoo&from=R6&fss=0&sacur=0&afepn=".$cjid2."&customid=".$front->sid."&saslc=0&fcl=3&saaff=afepn&catref=C5&frpp=100&satitle=".urlencode($front->q)."+".urlencode($sitewidequery)."&ftrv=1&fts=$srchdesc&".$sitenum."&sascs=".$front->bin."&fspt=".$front->local."&fpos=".$front->zip."&sadis=".$front->miles."&frts=$frts", ); } } if (!isset($feedid)) $feedid = 0; $rss_url = $RSSFEEDS[$feedid]; //echo $rss_url; it have something to do with the else but i have no idea. please help thank you Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/ Share on other sites More sharing options...
jcanker Posted November 10, 2010 Share Posted November 10, 2010 You can't have multiple elses like you do. You can only have one else--the last one. If you need to check for multiple conditions, you can use: if(condition) { code here } elseif(2nd condition) { code here } else(last condition) { code here } Also, if you're testing for multiple conditions, it's probably better to use a case instead. 3 conditions are managable if for elseif, but much more & it gets confusing. Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/#findComment-1132741 Share on other sites More sharing options...
ManiacDan Posted November 10, 2010 Share Posted November 10, 2010 You have an else immediately followed by another else right in the middle of that block. You can't do that. Also, none of this code makes any sense, you're using && where it doesn't belong and your indentation is horrible. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/#findComment-1132742 Share on other sites More sharing options...
coolal Posted November 10, 2010 Author Share Posted November 10, 2010 so for my code what would i do to fix it can you fix it please Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/#findComment-1132746 Share on other sites More sharing options...
jcanker Posted November 10, 2010 Share Posted November 10, 2010 I started to take your code and show you the correction, but ManiacDan is right--there's a ton of mistakes in it. If statements aren't ended with ; like you have in the first line. The ; goes at the end of each line inside the curly braces (and you used parantheses instead of curly braces): if(condition) { code set 1; 2nd thing to do; } For big sets of condition checks, like your "What state is it from" setup, use a switch (what I mistakenly called a case--don't ask me why--in my earlier post switch($variable) { case 0: stuff to do; break; case 1: etc.... } So, for your first block of if checks: switch($siteType) { case "US": $siteid = '0&language=en-US'; $sitenum = 'salic=0'; break; case "UK": . . . } Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/#findComment-1132755 Share on other sites More sharing options...
coolal Posted November 10, 2010 Author Share Posted November 10, 2010 can i just email the text to you? Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/#findComment-1132758 Share on other sites More sharing options...
coolal Posted November 10, 2010 Author Share Posted November 10, 2010 jcanker please look in your hotmail account i have send the whole text Quote Link to comment https://forums.phpfreaks.com/topic/218317-please-need-help-with-parse-error-syntax-error-unexpected-t_else/#findComment-1132761 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.