<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023328" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023328</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143387</link>
    <description> &lt;p&gt;Well after all that (finally got it working properly) it doesn&#039;t work in Opera6, looking at Operas help forums it seems the version 6 browser has some bugs where javascript is concerned, very slow on document.write and weird  results as documented by the staff there.&lt;/p&gt;
&lt;p&gt;Am downloading version 7 now (1.3kb/s) and see if that helps, if not have to either find another script or boogie up a browser redirect to a noscript tag lot.&lt;/p&gt;
&lt;p&gt;becoming a isolated monk is looking more and more promising&lt;/p&gt;
&lt;p&gt;[edit]Opera7 displays as it should[/edit]&lt;/p&gt;
 </description>
     <pubDate>Sun, 28 Dec 2003 02:16:54 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143387 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143385</link>
    <description> &lt;p&gt;fyi external js files and stylesheets can contain php code as long as they have a php extension.&lt;/p&gt;
&lt;p&gt;For example:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;./myjavascriptfile.php&amp;quot;&amp;amp;gt;&amp;amp;lt;/script&amp;amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sun, 28 Dec 2003 01:34:04 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1143385 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143383</link>
    <description> &lt;p&gt;ha! I run into that problem myself and I still didn&#039;t see it! Doh!&lt;/p&gt;
 </description>
     <pubDate>Sun, 28 Dec 2003 00:50:01 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1143383 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143380</link>
    <description> &lt;p&gt;Kinda makes sense not being able to parse inside .js file&lt;br /&gt;
I placed the PHP/javascript on the page and now I get a result, not the one I need but is something (result is &quot;should of been quicker&quot; so means its not getting the year or month correctly)&lt;/p&gt;
&lt;p&gt;Oh and I figured out why the basic example wasn&#039;t working, anyone spot the problem now&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$php_var &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;from PHP&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;&lt;strong&gt;style&lt;/strong&gt; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
var js_var = &lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;print &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$php_var&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;;&lt;br /&gt;
document.write(js_var);&lt;br /&gt;
style&amp;gt;&lt;/p&gt;
&lt;p&gt;style should be script,&lt;br /&gt;
lack of sleep, dead lines and to much going on at the same time causes premature aging, insanity loss and wrinkles&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 23:25:54 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143380 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143378</link>
    <description> &lt;p&gt;The problem, I think, is the order, no?&lt;/p&gt;
&lt;p&gt;You have a .php page that is parsed -- things are sent without parsing, generally the included .js are just straight html, right? So they are included not as part of the .php page, just as JavaScript.&lt;/p&gt;
&lt;p&gt;When using JavaScript and PHP, all the PHP has to be parsed FIRST, then the JavaScript can use it. It can&#039;t be parsed while inside a JavaScript file (.js) -- afaik, if the JavaScript is written on the page directly, not included, it should work. If it&#039;s included, it skips the parsing and the PHP won&#039;t be, well, parsed.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.php-forum.com/p/viewtopic.php?t=2412&quot; class=&quot;bb-url&quot;&gt;http://www.php-forum.com/p/viewtopic.php?t=2412&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So you would be better to write the JavaScript with PHP.&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 23:03:56 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1143378 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143377</link>
    <description> &lt;p&gt;the main script has PHP in .js file, but last example isn&#039;t (but does have the type)&lt;/p&gt;
&lt;p&gt;PHP should be parsed first, then values given to JS, no?&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 22:57:33 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143377 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143375</link>
    <description> &lt;p&gt;so you have the php in a .js file? How would that get parsed? The JavaScript won&#039;t be parsed as php, it&#039;s a type text/javascript?!&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 22:53:09 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1143375 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143374</link>
    <description> &lt;p&gt;if I do this on the main page:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$php_var &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;from PHP&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;var js_var=&quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;print &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$php_var&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;br /&gt;
document.write(js_var);&lt;/p&gt;
&lt;p&gt;var cd_year = &quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ends_year&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;br /&gt;
var cd_month = &quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ends_month&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;br /&gt;
var cd_day = &quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cd_day&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;br /&gt;
var cd_hour = &quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cd_hour&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;br /&gt;
var cd_min = &quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cd_min&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;br /&gt;
var cd_sec = &quot;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$cd_sec&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&quot;;&lt;/p&gt;
&lt;p&gt;the output is:&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
var cd_year = &quot;2003&quot;; var cd_month = &quot;12&quot;; var cd_day = &quot;2&quot;; var cd_hour = &quot;3&quot;; var cd_min = &quot;13&quot;; var cd_sec = &quot;55&quot;;&lt;/p&gt;
&lt;p&gt;so the PHP variables do have values but the PHP to Javascript isn&#039;t displaying&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 22:51:42 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143374 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143370</link>
    <description> &lt;p&gt;output is :&lt;br /&gt;
 NaN days NaN hours NaN minutes, and NaN seconds left until The result&lt;/p&gt;
&lt;p&gt;if you change this line&lt;br /&gt;
mycountdown.setEventDate(cd_year, cd_month, cd_day, cd_hours, cd_minutes, cd_seconds);&lt;br /&gt;
to numbers, ie:&lt;br /&gt;
mycountdown.setEventDate(2004, 12, 12, 0, 0, 0);&lt;br /&gt;
it will work, so its not getting the PHP values, but if I echo the PHP values (on the main page, not in the included js file) they are there but somehow not registering in the javascript file. &lt;/p&gt;
&lt;p&gt;Thats why I gave that very basic example (post #1), it has to be something very simple I&#039;m over looking - php related&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 22:33:20 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143370 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-javascript-0#comment-1143349</link>
    <description> &lt;p&gt;Try removing the PHP and just using text values...Find whether it is the PHP or JS which is at fault.&lt;/p&gt;
 </description>
     <pubDate>Sat, 27 Dec 2003 12:49:21 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1143349 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
