I have some input fields in my View. I want a link to be generated dynamically based off the user's input into these fields.
My understanding is that normally, php cannot be updated after the page is rendered, but for some reason I think this is different in an MVC setup??
My solution - based on this assumption - is to store a php variable in the user input field. And call that variable where my link is generated.
example:
the input field, I want to store the input text into new variable $locationhold
<dt><label for="location_area" class="required">Area</label></dt>
<dd><input type="text" name="location_area" id="location_area" value="<?php if($this->validation->location_area){ echo $this->validation->location_area; $locationhold=$this->validation->location_area; }else echo $property->location_area; ?>" class="required" /></dd>
and then somehow summon $locationhold and make it part of this link:
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.mysite.com/item/listing/<?php echo $locationhold ?>" data-text="NEW POST!" data-count="none">Tweet</a>
anyway this doesn't quite work, tips? the <?php echo ?> is ignored. My tweet says "New Post! http://www.mysite.com/item/listing/" and not the rest of the information that I wanted to dynamically append to the link. This may be because by the time the page rendered, $locationhold was still empty, but how can I retain a user modified value in it and achieve the result I am looking for