I know that it's kind of wrong to ask a question that's almost been answered in the past, but even though I'm trying to use this solution, it doesn't work.
Basically, I have a php table with a search link created in a HTML button from the strings inside the table.
Let's say that this string is creating a search in the website called Discogs and that the information I'm searching through a created link is the word "Beatles".
www.discogs.com/search/?q=Beatles
You notice the ?q=
Everytime I click on the link through a php code which looks like this, the opened link brings me to www.discogs.com/search/? WITHOUT THE REST OF STRINGS (in that case, the word Beatles)
I tried to rawurlencode the ?
to have it as a %3F
.
Here is what my code looks like
$discogslink = 'http://www.discogs.com/search/'.rawurlencode('?').'q='.'Beatles' ;
$form = "<form action='$discogslink' >";
$form .= "<input type='submit' value='Discogs'>";
$form .= "</form>";
echo '<td class="'.$lps->type.'">'.$form.' </td>';
The link that I would like to open is http://www.discogs.com/search/?q=Beatles
The link that opens is : http://www.discogs.com/search/? (nothing after the '?'...)
Do you have any idea why it does that?
BONUS QUESTION : How can I make the button open in a new tab instead of the same one?