i use the <form method=post action=file.php>
<textarea................
submit the below textfile ,then $fp = fopen( "$time_start.c", "w" );
and fwrite the text to the file ,but why " -> \" ,,,,
#include <iostream>
using namespace std;
void main()
{
cout << "Hello World!" << endl;
cout << "Welcome to C++ Programming" << endl;
}
#include <iostream>
using namespace std;
void main()
{
cout << \"Hello World!\" << endl;
cout << \"Welcome to C++ Programming\" << endl;
}
a simple problem......
Moderator: General Moderators
Re: a simple problem......
My be you should post a code of "file.php". I'm not an augur even if I want it so much.
Re: a simple problem......
<?php
//$filename=date("Y.m.d");
function microtime_float() //since the Unix Epoch (0:00:00 January 1, 1970 GMT)
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
$fp = fopen( "$time_start.c", "w" );
fwrite($fp,$_POST["text"]);
fclose($fp);
print "your name is ";
print $_POST["text"];
?>
//$filename=date("Y.m.d");
function microtime_float() //since the Unix Epoch (0:00:00 January 1, 1970 GMT)
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
$fp = fopen( "$time_start.c", "w" );
fwrite($fp,$_POST["text"]);
fclose($fp);
print "your name is ";
print $_POST["text"];
?>
Re: a simple problem......
May be this could be useful.
http://www.webmasterworld.com/php/3609209.htm
http://www.webmasterworld.com/php/3609209.htm