Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Calling form to page...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Calling form to page...

 Post Reply Post Reply
Author
*bounce* View Drop Down
Newbie
Newbie


Joined: 08 January 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote *bounce* Quote  Post ReplyReply Direct Link To This Post Topic: Calling form to page...
    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/
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?

Back to Top
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post 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>")

...

%>

Back to Top
*bounce* View Drop Down
Newbie
Newbie


Joined: 08 January 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote *bounce* Quote  Post ReplyReply Direct Link To This Post 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.

 

Back to Top
*bounce* View Drop Down
Newbie
Newbie


Joined: 08 January 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote *bounce* Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
*bounce* View Drop Down
Newbie
Newbie


Joined: 08 January 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote *bounce* Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2004 at 2:10pm
I got it taken care of. Thanks for your great help!

Edited by *bounce*
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.