Solved

Post HTML Value without clicking the link?

Posted on 2009-04-13
33
326 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
ID: 24133961
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
ID: 24133964
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
ID: 24133982
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 10

Expert Comment

by:mstrelan
ID: 24133994
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
ID: 24134012
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
ID: 24134019
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
ID: 24134028
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
ID: 24134053
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
ID: 24134084
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
ID: 24134090
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
ID: 24134109
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
ID: 24134117
Well, I dont have a way to modify the code....
0
 
LVL 10

Expert Comment

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

Author Comment

by:gtvingo14
ID: 24134154
yes.
0
 
LVL 10

Expert Comment

by:mstrelan
ID: 24134165
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
ID: 24134169
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
 
LVL 6

Author Comment

by:gtvingo14
ID: 24134196
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
ID: 24134207
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
ID: 24134334
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
ID: 24134363
You should accept both comment #24134165 and #24133961 as partial solutions.
0
 
LVL 6

Author Comment

by:gtvingo14
ID: 24134373
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
ID: 24134376
You are not offering enough detail for us to provide a solution
0
 
LVL 6

Author Comment

by:gtvingo14
ID: 24134383
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
ID: 24134397
- 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
ID: 24134421
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
ID: 24134435
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
ID: 24134447
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
ID: 24134503
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
ID: 24135901
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
ID: 24135924
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
ID: 24135931
That was what I was looking for, thanks I will try it in the morning.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24136162
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
would like the bottom of this page to be smaller 3 29
manage footer size 4 56
keyword rich ebay title, description 2 36
QQ problem 22 24
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

832 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