הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 27-02-08, 15:18   # 6
Meir
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Dec 2006
גיל: 34
הודעות: 383

Meir לא מחובר  

אני לא מבין למה אתה מסתבך.
html:

קוד:
<html>
<head>
<title>ajax test</title>
<script type="text/javascript">
function file_get_contents( url ) {
	// http://kevin.vanzonneveld.net
	// +   original by: Legaev Andrey
	// %        note 1: This function uses XmlHttpRequest and cannot retrieve resource from different domain.
	// *     example 1: file_get_contents('http://kevin.vanzonneveld.net/pj_test_supportfile_1.htm');
	// *     returns 1: '123'

	var req = null;
	
	try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
		try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
			try { req = new XMLHttpRequest(); } catch(e) {}
		}
	}
	
	if (req == null) throw new Error('XMLHttpRequest not supported');

	req.open("GET", url, false);
	req.send(null);

	return req.responseText;
}
</script>
</head>
<body>
<input type="text" name="textToFile" id="textToFile" value="" /><input type="button" name="send" value="send" onclick="javascript:file_get_contents('yourfile.php?string=' + document.getElementById('textToFile').value)" />
</body>
</html>
PHP קוד:
<?php
file_put_contents
('text.txt'urldecode($_GET['string']), FILE_APPEND);
?>
הקוד של מימוש הפונקציה file_get_contents בjavascript נלקח מפה:

http://kevin.vanzonneveld.net/techbl..._get_contents/
__________________
רק אחרי שנמצאים בחושך, אפשר להעריך את האור.
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 13:55.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