Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to get form action right

Posted on 2014-03-09
3
Medium Priority
?
266 Views
Last Modified: 2014-03-10
In a list of links this code is used:

echo '<form action="tinymce/edit_tinymce.php?sort='.$id.'">
        <tr>
          <td>&nbsp;</td>
          <td style="background-color: #E5EDF6"><span class="brodrubrik">Redigera resa till '.$plats.' den '.$datum.'</span></td>
          <td style="background-color: #E5EDF6"><input type="submit" name="B2" id="B2" value="G&aring; dit" >
          </span></td>
          <td>&nbsp;</td>
        </tr>
        </form>';

Open in new window

The url is correct when in the browser the cursor is put on the button. But when the button is pressed and the new page comes up the url is displayed awkwardly in the browser's address field.
I had expected to get http://www.whaterver.com/tinymce/edit_tinymce.php?sort=x but instead I get http://www.whaterver.com/tinymce/edit_tinymce.php?B2=G%E5+dit.

Please, experts, teach me how to get it right.
0
Comment
Question by:lericson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39916585
That's what happens, the querystring is set with the values in the FORM - if there is already something there then it will be replaced.
Put your sort value in an hidden field

This bit
B2=G%E5+dit.

Is your submit button and its normal for it to be passed in the querystring as well, unless you remove the name attribute

You can get around it by specifying the method as POST then the url in the action field will be untouched as the form values are passed invisibly
<form method="POST" ...
0
 

Author Closing Comment

by:lericson
ID: 39917118
Thanks!
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question