Jump to content

Pushing a Variable through to a third page while using AJAX


ArizonaJohn

Recommended Posts

Hello,

 

I would like to use the same variable on three pages.  Right now I can only get it to work on two.  The first page has a simple HTML form where the variable is entered.  The second page uses the variable just fine.  I am using AJAX to refer to a third page, and I'm not sure how to use the same variable on the third page.  The variable is called "find."

 

On the second page, I have this:

 

$find = strip_tags($find);
$find = trim ($find);
$result=mysql_query("SHOW TABLES FROM sand2 LIKE '%$find%'")
or die(mysql_error());

 

The second page then has AJAX which points to a third page/URL, and on this third page/URL, I have this:

 

function getAllVotes($id)
{
/**
Returns an array whose first element is votes_up and the second one is votes_down
**/
$votes = array();
$q = "SELECT * FROM santafe WHERE id = $id";

 

On the third page, I would like to replace the table "santafe" with the variable "find," the same variable that I use on the second page.  How do I do this?

 

Thanks in advance,

 

John

Well, I guess I should have said I want to make the table name a variable.  On the second page, the table displayed is the one whose name matches the variable "find."  I want to use this same table in the third page that the AJAX points to.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.