1

I have the following <td> tag with <a> tag in it that contains a php variable in href. I only can browse upto uploads folder. Does anyone know why? It supposed to browse until uploads\$_POST['searchInput'] . But it is not doing that.

<td class="viewEditTd"><button class = "btn btn-info viewEditButton"><a href="file://///172.xx.xx.xxx\TEMP\xxx\uploads\"<?php echo $_POST['searchInput']; ?>"\" target="_blank"><span class="
        glyphicon glyphicon-folder-open" aria-hidden="true"></span> View File</a></button></td>
Anu
  • 1,123
  • 2
  • 13
  • 42
  • Why is it marked as duplicate? I think it's genuinely different question. I was about to answer this. – Vincent Apr 27 '18 at 01:47
  • @Barmer: I don't understand why you mark as duplicate. And when i checked the so called answer you suggested in another post, it is quite different. – Anu Apr 27 '18 at 01:49
  • @Barmar ^ that was intended for you. They misspelled your name. – Funk Forty Niner Apr 27 '18 at 01:58
  • @Anu Please take care when typing someone's name. Typos do count here also, so I had to ping him myself so he could see the probable error. – Funk Forty Niner Apr 27 '18 at 01:59
  • 1
    see my [pic](https://i.stack.imgur.com/C8HKl.png) @Anu – qskane Apr 27 '18 at 02:02
  • @Barmar Please remove the duplicate lock. I saw the answer you suggested is discussing different topics whereas my question is different – Anu Apr 27 '18 at 02:02
  • @FunkFortyNiner Thank you. i will take note about the typo next time – Anu Apr 27 '18 at 02:04
  • @qskane Thanks a lot. Such a silly mistake from me. Your suggestion worked perfectly fine. How to mark your answer as correct? – Anu Apr 27 '18 at 02:07
  • @Anu you can't. because this is just a comment, I think you need an IDE, such as PhpStom , that is why I can easily fix your error :) – qskane Apr 27 '18 at 02:09
  • @qskane Thanks. The question is wrongly locked as duplicate by someone. So I can't post your suggested code as answer too. – Anu Apr 27 '18 at 02:11
  • @Anu It is not wrongly locked, just because there are too many typos questions. No matter, you should feel happy, the question is solved – qskane Apr 27 '18 at 02:14
  • I marked it as a duplicate because I thought you were asking why the `` is showing up on the page. – Barmar Apr 27 '18 at 19:38
  • @Anu Typo questions shouldn't get an answer anyway. They should be closed as off-topic, using the reason "Couldn't reproduce or typo". – Barmar Apr 27 '18 at 19:40
  • @Barmar Thanks for removing the lock. By the way the typo Funk Forty Niner mentioned is not typo in question. It is the typo error I made when i tried to type your name in the comments. There was no typo in my question earlier – Anu Apr 28 '18 at 23:30
  • @Anu The typo I was talking about was the extra double quotes around the php tag. – Barmar Apr 28 '18 at 23:48
  • @Barmar When I posted the question, i was using those double quotes intentionally by thinking, it was needed. Not a typo error from me; that is what i thought. I believe stack overflow got many questions such as this one whereby the person who posted question thought some formatting needed whereby actually such formatting will cause codes to crash. Anyhow, for my case I realized the mistake in my code and I got the correct answer too from here itself – Anu Apr 30 '18 at 00:41
  • For our purposes it might as well be a typo. There's no close reason specifically for such minor errors, we use that one for most questions where the error is really minor and the solution is not likely to help future readers. It's good you resolved your issue, this is just about whether it's a useful question for others. – Barmar Apr 30 '18 at 03:35

1 Answers1

0

I am able to solve the issue with the help of Stack overflow forum member. This is how it solved. My issue was as below

<td class="viewEditTd"><button class = "btn btn-info viewEditButton"><a href="file://///172.xx.xx.xxx\TEMP\xxx\uploads\"<?php echo $_POST['searchInput']; ?>"\" target="_blank"><span class="
        glyphicon glyphicon-folder-open" aria-hidden="true"></span> View File</a></button></td>

It was solved by removing the two double quotes around the php tags. Working answer is

<td class="viewEditTd"><button class = "btn btn-info viewEditButton"><a href="file://///172.xx.xx.xxx\TEMP\xxx\uploads\<?php echo $_POST['searchInput']; ?>" target="_blank"><span class="
        glyphicon glyphicon-folder-open" aria-hidden="true"></span> View File</a></button></td>
Anu
  • 1,123
  • 2
  • 13
  • 42