Jump to content
mhamilton

Post to PHP

Recommended Posts

I am trying to pass a Frog User field on to a PHP page to allow data to come up without user intervention.  Is there a way to submit this data if they hit a button to access the page by which the button acts as a submit passing the information from that user on to the PHP page?

 

Thanks!

Link to comment
Share on other sites

Hi @mhamilton

This tutorial:

https://www.frogeducation.com/community/tutorials/html-tutorials/html-intro

goes into some detail, but shows you how to use this code:

var user = FrogOS.getUser();

To get the logged in user's details.  

With this, it should be straight-forward to add it to a button which could either use a URL with the variable attached or an html form to push the details to a php page

<a href="yourpage.php?user=myvar">click</a>

or

<form action="yourpage.php" method="push">
  user details: <input type="text" name="userdetails" value="myvar"><br>
  <input type="submit" value="Submit">
</form>

You'd need to add the myvar bit using Javascript:

<div class="mybutton"></div>

<script>
  var user = FrogOS.getUser().username;
  
  this.element.find('.mybutton').html(
   '<a href="yourpage.php?user='+user+'&" target="_blank">click</a>'
    
  )  
  
  
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...