Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Filtering recordsets with URL Variables

New Here ,
Jun 28, 2007 Jun 28, 2007
I was following the tutorial "Building a Forum with Dreamweaver – Part 1: Getting Started" by Marius Zakaria (you can find it on the Adobe website under support or something). My problem has to do with filtering recordsets with URL variables. I can successfully display the URL variable on the desired page. But when I Drag and drop a recordset filtered with a URL variable, nothing happens when I test the site--even though the raw URL variable that I dragged and dropped worked. What's going on? I basically had the same problem when filtering recordsets with Session Variables, but I managed to fix it by inserting <?php session_start(); ?> at the top of the code on the page. Do I need to do/insert something similar to make the URL variable-filtered recordsets work? What do I need to do?
TOPICS
Server side applications
213
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 28, 2007 Jun 28, 2007
LATEST
You have to make sure you name the url variable the correct name when you make the recordset, the name of the db column will be used by default, when you made the link you named the variable like this 'yourpage.php?YOURVARIABLE=' when you make the recordset be sure to type in YOURVARIABLE into the textfield next to the drop down where you selected 'URL Paramter'

Here is some code to check if the get variable is numeric and then assign it to a variable- $validtopic, then you can use the variable to filter the recordset, if you are using the advanced button when making the recordset.
if(isset($_GET['id']) == TRUE) {
if(is_numeric($_GET['id']) == FALSE) {
header ("Location: " . $config_dir . "index.php");
} else {
$validtopic = $_GET['id'];
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines