php - CSS class not getting reflected in the table -
i have values in table on upon click want set particular class , navigate page. table looks this:
<?php // form page file name if($content_type == "") { $content_type = "wtc"; } ?> <table border='0' width='250' class='navigation'> <tr> <td align='left' valign='right' class=<?php if($content_type == "wtc") echo 'active'; ?>><a href='?page=wtc'>create wtc server</a></td> </tr> <tr> <td align='left' valign='right' class=<?php if($content_type == "rap") echo 'active'; ?>><a href='?page=rap'>create rap</a></td> </tr> <tr> <td align='left' valign='right' class=<?php if($content_type == "lap") echo 'active'; ?>><a href='?page=lap'>create lap</a></td> </tr> <tr> <td align='left' valign='right' class=<?php if($content_type == "import") echo 'active'; ?>><a href='?page=import'>import services</a></td> </tr> <tr> <td align='left' valign='right' class=<?php if($content_type == "export") echo 'active'; ?>><a href='?page=export'>export services</a></td> </tr> </table>
here thing is navigating page class not set on value when clicked on.
please suggest solution. in advance.
you need before @ page
value $_get
array
// read page parameter (if exists) $content_type = @$_get['page']; // it's better sanitize bit user input $content_type = htmlspecialchars($content_type); if ($content_type == "") { $content_type = "wtc"; }
since when click you're passing page
parameter querystring
Comments
Post a Comment