Hi all,
I have on my computer (localhost) a xampp server with a mysql database and php files.
On the same machine i have SpiderBasic with a script with a HTTPRequest() in it.
When i put my local ip in HTTPRequest() and i press F5 for testing it, then it gives a HTTPRequest error.
But if i put my webhost name in HTTPRequest() to my webhost php file. it can succesfully retrieve the contents of the php file.
What is the difference between them? Both are different servers anyway. Locally on the same computer doesnt work, but on my webserver (without changing anything) it works.
I dont need a solution when i need to export it, but i want to have it that it is working with F5 (when developing the software).
Is this possible?
Any help is very appreciated!
How to get HTTPRequest() working with xampp locally?
Re: How to get HTTPRequest() working with xampp locally?
browsers do not allow you to retrieve data between domains (CORS restrictions)
so do you access you local http server using a diffrent port it is consider as cors violation
i have NOT checked with mysql, but i am almost certain that if you install in local browser a CORS disabler plugin (exist for firefox/chrome etc)
https://addons.mozilla.org/en-US/firefo ... ow-origin/
https://addons.mozilla.org/en-US/firefo ... s-unblock/
(both addons untested by me just suggestions)
so do you access you local http server using a diffrent port it is consider as cors violation
i have NOT checked with mysql, but i am almost certain that if you install in local browser a CORS disabler plugin (exist for firefox/chrome etc)
https://addons.mozilla.org/en-US/firefo ... ow-origin/
https://addons.mozilla.org/en-US/firefo ... s-unblock/
(both addons untested by me just suggestions)
Christos
Re: How to get HTTPRequest() working with xampp locally?
I tried 3 different add-ons, but doesnt work.
Any other ideas?
Any other ideas?
Re: How to get HTTPRequest() working with xampp locally?
the following example code displays "hello" in debugger (so it does access it and reads) with the first plugin -> https://mybrowseraddon.com/access-contr ... pe=install
(note that after isntalled this plugin you must click "on" on top right icon labeled "C" to become orange=active)
php code
therefore this way it works, if still do not work for you, provide some example code to test it further
(note that after isntalled this plugin you must click "on" on top right icon labeled "C" to become orange=active)
Code: Select all
Procedure HttpGetEvent(Success, Result$, UserData)
If Success
Debug Result$
Else
Debug "HTTPRequest(): Error"
EndIf
EndProcedure
; Get the content of this file, and display it in the debug window
;
HTTPRequest(#PB_HTTP_Get, "http://192.168.1.10/plouf/hello.php", "", @HttpGetEvent())
Code: Select all
<?php
echo "hello";
?>
therefore this way it works, if still do not work for you, provide some example code to test it further
Christos
Re: How to get HTTPRequest() working with xampp locally?
Hi, thanks for your example, and it works now.
I did something wrong on my part, when i compared your code with mine, i didnt add 'http://' before the ip address, and with the plugin its working now
Thank you for your testing.
I did something wrong on my part, when i compared your code with mine, i didnt add 'http://' before the ip address, and with the plugin its working now
Thank you for your testing.
Re: How to get HTTPRequest() working with xampp locally?
I had the same problem in my project "database interface module" and got some great help from the user Peter.
If you want to solve the problem without using a browser addon, please have a look in the first post of this thread:
viewtopic.php?p=7403#p7403
The interesting stuff is in section 2) "The following line can be found in the PHP file "config.php" in the config directory..."
Kind regards
Markus
If you want to solve the problem without using a browser addon, please have a look in the first post of this thread:
viewtopic.php?p=7403#p7403
The interesting stuff is in section 2) "The following line can be found in the PHP file "config.php" in the config directory..."
Kind regards
Markus
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"