• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

.asp file problem

Joined
Dec 2, 2009
Messages
3,353 (0.59/day)
System Name Dark Stealth
Processor Ryzen 5 5600x
Motherboard Gigabyte B450M Gaming rev 1.0
Cooling Snowman, arctic p12 x2 fans
Memory 16x2 DDR4 Corsair Dominator Pro
Video Card(s) 3080 10gb
Storage 2TB NVME PCIE 4.0 Crucial P3 Plus, 1TB Crucial MX500 SSD, 4TB WD RED HDD
Display(s) HP Omen 34c (34" monitor 3440x1440 165Hz VA panel)
Case Zalman S2
Power Supply Corsair 750TX
Mouse Logitech pro superlight, mx mouse s3, Razer Basiliskx with battery
Keyboard Custom mechanical keyboard tm680
Software Windows 11
Benchmark Scores 70-80 fps 3440x1440 on cyberpunk 2077 max settings
Hi guys!
I am trying to do a site as a homework, but i got "trapped" with the submitting button.
It clearly says that if you type your name, it will go to the index.asp file, but i see nothing
there and the file index.asp stays 0 bytes :S
Anyone can help me with this? :wtf:
 
Post the code please.
 
Jizzler's right, Alek, without seeing the code we have no idea what's going on.
 
ok, here is the code:
<form name="input" action="Index.asp" method="get">
Username: <input type="text" name="user" />
<input type="submit" value="Submit" />
Now the information goes to the .asp file in the same folder
but i dont see anything in the file :( and it is 0 bytes, meaning there is nothing in it
 
GET/POST data is not writen to the file, it is accessible though. On your Index.asp page, you would have something like this at the top:

Code:
<%
Dim name
name = Request.Form("name")
%>

Then the name variable could be used on that page.
 
I got nothing man
I dont know if you tried the code, but it doesn't happen anything to me
Should i add the code you gave? If yes where?
How can i make it to write the data?
method="post"????
 
Sorry, just noticed now that your form method is GET. To get those values you'd use Request.QueryString(Name_Of_Form_Element).

If you change your form's method to POST, then you would access the the data with Request.Form(Name_Of_Form_Element).

This might help demonstrate it:

Code:
<html>
<body>
<form action="getdemo.asp" method="get">
Your name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
<%
dim theName
theName = Request.QueryString("name")
IF theName <> "" THEN
	Response.Write("Hello " & theName)
ELSE
	Response.Write("Hello Anon!")
End If
%>
</body>
</html>

Put it into a file, save as getdemo.asp, run it. (and hopefully it works, I do about 1000 times more scripting in PHP than ASP).
 
THANKS MAN!
you made my day!
I will give it a try and reply if i have any problems :)

EDIT: Ok, i edited the html file and added your demonstration, same thing again
than i created a new file .asp and pasted the demonstration, " again
than i deleted the first html edit and did same think again, nothing
Can you show me were to put the demonstration exactly? I think i am missing smth here
 
Last edited:
I just tried it, no problems.

Is your server set up correctly? Apache needs a seperate module installed to handle ASP. For learning purposes, using IIS with it's native support for ASP would be easiest.
 
Ok. So now i got smth new! I know what is apache server i have it installed, but i have never used it. How is the process? Should i write the code in apache or in notepad?
Simply i dont know what should i do with the apache program.
I have installed Easy php which has the apache program.
 
Ok. So now i got smth new! I know what is apache server i have it installed, but i have never used it. How is the process? Should i write the code in apache or in notepad?
Simply i dont know what should i do with the apache program.
I have installed Easy php which has the apache program.

What exactly is your homework? First you mention ASP, apparently you installed PHP though. Doesn't your teacher tell you what to use?
 
I'm just pointing out that nothing in this thread makes sense. :laugh:

I'm chalking that up to Aleksander having to write in a foreign language, which is completely understandable.
What exactly is your homework? First you mention ASP, apparently you installed PHP though. Doesn't your teacher tell you what to use?
This.

Apache doesn't even support ASP or ASP.NET out of the box but you can add support for it with mono (for ASP.NET). I dunno much about original ASP because it's more or less abandoned.

If you're interested I wrote a guide on setting up LAMP in a VM which has support for C# & VB ASP.NET. It's majorly overkill for what you're doing though. . .

Does the HW have to be done in ASP? Can you do it in PHP?
 
My homework is this:
1. Create a box where you can write your name
2. Create a button where the person who wrote the name, can register
3. The registration name, comes to a text page where i can see the name of the person
from the server
This is all guys! 2 days still not solved :P
Now the file jizzler gave me, where should it be written???? O.o
 
Last edited:
Bump!
PLS help me! plssssssssssss
 
So what language are you writing this thing in?

1. Create a box where you can write your name
2. Create a button where the person who wrote the name, can register
3. The registration name, comes to a text page where i can see the name of the person
1. Easy.
2. Is there anything special about "register" or is it just sending the name typed into the textbox to the server?
3. When you talk about viewing the names, do you mean that the names of people who pressed "submit" are appended to a file which is stored on the server (and inaccessible to the web clients)?
 
1. yes it is
2. sending the name typed into the textbox to the server
3. the names of people can be seen "only" by me (server)
I have written all things here in a notepad saved as html, or even as php or asp
Nothing happens
The file does not show any name!
 
He's writing it in HTML (ASP) as per post #4, but the other details are sketchy.
Apache server? IIS server?
Are you using VS Web developer? Some other IDE?
Does the text file with the registrants name need to be in html format?
How is it going to be viewed?

In all honesty this is really easy to do, but we don't have enough information.
I think maybe it got over-engineered (we tend to do that here at TPU :D ) and he just needs it to run on a simple IIS server.
 
I am using Easy php
It has apache server integrated in the package
I dont know what is this apache, just have heard it has to do with servers
I am using Notepad as a program to make the web developing
The registrant names, need to be saved in a file, whatever it is, just to be read by me (server)
It is going to be viewed as real characters eg: Kreij and not 32kjd2o3 (computer language)
Show me your method if you know how to do it, but i dont get the names in the page
The page stays 0 bytes!
I mean: the developing file, accesses another file, like example.example
People open the developing file, with browsers. They write their names
Their names are sent to the other file and i can see their names, only by the other file!
 
Oy! :wtf:

The following are web servers:
IIS
Apache

The following are frameworks:
-ASP
-ASP.NET

The following are programming languages that run server side:
-PHP (mod_php on Apache)
-Perl (mod_perl on Apache)
-Python (mod_python on Apache)
-C# (ASP.NET) (mod_mono on Apache)
-VB (ASP.NET) (mod_mono on Apache)
-VBScript (ASP)
-JScript (ASP)
-PerlScript (ASP)

The following are programming languages that run client side:
-JavaScript
-HTML
-CSS
(The three are sometimes referred to as DHTML)

EasyPHP is called EasyPHP because it uses PHP, not ASP and not ASP.NET. If you want to use ASP or ASP.NET you'll have to use a web server that supports it such as IIS or Apache with mod_mono.

It is going to be viewed as real characters eg: Kreij and not 32kjd2o3 (computer language)
"Computer language" is the same as "real characters", it's just a different way of displaying them. For instance all of the following are equivalent:
ASCII: |Kreij
HEX: |0x 004B 7265 696A
UNICODE: |0x 0075 0114 0101 0105 0106

I am using Notepad as a program to make the web developing
Notepad is terrible for writing code. If you want something simple try Notepad++.
 
Last edited:
Thanks for information man, but that didn't solve anything.
I have to complete it for tomorrow but i think none will help me.
I will give one last try though, not to blame myself for it
Ok, Jizzler wrote the code! Where to write all that code?
asp? php? html? VB? JavaScript?
Where to put it?????
What should i do! None gives answers here?
I just got in a stupid problem, i know the code
He is writing in html(asp)??? what is this logic?
 
Building on the Jizzler's example:
Code:
<html>
<body>
<form action="getdemo.asp" method="get">
Your name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
<%
dim theName
theName = Request.QueryString("name")
IF theName <> "" THEN
	set fso = Server.CreateObject("scripting.FileSystemObject")
	set f = fso.GetFile("..\names.txt")
	set ts = f.OpenAsTextStream(8, -2)
	ts.WriteLine(theName)
	f.Close
End If
%>
</body>
</html>
The code is going to be a combination of HTML and ASP. The "<% . . . %>" section means you are using ASP; everywhere else is HTML. Since I didn't specify a language for the ASP section, it's assumed to be VBScript.

Save the code as "getdemo.asp" and create a blank file called "names.txt" in the nearest subdirectory to "getdemo.asp". You will have NO WAY OF TESTING THIS unless you install a server that runs ASP . . .

Also, I've never wrote anything in ASP so I dunno if it'll work at all. :D
 
Last edited:
Thanks man!
But that is again wrong
I can test by sending the name myself
The name didnt go
so there must be a mistake here for sure
I also tried in saving as getdemo.vbs, still didnt change a thing
 
:( Oy! I'm not getting through to you . . .

Let's look at the code one more time. Here's the HTML part:
Code:
<html>
<body>
<form action="getdemo.asp" method="get">
Your name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
If you copy it to a file and save it with the ".html" extension it'll look good in your browser, but it won't be functional

Why not?
Because all of the HTML is being run on the client side, the server is doing no processing other than providing the data you've requested.

So if you add the following to the previous HTML:
Code:
<%
dim theName
theName = Request.QueryString("name")
IF theName <> "" THEN
	set fso = Server.CreateObject("scripting.FileSystemObject")
	set f = fso.GetFile("..\names.txt")
	set ts = f.OpenAsTextStream(8, -2)
	ts.WriteLine(theName)
	f.Close
End If
%>
Then save it as ".asp" and again try it, NOTHING HAPPENS.

Why does nothing happen?
Because the ASP code must be executed on the server, the server DOES NOT EXIST so the code is never executed. Your browser will see the ASP code and do nothing because it cannot be processed client side.

How do we fix it?
Install IIS. And make sure your ".asp" and ".html" files are added to the "Inetpub\wwwroot" directory. Then open your server by browsing to "http://localhost/mypage.asp".

:pimp:
 
Back
Top