Jump to content

[SOLVED] Get in Forms give bad address


Sun_Blood

Recommended Posts

Hi

 

So this is probably quite easy but I can’t find the solution.

I want to have a form and after the user have chosen in the list the address need to be sent to the browser.

 

Here is a snip from my code.

 

<?php
$data = "ligaid=12&serie=2";

echo "<form action='index.php' ENCTYPE='application/x-www-form-urlencoded' name='sasong' method='GET'>
<select name='spela' ENCTYPE='text/plain' class='kommentera'>
<option value=''>---- Tidigare säsonger ----</option>
<option value='".$data."'>Session 1</option>
<option value='asd6'>Session 2</option>
<option value='asd8'>Session 3</option>
<option value='asd10'>Session 4</option>
</select>
<input type='submit' value='Submit'>
</form>";
?>

 

The address will now be

index.php?spela=ligaid%3D12%26serie%3D2

when I choose alternative "Session 1"

 

But I want it to be

index.php?spela=ligaid=12&serie=2

 

Can anyone help me?  :)

Link to comment
https://forums.phpfreaks.com/topic/129440-solved-get-in-forms-give-bad-address/
Share on other sites

but what values are you trying to get at the end of this and does it really matter what the url looks like?

what you are saying will result in

$_GET['spela'] will be 'ligaid=12';

and

$_GET['serie'] will be 2

are these the results you are looking for?

 

Scott.

yes that is true but that was only a exampel.

On the real page the address is longer and the pages before can't manage that scrambled address if I don't rewrite evrything to use htmlspecialchars, and I don't have that time.

 

If this can't be done I'll use post insted but then the page cant be bookmarked

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.