Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 07:54
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Recent Tutorial Support
| |-+  Flash GuestBook Support (Moderators: Flash-db, vesa kortelainen, Ronald Wernecke, Mohsin Sumar, Jorge Solis)
| | |-+  Revised GuestBook.php script
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 [2] 3 4 ... 8 Print
Author Topic: Revised GuestBook.php script  (Read 120444 times)
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« Reply #15 on: 10/04/03, 02:35 »

Hi,

you just placed the php file in a folder on your computer, or in a folder on a machine running a webserver (maybe your webhost)?
If you want to test locally, there are a few threads around about making an apache server work on windows
Also be sure that you open the movie in browser rather than in flash "test movie"

Musicman
Logged
Andrew Owen
Server what's that
*
Posts: 1



View Profile Email
« Reply #16 on: 10/22/03, 09:00 »

Any ideas why the total number of posts only appears after you subit a new entry.
Logged
Tom
Server what's that
*
Posts: 1



View Profile Email
« Reply #17 on: 10/22/03, 11:18 »

/* This Line adds the '&GuestBook=' part to the front of the data that is stored in the text file.  This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file  */

   $New = "$Input$OldData";


Just curious where is the $input getting the info from to add the &GuestBook= to add to the front of the text file ??

Im currently trying to make my own guestbook and ive used a snippet of this code but my guestbook must have:

&result=okay&entries=

At the front of the text file but when it prints it doesnt add this.

So im just curious where does the input get defined ??

Heres my php code:

<?

//No need to edit anything below here.
if (!isset($name) &#124;&#124; !isset($email) &#124;&#124; !isset($message) &#124;&#124; empty($name) &#124;&#124; empty($email) &#124;&#124; empty($message)) {
print "&result=Fail";
print 
"&errorMsg=" urlencode("Input required for all fields.");
exit;
}

$email strtolower($email);

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

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

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

$message stripslashes($message);

//$file = fopen('entry.txt', 'a+');
$filename "entry.txt";
$fp fopen$filename,"r"); 
$OldData fread($fp80000); 
fclose($fp); 
   
$Input 
"<font color=\"#000000\">Name:</font> $name\n<font color=\"#000000\">Email:</font> <font color=\"#990000\"><u><A href=\"mailto:$email\">$email</A></u></font><br>\n<font color=\"#000000\">Website:</font> <font color=\"#990000\"><u><A href=\"http://$website\"target=\"_blank\">$website</A></u></font><br>\n<font color=\"#000000\">Posted:</font> $posted\n<font color=\"#000000\">Message:</font> $message\n\n";

$New "$Input$OldData";
   
$fp 
fopen$filename,"w"); 
fwrite($fp$New);
fclose($fp); 

