Hi Everyone. I am wondering if I can somehow manually pass a variable through the url into a text box. I did the following an dit did not work.

url is http://localhost/project.php?var=001

<input id="txtstext" class="t-box" name="txtstext" type="text" value="<?php ?var=$promo; ?>" style="width:100px">

Therefore I want to paste the above url into the browser and it fills the texbox with 001.

How can I get this to work?

<input id="txtstext" class="t-box" name="txtstext" type="text" value="<?php echo htmlentities($_GET['var'],ENT_QUOTES); ?>" style="width:100px">
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.