SOLVED @ FRED ! HTTPRequest apache2

Just starting out? Need help? Post your questions and find answers here.
atlante
Posts: 8
Joined: Thu Apr 16, 2015 10:24 am

SOLVED @ FRED ! HTTPRequest apache2

Post by atlante »

Hello guys,

First sorry for my english (i'm french).
I'm working on a new project, a web project and i'm testing spider basic for be faster on the design.

My problem is i didn't success to user httpRequest function.

For exemple, i did a little script in php for manage user session but i'm not able to send information to the php script.

SpiderBasic

Code: Select all

Procedure HttpGetEvent(Success, Result$, UserData)
    If Success
      Debug Result$
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure
HTTPRequest(#PB_HTTP_Post, "http://127.0.0.1/pmu/php_post.php", "email=hello@world.fr, password=ThePassword", @HttpGetEvent())
Php:

Code: Select all

<?php
// define variables and set to empty values
$email =  $password = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
  $email = test_input($_POST["email"]);
  $password = test_input($_POST["password"]);
  echo $name;
}

function test_input($data) {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
}
?>
Thanks in advance guys !
Last edited by atlante on Thu Apr 21, 2016 12:44 pm, edited 1 time in total.
atlante
Posts: 8
Joined: Thu Apr 16, 2015 10:24 am

Re: HTTPRequest problem on debian with apache2

Post by atlante »

I found the problem ( rights problem), cmod has fixed it.

@FRED : L'utilisation de « getAttributeNode() » est obsolète. Utiliser « getAttribute() » à la place.

And for others, if you are working with compiler and apache : you have to configure Access-Control-Allow-Origin (in pache conf).

Regards,
Post Reply