Re: How to shortcut execute php script without filling out form?



worktech@xxxxxxxxx wrote:

This is not my website I am dealing with, it is a public site that
uses a form that has the code above. So why can't I just pass the
data through the address bar? Is there some security in place that
might prevent url passing of variables?

No, it's just coded in a way it doesn't react to the variables you pass in the $_GET array, but only in the $_POST array.

There is a small work around, but it has nothing to do with PHP. At least, not as you describe it.

If I can't do that, would writing a script that uses sockets be able
to accomplish this somehow? Or is it somehow not possible without
using their html form

Woah, hold your horses !

You don't need to use sockets to do this. If you want to retrieve data with your PHP server, then a little bit of cURL and it will all be over.

On the other hand, from what you've explained, I understood that it's just *you*, client side who wants to get to a page that needs a form to post a bit of information.

Create an html file with this code in it:

<html>
<head>
<script type="text/javascript">
function sendData ()
{
var form = document.getElementById ("theForm");
form.submit ();
}
</script>
</head>
<body onload="javascript:sendData ()">
<form id="theForm" method=POST action="http://whateversite.com/rcon.php";>
<input type="hidden" name="addr" value="ADDRESSVALUE" />
<input type="hidden" name="rcon" value="RCONVALUE" />
<input type="hidden" name="announceflag" value="1" />
</form>
</body>
</html>

(You will need to replace 3 values: the address of the server, and the values of "addr" and "rcon")

When you load this page, it will automagically submit the form to the server, and should get you where you want.

Of course, this only works if there are no cookies involved (in which case you will have to identify against the server before executing this page, within the same browser).

If I misread your post, please correct me.

HTH,

S.
.



Relevant Pages

  • Re: How to do a post back when user press enter.
    ... It is hosted on a web server, ... the client browser, which is designed to read and interpret HTML. ... UI, via the event handler. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: PHP-Yes, HTML-No --- Why?
    ... The .html signifies that the file contains HTML - and pretty ... A php script contains both HTML and PHP code so technically speaking it's not just HTML. ... The user is getting a file from your web server, an HTML file, and it has an extension of something other than HTML. ... I hope you weren't configuring them as per your personal likes and dislikes but instead were configuring them as per the customer requirements and for speed, ...
    (comp.lang.php)
  • Re: PHP-Yes, HTML-No --- Why?
    ... You are arguing to have ..html at the end of every URL even if the file contains PHP or another scripting language. ... By that very figure you are in the minority and I'd venture to guess the the number of people who really, really care about such trivial things such as yourself is probably closer to .1% in the real population. ... FTP requests are not HTTP. ... The point about MP3 files is that if you configure your web server to treat every file as potentially having dynamic content and that it should search through the entire file looking to determine exactly which language might be in use in the file and hand it off to the appropriate parser, interpreter or module then you are gonna have to contend with the fact that occasionally you're gonna be charging the web server with reading and parsing potentially huge files - all in the name of a foolish consistency. ...
    (comp.lang.php)
  • Problem with some Pages? - Re: More piccies
    ... >> in Firefox, Biffo. ... Yep, or to be more exact, what the *Browser* is seeing in the HTML ... the same Server, which just happened to have a single Character ... the Pages/Pics using BackSlashes or ForwardSlashes! ...
    (uk.people.silversurfers)
  • Re: How to do a post back when user press enter.
    ... > requested by a client browser, ... > by an ISAPI (Internet Server Application Programming Interface) ... > and interpret HTML. ... > to its process and UI, via the event handler. ...
    (microsoft.public.dotnet.framework.aspnet)