Jump to content

Alexancho

Members
  • Posts

    54
  • Joined

  • Last visited

Alexancho's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I use a js function that moves a background image and i want to stop this moving after a time.I tried to use setTimeout() and clearTimeout() methods, but it doesn't stop the movement.What is the problem? <script type="text/javascript" language="javascript"> function MoveBg(){some code} $(function() { var i = setTimeout("MoveBg()" ,200);setTimeout(function(){clearTimeout(i)},10000); }); </script>
  2. Thank you. I tried to write something like this, but it doesn't work:$date1 = '2010-08-10'; // beginning of period of time$date2 = '2010-10-10'; // end of period of time$query = "SELECT * FROM sms_data_after_date WHERE username = '".$username."' WHERE DATEDIFF(date,$date1)>=0 AND DATEDIFF($date2,date)>=0 ORDER by sms_id DESC"; or $query = "SELECT * FROM sms_data_after_date WHERE username = '".$username."' WHERE DATEDIFF(date,'2010-08-10')>=0 AND DATEDIFF('2010-10-10',date)>=0 ORDER by sms_id DESC"; What's wrong!
  3. VARCHAR, but i can change it to date or any other.
  4. There is a MySQL table with list of users there actions and dates of this actions in dd-mm-yy format. I need to select data from this table according to period of time (picked from calendar, for example, from 01-11-2010 till 30-11-2010). What is the right way to do it?
  5. Thank You very much!Everything works now!
  6. Thank you. I understand more now, but still i probably do some stupid mistake with return.This code works: $result = ''; // My code while(!feof($fp)) { $result .= fgets($fp, 4096); } //close fp - we are done with it fclose($fp); /* my code http://www.jonasjohn.de/snippets/php/post-request.htm */ // split the result header from the content $result = explode("\r\n\r\n", $result, 2); $header = isset($result[0]) ? $result[0] : ''; $content = isset($result[1]) ? $result[1] : ''; // return as array: $response = array($header, $content);echo "<pre>"; print_r($content); echo "</pre>"; echo "<br />"; //return array($header, $content); return $content; } }//function-doPost But this code gives me $result = ''; // My code while(!feof($fp)) { $result .= fgets($fp, 4096); // My code } //close fp - we are done with it fclose($fp); /* my code http://www.jonasjohn.de/snippets/php/post-request.htm */ // split the result header from the content $result = explode("\r\n\r\n", $result, 2); $header = isset($result[0]) ? $result[0] : ''; $content = isset($result[1]) ? $result[1] : ''; // return as array: $response = array($header, $content); //return array($header, $content); return $content; } }//function-doPost echo "<pre>"; print_r($content); echo "</pre>"; echo "<br />"; What is the problem? I mean i want to have $content outside the function.
  7. I don't use cURL. I use script like that:http://www.jonasjohn.de/snippets/php/post-request.htm
  8. I sent a PHP POST request to another server by using a socket connection from my web page and received a response: I can see it as if there is something like this in my page:$response = $_POST['something'];echo $response; but there isn't. I knew server must send me response also by method POST. That's all. I don't know the name of a variable the server uses.And i am still on the same web page.So, i have two questions 1. Why i can see the response? What technique the server uses?2. Is there the way to write this response into variable, so i can work with it?
  9. OK. Thank you. I'll try to examine this staff.
  10. I am creating a page that is some kind of a mediator between different pages.My page receives a data from submitted form, creates XML document and sends it to another page (in different server).After that my page receives an answer, also as XML. So, it is exchange of XML documents and data processing.But there are only 2 or 3 kinds of a documents. I mean it is some standard documents, let say some information about clients. Only some data inside changes.
  11. The task is "The XML document must be transmitted in the 'body' of the POST request as content type text/xml" I didn't find a clear explanation how to do it. Should i send it as a string? What should i do?
  12. Actually i don't exactly understand how i can use sessions for my purpose. Does it mean i should open session for the user and close it on the stage 2? Will it work as some kind of disconnection? Client should be able to stay on his page and send another form. I only want him not to follow some redirections.
  13. I am creating a page that is some kind of a mediator between different pages:1. From one page a client sends a form. 2. A page-mediator does some checks and actions, makes decisions and sends data to a third side page. 3. The third side page do something and sends data to the mediator.4. Mediator again does something and sends notification to the client.In a common flow when we use form submitting or header("Location: ...") the client will see all the redirection, pages reloading etc. But the aim is to make the client dialing with mediator page only. The better thing is to send to client some message on the stage 2 and continue with the third side separately. Is there the way to do that?
×
×
  • Create New...