Solved

Post HTML Value without clicking the link?

Posted on 2009-04-13
33
319 Views
Last Modified: 2012-06-27
I want to be able to enter a line such as:

http://www.testsite.com/yyy/yyy and I want to post an acount of ### without clicking on the link?

Such as http://www.testsite.com/yyy/yyy?value="###"    

Anyone any other ideas?

Thanks

<form action="/yyy/yyy" method="post">

			Deposit: <input id="yyy_amount" name="yyy_amount" type="text" /yyy/yyy /> <input name="commit" type="submit" value="yyy Amount" />

Open in new window

0
Comment
Question by:gtvingo14
  • 14
  • 12
  • 3
  • +1
33 Comments
 
LVL 4

Expert Comment

by:khsater
Comment Utility
You want to submit a post without clicking on a submit button?  You can do this on FF for sure, and IE under certain conditions: http://www.thefutureoftheweb.com/blog/submit-a-form-in-ie-with-enter.  If you want to submit information without any user action, you'll need to use JavaScript.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
Do you understand the difference between $_GET and $_POST ?

The POST array contains values submitted via a form with method="post" whereas the GET array contains values in the URL string eg ?var1=someValue&var2=someValue

Or you can change the form method to method="get" and the values will show up in the URL, which can lead to security issues.

Does this help? I can explain more if you like.
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
Well, what i need is to enter a website in the address bar such as the one shown above and submit number 10.

http://www.testsite.com/yyy/yyy?value="10"

I am just not sure about the right syntax of doing this, it must be very simple.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
What server side language are you using? PHP?
If the url reads http://www.testsite.com/yyy/?yyy=10 then you can output the value of yyy by writing
<?php echo($_GET['yyy']); ?>

The question mark indicates the start of a list of variables. then comes the variable name. then equals. then the value. eg.

www.google.com?q=Lorem+ipsum

variable name is q, value is Lorem ipsum. access it with $_GET['q']
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
Hello, thanks for your help.

I am not looking to find a value of anything, I just want to enter 10 in post.

so far, this is what I am thinking....

http://www.testsite.com/yyy/yyy?yyy_amount="10"

from code of:


<form action="/yyy/yyy" method="post">
                  Deposit: <input id="yyy_amount" name="yyy_amount" type="text" /yyy/yyy /> <input name="commit" type="submit" value="yyy Amount" />
0
 
LVL 4

Expert Comment

by:khsater
Comment Utility
You can't transfer the value of a form field into an address and forward the user without javascript.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
Sorry I'm having trouble understanding what you want to do. Let me know if this is correct.

You want to type in the address bar http://www.testsite.com/yyy/yyy?yyy_amount=10
Then you have a form with an input field called yyy_amount. Then you want to put the number 10 that you've got from the address bar in to that input field.
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
mstrelan, yes you have the right idea, but I dont want to just put it into the field, I want to submit it...

khsater, what would be my fast and easy alternative, this is not a critical task, but I just assumed it would not be complicated.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
It will be submitted when you hit the Submit button.
<form action="/yyy/yyy" method="post">

    <input name="yyy_value" id="yyy_value" value="<?php echo($_GET['yyy_value']);" />

    <input type="submit" value="Submit!" />

</form>

Open in new window

0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
Ok, I guess my question if there is any way around clicking on the link of a button?

do I need to write a script to do this? there has to be a way of doing it...and an easy one.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
when do you want it to submit? as soon as you type in the value?
try this

<form action="/yyy/yyy" method="post">

    <input name="yyy_value" id="yyy_value" value="<?php echo($_GET['yyy_value']);" onblur="if(!isNaN(this.value)) { this.form.submit(); }" />

    <input type="submit" value="Submit!" />

</form>

Open in new window

0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
Well, I dont have a way to modify the code....
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
So you want to submit this value on sonebody elses site?
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
yes.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
That doesn't sound like a good thing. If they want you to be able to do it they will provide you with access to do it. If their server is not very secure submitting values that aren't expected can corrupt their databases and applications. But that's not saying its not possible to do. Do you use Firefox?
0
 
LVL 4

Expert Comment

by:khsater
Comment Utility
So what you want to do is submit a post value by submitting a get value to another persons website?
This is not possible.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
khsater, you are dismissed from this question.

