<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'passing php variable to html - is it possible?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'passing php variable to html - is it possible?' posted on the 'PHP' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 03:34:28 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 03:34:28 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>passing php variable to html - is it possible?</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/392262/392262/passing-php-variable-to-html---is-it-possible/</link>
      <description>In the code listed below, I want to be able to pass the value from the varibles in the sql select statement to the html page below.  (Note: the only one I'm trying is the $company variable, I'll do the rest when I get that to work.)  The problem is that no matter what I use in the value clause in the html, it doesn't evaluate the variable to the value.  Can anyone help me out?  I'm new to this, so I'm pretty sure I'm doing something silly to cause this.&lt;br /&gt;
&lt;br /&gt;
Code: &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
&amp;lt;?php
$link  = mysql_connect('xxxxxxxxxxx.net:4444', 'xxxxxx', 'pw','db');
if (!$link) {
	 printf("Connect failed: %s\n", mysql_error());
	 exit();
} else {
// select the database
   $db_selected = mysql_select_db('testdb', $link);
   if (!$db_selected) {
      die ('Select db failed: testdb: ' . mysql_error());
   }
// Perform Query
   $query ="select * from leadsTable";
   $result = mysql_query($query);
   $rows=mysql_num_rows($result);
   if (!$result) {
      $message  = 'Invalid query: ' . mysql_error() . "\n";
      $message .= 'Whole query: ' . $query;
      die($message);
   } else {
      while ($newArray = mysql_fetch_array($result, MYSQL_ASSOC)) {
             $id  = $newArray['id'];
             &lt;strong&gt;&lt;span style="color: Red;"&gt;$company = $newArray['company_name'];&lt;/span&gt;&lt;/strong&gt;
             $contact = $newArray['contact'];
             $phone = $newArray['phone'];
             $fax = $newArray['fax'];
             $street = $newArray['street'];
             $city = $newArray['city'];
             $state = $newArray['state'];
             $zip = $newArray['zip'];
             $job_type = $newArray['job_type'];
             $license_class = $newArray['license_class'];
             $experience = $newArray['experience'];
             $date_found = $newArray['date_found'];
             $date_of_contact = $newArray['date_of_contact'];
             $notes = $newArray['notes'];
             echo "ID is ".$id.
                  "&amp;lt;br/&amp;gt;Company: ".$company.
                  "&amp;lt;br/&amp;gt;Contact: &amp;amp;nbsp ".$contact.
                  "&amp;lt;br/&amp;gt;Phone: &amp;amp;nbsp  &amp;amp;nbsp ".$phone.
                  "&amp;lt;br/&amp;gt;Fax: &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp ".$fax.
                  "&amp;lt;br/&amp;gt;Street: &amp;amp;nbsp  &amp;amp;nbsp ".$street.
                  "&amp;lt;br/&amp;gt;City: &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp ".$city.
                  "&amp;lt;br/&amp;gt;State: &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp ".$state.
                  "&amp;lt;br/&amp;gt;Zip: &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp  &amp;amp;nbsp ".$zip.
                  "&amp;lt;br/&amp;gt;Job Type: &amp;amp;nbsp ".$job_type.
                  "&amp;lt;br/&amp;gt;License: $nbsp  ".$license_class.
                  "&amp;lt;br/&amp;gt;Experience: ".$experience.
                  "&amp;lt;br/&amp;gt;Date Found: ".$date_found.
                  "&amp;lt;br/&amp;gt;Date of Contact: ".$date_of_contact.
                  "&amp;lt;br/&amp;gt;Notes: $nbsp ".$notes.
                  "&amp;lt;br/&amp;gt;------------------------------&amp;lt;br/&amp;gt;";
      }
   echo "Rows returned: ". $rows;
   }
}
//mysql_free_result($result);
?&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Update Leads Table&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;!--align="center" will center the form --&amp;gt;
&amp;lt;table width="300" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;form name="form1" method="post" action="update_leads_table.php"&amp;gt;
&amp;lt;td&amp;gt;
&amp;lt;table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td colspan="4"&amp;gt;&amp;lt;strong&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp
;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;n
bsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;
Update Lead&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;
&lt;strong&gt;&lt;span style="color: Red;"&gt;
This php echo statement displays the value I'm looking for!
&lt;/span&gt;&lt;/strong&gt;
&amp;lt;? echo "company $company&amp;lt;br&amp;gt;"; ?&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td width="78"&amp;gt;Company&amp;lt;/td&amp;gt;
&amp;lt;td width="40"&amp;gt;:&amp;lt;/td&amp;gt;
&amp;lt;td width="294"&amp;gt;&amp;lt;input name="company" type="text" value="&lt;strong&gt;&lt;span style="color: Red;"&gt;$company&lt;/span&gt;&lt;/strong&gt;"&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt; Date Found : &amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;input name="date_found" type="text" id="date_found"&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/392262/392262/passing-php-variable-to-html---is-it-possible/</guid>
      <pubDate>Fri, 12 Jun 2009 19:33:17 -0700</pubDate>
      <category>PHP</category>
    </item>
    <item>
      <title>Re: passing php variable to html - is it possible?</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/392262/392379/re-passing-php-variable-to-html---is-it-possible/#392379</link>
      <description>You are forgetting to tell the parser that the Value is a PHP variable...&lt;br /&gt;
&lt;br /&gt;
change&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;input name="company" type="text" value="$company"&amp;gt;&lt;/pre&gt;&lt;br /&gt;
    &lt;br /&gt;
to &lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;input name="company" type="text" value="&lt;strong&gt;&amp;lt;?php echo&lt;/strong&gt; $company; &lt;strong&gt;?&amp;gt;&lt;/strong&gt;"&amp;gt;&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/392262/392379/re-passing-php-variable-to-html---is-it-possible/#392379</guid>
      <pubDate>Tue, 16 Jun 2009 00:08:36 -0700</pubDate>
      <category>PHP</category>
    </item>
    <item>
      <title>Re: passing php variable to html - is it possible?</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/392262/392380/re-passing-php-variable-to-html---is-it-possible/#392380</link>
      <description>You are forgetting to tell the parser that u have switched to PHP ...&lt;br /&gt;
&lt;br /&gt;
change&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;input name="company" type="text" value="$company"&amp;gt;&lt;/pre&gt;&lt;br /&gt;
    &lt;br /&gt;
to &lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;input name="company" type="text" value="&lt;strong&gt;&amp;lt;?php echo&lt;/strong&gt; $company; &lt;strong&gt;?&amp;gt;&lt;/strong&gt;"&amp;gt;&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/392262/392380/re-passing-php-variable-to-html---is-it-possible/#392380</guid>
      <pubDate>Tue, 16 Jun 2009 00:08:54 -0700</pubDate>
      <category>PHP</category>
    </item>
    <item>
      <title>Re: passing php variable to html - is it possible?</title>
      <link>http://www.programmersheaven.com/mb/phpstuff/392262/392391/re-passing-php-variable-to-html---is-it-possible/#392391</link>
      <description>Thank you very much!  I'm new to this, so I'll make sure to remember this in the future!</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/phpstuff/392262/392391/re-passing-php-variable-to-html---is-it-possible/#392391</guid>
      <pubDate>Tue, 16 Jun 2009 03:27:45 -0700</pubDate>
      <category>PHP</category>
    </item>
  </channel>
</rss>