How do you pass two URL parameters to a page in PHP
the following bit of code based on david powers code in book php solutions - book highly recommended :
'<a href= "'. $_server['php_self']. '?curpage=' .($curpage+1) .'" > next > </a>';
this used navigate page page , when clicked, produces url ending
.showflagsab?curpage=3
it works fine when sql query "select * table"
however, sql query "select * table id= 5", passing current page variable, need pass id variable.
it show showflagsab.php?curpage=3&id=5
i spent ages trying syntax correct, far have not succeeded.
can help?
howard walker
you need add &$var= end of link
'<a href ="' .$_server['php_self'] . '?curpage=' .($curpage+1) .'&id='.$yourid.'"> link </a> '
careful sql injection though going have check value of id valid, (if using pdo):
stored_procedure = "select user user_db id = ? limit 1;
sql_execute_with_param(stored_procedure, input_id);
More discussions in Develop server-side applications in Dreamweaver
adobe
Comments
Post a Comment