Post Variables

M

Mike

Hello,
I have a string I want to send to a php page but I want to send it as
a POST for security reasons.

I am doing this now:
location.href="saveteams.php?Result=" + All; // All is my string(This
Works)

How can I do it as a POST?
Thanks
Mike
 
M

Martin Honnen

Mike said:
Hello,
I have a string I want to send to a php page but I want to send it as
a POST for security reasons.

I am doing this now:
location.href="saveteams.php?Result=" + All; // All is my string(This
Works)

How can I do it as a POST?

XMLHttpRequest allows you to make post requests. Or you need to let the
browser submit a HTML form with method="POST".
 
V

VK

Hello,
I have a string I want to send to a php page but I want to send it as
a POST for security reasons.

I am doing this now:
location.href="saveteams.php?Result=" + All; // All is my string(This
Works)

How can I do it as a POST?
Thanks
Mike

Anywhere on your page:

<form name="aJaX" method="POST" action="saveteams.php"
style="position:absolute"
<input type="hidden" name="Result" value=""
</form>

and in your script:

document.forms['aJaX'].Result.value = All;
document.forms['aJaX'].submit();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,375
Latest member
FelishaCma

Latest Threads

Top