Skip to main content
bagonterman
Inspiring
August 6, 2013
Question

Test if new HttpConnection is valid?

  • August 6, 2013
  • 1 reply
  • 1177 views

if ( !ExternalObject.webaccesslib ) {

ExternalObject.webaccesslib = new ExternalObject("lib:" + pathToLib);

}

$.writeln("Loaded webaccess library...");

var http = new HttpConnection("file:///Users/art5/Desktop/TestPHP.html");

http.request = "input name=Fred Smith" ;

http.method = "POST"

http.execute() ;

I am returning false but I am not even sure if http var is correct. How can I test this part?

I am trying to set up a simple senario to see how and if this will work.

Thanks in advance for any info.

CS 5 BRIDGE MAC

This topic has been closed for replies.

1 reply

bagonterman
Inspiring
August 6, 2013

I do not see new HttpConnection anywhere in the object model viewer for sdk. I am using an example from javascript reference. The reference uses var http = new HttpConnection("http://localhost/perlasp/wform.asp" ) ; I can not use a asp file. So i thought I might use a simple html file with php. Like so.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

  <title></title>

</head>

<body>

<form action="welcome.php"

method="post">

Name:

  <input name="fname" type="text">

Age: <input name="age" type="text">

  <input type="submit"></form>

</body>

</html>

any ideas how I can write to this. Get results on the page. Should I try and write to the php file?

Inspiring
August 6, 2013

Do you have a web server installed and running on your system? You don't need an .asp file but but I think you do need a web server( localhost in this case ). You can not just access a local file as you are doing in your first post.

bagonterman
Inspiring
August 6, 2013

I created a wix page that had something basic on it just so I could test it. However the source code is beyond me it doesn't represent what I wrote on there. So when I post my request it does nothing. Can you index the source code?