roosterbob Posted June 23, 2007 Share Posted June 23, 2007 I'm getting this error: Parse error: syntax error, unexpected '%' With this code: <?php ob_start(); if(isset($_REQUEST[’kw’])) { $kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).”"; $k1w = urldecode( $_REQUEST[’kw’] ).”"; } else { $k1w = NULL; } ?> <? echo ( ( strlen( $k1w ) <6 ) ? “Default Text” : “$k1w\n” ) ; ?> Quote Link to comment Share on other sites More sharing options...
chigley Posted June 23, 2007 Share Posted June 23, 2007 You are using "smart quotes" in your code, and you need to use standard ones: " ' Quote Link to comment Share on other sites More sharing options...
roosterbob Posted June 25, 2007 Author Share Posted June 25, 2007 So my code should look like: <?php ob_start(); if(isset($_REQUEST[’kw’])) { $kw = preg_replace("/%20/"," ",$_REQUEST["kw"]).""; $k1w = urldecode( $_REQUEST["kw"] ).""; } else { $k1w = NULL; } ?> Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted June 25, 2007 Share Posted June 25, 2007 <?php ob_start(); if(isset($_REQUEST['%kw'])) { $kw = preg_replace("/%20/"," ",$_REQUEST["kw"]).""; $k1w = urldecode( $_REQUEST["kw"] ).""; } else { $k1w = NULL; } ?> Quote Link to comment 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.