Page 1 of 1

Use Javascript input for PHP Script

Posted: Wed Oct 01, 2003 1:45 am
by melbell
If I have this javascript code:

var name = prompt("What is your name", "Type you name here");

Is there any way that I can use that input in a php script?

Posted: Wed Oct 01, 2003 1:55 am
by delorian
Yes.

Code: Select all

var name = prompt("s...."," ");
window.location = '/path/to/your/script.php?name=' + name;
Or just put this value to a form field and submit to your script.

Posted: Wed Oct 01, 2003 7:20 am
by [xNet]DrDre
exactly.

while the GET method is easier to do, this can lead to bombing of scripts if any kind of logging is involved