<?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://www.css-tricks.com/forums/categories/php/feed.rss</link>
      <pubDate>Sun, 19 May 13 07:42:30 -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>how to insert config.php data from install.php</title>
      <link>http://www.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://www.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://www.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://www.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://www.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://www.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://www.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>sending and receiving data on php</title>
      <link>http://www.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>Simple Contact Form Problems</title>
      <link>http://www.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://www.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://www.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://www.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://www.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://www.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://www.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://www.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://www.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://www.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>WORDPRESS: How to add Featured Video and display on home page?</title>
      <link>http://www.css-tricks.com/forums/discussion/24861/wordpress-how-to-add-featured-video-and-display-on-home-page</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>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>.</p>

<p>Everything works perfectly.
I just wanted to be able to select a video to display on my home page as a "Featured Video"</p>

<p>Similar to <a rel="nofollow" href="http://www.noeltock.com/web-design/wordpress/how-to-custom-post-types-for-events-pt-2/" title="http://www.noeltock.com/web-design/wordpress/how-to-custom-post-types-for-events-pt-2/">Noel's Event's CPT  Tutorial</a> .</p>

<p>Admin is able to display a featured event....</p>

<p>I'm an extreme beginner, clearly. 
So if anyone can help me get on the right track that would be very much appreciated!
please :)</p>
]]></description>
   </item>
   <item>
      <title>Help with Wordpress please!</title>
      <link>http://www.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>
   <item>
      <title>Problem with Dropdown Menu on Ipad</title>
      <link>http://www.css-tricks.com/forums/discussion/24792/problem-with-dropdown-menu-on-ipad</link>
      <pubDate>Fri, 10 May 2013 11:03:13 -0400</pubDate>
      <dc:creator>Hillcrest1674</dc:creator>
      <guid isPermaLink="false">24792@/forums/discussions</guid>
      <description><![CDATA[<p>We are having a problem with a drop down menu which is not properly displayed on an Ipad.</p>

<p>When opening the drop down menu on an Ipad, the drop down menu is not wide enough, so the text within the drop menu is displayed in 2 rows which looks really bad. (looks fine on IE or Chrome)</p>

<p>We asked our programmers to make the drop down menu wider so text will be displayed in one row. But our Programmers say that Ipad selects the width of the drop down menu automatically and there is nothing they can do about this.</p>

<p>Is there a way to fix this problem ?</p>
]]></description>
   </item>
   <item>
      <title>Help with wordpress Search Result URLs</title>
      <link>http://www.css-tricks.com/forums/discussion/24805/help-with-wordpress-search-result-urls</link>
      <pubDate>Sat, 11 May 2013 03:32:28 -0400</pubDate>
      <dc:creator>nomi</dc:creator>
      <guid isPermaLink="false">24805@/forums/discussions</guid>
      <description><![CDATA[<p>i want to modify wordpress search result urls. Lets say I am on <a href="http://www.xyz.com/en-uk/temp/" target="_blank" rel="nofollow">http://www.xyz.com/en-uk/temp/</a> and I search for the keyword "jug", then it redirects me to: <a href="http://www.xyz.com/en-uk/temp/?s=jug&amp;Submit=Search#" target="_blank" rel="nofollow">http://www.xyz.com/en-uk/temp/?s=jug&amp;Submit=Search#</a> whereas I would like to be redirected to <a href="http://www.xyz.com/en-uk/?s=jug&amp;Submit=Search#" target="_blank" rel="nofollow">http://www.xyz.com/en-uk/?s=jug&amp;Submit=Search#</a>.</p>

<p>can someone help me here?</p>
]]></description>
   </item>
   <item>
      <title>Load PHP file if parent and child of parent</title>
      <link>http://www.css-tricks.com/forums/discussion/24635/load-php-file-if-parent-and-child-of-parent</link>
      <pubDate>Fri, 03 May 2013 17:50:05 -0400</pubDate>
      <dc:creator>toasterdroid</dc:creator>
      <guid isPermaLink="false">24635@/forums/discussions</guid>
      <description><![CDATA[<p>I am building a website in WordPress and have a set of photos that display along the top of the page (in the background) and have them to where the set of photos can change depending on where the visitor is on the website. For example, if they are looking at the FAQ page, then photos pertaining to asking questions are shown. If they are looking at the news page, then photos pertaining to news are shown. The code I have works great, however, I'd like to now show photos based on a specific parent and any children of the parent.</p>

<p>Here's my code as it stands now:</p>

<p><code>&lt;?php if ( is_front_page() ) { include'media/home.php'; } elseif ( is_404() ) { include'media/404s.php'; } elseif ( is_page('news') ) { include'media/home.php'; } elseif ( is_page('faqs') ) { include'media/faqs.php'; } elseif ( is_category('africa-2') ) { include'media/faqs.php'; } else { include'media/general.php'; } ?&gt;</code></p>

<p>How can I tell WordPress, I want it to show a certain php file if it is a parent page and all of it's children?</p>
]]></description>
   </item>
   <item>
      <title>PHP Search and Return Div By Class</title>
      <link>http://www.css-tricks.com/forums/discussion/16973/php-search-and-return-div-by-class</link>
      <pubDate>Sun, 01 Apr 2012 19:59:18 -0400</pubDate>
      <dc:creator>KelvinAlf</dc:creator>
      <guid isPermaLink="false">16973@/forums/discussions</guid>
      <description><![CDATA[Mouthful I know but here is my situation:<br />I want to be able to strip everything except a certain div class from the WP content. The structure is so:<br /><pre><code>&lt;p&gt;<br />	 &lt;div class=&quot;one&quot; style=&quot;might have: inline-css&quot;&gt;More code in here I want to keep.&lt;/div&gt;<br />&lt;/p&gt;<br />&lt;p&gt;<br />	 I don't want this whole paragraph.<br />&lt;/p&gt;<br />&lt;p&gt;<br />	 &lt;div class=&quot;one&quot;&gt;Even more code in here I want to keep.&lt;/div&gt;<br />&lt;/p&gt;</code></pre><br />I got it to semi work except for the fact that it shows the content of the div but not the full div itself.<br />What I want it to output is the following:<br /><pre><code>	 &lt;div class=&quot;one&quot; style=&quot;might have: inline-css&quot;&gt;More code in here I want to keep.&lt;/div&gt;<br />	 &lt;div class=&quot;one&quot;&gt;Even more code in here I want to keep.&lt;/div&gt;</code></pre><br /><br />My PHP isn't very good at all and I've had problems with getting this to work. Any help is appreciated!<br /><br />*EDIT*<br />I found a function that does kind of what I want except with images.<br /><pre><code>function getVideos() {<br />        global $more;<br />        $more = 1;<br />        $link = get_permalink();<br />        $content = get_the_content();<br />        $count = substr_count($content, '&lt;img');<br />        $start = 0;<br />        for($i=1;$i&lt;=$count;$i++) {<br />            $imgBeg = strpos($content, '&lt;img', $start);<br />            $post = substr($content, $imgBeg);<br />            $imgEnd = strpos($post, '&gt;');<br />            $postOutput = substr($post, 0, $imgEnd+1);<br />            $postOutput = preg_replace('/width=&quot;([0-9]*)&quot; height=&quot;([0-9]*)&quot;/', '',$postOutput);;<br />            if(stristr($postOutput,'&lt;img')) { echo '&lt;a href=&quot;'.$link.'&quot;&gt;'.$postOutput.&quot;&lt;/a&gt;&quot;; }<br />            $start=$imgEnd+1;<br />        }<br />        $more = 0;<br />    }</code></pre>]]></description>
   </item>
   <item>
      <title>How to Convert to Wordpress?</title>
      <link>http://www.css-tricks.com/forums/discussion/24802/how-to-convert-to-wordpress</link>
      <pubDate>Fri, 10 May 2013 20:20:41 -0400</pubDate>
      <dc:creator>NoizyCr1cket</dc:creator>
      <guid isPermaLink="false">24802@/forums/discussions</guid>
      <description><![CDATA[<p>Hi. I'd like to eventually start a blog on my website so I figured I'd use Wordpress for it. However, after thinking about it, I thought it would be great to have my whole website converted to a Wordpress template so that I can get experience with it as well as ease of editing the site. I've looked at a few different tutorials online but it seems like they only focus on a header.php, sidebar.php, and footer.php layout which makes it difficult to learn from them because my website is in a different layout than that. I would like my blog page(s) to be a header, content, sidebar, and footer layout though. Can anyone help me convert this website to a Wordpress theme? <a href="http://gchiller.com" target="_blank" rel="nofollow">http://gchiller.com</a></p>

<p>Thanks.</p>
]]></description>
   </item>
   <item>
      <title>Anyone used Gallery Addon for Advanced Custom Fields with Captions?</title>
      <link>http://www.css-tricks.com/forums/discussion/24782/anyone-used-gallery-addon-for-advanced-custom-fields-with-captions</link>
      <pubDate>Fri, 10 May 2013 03:29:13 -0400</pubDate>
      <dc:creator>JoshWhite</dc:creator>
      <guid isPermaLink="false">24782@/forums/discussions</guid>
      <description><![CDATA[<p>Hey all,</p>

<p>I've got a problem that I was hoping someone has already been down this road.  I have a site that is utilizing ACF and we also added the premium Gallery Addon.</p>

<p>What I've done is I installed Easy Fancybox and then spit out the gallery into a simple list with the fancybox class.  The problem is there is no way from what I can see how to get the captions from within the gallery addon to show up anywhere on the images once they are clicked.</p>

<p>Has anyone worked heavily on captions within WP or ran into this same dilemma that they were able to solve?  If so, any help you can offer would be great!</p>

<p>I've tried a couple of javascript methods described in the plugin support, but it's no secret I'm no javascript guru :)</p>
]]></description>
   </item>
   <item>
      <title>WORDPRESS THEME DEV HELP...</title>
      <link>http://www.css-tricks.com/forums/discussion/24777/wordpress-theme-dev-help-</link>
      <pubDate>Thu, 09 May 2013 22:15:22 -0400</pubDate>
      <dc:creator>dominick1</dc:creator>
      <guid isPermaLink="false">24777@/forums/discussions</guid>
      <description><![CDATA[<p>hey guys..</p>

<p>ok so im creating a wp theme and on the homepage i have a sidebar that i want to display some images like maybe 8 or so and it's responsive so its in 2 columns then 1 column, that sorta thing. when i built the site it was still static so i just used <img src="src" alt="image" /> but now that i moved into wordpress im trying to figure out how i could upload images into the media uploader and then do some sort of function to query and array and spit the images out and be able to specify the size i want the thumbs to be, how many to spit out, that sorta thing. i know there is a way to do this but im looking and i cant find it or maybe i am seeing it but just not getting it. if somebody could help me that would be really amazing! :)</p>
]]></description>
   </item>
   <item>
      <title>How do I fix this?  Declaration dropped.</title>
      <link>http://www.css-tricks.com/forums/discussion/24729/how-do-i-fix-this-declaration-dropped-</link>
      <pubDate>Wed, 08 May 2013 09:38:17 -0400</pubDate>
      <dc:creator>siouxfan45</dc:creator>
      <guid isPermaLink="false">24729@/forums/discussions</guid>
      <description><![CDATA[<p>I'm downright OCD about errors and depreceated elements when it comes to WordPress.</p>

<p>I'm using FireFox's web console and <a rel="nofollow" href="http://themeforward.com/demo2/" title="">my theme</a> is returning declaration dropped for box-sizing... but box-sizing is nowhere to be found in the HTML and CSS.  I'd obviously be happy with a "Oh, look here!" answer.  However, if you simply know how I can start narrowing down possibilities it would be helpful as I'm completely stumped.</p>
]]></description>
   </item>
   <item>
      <title>WordPress is_page failing in responsive design</title>
      <link>http://www.css-tricks.com/forums/discussion/24538/wordpress-is_page-failing-in-responsive-design</link>
      <pubDate>Tue, 30 Apr 2013 09:24:06 -0400</pubDate>
      <dc:creator>iamshawnrice</dc:creator>
      <guid isPermaLink="false">24538@/forums/discussions</guid>
      <description><![CDATA[<p>I am running into a very odd bug here:
<a href="http://dppad.com/dev/3/about/" target="_blank" rel="nofollow">http://dppad.com/dev/3/about/</a></p>

<p>I am trying to add a 'current' state to the nav item reflecting the current page. It's successful on the full and tablet versions of the menu (contained in header.php), but the mobile version (in footer.php) is only giving me luck on one of the pages.</p>

<p>Any thoughts are greatly appreciated.</p>

<p>footer.php:
<a href="http://pastebin.com/2ZjP9BCU" target="_blank" rel="nofollow">http://pastebin.com/2ZjP9BCU</a></p>

<p>header.php:
<a href="http://pastebin.com/tPUNNU1r" target="_blank" rel="nofollow">http://pastebin.com/tPUNNU1r</a></p>
]]></description>
   </item>
   <item>
      <title>Wordpress Custom Post Types Issue</title>
      <link>http://www.css-tricks.com/forums/discussion/24727/wordpress-custom-post-types-issue</link>
      <pubDate>Wed, 08 May 2013 08:12:47 -0400</pubDate>
      <dc:creator>Mulegoat</dc:creator>
      <guid isPermaLink="false">24727@/forums/discussions</guid>
      <description><![CDATA[<p>Hi there</p>

<p>I am in the process of creating a site for a Tour Operator. Aside from the usual pages the bulk of the site consists of the following parent-child-grand child page structure, all with the 'destinations' page at the root. This example uses Africa as the child of the destinations page but the pattern is replicated many times over:</p>

<p>www.sitename.com/destinations/</p>

<pre><code>- Africa (Uses 'Region' template)

  -- Madagascar (Uses 'Country' template)

    --- Accommodation (Uses 'Accommodation Parent' template)

      ---- Holiday Inn (Uses 'Accommodation' template)


    --- Itineraries (Uses 'Itineraries Parent' template)

      ---- Madagascar Luxury Tour (Uses 'Itinerary' template)


    --- Highlights (Uses 'Highlights Parent' template)

      ---- Northern Rainforest (Uses 'Highlights' template)
</code></pre>

<p>The issue I'm trying to resolve is how best to build the site given that each country page needs to return links to pages using the 'Accommodation', Itinerary' and 'Highlights' templates, i.e. the 3 grandchild types. I also need to return links to the parent pages.</p>

<p>This I could normally do with separate query posts on the page templates but I am wondering if I should be using Custom Post Types for Accommodation, Itinerary and Highlights pages? At present I am struggling to implement these pages and assign them to their correct place in the sitemap e.g. Creating an 'Accommodation' CPT leaves all accommodation pages as children of www.sitename.com/accommodation whereas I need multiple instances of 'accommodation' as a child of the respective 'country' page. This also obviously applies to the other parent page names.</p>

<p>Any thoughts on how best to implement this would be great.</p>

<p>Many thanks in advance</p>
]]></description>
   </item>
   </channel>
</rss>