/*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=\"#990000\"><u><A href=\"mailto:$email\">$email</A></u></font><br>\n<font color=\"#000000\">Website:</font> <font color=\"#990000\"><u><A href=\"http://$website\"target=\"_blank\">$website</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$website$message);
}

function 
mailAdmin($name$email$website$message) {
   $mailTo "you@yoursite.com";
   $mailFrom "From: <you@yoursite.com>";
   $mailSubject "New Guestbook Entry";
   $mailBody "A visitor to your site has left the following information in your guestbook:\n
   Name: $name
   Email: $email
   Website: $website
   The visitor commented:
   ------------------------------
   $message 
   ------------------------------
   You can view the message at:
   [url=http://www.yoursite.com]http://www.yoursite.com[/url]"
;
   mail($mailTo$mailSubject$mailBody$mailFrom);
   mail($email"Your Subject""Thank you message""From: Autoresponder");
}

print 
"&result=okay";
exit;

?>

Any help would be appreciated.
« Last Edit: 10/22/03, 11:21 by Tom » Logged
Michael
Server what's that
*
Posts: 2



View Profile Email
« Reply #18 on: 10/27/03, 09:12 »

I downloaded the guest book scripts and there is no GuestBook.swf in the Zip file ?
Logged
vesa kortelainen
Administrator
Systems Administrator
*****
Posts: 3450


View Profile
« Reply #19 on: 10/27/03, 09:16 »


I downloaded the guest book scripts and there is no GuestBook.swf in the Zip file ?


You have to Publish your Flash-file...
Logged
Michael
Server what's that
*
Posts: 2



View Profile Email
« Reply #20 on: 10/27/03, 09:24 »

Ha ha not real bright am I  Embarrassed
Logged
matthias
Server what's that
*
Posts: 17



View Profile Email
« Reply #21 on: 10/28/03, 10:52 »

hi php gods
i'm new.
i was going to try out this php and flash guestbook but when i installed everything and checked my guestbook.php online it said:

Parse error: parse error in /home/.sites/142/site27/web/guestbook/guestbook.php on line 4.

what i did? i changed the first "post" and "gets" as you suggested to
$HTTP_POST_VARS["Submit"]; and so on.

checked again and got:
Parse error: parse error in /home/.sites/142/site27/web/guestbook/guestbook.php on line 12
failure shifted some lines down.
but the first problems i solved??? i donno.
since this new note it seems nothing that's starting with "$" (eg. $Name) as a normal variable in php (right) is being accepted!?

do i have to use some script in my html document i which my swf file is embd? or has that nothing to do with it at all.

thanks for your help.
« Last Edit: 10/28/03, 10:55 by matthias » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #22 on: 10/28/03, 11:03 »

Mi Matthias,
how do you expect that we see a misstype, if you dont list the code?

If you show what you have in the preceding line, the line which is named and the following line, we may have a chance to find the error  Wink
Logged

happy flashing
Cool
Ronald
dan_0032
Server what's that
*
Posts: 24



View Profile WWW Email
« Reply #23 on: 10/28/03, 11:08 »

Hi ,
I have read through and tried everything on here several times and now it is time for the white flag before I go completely insane.  
Will someone please look at my guestbook www.its-logical.com for me and tell me why it hangs and says "processing...  Loading new..." with nothing ever being loaded.

new php script is loaded

(insanity approaching)  Huh  Huh  Huh
 
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #24 on: 10/28/03, 11:46 »

Hi Dan,
same words to you:
It realy is hard to find an error if you dont have the source code.
Logged

happy flashing
Cool
Ronald
dan_0032
Server what's that
*
Posts: 24



View Profile WWW Email
« Reply #25 on: 10/28/03, 11:56 »

Ronald,
The php file is a copy of the first entry in this thread and the actions on the submit button is:

on (release) {
   if (Name eq "") {
      _root.Status = "Please enter your name";
   } else if (Email eq "") {
      _root.Status = "Please enter email Address";
   } else if (Website eq "") {
      _root.Status = "Please enter the URL to your website";
   } else {
      Submit = "Yes";
      NumHigh = 10;
      NumLow = 0;
      _root.GuestBook = "Processing..   Loading New... ";
      loadVariablesNum ("GuestBook.php", 0, "POST");
      _root.Status = "Your entry has been submitted.  You should see your comments appear immediatly";
      gotoAndStop (2);
   }
}

_____________________________________
anything else you need?
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #26 on: 10/28/03, 12:08 »

Hi Dan,
did you check for mod of the textfile?
How do you access the server? Can you see the textfile?
It looks like you dont have the rights to access the file, or something like this.
Logged

happy flashing
Cool
Ronald
dan_0032
Server what's that
*
Posts: 24



View Profile WWW Email
« Reply #27 on: 10/28/03, 12:19 »

Ronald,
I Have a folder on the server called guestbook containing the following files:  
GuestBook.txt
GuestBook.php
guestbook.swf
All files are visible and it allowed me to change the properties CHMOD of GuestBook.txt 777 (all checked).  Called the ISP yesterday and they run php version 4.

I appreciate your help - What do I look for next?
Logged
vesa kortelainen
Administrator
Systems Administrator
*****
Posts: 3450


View Profile
« Reply #28 on: 10/28/03, 13:38 »

run the GuestBook.php in your server... what it says?
Logged
dan_0032
Server what's that
*
Posts: 24



View Profile WWW Email
« Reply #29 on: 10/28/03, 14:37 »

http://www.its-logical.com/guestbook/phpinfo.php4

Hi Vesa,
the link gives all the info on the server's php.  Does this help?
Logged
Pages: 1 [2] 3 4 ... 8 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything