i am trying to get a variable in to php from html without using form. so i don't have method option post,get etc. as i have attached the code, i want value of the variable 'buy1' in php, i tried id instead of name, but didn't work , because how to access in php file without using get or post and action attribute? i am really struggling here.
jQuery(document).ready(function($) {
var myPlaylist = [
{
mp3:'thumb/audio/1.mp3',
//oga:'thumb/audio/1.ogg',
title:'Rock and Roll',
artist:'Artist 1',
rating:4,
buy:'',
price:"<a href='#' target='_blank' title='Download Sample'><i class='cloud download icon'></i></a> **<a href='test.php' name='buy1' target='_blank' title='Purchase'><i class='payment icon'></i></a>** <a href='#' target='_blank' title='View On Spotify'><i class='spotify icon'></i></a> <a href='#' target='_blank' title='View On SoundCloud'><i class='soundcloud icon'></i></a> <a href='#' target='_blank' title='View On Itunes'><i class='apple icon'></i></a>",
I would recommend using forms or use AJAX to send a POST request. However, If you really don't want to use forms or use POST, GET, etc. a possibility is to take advantage of a PHP session.
Give this tutorial a read, it'll hopefully get you started with PHP sessions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.