Library tutorials & articles
Classic Guestbook made with Flash and ASP/PHP
By Pradeep Mamgain, published on 05 Apr 2002
Page 2 of 4
- Introduction
- More Flash Code
- The PHP Code
- The ASP Code
More Flash Code
Add two button instances for Next 10 and previous 10 records and add the following
code in action window.
Code for next Button
Code for Previous Button
Add three dynamic text fields to the movie for Total entries(totalentries),Low Limit (txtll) and High Limit (txthl) respectively.
Now Insert a new movie instance. Place four dynamic text boxes for name(textname) , email (txtemail) , website (txtwebsite) and comments (txtcomments). Add two buttons for Submit and Reset.
Code for Submit Button
Code for reset button
Code for next Button
on (release) { // Increase limits by 10
lowlimit = Number(lowlimit)+Number(10);
highlimit = Number(highlimit)+Number(10);
txtmain = "Processing Entries from "+lowlimit+" to "+highlimit+"
Please wait ::: ";
loadVariablesNum ("guestbook.php?lowlimit="+lowlimit+"&highlimit="+highlimit,
0);
}
Code for Previous Button
on (release) {
if (lowlimit == "0") {
txtmain = ":::: Nothing before Zero ::::";
}else{
lowlimit = Number(lowlimit) - Number(10); //
dec. limits by 10
highlimit = Number(highlimit) - Number(10);
txtmain = "Processing Entries "+lowlimit+" to "+highlimit+" Please
wait for a while :::::: ";
loadVariablesNum ("guestbook.php?lowlimit="+lowlimit+"&highlimit="+highlimit,
0);
}
}
Add three dynamic text fields to the movie for Total entries(totalentries),Low Limit (txtll) and High Limit (txthl) respectively.
Now Insert a new movie instance. Place four dynamic text boxes for name(textname) , email (txtemail) , website (txtwebsite) and comments (txtcomments). Add two buttons for Submit and Reset.
Code for Submit Button
on (release) {
if (txtname eq "") {
_root.txtmessage = "Name information missing.";
} else if (txtemail eq "") {
_root.txtmessage = "Email missing.";
} else if (txtcomments eq "") {
_root.txtmessage = "Comments missing.";
} else if (txtwebsite eq "") {
_root.txtmessage = "Enter the URL to your website";
} else {
submit= "Y"; // this variable will be used in
PHP script to determine whether the new data has submitted or not.
highlimit = 10;
lowlimit = 0;
_root.txtmain = "wait :::: Posting New Entry ::: ";
loadVariablesNum ("guestbook.php", 0, "POST"); //
send variable to PHP script
_root.txtmessage = "Comments posted";
txtname1=txtname;
gotoAndStop (2);
}
}
Code for reset button
on (release) {
txtname = "";
txtemail = "";
txtWebsite = "http://";
txtcomments = "";
}
Related articles
Related discussion
-
Beginning from scratch
by Slicksim (1 replies)
-
How to modularize CSS menus
by Slicksim (2 replies)
-
What technology / Framework would you propose
by James Crowley (2 replies)
-
ASP VS PHP
by paulfp (9 replies)
-
What would motivate you to change your job?
by kovshenin (4 replies)
Related podcasts
-
Java Posse #212 - Oracle Developer Tools Interview
Interview with Ted Farrell about Oracle Developer Tools Fully formatted shownotes can always be found at http://javaposse.com We talk to Ted Farrell (and at the end Duncan Mills) about the Oracle Java developer tools, the new Oracle 11g product stack, Oracle's work on JSRs, the future of the ...
Related jobs
-
Senior Web Developer - Luxembourg
in Luxembourg (€45K-€70K per annum)
I've managed to get PHP working on my site and the PHP version seems to be working ok
Hi there
I've created a new directory on my site called guestbook and in it have placed the files:
guestbook.swf
guestbook.html [containing the swf file above]
asguest.asp
guestbook.txt
guestbook.mdm
I have created a new ODBC on my server and this is the path to the database:
htdocs\guestbook\guestbook.mdb
the link to the guestbook is http://www.eskymo.co.uk/guestbook/guestbook.html and is in it's original state as I wanted to test it worked before re-designing the interface. When checking the swf file online and entering my details and message it does the following:
says thankyou for signing up in the right hand panel and in the left panel reads 'wait ::: posting new entry' but nothing else happens even when refreshing the page.
Am I doing something wrong - do i need to alter the path to the databse in the script at all even though all the files are sitting in the same directory. As there is no working demo accompanying the tutorial I have no idea what it is supposed to do, even though i presume the data i've inputted should appear int he left panel.
Can anyone help me with this - i feel like such a numpty - It's the first time i'm dealing with databases and not sure if i'm missing something.
cheers
e
I have had a problem running the guestbook. Whenever I try to add an entry, I get error messages pointing to the highlimit, lowlimit and in variables, saying they are undefined.
Can anyone tell me what I am doing wrong??
I'd appreciate it if you emailed me
Thanks..
This thread is for discussions of Classic Guestbook made with Flash and ASP/PHP.