Button passing variable to external file

Struggle…
I am trying to post a parameter (don’t mind how, session or url) to an external PHP page through a button in a form.

So in the form, where the button is, I set up an onload event

[var_quote_id] = {quote_id};

On the button the macro:

{
sc_redir(http://localhost/get.php, "quote_id=[var_quote_id]", "_parent");
}

I want to test whether I am receiving the variable at get.php, for that I have this snippet

<?php
echo 'Hello ' . htmlspecialchars($_GET["name"]) . '!';
?>

I get the value for var_quote_id when I check data in session within SC. But not able to pass onto get.php

As always, thanks for any help.

Re: Button passing variable to external file


{
  sc_redir(http://localhost/get.php, "quote_id=[var_quote_id]", "_parent");
}


<?php
echo 'Hello ' . htmlspecialchars($_GET["name"]) . '!';
?>

If your page need the parameter name using get, just pass directly in the url:


{
  sc_redir("http://localhost/get.php?name=" . [var_quote_id], "", "_parent");
}

Re: Button passing variable to external file

Hi,
Thanks for your help. This is fixed.