This is not a complicated process, I am not trying to get a GET value, I am just trying to POST a value.

Same as me clicking on the button, I just dont want to scroll each time through 2000 lines of website.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
I can't help any further without knowing the specifics of the website you want to post to. I hope you are not trying to spam the website with hundreds of posts.
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
I just love when first reaction that I get is you are trying to do something malicious.

If I was trying to do anything malicious, I would have a little more knowledge than asking how to post a value...I guess I will play a bit with syntax, but this is not worth more than 15 minutes of my time which I have already spent...Was just an idea to help in my daily functions...
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
You should accept both comment #24134165 and #24133961 as partial solutions.
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
Why should I accept? You did not provide any partial answers...will wait for someone who knows this area
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
You are not offering enough detail for us to provide a solution
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
Well detail do you NEED? and why are you asking to accept without providing a solution, this is unprofessional and unfair to other experts who actually provide solutions on this site.
0
 
LVL 10

Expert Comment

by:mstrelan
Comment Utility
- Are there any other fields that need to be filled out before the form is posted or do you just want to post the value "10" in the one field and thats it.

- What is the "action" value of the form?

- What is the "method" of the form?

Or better yet just provide the url this form is on.
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
this websites requires login to post, which obviously I cannot provide.

The form has 100s of variables, drop downs, text fields....but everything is optional.

All I need to do is submit number 10 for specific variable. "id="yyy_value"

I dont need to do anything else, I dont need to reload, I dont need to get, I dont need anything crazy.

You dont understand what the action or method which I am trying to do here?
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
mstrelan, please dont waste anymore of your time, looks like you are not getting anywhere. I will just wait for someone who knows this area a little better.
0
 
LVL 10

Accepted Solution

by:
mstrelan earned 250 total points
Comment Utility
suit yourself. you are very rude.

If the server accepts &yyy_value=10 in the url then all you have to do is append that to the url string and hit enter. but it depends if it looks for GET values or only POST values. if its the latter you will need to use a firefox extension to submit post values or build your own form which posts to the same action="...". but then if the server is at all secure it will ensure that the referrer is on its server.

good luck finding help from someone else
0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
mstrelan, I have provided you with all of the information you have asked for, and instead of trying to figure out a solution you are thinking what is this for? I am sorry but accusing someone of trying to do anything malicious is not very polite on your end.

When I joined here in 2002, this site was about helping each other and figuring out solutions to the problems and thinking regarding code and not accusing each other of wrong doing. I am obviously not going to be giving out secrets of my business or what I do, there are privacy aspects you also have to consider.

If you can't or won't help, there are others here who are willing to help. And By the way I have helped much more than you have and I have not asked anyone to accept unanswered questions like you have.

Your last idea did not work.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Can you not load this page from your hard disc

Since there is only one field, the submit button is optional

If you add a target="_blank" to the form tag, the submission will open in a new window.





<html>

  <head>

  <title></title>

  </head>

  <body onLoad="document.forms[0].elements[0].focus();document.forms[0].elements[0].select()">

<form action="http://www.testsite.com/yyy/yyy" method="post">

Deposit: <input id="yyy_amount" name="yyy_amount" type="text" /> 

<input name="commit" type="submit" value="yyy Amount" />

</form>

  </body>

</html>

Open in new window

0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 250 total points
Comment Utility
If you save the page on your server, you can do this:

http://www.yourserver.com/autopost.html?1234234

<html>

  <head>

  <title></title>

  </head>

  <body onLoad="document.forms[0].elements[0].value=location.search.substring(1);document.forms[0].submit()">

<form action="http://www.testsite.com/yyy/yyy" method="post">

Deposit: <input id="yyy_amount" name="yyy_amount" type="text" /> 

</form>

  </body>

</html>

Open in new window

0
 
LVL 6

Author Comment

by:gtvingo14
Comment Utility
That was what I was looking for, thanks I will try it in the morning.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
PS: The last comment from mstrelan
"build your own form which posts to the same action="...". but then if the server is at all secure it will ensure that the referrer is on its server."

is correct. So what I posted is just that, your own version of the form. And if they test the referrer or a session, then the submission from an external page will be ignored.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now