<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>PHP Problems - CSS-Tricks Forums</title>
      <link>http://css-tricks.com/forums/categories/php/feed.rss</link>
      <pubDate>Tue, 21 May 13 12:35:40 -0400</pubDate>
         <description>PHP Problems - CSS-Tricks Forums</description>
   <language>en-CA</language>
   <atom:link href="/forums/discussions/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Wrap wp_nav_menu output around option tags for select menu</title>
      <link>http://css-tricks.com/forums/discussion/25026/wrap-wp_nav_menu-output-around-option-tags-for-select-menu</link>
      <pubDate>Mon, 20 May 2013 17:29:07 -0400</pubDate>
      <dc:creator>croydon86</dc:creator>
      <guid isPermaLink="false">25026@/forums/discussions</guid>
      <description><![CDATA[<p>Hi all</p>

<p>I have set up a wp_nav_menu in Wordpress. I have 2 parent categories, with 2 sub-categories each, so this produces a nested list.</p>

<p>My current code to call this menu is...</p>

<pre><code>&lt;?php wp_nav_menu( 
          array( 
              'theme_location'    =&gt;  'shop-categories',
              'container'         =&gt;  'nav',
              'container_class'   =&gt;  'shop-cat'
          ) 
      ); ?&gt;
</code></pre>

<p>... which outputs this...</p>

<p>(I have simplified the code so you just get an idea of the markup)</p>

<pre><code>&lt;nav class="shop-cat"&gt;
  &lt;ul&gt;
    &lt;li&gt;
      &lt;a&gt;Clothing&lt;/a&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a&gt;T-Shirts&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a&gt;Tops&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a&gt;Accessories&lt;/a&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a&gt;Earings&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a&gt;Hats&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
&lt;/nav&gt;  
</code></pre>

<p>Now I would like to output this...</p>

<pre><code>&lt;select&gt;
  &lt;optgroup label="Clothing"&gt;
    &lt;option value="T-Shirts"&gt;T-Shirts&lt;/option&gt;
    &lt;option value="Tops"&gt;Tops&lt;/option&gt;
  &lt;/optgroup&gt;
  &lt;optgroup label="Accessories"&gt;
    &lt;option value="Earings"&gt;Earings&lt;/option&gt;
    &lt;option value="Hats"&gt;Hats&lt;/option&gt;
  &lt;/optgroup&gt;
&lt;/select&gt;
</code></pre>

<p>...is this possible to do dynamically? Or will it be better to do this manually? I have had a look around but couldn't find any help on this.</p>

<p>Any help appreciated.</p>
]]></description>
   </item>
   <item>
      <title>sending and receiving data on php</title>
      <link>http://css-tricks.com/forums/discussion/24925/sending-and-receiving-data-on-php</link>
      <pubDate>Thu, 16 May 2013 04:10:16 -0400</pubDate>
      <dc:creator>Rohithzr</dc:creator>
      <guid isPermaLink="false">24925@/forums/discussions</guid>
      <description><![CDATA[<p>i hav this form in index.php</p>

<pre><code>  &lt;form action="login.php" method="post"&gt;
  &lt;input type="text" id="txt" class="txt_box" placeholder="ITHC Username or Email" name="user_name"/&gt;
  &lt;input type="button" id="button" class="submit" value="LOG IN" /&gt;
  &lt;input type="submit" id="cancel" class="cancel" value="CANCEL" onClick="disablePopup()" /&gt;
  &lt;/form&gt;
</code></pre>

<p>then i want to send the values to login.php
process the data with mysql in login.php
and return the value / errors or data to index .php and display it</p>
]]></description>
   </item>
   <item>
      <title>.htaccess friendly url</title>
      <link>http://css-tricks.com/forums/discussion/25016/-htaccess-friendly-url</link>
      <pubDate>Mon, 20 May 2013 08:40:28 -0400</pubDate>
      <dc:creator>donpeppo</dc:creator>
      <guid isPermaLink="false">25016@/forums/discussions</guid>
      <description><![CDATA[<p>Hi!
I have a problem with my friendly urls.</p>

<p>I want everything after mydomain.com/ should be handled as ?page=</p>

<p>This is how far I've got so far in my .htaccess</p>

<pre><code>DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)(.*) index.php?page=$1  [NC,L]
</code></pre>

<p>And it works pretty well if write /login my pagehandler catch it as <strong>?page=login</strong> 
but if you write an existing  filename it doesn't work.
Example: <strong>mydomain.com/folder</strong>  becomes <strong>mydomain.com/folder/</strong>  (adds a slash after)
Or if you write: <strong>mydomain.com/file.php</strong>  it loads that php file but i want it not to.
I want it to be handled as <strong>?page=file.php</strong></p>

<p>And i guess this may lead to problems linking to css, and js, if it does and you have any suggestions on how to solve that as well
i would be very thankfull.</p>

<p>I hope I'm not to confusing for you guys.
and thanks in advance for any help you can provide.</p>
]]></description>
   </item>
   <item>
      <title>hNews Microformat</title>
      <link>http://css-tricks.com/forums/discussion/25036/hnews-microformat</link>
      <pubDate>Tue, 21 May 2013 00:00:27 -0400</pubDate>
      <dc:creator>Jeager</dc:creator>
      <guid isPermaLink="false">25036@/forums/discussions</guid>
      <description><![CDATA[<p>So I am still working on a starter theme that suits me. I came across the  hNews Microformat of the "html5 reset" theme. I am using the loop as a template part that I can add where needed. My question is less of a php issue I guess, but more of a semantic issue.</p>

<pre><code>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

  &lt;article &lt;?php post_class() ?&gt; id="post-&lt;?php the_ID(); ?&gt;"&gt;

    &lt;h1 class="entry-title"&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;

    &lt;div class="entry-content"&gt;

      &lt;?php the_content(); ?&gt;

      &lt;?php wp_link_pages(array('before' =&gt; __('Pages: '), 'next_or_number' =&gt; 'number')); ?&gt;

      &lt;?php the_tags( __('Tags: '), ', ', ''); ?&gt;

      &lt;?php // posted_on(); ?&gt;

    &lt;/div&gt;

    &lt;?php edit_post_link(__('Edit this entry'),'','.'); ?&gt;

  &lt;/article&gt;

 &lt;?php comments_template(); ?&gt;

&lt;?php endwhile; endif; ?&gt;
</code></pre>

<p>If I use the article tag, is it okay to use this format to post pages also, or should I have another loop that will display the pages in a div rather than an article?</p>
]]></description>
   </item>
   <item>
      <title>WORDPRESS: Display a Featured Post on homepage?</title>
      <link>http://css-tricks.com/forums/discussion/25006/wordpress-display-a-featured-post-on-homepage</link>
      <pubDate>Mon, 20 May 2013 01:42:17 -0400</pubDate>
      <dc:creator>Keilowe</dc:creator>
      <guid isPermaLink="false">25006@/forums/discussions</guid>
      <description><![CDATA[<p>I followed <a rel="nofollow" href="http://wp.tutsplus.com/tutorials/creative-coding/youtube-and-vimeo-video-gallery-with-wordpress/" title="http://wp.tutsplus.com/tutorials/creative-coding/youtube-and-vimeo-video-gallery-with-wordpress/">this tutorial</a>. Everything works fine I just wanted to add a Custom meta box that has a drop down to display a specific video as "Featured".</p>

<p>I also found <a rel="nofollow" href="http://wordpress.stackexchange.com/questions/9968/how-do-i-create-a-featured-post-within-a-custom-post-type" title="http://wordpress.stackexchange.com/questions/9968/how-do-i-create-a-featured-post-within-a-custom-post-type">this post on stack exchange</a>. But I am not a PHP type of person, so I am clueless on what to do.</p>

<p>Can some one please help me add the Featured Post meta box along with a piece of code to display the selected video inside of a page template?</p>

<p>I'd really appreciate all help!!</p>
]]></description>
   </item>
   <item>
      <title>&quot;Events list&quot; HELP in WP custom theme for client ..</title>
      <link>http://css-tricks.com/forums/discussion/25032/events-list-help-in-wp-custom-theme-for-client-</link>
      <pubDate>Mon, 20 May 2013 22:42:17 -0400</pubDate>
      <dc:creator>dominick1</dc:creator>
      <guid isPermaLink="false">25032@/forums/discussions</guid>
      <description><![CDATA[<p>ok so i am having a problem trying to get my events to only display if the date has not already passed. meaning pretty much if the date is anything less then today dont show it. Ive been wrastling with this for a few hours now and i am in much need of help. ive tried all diff kinds of things.</p>

<p>i am using wordpress and i am also using the custom post types plugin and custom post types ui plugin.</p>

<p>the custom field i am trying to grab the date from and use to compare is called "date_of_event" and it is being created with the datepicker.</p>

<p>if you want to see a live version of what i have now it is indeed live on my server and its working as far as grabing the custom post type and displaying the date chosen by the date picker in the correct ASC order n stuff but for dates that have passed they are still showing as i have not written any logic to do so. this is what im having trouble with. this is the link --&gt; <a rel="nofollow" href="http://domenicocolandrea.com/tiki-bar/" title="domenicocolandrea.com/tiki-bar/">http://domenicocolandrea.com/tiki-bar/
</a></p>

<p>also if you want to see what my code looks like  a link to a .php file of the exact page is here --&gt;   <a rel="nofollow" href="https://www.dropbox.com/s/64zjakrkgtai1mn/eventsHELP.php" title="eventsHELP.php">https://www.dropbox.com/s/64zjakrkgtai1mn/eventsHELP.php</a></p>

<p>To anyone that responds i thank you ahead of time. if there is anything else you may need of me to provide in order to better tackle this please let me know and i will do so.</p>

<p>Thank you.
Dominick</p>
]]></description>
   </item>
   <item>
      <title>FOR loop with counter in variables</title>
      <link>http://css-tricks.com/forums/discussion/25002/for-loop-with-counter-in-variables</link>
      <pubDate>Sun, 19 May 2013 21:31:03 -0400</pubDate>
      <dc:creator>Senff</dc:creator>
      <guid isPermaLink="false">25002@/forums/discussions</guid>
      <description><![CDATA[<p>So I have custom fields in Wordpress but they are not all required, so they may or may not exist. There's a maximum of 3, and I've named them product_image_1, product_image_2, product_image_3. etc.</p>

<p>Right now, I have this to write them:</p>

<pre><code>  the_field('product_image_1');
  the_field('product_image_2')';
  the_field('product_image_3')';
</code></pre>

<p>So I want to put this in a loop, and I thought this was the way to do it:</p>

<pre><code>  for($i=1; $i &lt;= 4; $i++) {
      the_field('${"product_image_" . $i}');
  }
</code></pre>

<p>But this doesn't seem to work and it doesn't write out anything but three times <code>&lt; img src="" &gt;</code>.</p>
]]></description>
   </item>
   <item>
      <title>border none last-child not working in php dynamic list</title>
      <link>http://css-tricks.com/forums/discussion/25022/border-none-last-child-not-working-in-php-dynamic-list</link>
      <pubDate>Mon, 20 May 2013 12:18:58 -0400</pubDate>
      <dc:creator>botpro7</dc:creator>
      <guid isPermaLink="false">25022@/forums/discussions</guid>
      <description><![CDATA[<p>hi guys, i'm trying to rid border bottom from the last div of php dynamic list. Any suggestion to make this work?</p>

<p>These are the <a rel="nofollow" href="http://codepen.io/botpro7/pen/JuEdp" title="codes">codes</a></p>

<p>Thanks in advanced.</p>
]]></description>
   </item>
   <item>
      <title>Limit WordPress URL length</title>
      <link>http://css-tricks.com/forums/discussion/14795/limit-wordpress-url-length</link>
      <pubDate>Tue, 29 Nov 2011 11:58:04 -0500</pubDate>
      <dc:creator>Johnnyb</dc:creator>
      <guid isPermaLink="false">14795@/forums/discussions</guid>
      <description><![CDATA[Hey all,<br /><br />I'm working on a rebuild of a site and trying to keep the new URL's the same as the old ones.  The old ones just use the post name but they appear to be limited to a certain number of characters, for example: <br /><code>www.example.com/news/boston-meets-with-life-sciences-economic-development-organization-from-</code><br /><br />The new URL generated by WordPress looks like this:<br /><code>www.example.com/news/boston-meets-with-life-sciences-economic-development-organization-from-europe/</code><br /><br />I know I can edit the permalink manually via the post editor, but as there are a lot of posts involved then I'm wondering if there's a way to limit the URL (to 100 characters for example) automatically?<br /><br />Any nudge in the right direction would be much appreciated!<br /><br />Thanks in advance!]]></description>
   </item>
   <item>
      <title>Change body background color each week from four set colors</title>
      <link>http://css-tricks.com/forums/discussion/25017/change-body-background-color-each-week-from-four-set-colors</link>
      <pubDate>Mon, 20 May 2013 08:48:33 -0400</pubDate>
      <dc:creator>digitalvaldosta</dc:creator>
      <guid isPermaLink="false">25017@/forums/discussions</guid>
      <description><![CDATA[<p>Where I work, they use colored tags that determine what week clothing items were received. They use only four colors (red, green, blue, yellow). We would like to create a page in which the background color changes to that week's color. I am sure this is simple but I am still new to PHP and am trying to automate trivial things like this as best as possible.</p>

<p>Thanks in advanced for your help.</p>

<p><a rel="nofollow" href="http://joshmcclanahan.com" title="Josh McClanahan">Josh McClanahan</a>
from <a rel="nofollow" href="http://digitalvaldosta.com" title="Digital Valdosta">Digital Valdosta</a></p>
]]></description>
   </item>
   <item>
      <title>Is it good to use header.php?</title>
      <link>http://css-tricks.com/forums/discussion/24992/is-it-good-to-use-header-php</link>
      <pubDate>Sun, 19 May 2013 10:08:03 -0400</pubDate>
      <dc:creator>Rohithzr</dc:creator>
      <guid isPermaLink="false">24992@/forums/discussions</guid>
      <description><![CDATA[<p>I was learning php and found a few articles, one of them was good and i understood php things from there. In that, there was a common Header.php for all files and a footer.php. Now as i am starting to create a new PHP based Forum then</p>

<ol>
<li>Should I use a common Header.php and Footer.php</li>
<li>I want to create a fluid Layout so is it ok to use Boilerplate.css [Dreamweaver's Fluid Design option]</li>
<li>Should i design the whole site in html and then convert it to PHP</li>
</ol>

<p>Really need suggestions, and I know that this is the best place to get it.</p>
]]></description>
   </item>
   <item>
      <title>how to insert config.php data from install.php</title>
      <link>http://css-tricks.com/forums/discussion/24711/how-to-insert-config-php-data-from-install-php</link>
      <pubDate>Tue, 07 May 2013 12:09:17 -0400</pubDate>
      <dc:creator>amis</dc:creator>
      <guid isPermaLink="false">24711@/forums/discussions</guid>
      <description><![CDATA[<p>I have been built script and make install.php for my script</p>

<p>I want insert data of servername , user , password , database in install.php like installation in wordpres</p>
]]></description>
   </item>
   <item>
      <title>Form Validation</title>
      <link>http://css-tricks.com/forums/discussion/24982/form-validation</link>
      <pubDate>Sat, 18 May 2013 17:55:04 -0400</pubDate>
      <dc:creator>LaurelBrittany</dc:creator>
      <guid isPermaLink="false">24982@/forums/discussions</guid>
      <description><![CDATA[<p>I am trying to validate a form and I keep getting an error: Notice: Undefined variable: errorString in C:\xampp\htdocs\introducingphp\email\required_fields\index.php on line 7</p>

<p>The form fields also fill with error text. The form works fine</p>

<pre class="codepen"><code>&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;PHP Form Processing Example&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;?php echo $errorString; ?&gt;

&lt;form action=&quot;process.php&quot; method=&quot;POST&quot;&gt;
  Name:*&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;Name&quot; value=&quot;&lt;?php echo $Name; ?&gt;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;
  Email:*&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;Email&quot; value=&quot;&lt;?php echo $Email; ?&gt;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;
  URL:*&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;URL&quot; value=&quot;&lt;?php echo $URL; ?&gt;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;
  Company:&lt;br /&gt;&lt;input type=&quot;text&quot; name=&quot;Company&quot; value=&quot;&lt;?php echo $Company; ?&gt;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit Form&quot; /&gt;
&lt;/form&gt;
  
&lt;/body&gt;
&lt;/html&gt;</code><a rel="nofollow" href="http://codepen.io/chibiwawa/pen/mCtFe">Check out this Pen!</a></pre>



<p>This is the process.php</p>

<pre class="codepen"><code>&lt;?php
/*
 *  Specify the field names that are in the form. This is meant 
 *  for security so that someone can't send whatever they want 
 *  to the form.
 */
$allowedFields = array(
  'Name',
  'Email',
  'URL',
  'Company',
);

// Specify the field names that you want to require...
$requiredFields = array(
  'Name',
  'Email',
  'URL',
);

$errors = array();
foreach($_POST AS $key =&gt; $value)
{
  // first need to make sure this is an allowed field
  if(in_array($key, $allowedFields))
  {
    $$key = $value;
    
    // is this a required field?
    if(in_array($key, $requiredFields) &amp;&amp; $value == '') 
    {
      $errors[] = &quot;The field $key is required.&quot;;
    }
  } 
}

// were there any errors?
if(count($errors) &gt; 0)
{
  $errorString = '&lt;p&gt;There was an error processing the form.&lt;/p&gt;';
  $errorString .= '&lt;ul&gt;';
  foreach($errors as $error)
  {
    $errorString .= &quot;&lt;li&gt;$error&lt;/li&gt;&quot;;
  }
  $errorString .= '&lt;/ul&gt;';
  
  // display the previous form
  include 'index.php';
}
else
{
  // At this point you can send out an email or do whatever you want
  // with the data...
  
  // each allowed form field name is now a php variable that you can access
  
  // display the thank you page
  header(&quot;Location: thanks.html&quot;);
}

</code><a rel="nofollow" href="http://codepen.io/chibiwawa/pen/mCtFe">Check out this Pen!</a></pre>


]]></description>
   </item>
   <item>
      <title>Friendly URL | GET parameters lost</title>
      <link>http://css-tricks.com/forums/discussion/24832/friendly-url-get-parameters-lost</link>
      <pubDate>Sun, 12 May 2013 05:55:28 -0400</pubDate>
      <dc:creator>AndrewPham</dc:creator>
      <guid isPermaLink="false">24832@/forums/discussions</guid>
      <description><![CDATA[<p>Let's say I have a website : example.com</p>

<p>And a webpage: example.com/page.php</p>

<p>I want to make it more friendly, so I use .htaccess: example.com/page</p>

<p>Which contains links to other "pages". They are actually the same one, the only difference being the GET parameters from the URL, which would pull different content from the database.</p>

<p>So by clicking the links within "page.php", wether you're on "example.com/page.php" or "example.com/page", you'll get to "example.com/page.php?category=design&amp;page=3&amp;lang=ro"</p>

<p>I want to make it more friendly too, so I use, again, .htaccess. The result would be "example.com/page", followed by all those values, separated by slashes: "example.com/page/design/3/ro"</p>

<p>My question is: Within the page.php file, how on earth am I going to be able to make use of the GET parameters??</p>

<p>$_GET["category"] or $_GET["page"] wouldn't work, at least in my case. Does it work for you? It isn't even logical to work. There is no "category" or "page" parameter in the URL. So when attempting to write $_GET["category"], the server will analize the URL and it will need the actual parameter NAME as well as the VALUE. In our case, we only have the value. Someone, please fill me in?</p>
]]></description>
   </item>
   <item>
      <title>what is wrong in these codes php, sql</title>
      <link>http://css-tricks.com/forums/discussion/24933/what-is-wrong-in-these-codes-php-sql</link>
      <pubDate>Thu, 16 May 2013 11:56:57 -0400</pubDate>
      <dc:creator>Rohithzr</dc:creator>
      <guid isPermaLink="false">24933@/forums/discussions</guid>
      <description><![CDATA[<p>index.php</p>

<pre><code>    &lt;div class="pophead"&gt;
&lt;?php 
  include 'connect.php'
  ?&gt;
        &lt;form action="login.php" method="POST"&gt;
            &lt;input type="text" id="txt" class="txt_box" placeholder="ITHC Username or Email" name="user_name"/&gt;
            &lt;input type="password" id="pass" class="pass_box" placeholder="Password" name="user_pass"/&gt;
            &lt;input type="submit" id="button" class="submit" value="LOG IN" /&gt;
            &lt;input type="button" id="cancel" class="cancel" value="CANCEL" onClick="disablePopup()" name="user_pass"/&gt;
        &lt;/form&gt;
    &lt;!--i want to display a error msg here between error--&gt;
    &lt;error&gt;&lt;/error&gt;
    &lt;/div&gt;
</code></pre>

<p>and login.php</p>

<pre><code>&lt;?php
  if(isset($_SESSION['signed_in']) &amp;&amp; $_SESSION['signed_in'] == true)
  {
    ?&gt;
      &lt;script type="text/javascript"&gt;
        alert("You are already signed in, you can &lt;a href='signout.php'&gt;sign out&lt;/a&gt; if you want.");
        history.back();
      &lt;/script&gt;
  &lt;?php
}
else
{
  if($_SERVER['REQUEST_METHOD'] === 'POST')
  {
    $errors = array();
    if(!isset($_POST['user_name'])){
      $errors[] = 'The username field must not be empty.';
    }

    if(!isset($_POST['user_pass'])){
      $errors[] = 'The password field must not be empty.';
    }

    if(!empty($errors)){
      ?&gt;
        &lt;script type="text/javascript"&gt;
                    alert("Uh-oh.. a couple of fields are not filled in correctly..");
                    history.back();
                &lt;/script&gt;
      &lt;?php
    }
  }
    else
    {
      $sql = "SELECT 
            user_id,
            user_name,
            user_level
          FROM
            user
          WHERE
            user_name = '" . mysql_real_escape_string($_POST['user_name']) . "'
          AND
            user_pass = '" . sha1($_POST['user_pass']) . "'";

      $result = mysql_query($sql);
      if(!$result)
      {
        ?&gt;
          &lt;script type="text/javascript"&gt;
                        alert("SQl ERROR TRY AGAIN LATER");
                        history.back();
                    &lt;/script&gt;
                &lt;?php
      }
      else if(mysql_num_rows($result) == 0)
      {
        ?&gt;
          &lt;script type="text/javascript"&gt;
                        alert("wrong user and pass combination");
                        history.back();
                    &lt;/script&gt;
                &lt;?php
      }
      else
      {
        $_SESSION['signed_in'] = true;
        while($row = mysql_fetch_assoc($result))
        {
          $_SESSION['user_id']  = $row['user_id'];
          $_SESSION['user_name']  = $row['user_name'];
          $_SESSION['user_level'] = $row['user_level'];
        }
        ?&gt;
          &lt;script type="text/javascript"&gt;
                        alert("Welcome, ' . $_SESSION['user_name'] . '. &lt;br /&gt;&lt;a href='index.php'&gt;Proceed");
                        history.back();
                    &lt;/script&gt;
                &lt;?php

      }
    }
  }

?&gt;  
</code></pre>
]]></description>
   </item>
   <item>
      <title>Change Status of a Message from Read to Unread</title>
      <link>http://css-tricks.com/forums/discussion/24920/change-status-of-a-message-from-read-to-unread</link>
      <pubDate>Wed, 15 May 2013 18:19:55 -0400</pubDate>
      <dc:creator>Hillcrest1674</dc:creator>
      <guid isPermaLink="false">24920@/forums/discussions</guid>
      <description><![CDATA[<p>How do you implement the option to change status of a Message in our admin section from "Read" to "Unread" ? Is that really hard to do ?</p>

<p>We receive messages in our admin section and once a message is read we would like to be able to change the status of the message from "read" back to "Unread".</p>

<p>Is that a rather easy thing to do or complicated ?</p>

<p>Thank you !</p>
]]></description>
   </item>
   <item>
      <title>How to set top margin in layerslider</title>
      <link>http://css-tricks.com/forums/discussion/24890/how-to-set-top-margin-in-layerslider</link>
      <pubDate>Tue, 14 May 2013 18:48:07 -0400</pubDate>
      <dc:creator>AAL002626</dc:creator>
      <guid isPermaLink="false">24890@/forums/discussions</guid>
      <description><![CDATA[<p>Hi Friends,</p>

<p>I am not very technical sound in php and coding.</p>

<p>My problem is Whenever i am activating layerslider on homepage its always showing 40-50px below my tabs,  i tried all options and setting's but didn't find any option to set top margin,  so please help me out.</p>

<p>My website is demo.thinkeduventures.com,  its only testing website so please ignore all other errors,  focus only on layerslider,  because i need to implimented on my clients webpage.</p>
]]></description>
   </item>
   <item>
      <title>Wordpress - Permalinks without nested sub-categories</title>
      <link>http://css-tricks.com/forums/discussion/3255/wordpress-permalinks-without-nested-sub-categories</link>
      <pubDate>Mon, 06 Jul 2009 04:07:25 -0400</pubDate>
      <dc:creator>itjunge</dc:creator>
      <guid isPermaLink="false">3255@/forums/discussions</guid>
      <description><![CDATA[Hi,<br /><br />I have searched the web for a couple of days but can't find a appropriate answer.<br /><br />I use a Worpdress link structure like this: %category%/%postname% which results in /category/postname<br /><br />But if I have posts in subcategories the Link is like /category/subcategory/postname<br /><br /><b>How can I define that the subcategory will NOT appear in the permalink?</b><br /><br />As I mentioned before, I can't find any advice to this on the web so I ask you for help.]]></description>
   </item>
   <item>
      <title>Simple Contact Form Problems</title>
      <link>http://css-tricks.com/forums/discussion/11024/simple-contact-form-problems</link>
      <pubDate>Tue, 01 Mar 2011 14:25:01 -0500</pubDate>
      <dc:creator>rmbrug</dc:creator>
      <guid isPermaLink="false">11024@/forums/discussions</guid>
      <description><![CDATA[Hi. I've never really worked with PHP but I've been trying to use the Nice &amp; Simple Contact Form. It seems like it works but when I hit submit to test it, I never receive the email back. Any ideas as to what's going wrong?<br /><br />My PHP:<br /><pre><code>&lt;?php<br /><br />$EmailFrom = &quot;creamandtwosugars@gmail.com&quot;;<br />$EmailTo = &quot;rmbruggeman@gmail.com&quot;;<br />$Subject = &quot;New Contact Form Response&quot;;<br />$Name = Trim(stripslashes($_POST['Name'])); <br />$Email = Trim(stripslashes($_POST['Email'])); <br />$Message = Trim(stripslashes($_POST['Message'])); <br /><br />// validation<br />$validationOK=true;<br />if (!$validationOK) {<br />  print &quot;&lt;meta http-equiv=\&quot;refresh\&quot; content=\&quot;0;URL=error.htm\&quot;&gt;&quot;;<br />  exit;<br />}<br /><br />// prepare email body text<br />$Body = &quot;&quot;;<br />$Body .= &quot;Name: &quot;;<br />$Body .= $Name;<br />$Body .= &quot;\n&quot;;<br />$Body .= &quot;Email: &quot;;<br />$Body .= $Email;<br />$Body .= &quot;\n&quot;;<br />$Body .= &quot;Message: &quot;;<br />$Body .= $Message;<br />$Body .= &quot;\n&quot;;<br /><br />// send email <br />$success = mail($EmailTo, $Subject, $Body, &quot;From: &lt;$EmailFrom&gt;&quot;);<br /><br />// redirect to success page <br />if ($success){<br />  print &quot;&lt;meta http-equiv=\&quot;refresh\&quot; content=\&quot;0;URL=contactthanks.php\&quot;&gt;&quot;;<br />}<br />else{<br />  print &quot;&lt;meta http-equiv=\&quot;refresh\&quot; content=\&quot;0;URL=error.htm\&quot;&gt;&quot;;<br />}<br />?&gt;</code></pre><br /><br />And the html:<br /><pre><code><br />&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt" target="_blank" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt</a>;<br />&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml&quot;&amp;gt" target="_blank" rel="nofollow">http://www.w3.org/1999/xhtml&quot;&amp;gt</a>;<br />&lt;head&gt;<br />&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/ht	 ml; charset=utf-8&quot; /&gt;<br />&lt;title&gt;Cream &amp; Two Sugars&lt;/title&gt;<br />&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;stylesheet.css&quot; /&gt;<br /><br />&lt;body class=&quot;contact&quot;&gt;<br />        &lt;div id=&quot;container&quot;&gt;<br />            &lt;div id=&quot;wrapper1&quot;&gt;<br />                &lt;hr /&gt;<br />                &lt;div id=&quot;navrow&quot;&gt;<br />                    &lt;ul&gt;<br />                        &lt;li&gt;&lt;a href=&quot;index.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br />                        &lt;li&gt;&lt;a href=&quot;/portfolio&quot;&gt;Portfolio&lt;/a&gt;&lt;/li&gt;<br />                        &lt;li&gt;&lt;a href=&quot;blog.html&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;<br />                        &lt;li&gt;&lt;a href=&quot;#&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;<br />                    &lt;/ul&gt;<br />                    &lt;br /&gt;<br />                &lt;/div&gt;<br />                &lt;div id=&quot;header&quot;&gt;<br />	&lt;h1&gt;Contact&lt;/h1&gt;<br />	&lt;/div&gt;<br />                &lt;div id=&quot;content&quot;&gt;<br />                	&lt;p&gt;Please feel free to contact me via &lt;a href=&quot;mailto:rmbruggeman@gmail.com&quot;&gt;email&lt;/a&gt; or the form below.&lt;/p&gt;<br />    	&lt;div id=&quot;contact-area&quot;&gt;<br />                        &lt;form method=&quot;post&quot; action=&quot;contactengine.php&quot;&gt;<br />                            &lt;label for=&quot;Name&quot;&gt;Name:&lt;/label&gt;<br />                            &lt;input type=&quot;text&quot; name=&quot;Name&quot; id=&quot;Name&quot; /&gt;<br />                <br />                            &lt;label for=&quot;Email&quot;&gt;Email:&lt;/label&gt;<br />                            &lt;input type=&quot;text&quot; name=&quot;Email&quot; id=&quot;Email&quot; /&gt;<br />                            <br />                            &lt;label for=&quot;Message&quot;&gt;Message:&lt;/label&gt;&lt;br /&gt;<br />                            &lt;textarea name=&quot;Message&quot; rows=&quot;20&quot; cols=&quot;20&quot; id=&quot;Message&quot;&gt;&lt;/textarea&gt;<br />                            <br />                            &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot; class=&quot;submit-button&quot; /&gt;<br />                        &lt;/form&gt;        <br />        	&lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;<br />    	&lt;/div&gt;<br />	&lt;/div&gt;<br />            &lt;/div&gt;<br />            &lt;div id=&quot;footer&quot;&gt;<br /><br />            &lt;/div&gt;<br />    &lt;/div&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;<br /></code></pre>	 ]]></description>
   </item>
   <item>
      <title>Facebook tab with form</title>
      <link>http://css-tricks.com/forums/discussion/24905/facebook-tab-with-form</link>
      <pubDate>Wed, 15 May 2013 06:23:57 -0400</pubDate>
      <dc:creator>XaviJr</dc:creator>
      <guid isPermaLink="false">24905@/forums/discussions</guid>
      <description><![CDATA[<p>Hi guys. 
I'm trying to set up a newsletter form in a tab of my facebook page and I have all the javascript and php validation ready.</p>

<p>My problem is that my tab code is on a static html app and I don't know how to call the php file/code. I have to host that code in my own server and call it using ajax? But that will not have those same origin policy problems?</p>

<p>Thanks in advance.</p>
]]></description>
   </item>
   <item>
      <title>PHP Fatal error (joomla)</title>
      <link>http://css-tricks.com/forums/discussion/24903/php-fatal-error-joomla</link>
      <pubDate>Wed, 15 May 2013 06:13:59 -0400</pubDate>
      <dc:creator>ani7ruddha</dc:creator>
      <guid isPermaLink="false">24903@/forums/discussions</guid>
      <description><![CDATA[<p>PHP Fatal error:  Call to undefined method stdClass:onDisplay() in libraries\joomla\html\editor.php on line 459</p>

<p><a href="http://techcongress.net/" target="_blank" rel="nofollow">http://techcongress.net/</a></p>

<p>Plz help asap</p>
]]></description>
   </item>
   <item>
      <title>Detect mobile and redirect</title>
      <link>http://css-tricks.com/forums/discussion/13960/detect-mobile-and-redirect</link>
      <pubDate>Mon, 03 Oct 2011 14:20:50 -0400</pubDate>
      <dc:creator>DocRocks</dc:creator>
      <guid isPermaLink="false">13960@/forums/discussions</guid>
      <description><![CDATA[I'm not a php programmer and would like to find a php script to detect visitors who are using mobile phones to my site, and then redirect them to a subdomain on the site optimized for small screens.  Can someone point me to an easy to understand and install script to do that? <br /><br />Thanks]]></description>
   </item>
   <item>
      <title>The usage of === in PHP</title>
      <link>http://css-tricks.com/forums/discussion/24901/the-usage-of-in-php</link>
      <pubDate>Wed, 15 May 2013 03:22:26 -0400</pubDate>
      <dc:creator>Melindrea</dc:creator>
      <guid isPermaLink="false">24901@/forums/discussions</guid>
      <description><![CDATA[<p><a rel="nofollow" href="/forums/profile/traq">@traq</a></p>

<p>I think we were quite off-topic in that post, but I think the discussion is good =)</p>

<p>So, to recap, the difference between <code>==</code> (or <code>!=</code>) and <code>===</code> (or <code>!==</code>) is that the second one also tests type, so for instance (to use your exact example):</p>

<pre><code> &lt;?php
 $i = 0;
 // == does type coercion.  FALSE and 0 are equivalent...
 if ($i ==  false) { /* true! */ }
 // ...but NOT identical.
 if ($i === false) { /* false! */ }

 // real-world example:
 $str = "ABCDEFG";
 // you hate the letter "A".
 // make sure $str DOES NOT HAVE the letter "A" in it!
 if (strpos($str,"A") == false)  {
     // this compares as TRUE, even though "A" is in the string!
     // this is because the *first* position in the string is position *0*.
     // 0 == false.
 }

 // same example, but using ===
 if (strpos($str,"A") === false) {
     // this compares as FALSE, as expected.  
     // 0 !== false.
 }
</code></pre>

<p>So, outside of most people not being aware of the difference, are there any downsides to using <code>===</code>/<code>!==</code>?</p>
]]></description>
   </item>
   <item>
      <title>Why my contact form is going to a different page?</title>
      <link>http://css-tricks.com/forums/discussion/24505/why-my-contact-form-is-going-to-a-different-page</link>
      <pubDate>Mon, 29 Apr 2013 10:01:39 -0400</pubDate>
      <dc:creator>ghafirsayed</dc:creator>
      <guid isPermaLink="false">24505@/forums/discussions</guid>
      <description><![CDATA[<p>Hi , I m creating a website on wordpress, and I didn't want to use a plugin for contact us so I thought I should create my own. But I m having a problem. When you fill  the form it is going to a different page even though action="" however if the form is empty is lands up to the same page and also send a blank email. 
But why is it going to a different page when I enter information in the form.</p>

<p><a href="http://mstoicthemes.com/duchi/" target="_blank" rel="nofollow">http://mstoicthemes.com/duchi/</a></p>

<p>And here is the code</p>

<pre><code>        &lt;?php
  if(isset($_POST['submit'])){

    $name= $_POST['name'];
    $email= $_POST['email'];
    $subject= $_POST['subject'];
    $comments= $_POST['contact_content'];

     $emailTo = 'sayed2x2@gmail.com';
     $subject = $name.' sent you this message from your website.';
    $body = "Name: $name: $email: $comments";
    $headers = 'From: My Site &lt;'.$emailTo.'&gt;' . "rn" . 'Reply-To: ' . $email;

    $mailsent = mail($emailTo, $subject, $body, $headers);

    if($mailsent){
      echo "&lt;h4&gt;Thank you contacting us&lt;/h4&gt;&lt;h4&gt;We will get back to you soon&lt;/h4&gt;";
      }else{
        echo "Your Email was not sent";
        }


    }else{
  ?&gt;      
</code></pre>

<p>else part</p>

<pre><code>  &lt;form action="" method="post"&gt;
    &lt;label for="name"&gt;Name:&lt;/label&gt;
      &lt;input type="text" name="name" id="name" class="mstoic-input" value="&lt;?php if(isset($_POST['submit'])): echo $_POST['name']; endif;?&gt;"&gt;&lt;br&gt;

      &lt;label for="email"&gt;Email:&lt;/label&gt;
      &lt;input type="text" name="email" id="email" class="mstoic-input" value="&lt;?php if(isset($_POST['submit'])): echo $_POST['email']; endif; ?&gt;"&gt;&lt;br&gt;

      &lt;label for="subject"&gt;Subject:&lt;/label&gt;
      &lt;input type="text" name="subject" id="subject" class="mstoic-input" value="&lt;?php if(isset($_POST['submit'])): echo $_POST['subject']; endif; ?&gt;"&gt;&lt;br&gt;

      &lt;textarea name="contact_content" cols="31" rows="4" id="contact_content" class="mstoic-input"&gt;&lt;?php if(isset($_POST['contact_content'])): echo $_POST['contact_content']; endif ?&gt;&lt;/textarea&gt;&lt;br&gt;

      &lt;input type="submit" name="submit" id="submit" value="Send" class="mstoic-button"&gt;

  &lt;/form&gt;

  &lt;?php } ?&gt;
</code></pre>
]]></description>
   </item>
   <item>
      <title>problem with chmod() function</title>
      <link>http://css-tricks.com/forums/discussion/24856/problem-with-chmod-function</link>
      <pubDate>Mon, 13 May 2013 17:07:29 -0400</pubDate>
      <dc:creator>amis</dc:creator>
      <guid isPermaLink="false">24856@/forums/discussions</guid>
      <description><![CDATA[<p>i have this error
i want to give 0777 permation</p>

<p>warning: chmod() [function.chmod]: Operation not permitted in /sites/all/mediafront/players/osmplayer/player/OSMPlayer.php</p>
]]></description>
   </item>
   <item>
      <title>Why does it give an infinite loop(beginner question)?</title>
      <link>http://css-tricks.com/forums/discussion/24865/why-does-it-give-an-infinite-loopbeginner-question</link>
      <pubDate>Tue, 14 May 2013 02:28:41 -0400</pubDate>
      <dc:creator>ghafirsayed</dc:creator>
      <guid isPermaLink="false">24865@/forums/discussions</guid>
      <description><![CDATA[<p>Hi, I m trying to get 4 sets of number which should be like this seperated in horizontal line
1 2 3 4| 5 6 7 8 | 9 10 11 12| 13 14 15 16 and I wrote a for loop for it but why does if give me an infinite loop?</p>

<pre><code>&lt;?php
    //to get four sets
    for($i=1; $i&lt;=4; $i++){
      
      if($i=1){
        $n=1;
        }else{
          $n= 2*$i+1; //to increment the number
          }
              
      for($j=$n; $j&lt;=$n+2; $j++){
        echo $j. '&lt;br&gt;' ;
        }
      echo ''; //this is hr tag but isn't displaying on csstricks
      }
  ?&gt;
</code></pre>
]]></description>
   </item>
   <item>
      <title>Emails sent to Admin Section</title>
      <link>http://css-tricks.com/forums/discussion/24891/emails-sent-to-admin-section</link>
      <pubDate>Tue, 14 May 2013 19:13:48 -0400</pubDate>
      <dc:creator>Hillcrest1674</dc:creator>
      <guid isPermaLink="false">24891@/forums/discussions</guid>
      <description><![CDATA[<p>I have a php website and admin page.</p>

<p>Just so you know, I'm not a programmer, just trying to find an answer.</p>

<p>Here  is my problem:</p>

<p>When a user sends a message via the "Contact us" page of my site currently this message shows up in the admin section from where I can reply to that message.
However when the user replies to my message from his regular email account, his message does not show up back in my admin section.</p>

<p>Is there a way that messages sent from a regular email account are displayed in the admin section of my website ?</p>

<p>Thank you !!!</p>
]]></description>
   </item>
   <item>
      <title>user input destroys my site design</title>
      <link>http://css-tricks.com/forums/discussion/24656/user-input-destroys-my-site-design</link>
      <pubDate>Sun, 05 May 2013 04:05:04 -0400</pubDate>
      <dc:creator>Rohithzr</dc:creator>
      <guid isPermaLink="false">24656@/forums/discussions</guid>
      <description><![CDATA[<p>i made a php forum in that if a user enters a post with a html tag and doesnt close it then the whole page's design is disturbed</p>
]]></description>
   </item>
   <item>
      <title>delete</title>
      <link>http://css-tricks.com/forums/discussion/24861/delete</link>
      <pubDate>Mon, 13 May 2013 21:06:13 -0400</pubDate>
      <dc:creator>Keilowe</dc:creator>
      <guid isPermaLink="false">24861@/forums/discussions</guid>
      <description><![CDATA[<p>delete</p>
]]></description>
   </item>
   <item>
      <title>Help with Wordpress please!</title>
      <link>http://css-tricks.com/forums/discussion/24822/help-with-wordpress-please</link>
      <pubDate>Sat, 11 May 2013 19:48:26 -0400</pubDate>
      <dc:creator>NoizyCr1cket</dc:creator>
      <guid isPermaLink="false">24822@/forums/discussions</guid>
      <description><![CDATA[<p>Hi. I'd like to use Wordpress on my website (<a href="http://gchiller.com/" target="_blank" rel="nofollow">http://gchiller.com/</a>), but it's so confusing! I've tried using guides <a rel="nofollow" href="http://yoast.com/wordpress-theme-anatomy/">here</a>, <a rel="nofollow" href="http://thethemefoundry.com/blog/html-wordpress/">here</a>, and <a rel="nofollow" href="http://codex.wordpress.org/Theme_Development">here</a>, but I haven't been able to gather much out of any of these.</p>

<p>Here's an explanation of what I'm trying to accomplish:</p>

<p>Currently I have a Home, About, Portfolio, and Contact page on my website. I will be merging my Home and About pages for the sake of having space in my navigation bar for a link to my Blog page. I'd like to have each page be editable with Wordpress, but only let my Blog page have comments and a sidebar with blog-related information like recent posts, etc. I've tried chopping up the page into index.php, header.php, and footer.php, but after that, I got nowhere. I'm completely lost on how to convert my existing pages to Wordpress and how to construct a Blog page with Wordpress.</p>

<p>What I really need is someone to give me a rundown of how to make Wordpress work in my situation.</p>

<p>Please help!</p>

<p>Thanks.</p>
]]></description>
   </item>
   </channel>
</rss>