{"id":5,"date":"2006-10-19T14:25:33","date_gmt":"2006-10-19T12:25:33","guid":{"rendered":"http:\/\/blog.ansuz.nl\/index.php\/2006\/10\/19\/send-data-to-php\/"},"modified":"2008-04-13T17:16:07","modified_gmt":"2008-04-13T15:16:07","slug":"send-data-to-php","status":"publish","type":"post","link":"http:\/\/blog.ansuz.nl\/index.php\/2006\/10\/19\/send-data-to-php\/","title":{"rendered":"Send data to PHP"},"content":{"rendered":"<p>In order to have a PHP script executed (and <strong>not opened<\/strong> in a window) through ActionScript use <code>loadVars.sendAndLoad(url, your_data, method)<\/code> instead of <code>loadVars.send(url)<\/code>. In this way the opening of a new window isn&#8217;t necessary.<\/p>\n<p>example:<\/p>\n<div id=\"ig-sh-1\" class=\"syntax_hilite\">\n\n\t\t<div class=\"toolbar\">\n\n\t\t<div class=\"view-different-container\">\n\t\t\t\t\t\t<a href=\"#\" class=\"view-different\">&lt; View <span>plain text<\/span> &gt;<\/a>\n\t\t\t\t\t<\/div>\n\n\t\t<div class=\"language-name\">ActionScript<\/div>\n\n\t\t\n\t\t<br clear=\"both\">\n\n\t<\/div>\n\t\n\t<div class=\"code\">\n\t\t<ol class=\"actionscript\" style=\"font-family:monospace\"><li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #808080;font-style: italic\">\/\/ create a new LoadVars instance<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #000000;font-weight: bold\">var<\/span> c_lv:<span style=\"color: #0066CC\">LoadVars<\/span> = <span style=\"color: #000000;font-weight: bold\">new<\/span> <span style=\"color: #0066CC\">LoadVars<\/span><span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #66cc66\">&#041;<\/span>;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #808080;font-style: italic\">\/\/ populate it with some data<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">c_lv.<span style=\"color: #006600\">bericht<\/span> = input_bericht.<span style=\"color: #0066CC\">text<\/span>;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">c_lv.<span style=\"color: #006600\">email<\/span> = input_mail.<span style=\"color: #0066CC\">text<\/span>;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">&nbsp;<\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\"><span style=\"color: #808080;font-style: italic\">\/\/ offer the data to the PHP mail handler and execute it!<\/span><\/div><\/li>\n<li style=\"font-weight: normal;vertical-align:top\"><div style=\"font: normal normal 1em\/1.2em monospace;margin:0;padding:0;background:none;vertical-align:top\">c_lv.<span style=\"color: #0066CC\">sendAndLoad<\/span><span style=\"color: #66cc66\">&#040;<\/span><span style=\"color: #ff0000\">&quot;sendForm.php&quot;<\/span>, c_lv, <span style=\"color: #ff0000\">&quot;POST&quot;<\/span><span style=\"color: #66cc66\">&#041;<\/span>;<\/div><\/li>\n<\/ol>\t<\/div>\n\n<\/div>\n\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>In order to have a PHP script executed (and not opened in a window) through ActionScript use loadVars.sendAndLoad(url, your_data, method) instead of loadVars.send(url). In this way the opening of a new window isn&#8217;t necessary. example: &lt; View plain text &gt; &hellip; <a href=\"http:\/\/blog.ansuz.nl\/index.php\/2006\/10\/19\/send-data-to-php\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[14,136],"class_list":["post-5","post","type-post","status-publish","format-standard","hentry","category-actionscript2","tag-actionscript-20","tag-php"],"_links":{"self":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ansuz.nl\/index.php\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}