Print Page | Close Window

Calling form to page...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8690
Printed Date: 28 March 2026 at 2:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Calling form to page...
Posted By: *bounce*
Subject: Calling form to page...
Date Posted: 08 January 2004 at 11:42am

Hello...
 
I am working on a form that will be filled out in one page and when you click on submit it will take what you entered and put it in with other text and display on another page. To see what I mean go here:
http://ee.1asphost.com/needhelp101/ - http://ee.1asphost.com/needhelp101/
Fill in the fields and hit submit. When it takes you to the new page it is blank. It is supposed to take what you entered and mix it with other text and display code to make an HTML page. The one file has this in it:
***
Index.asp
***

<html>
<body>
<form method="post" action="generate_it.asp">
Title of Site: <input type="text" name="title" size="20"><BR><BR>
Web Address to Main Picture: <input type="text" name="picture" size="20"><BR><BR>
Content: <input type="text" name="content" size="20"><BR><BR>
Another Picture: <input type="text" name="pic1" size="20"><BR><BR>
Another Picture: <input type="text" name="pic2" size="20"><BR><BR>
Another Picture: <input type="text" name="pic3" size="20"><BR><BR>
Link: <input type="text" name="link1" size="20"><BR><BR>
Name of Link: <input type="text" name="name1" size="20"><BR><BR>
Link: <input type="text" name="link2" size="20"><BR><BR>
Name of Link: <input type="text" name="name2" size="20"><BR><BR>
Link: <input type="text" name="link3" size="20"><BR><BR>
Name of Link: <input type="text" name="name3" size="20"><BR><BR>
Link: <input type="text" name="link4" size="20"><BR><BR>
Name of Link: <input type="text" name="name4" size="20"><BR><BR>
Link: <input type="text" name="link5" size="20"><BR><BR>
Name of Link: <input type="text" name="name5" size="20"><BR><BR>
<input type="submit" value="Submit">
</form>
</body>
</html>

And the other has this in it:
***
Generate_It.asp
***
<%
If title<>"" Then
Response.Write("<html><head><title>" & Request.Form("title") & "</title></head><br />")
Response.Write("<body><h1> " & title & "</h1>")
End If
If picture<>"" Then
Response.Write("" & picture & "")
End If
If content<>"" Then
Response.Write("<BR><BR><table width=85% align=center>" & content & "</table><BR><BR>")
End If
If pic1<>"" Then
Response.Write("" & pic1 & " ")
End If
If pic2<>"" Then
Response.Write("" & pic2 & " ")
End If
If pic3<>"" Then
Response.Write("" & pic3 & "")
End If
If link1<>"" Then
Response.Write("<a href="" & link1 & "">")
End If
If name1<>"" Then
Response.Write("" & name1 & "</a> | ")
End If
If link2<>"" Then
Response.Write("<a href="" & link2 & "">")
End If
If name2<>"" Then
Response.Write("" & name2 & "</a> | ")
End If
If link3<>"" Then
Response.Write("<a href="" & link3 & "">")
End If
If name3<>"" Then
Response.Write("" & name3 & "</a> | ")
End If
If link4<>"" Then
Response.Write("<a href="" & link4 & "">")
End If
If name4<>"" Then
Response.Write("" & name4 & "</a> | ")
End If
If link5<>"" Then
Response.Write("<a href="" & link5 & "">")
End If
If name5<>"" Then
Response.Write("" & name5 & "</a><BR><BR></body></html>")
End If
%>

What do I do to fix this so it works?




Replies:
Posted By: aalavar
Date Posted: 08 January 2004 at 12:13pm

Here is your problem... on the Generate_It.asp page, you aren't requesting the variables from the previous page.

Try:

<%

title = Request("title")
picture = Request("picture")
content = Request("content")
pic1 = Request("pic1")
pic2 = Request("pic2")
pic3 = Request("pic3")
link1 = Request("link1")
name1 = Request("name1")
link2 = Request("link2")
name2 = Request("name2")
link3 = Request("link3")
name3 = Request("name3")
link4 = Request("link4")
name4 = Request("name4")
link5 = Request("link5")
name5 = Request("name5")

If title<>"" Then
Response.Write("<html><head><title>" & title & "</title></head><br />")
Response.Write("<body><h1> " & title & "</h1>")

...

%>



Posted By: *bounce*
Date Posted: 08 January 2004 at 2:08pm

Thanks. I will let you know if that works. I had something similiar to that before but it wouldnt work because I didnt call it correctly.

 



Posted By: *bounce*
Date Posted: 08 January 2004 at 7:20pm
That worked. Thanks. Another question. If you will look at the above code you will see lots of HTML in the Response.Write. I dont want that converted to HTML when the page refreshes. Is there a way to do this?


Posted By: aalavar
Date Posted: 09 January 2004 at 9:30am
Do you mean that you just want to display the HTML code (so to speak) so that they could copy/paste it and create their own page with it?  I think that is what you are trying to do but I'm not sure...  Let me know.


Posted By: *bounce*
Date Posted: 09 January 2004 at 2:10pm
I got it taken care of. Thanks for your great help!


Posted By: Semikolon
Date Posted: 09 January 2004 at 2:14pm
you should use Request.Form instead of just Request.. or else it could cause problems if you have a querystring, cookie, application or something similar with the same names..



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net