ArizonaJohn Posted May 12, 2009 Share Posted May 12, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/157878-pushing-a-variable-through-to-a-third-page-while-using-ajax/ Share on other sites More sharing options...
Ken2k7 Posted May 12, 2009 Share Posted May 12, 2009 You want to replace a table with a variable? O_O Quote Link to comment https://forums.phpfreaks.com/topic/157878-pushing-a-variable-through-to-a-third-page-while-using-ajax/#findComment-832780 Share on other sites More sharing options...
ArizonaJohn Posted May 12, 2009 Author Share Posted May 12, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157878-pushing-a-variable-through-to-a-third-page-while-using-ajax/#findComment-832788 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.