jquery - How can my javascript code get access to POST variables? -
this odd situation , current thought doesn't work way, need other eyes on this.
a different website don't have control on has form hidden field in it. form action post , send url on website , need able value of hidden field using javascript.
as included in url , think parsing apart. since it's post being sent me i'm not entirely sure how value of hidden field out.
is doable? if so, should looking it?
thank you!
if server receiving sended form data uses php, can form values using:
<?php print_r($_post); ?> if page in server static html page, cannot post data. or can, have make html pages executed php pages (not recommended however).
you talk need value accessible javascript. like:
<script> <?php echo 'var input_field_value="'.htmlspecialchars($_post['name_of_input_field']).'";'; ?> </script> the question doesn't provide information server software used, assume php.
edit: after saturnix's comment added call htmlspecialchars() make safe execute in javascript.
Comments
Post a Comment