Hey,

Im wondering if someone could tell me how to set a variable depending on the link that is clicked than pass it to php.

It's for a rating plugin - The links will be numbers 1 - 5 and need to pass the integer to php when clicked.. in background.

I am assuming I would use "XMLHttpRequest" so I can reload - send variable, and display in the background.

Could I do something like this for the links.

<a href="" onclick="loadurl('function.php?vote=1')">Vote 1</a>
<a href="" onclick="loadurl('function.php?vote=2')">Vote 2</a>
and so forth...

Then in php have something like $vote = GET_(vote)... Sorry if this is way off base.

Yes you can.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.