1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

php script from a browser

Discussion in 'PHP' started by mike_ledis, Feb 9, 2011.

  1. mike_ledis

    mike_ledis New Member

    Hello! Suppose that a php script exists in a server and i have access as a client.that script has 4 args first and second are char args third and forth are int args. If i want to run that script from my browser what syntax i have to use?
  2. shabbir

    shabbir Administrator Staff Member

    PHP scripts are run directly using the browser URLs
  3. pein87

    pein87 New Member

    You need to know the url variables. If you know that you can then add values to them. Example url

    after the php you need a question mark or ? . This can also be done with a html page to or pretty much any script file.Then the url variable follow by an equal sign or = . This says make this url GET variable have the value after the equal sign. If there is more then one url variable you need to add an and sign or &. You can also use & but most servers have it as & . The above url has two variables that will be sent to the script via GET. POST types aren't sent so they can be seen via the url. You'd need packet filtering for that. However most use REQUEST in php so it doesn't need to filter request types. Also php doesn't use strong type, they are more or less validating the data being passed as int and string because php does not support types unless your type casting.

    the variables would be retrieved like so

    $user $_GET['uid'];
    $session $_GET['sid'];

    $session $_REQUEST['sid'];
    lots of sites dont validate their GET data and sql injections happen.
  4. mike_ledis

    mike_ledis New Member

    Pein87 first of all thank you! Could you explain me more about post method? If my script uses a post method how can i change the variables. I tried to make a post form in my pc,that uses the full url of the script that i want as an action. But every time, the browser is trying to find the url in the root directory that i placed my script.//ex C:/Users/mikeb/Desktop/
  5. lionaneesh

    lionaneesh New Member

    For post Requests you have to make a HTTP request to the server page...
    Another way of doing it is to simply make a simple form like :-

    You can do this by using Firebug a great addon for mozilla

    <form action="page_where_you_want_to_post" method="POST">
    <input name="argument1" type="text"/>
    <input name="argument2" type="text"/>
    <input name="argument3" type="text"/>

Share This Page