2

I need to pass a value from a form to an external php script via a url, but my code isn't working. When I submit my form, I'm expecting the url to look like this: example.com/script.php?zip=12345 but what I'm getting is this: example.com/script.php? with nothing after the ?. My form code is below. Am I doing something wrong, or do I need to change a setting somewhere?

        <form id="map" method="get" action="script.php">
            <input type="text" class="inline" id="zip" />
            <input type="submit" class="button" value="Go" />
        </form>
1
  • 1
    I would say that this is not an ExpressionEngine-related question and is better server by StackOverflow. Commented Dec 18, 2012 at 16:54

1 Answer 1

2

You're missing the name attribute on the text field.

<input type="text" class="inline" id="zip" name="zip" />

You may just want to change id to name (that would depend on whether or not you're using the ID for any CSS/jQuery selectors).

2
  • Doh! I must have looked at that code 100 times and not noticed that there was no name. Thanks. Commented Dec 18, 2012 at 16:54
  • No problem. For future reference Derek is right though. Any non-EE questions would be better off posted on Stack Overflow. Commented Dec 18, 2012 at 17:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.