PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<form action="create.php" method="GET">
First Name/ Email Address: <input name="name" value="<?php $name = $_GET['$name']; echo "$name" ?>">
<br>Link to Shorten: <input name="url" size="50"><br>
<input type="submit" value="Create Short URL"></form>
This simply doesn't work. I've tried echoing the entire form and replacing the name field's value with $name, but the field just stays blank. Can anyone help?
<form action="create.php" method="GET">
First Name/ Email Address: <input name="name" value="<?php $name = $_GET['$name']; echo "$name" ?>">
<br>Link to Shorten: <input name="url" size="50"><br>
<input type="submit" value="Create Short URL"></form>
This simply doesn't work. I've tried echoing the entire form and replacing the name field's value with $name, but the field just stays blank. Can anyone help?
I'm working on that. Oh yeah, while I'm talking about security, I log the IP address of every user on my site, and then have a script to check the persons name and location.
spider.nick wrote:The <? is the short version of <?php, which your sever probably supports. The = is equivalent to 'echo'. The ?> closes the PHP, as always.
Using PHP's short tags is not good coding practice and shouldn't be recommended.
spider.nick wrote:The <? is the short version of <?php, which your sever probably supports. The = is equivalent to 'echo'. The ?> closes the PHP, as always.
Using PHP's short tags is not good coding practice and shouldn't be recommended.
A matter of preference, but thank you for stating it as fact ...
I am of the opinion that short open tags should not be used, but I would like to see some evidence for your claim. I have found evidence that the "asp_tags" setting will be deprecated or removed, but not "short_open_tag". I think that is a rumor that was started by confusion between ASP-style short tags (<%) and the short open tag (<?).
IBM.com - The Future of PHP - Nathan A. Good wrote:Microsoft Active Server Pages (ASP)-style tags — the shorter version of the PHP tags — are no longer supported. To make sure this is not an issue for your scripts, verify that you aren't using the <% or %> tags in your PHP files.