Jump to content

Please need help with Parse error: syntax error, unexpected T_ELSE


coolal

Recommended Posts

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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":
          .
          .
          .

 

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.