Marco_
-
Posts
5 -
Joined
-
Last visited
Posts posted by Marco_
-
-
4 hours ago, requinix said:
Is this not already going through PHP? That request.done suggests you're doing AJAX...
the input/job_title and input/thumbnail-url they both already go through php because these are real visible fields on the form that gets physically populated on the fly.
The other field instead textarea/htmlcode is hidden hence cannot be populated on the fly and the value currently is not passed through php.
i have a receiving $phpvar now in the file functions.php that will need to get the value from this submit.php form that currently is not getting cause it is not passed.
i checked the http header request and i am struggling in finding a way to pass this value.
-
I have a submit.php file that includes the following jQuery code:
<script> [...] request.done(function( json ) { jQuery('input[name=thumbnail-url]').val(json.thumbnail_url); jQuery('input[name=job_title]').val(json.title); jQuery('textarea[name=htmlcode]').val(json.html); [...] </script>
I need to remove
jQuery('textarea[name=htmlcode]').val(json.html);
and pass the "json.html" value into a PHP variable in another php file (functions.php).
The code in the functions.php file is already there.
The thing i need to do (and i am seriously struggling with it) is placing the value of json.html into a $phpvariable that i can then call from the function.php file.
Do you need any more info for this issue?
Thanks.
storing json.html value (generated within jQuery code), in a PHP $ variable
in PHP Coding Help
Posted
hi Chhorn, thanks for this.
sorry but i am pretty new to coding.
the two lines that you wrote must be written exactly like this or i need to replace something in there? e. g. foo.php and var_dump?!
additionally both of these lines must be included in the submit.php file or some of them in another file?
last thing, what would i need to escape, and what does that mean?
Thanks a lot, hope in the near future will be able to avoid these silly questions...