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” ) ; ?> Link to comment https://forums.phpfreaks.com/topic/56862-simple-script-help-i-am-dumb/ 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: " ' Link to comment https://forums.phpfreaks.com/topic/56862-simple-script-help-i-am-dumb/#findComment-280937 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; } ?> Link to comment https://forums.phpfreaks.com/topic/56862-simple-script-help-i-am-dumb/#findComment-282413 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; } ?> Link to comment https://forums.phpfreaks.com/topic/56862-simple-script-help-i-am-dumb/#findComment-282416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.