0

I am new to coding. There seems to be a problem when I try to Get the value of "#". Some special characters do work but only the "#" won't work.

when I try to run my link: http://localhost/php/Final/DeleteTask.php?Username=311&ID_Task=Task#8

This is the output.

311
Task

The output won't show the value "Task#8". Instead it resulted in "Task" I have tried doing urldecode but it still won't work.

My php code here

Help is greatly appreciated. Thank you.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • [**Please Never** post images of code, data or error messages](https://meta.stackoverflow.com/a/285557/2310830). Please edit your question and include copy/paste the text into the question, formatted. This is so that we can try to reproduce the problem without having to re-type everything, and your question can be properly indexed or read by screen readers. – RiggsFolly Jun 08 '22 at 07:54
  • Why not just pass ` http://localhost/php/Final/DeleteTask.php?Username=311&ID_Task=8` and then in the code you can add `Task#` to the front of `ID_Task` if that is required later in the code – RiggsFolly Jun 08 '22 at 07:56
  • See the duplicate, basically the `#` and anything after it is not sent to the server it is only used in the browser to jump to an anchor in the page. Check out [How to Add an Anchor Link to Jump to a Specific Part of a Page](https://www.w3docs.com/snippets/html/how-to-create-an-anchor-link-to-jump-to-a-specific-part-of-a-page.html) – RiggsFolly Jun 08 '22 at 08:00
  • Alright thanks! I apologize for I am new. – Rafael Castillo Jun 08 '22 at 08:01
  • No need to apologise. In future though it is best to do a search with your favourite search engine. at least 75% of the time a beginner will find a question has been asked and answered already :) – RiggsFolly Jun 08 '22 at 08:02
  • If you want to use `#` as data you'll need to `urlencode` it – Honk der Hase Jun 08 '22 at 08:22

0 Answers0