473,322 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

A request to a php file with no data sent

178 100+
I want to get data from an external php file. This is how I would normally do it but this time I am not sending any data in the request. How do I achieve this when no data is being sent in the request?

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="text-utils.js"> </script>
  2. <script type="text/javascript" src="request.js"> </script>
  3. <script type = "text/javascript">
  4. window.onload = function() {
  5.     getProjects();
  6. }
  7. function getProjects() {
  8.     var url = "needmodule.php";
  9.     url = url + "&dummy=" + new Date().getTime();
  10.     request.open("GET", url, true);
  11.     request.onreadystatechange = updateProjects;
  12.     request.send(null);
  13. }
  14. function updateProjects() {
  15.     if (request.readyState == 4) {
  16.         var returned = request.responseText;
  17.         alert(returned);
  18. }
  19. </script>
  20.  
Aug 29 '08 #1
2 1262
Dormilich
8,658 Expert Mod 8TB
But you do send data. Although it's GET data...
Furthermore (this might be a writing mistake) shouldn't there be a "?" instead of an "&" in line 9?
Aug 29 '08 #2
Ferris
101 100+
yes,Dormilich is right , and furthermore, you missed a } in line 17. It should be
[HTML]alert(returned); }[/HTML]
Aug 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: PJ | last post by:
I would like to capture a request stream before the request has been completely sent to the server for the sake of saving the bytes of a posted file to disk. I have written httpmodules before, but...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
6
by: Clif | last post by:
Hi, I would like to find out exactly what is being sent when a web page uses the post request method. My thought was to use the webbrowser control together with the HTTPWebRequest class, but am...
8
by: abcd | last post by:
I can get the value on the form at the server side by using Request.form("max") when max field is disabled I dont get value. For GUI and business logic purpose I have disabled some fields with...
0
by: comp.text.xml | last post by:
Hi all, I'm using SOAP tool kit version 3 in my application. When analyzed SOAP responses closely using the Fiddler I noticed that the data we sent (a XML in this case) is again repeated in...
6
by: Cord-Heinrich Pahlmann | last post by:
Hi, I wrote a script which reads a formular from a forum loginpage. It automatically fills in my credentials an logs me in when I hit submit. I have secured the path to the script with a...
5
by: fergallydon | last post by:
I'm sending some data in a HTTP POST to an asp page. The data contains some + characters. When I try to access the data using Request.Form("data") I get the data but the + characters are replaced...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
10
by: mouac01 | last post by:
My site uses lots of AJAX requests to PHP files which then retrieves data from MySQL. About 95% of the time the requests complete without issues. Every once in a while a request will hang for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.