<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1040192" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1040192</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/passing-post-variable-new-window#comment-1226725</link>
    <description> &lt;p&gt;No worries, glad I could help &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 26 Nov 2007 20:13:20 +0000</pubDate>
 <dc:creator>calculator</dc:creator>
 <guid isPermaLink="false">comment 1226725 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/passing-post-variable-new-window#comment-1226720</link>
    <description> &lt;p&gt;Oh cool, thanks for that Calculator, I solved it by using target=&quot;_blank&quot; didn&#039;t even know you could do that with forms... &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 26 Nov 2007 18:11:16 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1226720 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/passing-post-variable-new-window#comment-1226699</link>
    <description> &lt;p&gt;Hi Renegade, &lt;/p&gt;
&lt;p&gt;How about:&lt;/p&gt;
&lt;p&gt;tools.php&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;form action=&amp;quot;redirect.php?action=connectionhistory&amp;quot; method=&amp;quot;post&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;or xhtml strict compliant:&lt;br /&gt;
in the separate js.js file&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;window.onload = function() {&lt;br /&gt;	if(document.getElementById(&amp;#039;myform&amp;#039;)){&lt;br /&gt;		var myform = document.getElementById(&amp;quot;myform&amp;quot;);&lt;br /&gt;		myform.target= &amp;quot;_blank&amp;quot;;&lt;br /&gt;	}		&lt;br /&gt;}//end window.onload&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
and in tools.php&lt;br /&gt;
&lt;code&gt;&amp;lt;form action=&amp;quot;redirect.php?action=connectionhistory&amp;quot; method=&amp;quot;post&amp;quot; id=&amp;quot;myform&amp;quot;&amp;gt;&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;You could also make the target =&quot;_blank&quot; a window.open with sizing capabilities quite easily by passing the href var to js if you need to.&lt;/p&gt;
 </description>
     <pubDate>Mon, 26 Nov 2007 12:30:44 +0000</pubDate>
 <dc:creator>calculator</dc:creator>
 <guid isPermaLink="false">comment 1226699 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/passing-post-variable-new-window#comment-1226693</link>
    <description> &lt;p&gt;If you already Googled it and didn&#039;t find any help, it may not be possible.  The browser is probably not posting the information because you have a script in it&#039;s place, and not a web page.&lt;/p&gt;
&lt;p&gt;Some alternatives:&lt;/p&gt;
&lt;ol class=&quot;bb-list&quot;&gt;
&lt;li&gt; Send the username in the URL as a $_GET field.&lt;/li&gt;
&lt;li&gt; If you have other fields other than a username, submit the form to a PHP file using AJAX, make that script store the $_POST data to the $_SESSION, open the popup, and then retrieve that data from the $_SESSION.&lt;/li&gt;
&lt;/ol&gt;
 </description>
     <pubDate>Mon, 26 Nov 2007 05:12:43 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1226693 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/passing-post-variable-new-window#comment-1226692</link>
    <description> &lt;p&gt;Oh yes, that&#039;s about what I did but, the new window is not picking up anything:&lt;/p&gt;
&lt;p&gt;This is more or less what I have at the moment:&lt;br /&gt;
tools.php&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;form action=&amp;quot;javascript: fnOpenWin(&amp;#039;redirect.php?action=connectionhistory&amp;#039;);&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;username: &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;username&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;search&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;js.js&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;function fnOpenWin(url) {&lt;br /&gt;window.open(url);&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;redirect.php&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if($_GET[&amp;#039;action&amp;#039;] == &amp;quot;connectionhistory&amp;quot;) {&lt;br /&gt;$url = &amp;quot;http://www.example.com/tools.php?username=&amp;quot; .&amp;nbsp; $_POST[&amp;#039;username&amp;#039;];&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Doing an echo of $url just gives me &quot;http://www.example.com/tools.php?username=&quot; so for some reason, the post variable is not being passed.&lt;/p&gt;
 </description>
     <pubDate>Mon, 26 Nov 2007 01:54:05 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1226692 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/passing-post-variable-new-window#comment-1226690</link>
    <description> &lt;p&gt;Hi Renegade, &lt;/p&gt;
&lt;p&gt;You can use a server side script (PHP, ASP etc...) to retrieve data passed from a &#039;post&#039; method.&lt;/p&gt;
&lt;p&gt;On page 1:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;form action=&amp;quot;page2.php&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;label for=&amp;quot;name&amp;quot;&amp;gt;Name:&amp;lt;/label&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;name&amp;quot; id=&amp;quot;name&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;On page 2 before the Doctype:&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myFromVar &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&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;&#039;&lt;/p&gt;
&lt;p&gt;and wherever you want the data to appear on page 2:&lt;br /&gt;
&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$myFromVar &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;You should also check that the data that is passed is of the right format by &#039;cleaning&#039; it. Ie. if you have a drop down menu called &#039;color&#039; with only 3 values (blue, red, green), I would do something like:&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;color&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; switch(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;color&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;blue&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;red&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;green:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $myColor = $_POST[&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;color&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit(&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;Error&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sun, 25 Nov 2007 21:16:54 +0000</pubDate>
 <dc:creator>calculator</dc:creator>
 <guid isPermaLink="false">comment 1226690 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
