Jump to content

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.

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

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

 

Should of said that then ;)

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'>";

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.