Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with jquery to php
    primarykey
    data
    text
    <p>The data passes fine in jQuery but when trying to pass it to PHP it starts bugging out and everything is NULL. I used alert boxes and it seems like the data and values are stored and then I tried using ajax to pass it to a php file I have and then I did var_dump to test the variable and it is NULL. Can someone please help me? </p> <p>Please help. </p> <p>jQuery code: </p> <pre><code> var dataString = 'Billing_Name=' + Billing_Name + '&amp;Billing_Email=' + Billing_Email + '&amp;Billing_Card=' + Billing_Card + '&amp;Month=' + Month + '&amp;Year=' + Year + '&amp;Billing_StreetAddress1=' + Billing_StreetAddress1 + 'Billing_StreetAddress2=' + Billing_StreetAddress2 + '&amp;Billing_City=' + Billing_City + '&amp;Billing_State=' + Billing_State + '&amp;Billing_Zip=' + Billing_Zip + '&amp;Billing_Phone=' + Billing_Phone; alert(dataString); $.ajax({ //cache: false, type: "POST", url: "test.php", data: dataString, // dataType: ($.browser.msie) ? "text" : "xml", success: function(ret) { alert(ret); //alert("it has been sent"); //$.get("https://affordableapparelny.com/ssl/checkoutprocess.php",dataString), alert("it was sent"); window.location.href="http://affordableapparelnewyork.com/ssl/test.php"; }, error: function(xhr, type, exception){ alert("something went wront here"); alert("Error: " + type); console.log('@Error: '+errorThrown); console.log('@Status: '+status); console.log('@Status Text: '+xhr.statusText); } }); </code></pre> <p>and here is the PHP code</p> <pre><code> &lt;?php $BName=$_POST['Billing_Name']; $BEmail=$_POST['Billing_Email']; $BCard=$_POST['Billing_Card']; var_dump($BName); $errormessages=array(); $errorcount=0; if(isset($_POST) &amp;&amp; is_array($_POST) &amp;&amp; count($_POST)){ foreach ($_POST as $key=&gt;$value){ $$key=$value; $$key=trim($$key); $$key=strip_tags ($$key); $$key=stripslashes($$key); $$key=htmlentities($$key); echo "$key $value &lt;br&gt;"; // echo "is it working"; } } else { $errormessages[]="Post variable not set"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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