# How do i get the URL from a button?



## Hamada90

And i mean a *BUTTON*.

How do I get the link(URL) from it?

For example on this page, there are a few buttons, here is an example from below:









^^^^^^^^^^^^

Needless to say, i tried rightclicking and i didnt find anyway to get a URL out of it.:4-dontkno


----------



## Laxer

view source would be my bet.

If you don't mind me asking: Why do you need this url?

provide me the link for better assistance.


----------



## Hamada90

Lets just say that the link is needed for me to set up an automated macro to do the work I usually have to do. (No, nothing that has to do with spamming/illegal stuff).

Well if _someone_ here can get the link out of the...lets say "Post Reply" or "Submit New thread" button it should work on the site where I need it aswell.

Ive tried with the view source but everything made me dizzy lol


----------



## Laxer

Have you tried programs that auto fill out forms?

Here are some firefox addons: 6 Best free Auto form filling Firefox addons | Web Design Blog & Webmaster Resource Online

I know many of them you can select a hot key to submit the form for you. As well as fill out information such as name, phone etc.

If this is still not what you're looking for you may need to write a script.


while viewing source you will be looking for one of two things.

an anchor tag:


Code:


<a href="LinkURL">Link</a>

or a Form


Code:


<form action="LinkURL">


----------



## DDAoN

Depending on the purpose of the button and the site, it may even be something embedded in PHP scripting, preventing you from being able to view the URL regardless of what you do due to the script being ran server-side rather than client.

Then there is the possibility of the form simply being "encrypted" by, let's just go with, JavaScript. You'd then have to track the form "name" or "id", usually "id", back to the source of the "encryption", which could be in a linked file, usually a *.js.

Without knowing what button you want help with, we can only give you ideas of what to look for, not instructions. For instance, the "Post Reply" button on this forum is an easy thing to get, simply right-click on the button and left-click on "Copy Shortcut". The link for it, for me, will be: http://www.techsupportforum.com/forums/newreply.php?do=newreply&noquote=1&p=3180552. It'll be different for you do to the change in posts to the thread.

I hope I, at least, help give a little insight into the different things to look for.


----------



## acidxxlife

@DDAoN

i am trying to find the link of a button that is .php
i have no experience with programming and am trying to learn on the run.
i was able to get the link of one button from the source code, example below.

<form action="sheet.php" class="rap_sheetFormM" method="post"> 
<input value=" Declare war" class="submit" type="submit"> 
<input name="action" value="attack" type="hidden"> 
<input name="idTarget" value="1331861875" type="hidden"> 
</form> 
</td><td>
https://apps.facebook.com/gangsterbattle/sheet.php?idTarget=1331861875&action=attack

can you help me figure out the URL to this code?
<form action="don.php" method="post"> <input class="submit" value="Accept" type="submit"> <input name="action" value="takeStamina" type="hidden"> </form> </td>

there is also another button that is more complicated where you have to select
the quantity to buy or sell. would you be able to help me with that too? 

thank you for your time.


----------



## acidxxlife

not sure if type of browser matters, but i got the page source code using firefox


----------



## acidxxlife

DDAoN said:


> Without knowing what button you want help with, we can only give you ideas of what to look for, not instructions. For instance, the "Post Reply" button on this forum is an easy thing to get, simply right-click on the button and left-click on "Copy Shortcut". The link for it, for me, will be: http://www.techsupportforum.com/forums/newreply.php?do=newreply&noquote=1&p=3180552. It'll be different for you do to the change in posts to the thread.
> 
> I hope I, at least, help give a little insight into the different things to look for.



the button that i figured out is to "attack" someone on an online game. the one i am trying to figure out is to redeem a "gift" by using my "don points". 

thanks again


----------



## Redcore

If you're automating something, you could use Selenium IDE (firefox add-on)...

Tutorial:
Selenium IDE Tutorial – Part 1



I've used it for simple unit tests in the past, works pretty well.


----------



## acidxxlife

I'm not trying to do any automated script from the button. the problem I'm having is the site where the button is on, is not working properly. i am just trying to see if i can extract the url if the.php button. is it possible to do it with the page source code?


----------



## Redcore

PHP shouldn't have anything to do with HTML (the button). As Laxer posted above you're probably looking for the form action attribute URL.

When that button is clicked, it should go to the URL anyways unless it's AJAX or your form is broken. Pretty basic stuff here.


----------



## acidxxlife

Redcore said:


> PHP shouldn't have anything to do with HTML (the button). As Laxer posted above you're probably looking for the form action attribute URL.
> 
> When that button is clicked, it should go to the URL anyways unless it's AJAX or your form is broken. Pretty basic stuff here.


how do i find the URL of the form action? sorry for not asking clearly, as i am not familiar with programming and cs.


----------



## liamm

This is getting more more complex, because, you must study all jacascript sheets. Any of them can contain jsons or other types of communication with the server, in ways you can barely think about that. I very curious of your curiosity though..


----------



## Redcore

acidxxlife said:


> how do i find the URL of the form action? sorry for not asking clearly, as i am not familiar with programming and cs.


In Google Chrome, right click on the web page and click "View Page Source" From there you can search for the text you see in the button (ie for your example button in your first post, "submit new thread") - searching is usually Control+F (win) or Command+F (mac). above that form button should be something that looks like "<form action="webpage.html">"

If you can't find it and this page is public, post the link.


----------

