wp does not allow to use a shortcode in a script it takes the parameter as literal not the value of the parameter. This value should then be used in functions.php to insert it in a database.
I think i better make a form to get the dta the user fills in and then insert it into the database. I do not see an other way to get data from the page to the database.
—this is in my page—–
<script>
function saverecordtodtabase()
{
$qsorecord=document.getElementById("callsign").value;
[qsologlogqsorecord $qsorecord]
}
</script>
—this is in functions.php–just an echo for debugging willleter be an dtabase insert sql statement.-
function qsolog_log_qso_record($atts) {
global $wpdb;
global $qsorecord;
$qsorecord=$atts[0];
echo($qsorecord);
}
add_shortcode( 'qsologlogqsorecord', 'qsolog_log_qso_record' );
Hello Steve,
I’m not using a plug in.
i’m using DOM, html and php in functions.php.
hanz