|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
February 2nd, 2005, 06:34 AM
|
Registered User
|
|
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can this be done in ASP?
Hi everyone
Am currently working through a website built in ASP
This is what i want to do.
As i am able to send a page request to a server which returns a page to be viewed, i want to take that page it returns(download it), open it internally, set it to a variable, then use a replace command to remove the header and footer of the url and then use the main body as display on the website. Thus just using the body text on my websites branding
Therefore i want to
Request page (Done)
open source (URL)
set as text variable
replace known code (header and footer)
display as body text
Am not to familiar with ASP
Can any1 help
and can it be done!
Nice and easy in php but server doesnt support it, it only does ASP
|
February 2nd, 2005, 06:54 AM
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
U have to made ActiveX DLL for that,
as u made HTTP request with the help of Winsoket,
which return the html code of requested page, u can use this html code according to ur requirement.
U have to explore a bit the http request thru win soket.
Hope this will help u.
Amit Jain
Sr. Software Engineer
|
February 2nd, 2005, 07:11 AM
|
Registered User
|
|
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok
am looking into that think that may help!
Just so i get this straight and to make sure where on the same page
am not using Winsoket
All that i mean my url request is that i want to download a certain url defined by the telephone number!
example
http://www.adslchecker.bt.com/pls/adsl/ADSLChecker.TelephoneNumberOutput?URL=www.onyx.net %2Fbroadband.asp&SP_NAME=a%2520Onyx%2520Internet&T elNo=01915292248&VERSION=7&MS=S&CAP=Y&AEA=Y
the red text is the only part that ever changes
which i can code for!
so you input number -> new page downloads url(html) using added tel
does this shine different light?
Cheers for the speedy reply
Phil
|
February 2nd, 2005, 07:44 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
February 2nd, 2005, 07:48 AM
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You may use XML HTTP object for this. This is built in windows 2000. If it is not there, you can download and install latest XML parser from MS and run on server.
Here are some sample scripts using this component.
On error resume next
Dim obj_xml_http
Dim str_html
Set obj_xml_http = Server.CreateObject("Msxml2.SERVERXMLHTTP")
obj_xml_http.Open "POST", "http://www.yoursite.com",False
obj_xml_http.Send
If Err.Number <> 0 Then
Response.Write("Your web site does not appear to be up right now. Please try again later.")
Err.Clear
Else
str_html = obj_xml_http.ResponseText
' do whatever replacements you want
Response.Write str_html
End if
|
February 3rd, 2005, 04:19 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yep, the XML HTTP way is how to go about it. Just one thing I like to add, that scheme of yours doesn't look legal.
- mega
Moving to C# .NET
|
February 3rd, 2005, 04:51 AM
|
Registered User
|
|
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
:) Checky
Yes it is completely legal
We are a valid reseller!
this is what they reccomend doing
but cudnt advice how in asp
How would i encorparate xml http into the site
??
cheers guys
u have showen me the way
:P
|
February 3rd, 2005, 06:00 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 217
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Just like madhukp suggest (made some small changes):
Code:
dblTelNo = 01915292248
On error resume next
Dim obj_xml_http
Dim str_html, strURL
strURL = "http://www.adslchecker.bt.com/pls/adsl/ADSLChecker.TelephoneNumberOutput" _
"?URL=www.onyx.net%2Fbroadband.asp&SP_NAME=a%2520Onyx%2520Internet&" _
"TelNo=" & dblTelNo & "&VERSION=7&MS=S&CAP=Y&AEA=Y"
Set obj_xml_http = Server.CreateObject("Msxml2.SERVERXMLHTTP")
obj_xml_http.Open "POST", strURL, False
obj_xml_http.Send
If Err.Number <> 0 Then
Response.Write("Your web site does not appear to be up right now. Please try again later.")
Err.Clear
Else
str_html = obj_xml_http.ResponseText
' do whatever replacements you want
Response.Write str_html
End if
- mega
Moving to C# .NET
|
February 3rd, 2005, 06:09 AM
|
Registered User
|
|
Join Date: Feb 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Can it be done so a telno is passed to the xml
from the page calling the xml
therefore the telno u mentioned will change per exicution
cheers for help all
|
|
|