[jQuery] passing variable from javascript to php via iframe using tableeditor

[jQuery] passing variable from javascript to php via iframe using tableeditor


The user starts out by clicking a link -
[code]
<tr class="home"<td>Location</td><td><input type="button"
onclick="vtwo.two()" value="Flexigrid"</td></tr>
This leads to a js file where an iframe is called to pop up a dialog box -
it is at this point that I want to pass a variable in the url:
[code]
var vtwo = {
    two: function() {
        var url = 'test.php?gameno=2';
    $('<iframe id="popup" src="' + url + '" />').addClass("flora").dialog({    
            title: .....,
            modal: true,
            overlay: {
    opacity: 0.5,
    background: "grey"
......
[code]
I've also tried passing it these ways:
        var url = 'test.php?gameno=' + "5";
then in test.php the first thing I do is get the variable and print to a log
file- the url in my browser shows the variable, but I cannot get it to print
out via php:

[code]
session_start();
$gameno = $_GET['gameno'];
error_log("gameno is $gameno", 0);
[/code]
Eventually, I need to pass this variable to a mysql database:
[code]
if($('.new',grid).length>0){
            $.ajax({
             type: "POST",
             dataType: "json",
             url: "save.php",
             data: { firstname: $('#firstname').val(), lastname:
$('#lastname').val(), homephone: $('#homephone').val(), cellphone:
$('#cellphone').val(), email: $('#email').val(), job: $('#job').val(),
gamenumber: $gameno },
             success: function(data){
                     alert("Thank you for volunteering!");
                 $("#flex1").flexReload();
             }
..... [/code]
Can anyone help??
--
View this message in context: http://www.nabble.com/passing-variable-from-javascript-to-php-via-iframe-using-tableeditor-tp18348478s27240p18348478.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

















































    • Topic Participants

    • kathy