<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1031275" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1031275</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1183907</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;fifeclub wrote:&lt;/strong&gt; (note: I don&#039;t know if it was necessary but I put a space between  &quot;else if&quot;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;....&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: quoted from &lt;a href=&quot;http://us2.php.net/manual/en/control-structures.elseif.php&quot; class=&quot;bb-url&quot;&gt;http://us2.php.net/manual/en/control-structures.elseif.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In PHP, you can also write &#039;else if&#039; (in two words) and the behavior would be identical to the one of &#039;elseif&#039; (in a single word). The syntactic meaning is slightly different (if you&#039;re familiar with C, this is the same behavior) but the bottom line is that both would result in exactly the same behavior.&lt;/p&gt;&lt;/blockquote&gt;
 </description>
     <pubDate>Fri, 28 Oct 2005 15:09:13 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1183907 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1182916</link>
    <description> &lt;p&gt;This is where good indenting would work. &lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;preg_match&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;/domain1\.com/i\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;HTTP_HOST\&quot;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; include(\&quot;/home/user1/public_html/header.php\&quot;);&lt;br /&gt; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp; if(preg_match(\&quot;/domain2\.com/i\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;HTTP_HOST\&quot;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; include(\&quot;/home/user2/public_html/header.php\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; include(\&quot;/home/user3/public_html/header.php\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt; &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
 This way you can easily see something is missing.&lt;/p&gt;
&lt;p&gt; I love a good editor that will do (, [, &amp;#10; else&amp;#10; {&amp;#10;   if(preg_match(\&amp;quot;/domain2\.com/i\&amp;quot;, $_SERVER[\&amp;quot;HTTP_HOST\&amp;quot;])) &amp;#10;   {&amp;#10;     include(\&amp;quot;/home/user2/public_html/header.php\&amp;quot;);&amp;#10;   }&amp;#10;   else&amp;#10;   {&amp;#10;     include(\&amp;quot;/home/user3/public_html/header.php\&amp;quot;);&amp;#10;   }&amp;#10; }&amp;#10; &amp;#10;[/codefilter_php]or if they all are &quot;one liners&quot; as I call them: &lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;preg_match&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;/domain1\.com/i\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;HTTP_HOST\&quot;])) &lt;br /&gt;&amp;nbsp;&amp;nbsp; include(\&quot;/home/user1/public_html/header.php\&quot;);&lt;br /&gt; else&lt;br /&gt;&amp;nbsp;&amp;nbsp; if(preg_match(\&quot;/domain2\.com/i\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;HTTP_HOST\&quot;])) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; include(\&quot;/home/user2/public_html/header.php\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; include(\&quot;/home/user3/public_html/header.php\&quot;);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt; This way requires good formatting and like I said, I usually only use it for all one liners, even if one section is more than one line, then I will bracket them all for clarity.&lt;/p&gt;
&lt;p&gt; -Greg&lt;/p&gt;
 </description>
     <pubDate>Thu, 20 Oct 2005 13:51:02 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1182916 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1182906</link>
    <description> &lt;p&gt;I know you&#039;ve already changed it, but you were missing a bracket. If you&#039;d tacked on one more closing bracket at the end to finish off the first else, that would have fixed it as well.&lt;/p&gt;
&lt;p&gt;You had this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if (...)&lt;br /&gt;{...}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;if (...)&lt;br /&gt;{...}&lt;br /&gt;else&lt;br /&gt;{...}&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
...which should have been this...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;[code]&lt;br /&gt;if (...)&lt;br /&gt;{...}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;if (...)&lt;br /&gt;{...}&lt;br /&gt;else&lt;br /&gt;{...}&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Thu, 20 Oct 2005 12:53:45 +0000</pubDate>
 <dc:creator>timjpriebe</dc:creator>
 <guid isPermaLink="false">comment 1182906 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1182861</link>
    <description> &lt;p&gt;yeah, that was a screw up. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/tongue.png&quot; title=&quot;Sticking out tongue&quot; alt=&quot;Sticking out tongue&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 20 Oct 2005 03:10:26 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1182861 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1182859</link>
    <description> &lt;p&gt;Yes, that did it.  Thanks!!!  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;br /&gt;
(note: I don&#039;t know if it was necessary but I put a space between  &quot;else if&quot;)&lt;/p&gt;
 </description>
     <pubDate>Thu, 20 Oct 2005 02:55:16 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1182859 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1182855</link>
    <description> &lt;p&gt;I think this is what you want. Combine the middle else/if to become an elseif statement. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;? &lt;br /&gt;if(preg_match(&amp;quot;/domain1\.com/i&amp;quot;, $_SERVER[&amp;quot;HTTP_HOST&amp;quot;])) { &lt;br /&gt;&amp;nbsp; include(&amp;quot;/home/user1/public_html/header.php&amp;quot;); &lt;br /&gt;} &lt;br /&gt;&amp;nbsp; else if(preg_match(&amp;quot;/domain2\.com/i&amp;quot;, $_SERVER[&amp;quot;HTTP_HOST&amp;quot;])) { &lt;br /&gt;&amp;nbsp; include(&amp;quot;/home/user2/public_html/header.php&amp;quot;); &lt;br /&gt;} else { &lt;br /&gt;&amp;nbsp; include(&amp;quot;/home/user3/public_html/header.php&amp;quot;); &lt;br /&gt;} &lt;br /&gt;?&amp;gt; &lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;(EDIT: Fixed spacing...)&lt;/p&gt;
 </description>
     <pubDate>Thu, 20 Oct 2005 02:38:22 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1182855 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/simple-ifelse-php-quesiton#comment-1182853</link>
    <description> &lt;p&gt;put the else tag inside the ifs???&lt;/p&gt;
 </description>
     <pubDate>Thu, 20 Oct 2005 02:29:58 +0000</pubDate>
 <dc:creator>demonhale</dc:creator>
 <guid isPermaLink="false">comment 1182853 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
