Forum Moderators: open

Message Too Old, No Replies

parameters in HTML

         

fotiss13

1:35 pm on May 4, 2004 (gmt 0)

10+ Year Member



Hi all,
is it possible to retrieve parameters in an HTML document?
For example in php u can send parameters through a form and then say:
if(name=a)
do this
else
do that

Can i do that in an HTML file with parameters that i will sent through a form?
Thanks

DrDoc

3:51 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pure HTML cannot do that... which is why we have languages like PHP/Perl/ASP ;)

pikester

6:17 pm on May 4, 2004 (gmt 0)



Actually, if you are handy with JavaScript, you could write some logic to parse out the data that is passed in. You could probably google to see if anyone has a JavaScript library that does this.

DrDoc

8:04 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...but that's not HTML ;)
Yes, it's possible with JavaScript:
<script type="text/javascript">
foo = location.search;
if(foo == "?blah") {
alert("blah");
}
else {
alert("no blah");
}
</script>

But, a PHP/Perl/ASP solution is much much better :)

fotiss13

9:00 am on May 5, 2004 (gmt 0)

10+ Year Member



Thanks a lot,
i guess i will use php, it is easier :)