url rewriting in php
Posted: Tue Feb 04, 2014 3:55 am
Dear all,
I have the following php it works fine, and open the detail.php page with correct id.
here is the url re-writing rule in .htaccess:
this produce the following RUL and ERROR:
Regards:
I have the following php it works fine, and open the detail.php page with correct id.
Code: Select all
<a href="contents/details.php?b_id=<?php echo $business["id"]; ?>" style="text-decoration:none; color:#000;"><h1 style="text-transform:capitalize; margin-bottom:5px;"><?php echo $business["name"]; ?></h1></a>now trying to change the above php to work with the rewriterule, here is the updated php:RewriteRule ^b_id-([a-zA-Z0-9_-]+)-([0-9]+).html$ contents/details.php?b_id=$2
Code: Select all
<a href="contents/details.html?b_id=<?php echo $business["name"]; ?>-<?php echo $business["id"]; ?>.html" style="text-decoration:none; color:#000;"><h1 style="text-transform:capitalize; margin-bottom:5px;"><?php echo $business["name"]; ?></h1></a>can anyone guide me, where I am wrong?You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'my own business.html' at line 1
Regards: