PDA

View Full Version : CHMOD levels


swolfe
11-04-2005, 06:33 AM
how do change CHMOD levels on a .txt file to be linked?

CyanBlue
11-04-2005, 12:48 PM
Howdy and Welcome... :)

I moved this question to the Server Side Scripting forum because Flash is not capable of doing that... You'd need to create a PHP script that does what you want to do that call that in Flash by using LoadVars() object...

swolfe
11-09-2005, 05:48 AM
thanks for your help. For some reason I can get this file to work. I have this php script set up in Dreamweaver. www.groundswellmusic.net is where I have set up this guestbook.



if (!isset($name) || !isset($email) || !isset($message) || empty($name) || empty($email) || empty($message)) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Input required for all fields.");
exit;
}

$email = strtolower($email);

addentry($name, $email, $message);

function addentry($name, $email, $message) {

$posted = strftime("%D %I:%M %p");

$message = stripslashes($message);

$file = fopen('entry.txt', 'a+');

if (!$file) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Could not open entry.txt file. Change CHMOD levels to 766.");
exit;
}

fputs($file, "<font color=\"#000000\">Name:</font> $name\n<font color=\"#000000\">Email:</font> <font color=\"#CCCCCC\"><u><A href=\"mailto:$email\">$email</A></u></font><br>\n<font color=\"#000000\">Posted:</font> $posted\n<font color=\"#000000\">Message:</font> $message\n\n");
fclose($file);

// Send admin an email when new entry occurs
// mailAdmin($name, $email);
}

function mailAdmin($name, $email) {
$mailTo = "Groundswell <groundswellmusic@yahoo.com>";
$mailFrom = "From: Guestbook <groundswellmusic@yahoo.com>";
$mailSubject = "New Guestbook Entry";
$mailBody = "$name ($email) has just posted in your guestbook\n\nView it at http://www.groundswellmusic.net";
mail($mailTo, $mailSubject, $mailBody, $mailFrom);
}

print "&result=okay";
exit;




here is the loadVar in Flash:

// Create our LoadVars Object
myData = new LoadVars();
// Call to scripts for data
myData.load("addentry.php?" + randNum + "&name=" + name + "&email=" + email + "&message=" + message, myData, "POST");

// When all of our data loads ...
myData.onLoad = function () {
if (myData.result == "okay") {
gotoAndPlay("loading");
} else {
gotoAndPlay("view");
}
}