bertieboy_93 Posted August 21, 2006 Share Posted August 21, 2006 Hi, I'm a newbie to PHP and have very little experience so sorry if this is a stupid question.As far as I can tell, PHP ignores periods ([color=red][size=18pt][i][b].[/b][/i][/size][/color]).I have a php script which involves changing a filename and I cannot get the file extension to work because the periods are removed.So the file test.jpg is processed by the server and delivered to the browser as testjpgThis obviously results in broken links.I'm sure there is an obvious solution but I have searched php.net and google and these returned nothing. Quote Link to comment https://forums.phpfreaks.com/topic/18212-stop-processing-periods/ Share on other sites More sharing options...
Daniel0 Posted August 21, 2006 Share Posted August 21, 2006 Sounds really strange. PHP is able to have periods in strings. Could you provide us with the code where you try do deal with a string containing periods? Quote Link to comment https://forums.phpfreaks.com/topic/18212-stop-processing-periods/#findComment-78172 Share on other sites More sharing options...
bertieboy_93 Posted August 21, 2006 Author Share Posted August 21, 2006 [code]<? echo "<img src=\"" . $target_directory$id[color=red][i][b].[/b][/i][/color]jpeg . "\" alt=\"" . $comments . "\"/>" ?>[/code]The variable $target_directory = "../../images/"and $id is the id in a mysql database.In the source code of my browser it reads:[code]<img src="0jpeg" alt="e3"/>[/code]So the period between $id and jpeg has been removed, breaking the link. Quote Link to comment https://forums.phpfreaks.com/topic/18212-stop-processing-periods/#findComment-78187 Share on other sites More sharing options...
Daniel0 Posted August 21, 2006 Share Posted August 21, 2006 An error in your coding. Use this [code]<?phpecho "<img src='{$target_directory}{$id}.jpeg' alt='{$comments}'/>";?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/18212-stop-processing-periods/#findComment-78191 Share on other sites More sharing options...
bertieboy_93 Posted August 21, 2006 Author Share Posted August 21, 2006 Thanks for replying so quickly and providing me with valuable information. Quote Link to comment https://forums.phpfreaks.com/topic/18212-stop-processing-periods/#findComment-78217 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.