PDA

View Full Version : HELP: PHP Guestbook question


s0me0ne
12-01-2005, 02:36 PM
Hi everyone,
I desperately need help for my guestbook here. Hope anyone could help me.
I have setted up my guestbook, it works but its own but when i load it from other .swf it wont work. I did CHMOD 766 to entry.txt was done, as you coud see it works by itself in guestbook.html

You can have a look at here.
http://www.absholute.com/test/updates.html

but when opening this ones...
http://www.absholute.com/test/updates/guestbook.html
it works!

So what i tried to do was getting the updates.swf to load the file in path of updates/guestbook.swf. But it showed undefined. I am sure most of you could be familiar with this. And here is the attachment of it.

Thanks alot!

s0me0ne
12-01-2005, 03:15 PM
Hi everyone,
Before I start my question, sorry to post twice. I thought i posted in the wrong board before? it was action script2 board. I think board this fits better, since its php.

I desperately need help for my guestbook here. Hope anyone could help me.
I have setted up my guestbook, it works but its own but when i load it from other .swf it wont work. I did CHMOD 766 to entry.txt was done, as you coud see it works by itself in guestbook.html

You can have a look at here.
http://www.absholute.com/test/updates.html

but when opening this ones...
http://www.absholute.com/test/updates/guestbook.html
it works!

So what i tried to do was getting the updates.swf to load the file in path of updates/guestbook.swf. But it showed undefined. I am sure most of you could be familiar with this. And here is the attachment of it.

Cota
12-01-2005, 03:18 PM
sorry, dont have flash on this machine...whats the code in guestbook.swf

s0me0ne
12-01-2005, 03:22 PM
ok here goes the long code.
there are 5 frames with labels
here's the 1st one labeled 'refresh'
************************************************** ***
// Create random number
randNum = Math.random() * 1000000;
// Create our LoadVars Object
myData = new LoadVars();
// Call to scripts for data
myData.load("entry.txt?" + randNum, myData, "POST");
// When all of our data loads ...
myData.onLoad = function () {
gotoAndPlay("view");
}
// Message scrollbar
scroll_mc.setStyleProperty("scrollTrack", 0xEFEFEF);
scroll_mc.setStyleProperty("highlight3D", 0xCCCCCC);
scroll_mc.setStyleProperty("highlight", 0xCCCCCC);
scroll_mc.setStyleProperty("shadow", 0xCCCCCC);
scroll_mc.setStyleProperty("darkShadow", 0xCCCCCC);
scroll_mc.setStyleProperty("arrow", 0xCCCCCC);
scroll_mc.setStyleProperty("face", 0xCCCCCC);
// Entries scrollbar
scroll_mc1.setStyleProperty("scrollTrack", 0xEFEFEF);
scroll_mc1.setStyleProperty("highlight3D", 0xCCCCCC);
scroll_mc1.setStyleProperty("highlight", 0xCCCCCC);
scroll_mc1.setStyleProperty("shadow", 0xCCCCCC);
scroll_mc1.setStyleProperty("darkShadow", 0xCCCCCC);
scroll_mc1.setStyleProperty("arrow", 0xCCCCCC);
scroll_mc1.setStyleProperty("face", 0xCCCCCC);
// Stop movie
stop();
************************************************** ***

