Jump to content

Recommended Posts

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 testjpg
This 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.
Link to comment
https://forums.phpfreaks.com/topic/18212-stop-processing-periods/
Share on other sites

[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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.