Jump to content

PHP Form


Jetmatt777

Recommended Posts

Hello,I am using a form to upload data to a .php page. I have a form set like this on the php file. I am trying to make a link of what the user submits.HTML Form (Just the part I am speeking of, the rest of the form works)

File Name: <input type="text" name="User File" /><br />
Now on the receiving end (php file that is defined in the <from action=""> tag)
File: <a href="http://link.I.will.keep.to.myself/images/<?php echo $_POST["User File"]; ?>.jpg</a>
What I am trying to do is make the form (html) send text to the php. The user just types in his File Name, and on the php end making it a link. As you can see above n the php quote. On the receiving php end te link doesn't show up. Can a short .php line exist in a anchor tag?Thanks, and I hope that made since.Matt
Link to comment
Share on other sites

for the word User File in the form and post key try using underscores instead of spaces like this

File Name: <input type="text" name="User_File" /><br />File: <a href="http://link.I.will.keep.to.myself/images/<?php echo $_POST["User_File"]; ?>.jpg</a>

Link to comment
Share on other sites

Single or double quotes, doesn't matter.mihalism is right, you need the underscore in the php part, but it is not necessary in the html, php will automatically convert spaces to underscores.Also don't forget to specify the method in the form tag (it is GET by default).

Link to comment
Share on other sites

for the word User File in the form and post key try using underscores instead of spaces like this
File Name: <input type="text" name="User_File" /><br />File: <a href="http://link.I.will.keep.to.myself/images/<?php echo $_POST["User_File"]; ?>.jpg</a>

Actually, tried that, this was just the one I had on my hard drive that I didn't edit, I edited the one thats uploaded to my host. Didn't work.
Link to comment
Share on other sites

for the word User File in the form and post key try using underscores instead of spaces like this
File Name: <input type="text" name="User_File" /><br />File: <a href="http://link.I.will.keep.to.myself/images/<?php echo $_POST["User_File"]; ?>.jpg</a>

Actually, tried that, this was just the one I had on my hard drive that I didn't edit, I edited the one thats uploaded to my host. Didn't work.
Link to comment
Share on other sites

Let me just show you what you should be doing, and hopefully you can figure out what you're doing wrong.For the form:<form action="process.php" method="post"><input type="text" name="field_name">...</form>For the PHP page:

<?php$value = $_POST['field_name'];?><a href="http://link.I.will.keep.to.myself/images/<?php echo $value; ?>.jpg">Click</a>

The anchor tag you posted above is malformed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...