Jump to content

php variable passed by jquery and get it for $ _GET to another php page


Recommended Posts

I usually go to the news of the story expanded, passes the variable with a while, as follows:

while ($noticias = @mysql_fetch_array($sql)) {
$sqll = mysql_query("SELECT * FROM categorias WHERE id='".$noticias['categoria']."'");
$datos = mysql_fetch_array($sqll);
<div class="leermas">[color="red"]<a href="noticias.php?n='.$noticias['id'].'">[/color]<strong>(Leer más)</strong></a></div>
</div></div>';

}

but now I want is to load the content of the page in a div and I usually when I  don't have to pass php variable in this way:

the link for load content

<a  class="recursostopwebjqampliada" href="">  

jQuery code that I have it in an external file called load.js

$(document).ready(function() {  
    $(".recursostopwebjqampliada").live("click", function(){ 
                                   
$("div#main2").load("topwebjq_ampliada.php?n='.$noticias['id'].'");//AQUI DONDE ESTA LA VARIABLE
     });  
});

and the page that loads the div I get the variable as follows:

$id = $_GET['n'];  

the problem is that jQuery does not read the file php load.js

then how I can fix it


load("topwebjq_ampliada.php?n='.$noticias['id'].'"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.