modchamp Posted November 26, 2008 Share Posted November 26, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/ Share on other sites More sharing options...
modchamp Posted November 27, 2008 Author Share Posted November 27, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-699886 Share on other sites More sharing options...
DeanWhitehouse Posted November 27, 2008 Share Posted November 27, 2008 Lol You should read up on HTML <input disabled='disabled' type=text value=$linkd> http://www.w3schools.com/tags/tag_input.asp Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-699888 Share on other sites More sharing options...
modchamp Posted November 27, 2008 Author Share Posted November 27, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-699894 Share on other sites More sharing options...
DeanWhitehouse Posted November 27, 2008 Share Posted November 27, 2008 <?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 Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-699901 Share on other sites More sharing options...
modchamp Posted November 27, 2008 Author Share Posted November 27, 2008 Sorry, well now since it's asked and thoroughly explained, can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-699991 Share on other sites More sharing options...
DeanWhitehouse Posted November 27, 2008 Share Posted November 27, 2008 Did you try the code i just posted? Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-700441 Share on other sites More sharing options...
modchamp Posted November 27, 2008 Author Share Posted November 27, 2008 Oh sorry didn't notice it before. Ok I just gave it a shot and got the following: http://img123.imageshack.us/img123/5326/error1ua5.png Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-700625 Share on other sites More sharing options...
DeanWhitehouse Posted November 28, 2008 Share Posted November 28, 2008 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>"; Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-700707 Share on other sites More sharing options...
modchamp Posted November 28, 2008 Author Share Posted November 28, 2008 What do you mean? If I echo $linkd then it works just fine, but when I put it in the textbox it cuts off at the apostrophe. Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-700716 Share on other sites More sharing options...
modchamp Posted November 28, 2008 Author Share Posted November 28, 2008 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'>"; Quote Link to comment https://forums.phpfreaks.com/topic/134427-solved-crazy-quoteapostrophe-situation/#findComment-700741 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.