run guestbook localhost good.
but upload app engine error can't open file.
code:
<html>
<head><title>My Guestbook</title></head>
<body>
<h1>Welcome to My Guestbook</h1>
<h2>Please write me a little note below</h2>
<form action="" method="POST">
<input type="text" name="user" placeholder="Name" />
<br />
<textarea cols="40" rows="5" name="note" placeholder="Comments" 
wrap="virtual"></textarea>
<br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php

if (isset($_POST['submit'])){

$user = $_POST['user'];
$note = $_POST['note'];

if(!empty($user) && !empty($note)) {
$msg = $user . ' : ' . $note;
//will open a file
$fp = fopen("notes.txt","a") or die("Can't open file");
//will write to a file
fwrite($fp, $msg."\n");
fclose($fp);
}
}
?>
 
<h2>The entries so far:</h2>
<?php
$file = fopen("notes.txt", "r") or exit("Unable to open file!");
//Output a line of the file until the end is reached
while(!feof($file))
  {
  //will return each line with a break
  echo fgets($file). '<br />';
  }
fclose($file);
?> 
</body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/78b4e793-0bda-4391-924f-68d36bd8d30e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: app.yaml
Description: Binary data

<<attachment: guestbook.php>>

DSFDF : dssss
Nguyên : Xin Chào!
baonguyen : chán!
hùng : abcncjf
hùng : abcncjf
b : àbsdfsk
nguyen1 : aaaa
nguyen1 : aaaa
nguyen2 : fsdfsnac : dgdgdfngfh : fghg/ngfh : fghg
fgd : fdgf
dds : sâ

Reply via email to