Jump to content

[SOLVED] Crazy Quote/Apostrophe Situation


modchamp

Recommended Posts

Well my brain is utterly fried right now and I need a little help.

 

$linkd = "<a href=\'$address" . "upload/$ran1" . $ran2 .  "$_FILES['file']['name']\\'>"

echo "<br>HTML Link (for websites): " . "<input readonly='readonly' type=text value=$linkd>";

 

I'm basically trying to get a readonly text field that will display the users uploaded image location in <a href> form, kind of similar to imageshack.us

 

Thanks in advance,

 

modchamp

Link to comment
https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/
Share on other sites

I've edited to the following:

 

$linkd = "<a href='$address" . "upload/" . $ran1 . $ran2 . $_FILES['file']['name'] . "\'>";

echo "<br>HTML Link (for websites): " . "<input readonly='readonly' type=text value=$linkd>";

 

Now I get <a in the textbox and then > after it. Any ideas?

No, not what I meant.

 

The read only setting is exactly what I want, when you disable it you can't select the text in the box and copy/paste it. The problem I'm having is that it's cutting the text in the textbox off, right at the first apostrophe.

Are you not putting anything inside the link?

$linkd = "<a href=\"".$address."upload/". $ran1.$ran2.$_FILES['file']['name']."\">";

 

needs to be something like

 

$linkd = "<a href=\"".$address."upload/". $ran1.$ran2.$_FILES['file']['name']."\">".$_FILES['file']['name']."</a>";

Ok was tinkering with it and got it to work. Just needed to put $linkd in single quotes:

 

$linkd = "<a href=\"".$address."upload/".$ran1.$ran2.$_FILES['file']['name']."\">".$_FILES['file']['name']."</a>"; 

echo "<br>HTML Link (for websites): <input readonly='readonly' type='text' value='$linkd'>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.