Note that there are some explanatory texts on larger screens.

plurals
  1. POGet information in mail.php that is parsed into manage.html from function.js
    primarykey
    data
    text
    <p>You select the product in home.html then cookies and functions in JS will parse the information into manage.html then in manage.html you can fill in your information and send it to mail.php then mail.php will look if the customer is already in the database, if not it will add. then it will add the order into the database.</p> <p>Everything else works, only the last step of adding the order to the database will not work, because I don't know how to get the JS in manage.html to mail.php.</p> <p>I'm trying to use something like $_GET["something"]; in mail.php, to get information from JavaScript that is parsed into manage.html.</p> <p>code in COOKIES.JS</p> <pre><code>function readCookies(name){ var nameCookie = name + "="; var cookieArray = document.cookie.split(';'); for (var i=0; i &lt; cookieArray.length; i++){ var thisCookie = cookieArray[i] while (thisCookie.charAt(0) ==' '){ thisCookie = thisCookie.substring(1,thisCookie.length); } if (thisCookie.indexOf(nameCookie) == 0){ return thisCookie.substring(nameCookie.length,thisCookie.length); } } return null; } </code></pre> <p>Code in FUNCTION.JS:</p> <pre><code>function cartShow(){ NumberOrdered = 0; NumberOrdered = readCookies("NumberOrdered"); tableRow = ""; for (i = 1; i &lt;= NumberOrdered; i++){ NewOrder = "Order" + i; thisCookie = readCookies(NewOrder); fields = new Array(); fields = thisCookie.split("|"); tableRow += "&lt;tr&gt;" + "&lt;td&gt;" + fields[0] + "&lt;/td&gt;" + "&lt;td&gt;" + fields[1] + "&lt;/td&gt;" + "&lt;td&gt;" + fields[2] + "&lt;/td&gt;" + "&lt;td&gt;" + fields[3] + "&lt;/td&gt;" + "&lt;td&gt;" + fields[4] + "&lt;/td&gt;" + "&lt;td&gt;" + fields[3] * fields[4] + "&lt;/td&gt;" + "&lt;td&gt;" + "&lt;img src=\"includes/images/delete.png\"/ OnClick=\"DeleteItem(" + i + ")\"&gt;" + "&lt;/td&gt;" + "&lt;/tr&gt;"; } document.write(tableRow); } function fillInForm(){ NumberOrdered = 0; NumberOrdered = readCookies("NumberOrdered"); for (i = 1; i &lt;= NumberOrdered; i++){ NewOrder = "Order" + i; thisCookie = ""; thisCookie = readCookies(NewOrder);; fields = new Array(); fields = thisCookie.split("|"); document.write("&lt;input type=hidden name=\"Product ID " + "&amp;nbsp;" + i + "\" value=\"" + "&amp;nbsp;" + fields[0] + "\"&gt;"); document.write("&lt;input type=hidden name=\"Brand " + "&amp;nbsp;" + i + "\" value=\"" + "&amp;nbsp;" + fields[1] + "\"&gt;"); document.write("&lt;input type=hidden name=\"Model " + "&amp;nbsp;" + i + "\" value=\"" + "&amp;nbsp;" + fields[2] + "\"&gt;"); document.write("&lt;input type=hidden name=\"Price " + "&amp;nbsp;" + i + "\" value=\"" + "&amp;nbsp;" + fields[3] + "\"&gt;"); document.write("&lt;input type=hidden name=\"Amount products " + "&amp;nbsp;" + i + "\" value=\"" + "&amp;nbsp;" + fields[4] + "\"&gt;"); document.write("&lt;input type=hidden name=\"Total cost " + "&amp;nbsp;" + i + "\" value=\"" + "&amp;nbsp;" + fields[3] * fields[4] + "\"&gt;"); document.write("&lt;input type=hidden name=\" " + "\" value=\"" + "\"&gt;"); } } </code></pre> <p>This then is used to show some product information on MANAGE.HTML:</p> <pre><code>&lt;form action="mail.php" enctype="text/plain" onSubmit="return checkForm(this);" method="get"&gt; &lt;table border=1 summary=""&gt; &lt;tr&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt;&lt;p name="id"&gt; id&lt;/p&gt;&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt; brand&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt; model&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt; price&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt; number&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt; total&lt;/b&gt;&lt;/td&gt; &lt;td bgcolor=#cccccc&gt;&lt;b&gt; delete&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt; &lt;script&gt; cartShow(); fillInForm(); &lt;/script&gt; &lt;/table&gt; &lt;input type="image" src="includes/images/checkout.png" alt="" value="send" /&gt; &lt;/form&gt; </code></pre> <p>After this, I need to get the information in MAIL.PHP.</p> <p>Because <code>&lt;script&gt;cartShow(); fillInForm();&lt;/script&gt;</code> in manage.html is showing the information in the table, I don't know how I can get it into MAIL.PHP.</p> <p>I hope someone can help me out, I'm trying for the last 5 hours to figure this out. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload