|
I paid eleven minerals for THIS?
|
If you're learning a language to write a website, DON'T use VBScript.
Use PHP. ![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
I paid eleven minerals for THIS?
|
PHP is just much more widely supported that it's better than ASP, even.
![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
)Dark_Marine_123(, the problem with using client-side VB is that it's potentially insecure and very widely unsupported.
It's similar to coding a program that is only usable on Windows 95. You're going to end up pissing a lot of your visitors off. Since PHP and ASP are server side, the type of browser doesn't matter. If you are however using server-side VB (must be extremely rare unless you're running some sort of VPS) that's okay and can look up resources on Google. I doubt very many of us have experience. Don't ever fall into the trap of using client-side VB since as far as I know only Internet Explorer for Windows supports it. Last time I checked parts of it could be considered malicious, so many versions of Internet Explorer have it disabled anyway. If you have the fundamentals of VB down, you should be able to pick up PHP or ASP easily. Reply if you have any more questions ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
I paid eleven minerals for THIS?
|
@MA The other thing to take into account is that, unless I'm mistaken, more servers support PHP than ASP (although most support both -- it's not like writing in something obscure like Python).
![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
VB is a High-End language, meaning its simplistic. If you want to write anything that anyone on the internet would like (because it works for them) learn either PHP or ASP.Net, for starters... Then maybe learn yourself some VB.Net, or maybe even C#.Net... Here is how you'd "accept a variable from a form" with PHP: That's how you'd accept, and pass a variable in a form (it also is a sticky form) All this stuff: is PHP. All this stuff: is HTML mixed with a simple PHP conditional script. If I knew any ASP, I'd show you that, but I don't... Let me explain the PHP to you: if (eregi ("^[[:alnum:]_]{4,20}$", stripslashes(trim($_POST['username'])))) is an "if, else conditional". Meaning, "if (function eregi ("beginning of string[[class any letter or number]extra character allowed within this conditional]{minimum number of characters needed to meet conditional, maximum number of characters allowed for conditional}end of string", function stripslashes(trim($_POST['username'])))) So if (eregi ("^[[:alnum:]_]{4,20}$", stripslashes(trim($_POST['username'])))), checks to see if a string with any letter or number, including an underscore (_) is passed, and if the condition is met, it will stripslashes (has to deal with Magic Quote stuff) and trim (take out unnecesary white-space) the variable $_POST['username'] We defined "username" inside of our HTML form (notice the bolded area): $_POST is a global function(?) that catches the "methed post" from your HTML form (if you use the method post that is...) It'd be best to use post instead of get in your "form action".. Get will have all the variable information in the URL... Its just for security reasons. So anyways: if your condition is met (the condition is that someone put a username in the "username" input field in your form, and they used any number and letter and/or the _ is included), the variable $u, will have the value: escape_data($_POST['username']); The $_POST['username'] will be whatever is inserted within the bolded area: so if I input Kellimus, it would look something like this: $u = escape_data($_POST['Kellimus']); If my condition is not met, thats when the "else" would happen. So if I didn't input a name into the "username" text field, it would return $u as FALSE, then output (in HTML): Does that make sense? I know that eregi, and all that stuff is confusing to beginners, but once you use it a while, you'll understand.... This post was edited 3 times, last edit by Kellimus: Nov 6 2007, 10:34 pm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
I paid eleven minerals for THIS?
|
Kellimus is just making himself feel special by using a bunch of advanced library functions.
If you use PHP to output an HTML form, eg. Code <?phpecho("<form action="this.php" method="POST"><input name="hi"></form>"); ?> then when the page is loaded with a POST query, the data is stored in an array called $_POST If you want the value of your input field, it's Code $_POST['hi']etc. ![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
So I'm gonna answer the question. As I posted previously, in ASP, after a user submits a form, you do: somevariable = Request.Form("name of form element to retrieve") on the page it is submitted to. An example: Code The Form: <form action="formhandler.asp" method="POST"> <input name="email" type="text" /> <input type="submit" /> </form> The ASP handling code: Dim Email Email = Request.Form("email") then do validation/storage code That's the ASP VB way to do it. If you ever decide to use client-side VBScript, then it'll only work on IE, and even then, many people have it turned off. ASP.Net also uses Request.Form, if you decide to go there, although there are often other ways depending on what you are doing. ![]() ![]() ![]() ![]() ![]() ![]() |
|
I paid eleven minerals for THIS?
|
He clearly is not an advanced programmer, so throwing things out like eregi() is pretty counterproductive.
![]() ![]() ![]() ![]() ![]() ![]() "Three can keep a secret, if two are dead." -Benjamin Franklin
"Had, having, and in quest to have, extreme; A bliss in proof, and proved, a very woe; Before, a joy proposed; behind, a dream. All this the world well knows; yet none knows well To shun the heaven that leads men to this hell." -William Shakespeare |
|
I know what a flame is, I'm trying to point out how everyone here whines about "flame this", "flame that". If I were to make a snipe comment like that, I'd get warned. But that's okay, thats the Admin's double standards for you PHP can do more complex things than Javascript.. ![]() ![]() ![]() ![]() ![]() ![]() ![]() |