note 113616 added to function.urlencode

From: Date: Wed, 06 Nov 2013 07:33:06 +0000
Subject: note 113616 added to function.urlencode
Groups: php.notes 
Request: Send a blank email to php-notes+get-197442@lists.php.net to get a copy of this message
Below is our jsonform source code in mongo db which consists a lot of double quotes. we are able to pass this source code to the ajax form submit function by using php urlencode : <script type="text/javascript"> $(function() { // Generate a form using jquery.dfrom $("#myform").dform({ "html":[ { "type":"p", "html":"Patient Record" }, { "name":"patient.name.first", "id":"txt-patient.name.first", "caption":"first name", "type":"text", }, { "name":"patient.name.last", "id":"txt-patient.name.last", "caption":"last name", "type":"text", }, { "type" : "submit", } ] }); }); </script> <form id="myform"> <?php //get the json source code from the mongodb $jsonform= urlencode($this->data['Post']['jsonform']); ?> //AJAX SUBMIT FORM <script type="text/javascript"> $('#myform').submit(function(){ // passing the variable fro PHP to javascript var thejsonform="<?php echo $jsonform ?>"; //var fname = $('input#fname').val(); var dataString = "jsonform=" + thejsonform ; $.ajax({ type: "POST", // url: "test1.php", data: dataString, success: function() { } }); return false; }); ---- Server IP: 216.235.13.26 Probable Submitter: 175.139.181.42 ---- Manual Page -- http://php.net/manual/en/function.urlencode.php Edit -- https://master.php.net/note/edit/113616 Del: integrated -- https://master.php.net/note/delete/113616/integrated Del: useless -- https://master.php.net/note/delete/113616/useless Del: bad code -- https://master.php.net/note/delete/113616/bad+code Del: spam -- https://master.php.net/note/delete/113616/spam Del: non-english -- https://master.php.net/note/delete/113616/non-english Del: in docs -- https://master.php.net/note/delete/113616/in+docs Del: other reasons-- https://master.php.net/note/delete/113616 Reject -- https://master.php.net/note/reject/113616 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#197442) next »