jquery - PHP-serialized String is cutted -


i have form send via ajax. in form put values php-serialized-string in hidden input.

<input type="hidden" name="userdata" id="userdata" value="<?php echo serialize($userinput); ?>"> 

now when send form..

let data = $('#step-4 :input').serialize();                      $('#step-5').load('php/send.php?data='+data, function() { ... 

the serialized string somehow cutted..

[userdata] => a:13:{s:6:

and can't figure out why(?)

share|improve question
    
please show ur jquery ajax code – abuhuraira lakdawala aug 8 '16 @ 13:19
1  
what's original data? what's result of serialze? truncated before form submitted, or after? have more code show us? – zac brown aug 8 '16 @ 13:20
2  
serialize() data contains quotes, there " after a:13:{s:6: s:6 says 6 char string follow, , has terminated html value=" attribute @ point – riggsfolly aug 8 '16 @ 13:21
    
dont pass serialized data way wont work – riggsfolly aug 8 '16 @ 13:22
1  
@ riggsfolly .. hmmm.. guess :/ .. approach achieve this? – 99problems aug 8 '16 @ 13:22

hopefully should solve query....

change html...

<input type="text" name="userdata" id="userdata" value="<?php echo htmlentities(serialize($userinput)); ?>"> 
share|improve answer
    
but wont make reading in javascript easy @ all – riggsfolly aug 8 '16 @ 14:05

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments