PDA

View Full Version : HTML code of death


gamemaster1432
01-23-2007, 3:28 PM
I was trying to make a form page for me and my friends (I still use this place!:D ) and Im searching the internet for code how to do this. I findings told me to use ASPs. so I tried it and it dosent even display anything. what am I doing wrong.
Code:
"<html>
<body>
<form action="demo_simpleform.asp" method="post">
Your name: <input type="text" name="fname" size="20" />
<input type="submit" value="Submit" />
</form>
<%
dim fname
fname=Request.Form("fname")
If fname<>"" Then
Response.Write("Hello " & fname & "!<br />")
Response.Write("How are you today?")
End If
%>
</body>
</html>"

BlackHawk
01-23-2007, 4:23 PM
First off, this belongs in the Programming Lexicon (http://www.warboards.org/forumdisplay.php?f=50).

Secondly, if I understand what you're trying to do, I'd say you could try and do it in PHP (I'm not familiar with ASP). I'm not sure if this is the most efficient way (I just started learning PHP) but, you could go:

<form action="demo_simpleform.asp" method="process.php">
Your name: <input type="text" name="fname" size="20" />
<input type="submit" value="Submit" />
</form>

<?php
// in the process.php file.
$fname = $_POST['fname'];
echo "Hello $fname, how are you today?"
?>

I altered it a bit but that's how it could be done, of course I'm sure Modred and co will come along and give you a more efficient way.

gamemaster1432
01-23-2007, 5:56 PM
sorry, I just was browsing and just pressed new thread. alright, ill try it. that was just a example i found using asp. thanks man! so i put that into a html or create a php file?

Modred
01-23-2007, 6:44 PM
Before you start jumping into ASP vs. PHP, you should find out what your web server supports, if anything. Active Server Pages (ASP) primarily runs on servers running Microsoft systems. PHP, along with a few other languages such as Python and Perl, will usually be available on servers running Apache, and these servers are usually some variant of Linux.

So, first things first: find out what type of server you're on, and what sort of server side scripting they support.

Next, assuming your web hosts supports ASP, your code looks fine and should work, if you have it in the right place. The ASP code, which is just VBScript (could also be written in Javascript), needs to be in "demo_simpleform.asp" because this is the page to which the information is posted. If you have all of this inside demo_simpleform.asp, it should work. But I'm not sure if this is what you mean to do.

What it looks like you want to do is set up a page so that when a user opens the page and types in his or her name, the page instantly updates and says "Welcome <person>". Something like this would be better done as client-side scripting using Javascript, but I won't go into how to implement that unless this is what you actually want.

gamemaster1432
01-24-2007, 7:37 AM
Alright, right now Im just playing with HTML right now. Im going to help my cousin make a site for his business and I need all the help I can get. I just know a little HTML code, so its hard

JoshisaNoob
01-30-2007, 11:23 AM
I really don't know much about ASP, but this might help you with HTML, and laying out the pages you want to make. Microsoft released "Visual Web Developer Express", which is comparable to Frontpage and Dreamweaver. I like it a lot, especially for code editing. I've also found it very helpful for learning new code in CSS and HTML, since it displays attributes of the given tag when you type it in. It will also point out your code errors, and help you to learn to avoid those mistakes. I don't know if the download is still free, but here's the link: Visual Web Developer Express (http://msdn.microsoft.com/vstudio/express/vwd/default.aspx)

gamemaster1432
01-30-2007, 8:10 PM
ok, thanks! ill try it!