2nd one labeled 'view'
************************************************** ***
// Clear imput boxes
name = "";
email = "";
website = "";
message = "";
// Populate text field
if (myData.result == "okay") {
entries_txt.htmlText = myData.entries;
} else {
entries_txt.htmlText = myData.errorMsg;
}
// Actions for character display
onEnterFrame = function () {
messagecount = 1000-message_txt.length;
};
// Set tab order
name_txt.tabIndex = 1;
email_txt.tabIndex = 2;
website_txt.tabIndex = 3;
message_txt.tabIndex = 4;
// System code
System.useCodepage = true;
// create error messages
error1 = "valid email required";
error2 = "input required";
// validate email function
function validate(address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
// form check
function formcheck() {
if ((((email == null)) || (email.length<1)) || (email == "valid email required")) {
email = error1;
action = "";
}
if (!validate(email)) {
email = error1;
action = "";
}
if ((name == null) || (name == "")) {
name = error2;
action = "";
}
if ((message == null) || (message == "")) {
message = error2;
action = "";
}
if ((validate(email)) && (email != error1) && (name != "") && (name != error2) && (message != "") && (message != error2)) {
name = name_txt.text;
email = email_txt.text;
website = website_txt.text;
message = message_txt.text;
gotoAndPlay("sending");
}
}
// Stop the movie
stop();
************************************************** ***

3rd one labeled 'sending'
************************************************** ***
// Create random number
randNum = Math.random() * 1000000;
// Create our LoadVars Object
myData = new LoadVars();
// Call to scripts for data
myData.load("addentry.php?" + randNum + "&name=" + name + "&email=" + email + "&website=" + website + "&message=" + message, myData, "POST");
// When all of our data loads ...
myData.onLoad = function () {
if (myData.result == "okay") {
gotoAndPlay("loading");
} else {
gotoAndPlay("view");
}
}
// Stop movie
stop();
************************************************** ***

4th one labeled 'loading'
************************************************** ***
// Create random number
randNum = Math.random() * 1000000;
// Create our LoadVars Object
myData = new LoadVars();
// Call to scripts for data
myData.load("entry.txt?" + randNum, myData, "POST");
// When all of our data loads ...
myData.onLoad = function () {
gotoAndPlay("view");
}
// Stop movie
stop();
************************************************** ***


Thanks for the fast reply, Sorry for the long codes. And hope you could help. Thanks heaps.

Cota
12-01-2005, 03:28 PM
Oddly enough, both your links work for me.....by itself and loaded into another SWF....

s0me0ne
12-01-2005, 03:34 PM
what do you mean?
http://www.absholute.com/test/updates.html
that works?
it is auto load that. i just made it load the guestbook.swf straight away.

but when u try to open that updates.html
the guestbook wont work. it says undefined. for the guestbooklog

but when u try to open the guestbook by itself, which is this site
http://www.absholute.com/test/updates/guestbook.html
can u see that the guesbooklog contains somethings? u can even post new things if u wanna try in that guestbook.html

Cota
12-01-2005, 03:37 PM
which function does the initial load?

s0me0ne
12-01-2005, 03:45 PM
initial load swf u mean?
its from the updates.swf
i was trying to load this form (guestbook.swf) in my web from updates.swf
so the command inside updates.swf is just simply:
the 1st frame
stop();
holder_mc.loadMovie('updates/guestbook.swf');
thats it...

Cota
12-01-2005, 03:49 PM
I meant within guestbook.swf, where is the function that loads the text file the first time.

s0me0ne
12-01-2005, 03:52 PM
i think
// Create random number
randNum = Math.random() * 1000000;
// Create our LoadVars Object
myData = new LoadVars();
// Call to scripts for data
myData.load("entry.txt?" + randNum, myData, "POST");
// When all of our data loads ...

>>> this is the one... i guess...
myData.onLoad = function () {
gotoAndPlay("view");
}

Cota
12-01-2005, 04:00 PM
Either its too early or I need sleep...try making it _global
_global.myData = new LoadVars();
Not even sure if that will work...but worth a try.

s0me0ne
12-01-2005, 04:06 PM
ok. i'll try that see how it goes!
im goin to sleep soon. wonder who can help more too here....

s0me0ne
12-01-2005, 04:13 PM
hmm its still undefined man...
anyway thanks alot for ur replies man... at least some tries...

any other can help?? please respond.. thanks...!

s0me0ne
12-02-2005, 06:50 AM
anybody would help me here??? im not really familiar with codings.. but i think this wont be that hard for you guys that know really much..

s0me0ne
12-02-2005, 06:53 AM
any other could help here???
i tried using _global.myData to all the codings but still not working.
still showing undefined :|

Flash Gordon
12-02-2005, 07:15 AM
****CROSS POST**********
please use your other thread.