NetTalk Central

Author Topic: How to redirect to a website/page from inside a netweb page  (Read 3271 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
How to redirect to a website/page from inside a netweb page
« on: August 28, 2015, 03:47:32 AM »
I have a netweb page which is a landing site from another client's website. I receive the parameter like this:
http://www.mysite.com/checkavailability/stall=F01 I have stored the value in the sessionvalue RequestedStall
I check in my database and can get 3 results
1.The stall with that number does not exist
2.The stall exists but has already been allocated to another applicant
3.The stall exists and can still be booked.

In the case of 1 and 2 I want to redirect back to the original website e.g. http:/www.show.com/map.htm
In the case of 3 I want to then send them to my website http://www.mysite.com/index where they will either login or register depending on whether they have accessed the site before.
I should have the SessionValue RequestedStall stored so when they go to the booking screen I can populate it with the relevant details
All the above logic works I can popup an alert message with the correct status but now I want to send them to the correct destination

My question is how do I code the redirect command within the NetWeb page?
Obviously <a href="http://www.mysite.com" >
or <a href="http:/www.show.com/map.htm" >
I also tried:
    packet.Append('<a href="http://www.mysite.com"> ')
    DO SendPacket
Where nothing happened
don't work so what do I do?
« Last Edit: August 28, 2015, 04:12:52 AM by terryd »
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: How to redirect to a website/page from inside a netweb page
« Reply #1 on: August 29, 2015, 06:28:13 PM »
This is how I do it, on the server side code where you make the decision

  Case 'blah'
   of 1
   orof 2
       p_web.Script(  P_web.WindowOpen('www.3d.com.au') )
   of 3
       p_web.Script(  P_web.WindowOpen('IndexPage') )
   end

The window open will resolve a URL such as someones site or a local proc in your app as above - your IndexPage gets called, you dont need to do the www.mySite.com bit

hope this helps
Kevin

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: How to redirect to a website/page from inside a netweb page
« Reply #2 on: August 30, 2015, 12:13:51 AM »
Thanks Kevin. Works a treat. I can even forgive Australia for beating us in the last Rugby series ;-)

Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186