Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Test if new HttpConnection is valid?

Engaged ,
Aug 06, 2013 Aug 06, 2013

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

TOPICS
Scripting
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 06, 2013 Aug 06, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 06, 2013 Aug 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 06, 2013 Aug 06, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 06, 2013 Aug 06, 2013

I am returning true now though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 08, 2013 Aug 08, 2013
LATEST

can you post to a html form using get file and then post? or does it have to be a seperate file on the server that the html is linked to. I am having trouble with this one. I am not really sure of what the possiblites are with post. There is only one example in the adobe reference. They do not show what the file looks like that they are posting too. Or the results?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines