0

So I have this HTML:

<form action="tickeroutput.php">Ticker Symbol: <input type="text" name="ticker" method="get"/>
                <input type="submit" value="Submit" />
            </form>

And then I want to use the data contained in ticker, however I have this in tickeroutput.php, and it doesn't seem to want to work:

    $ticker = $_GET("ticker");

Is this not the correct format to have $ticker as a string? I specifically need what the user inputs as a string variable.

2 Answers 2

2

First of all I think you meant to write :

<form action="tickeroutput.php" method="get">Ticker Symbol: 
<input type="text" name="ticker"/>
                <input type="submit" value="Submit" />
            </form>

and to fix your problem you should replace $ticker = $_GET("ticker"); with $ticker = $_GET["ticker"]; replace () with []

Sign up to request clarification or add additional context in comments.

Comments

1

You need to use square brackets, not (). $ticker = $_GET['ticker'] $_GET is an array.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.