Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 07:37
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 ... 5 6 [7] 8 Print
Author Topic: Revised GuestBook.php script  (Read 120443 times)
evie
Server what's that
*
Posts: 4



View Profile WWW
« Reply #90 on: 04/14/04, 19:45 »

is there a new flash file associated with this new php script? I've tried to get the guestbook to run over the past few days with the old script and it worked fine - apart from a few glitches when displaying the text entries...clicking on the next and previous buttons often wiped all the text, sometimes it would show one entry even if there were twenty entries and strange things like that.

so i copied and pasted the php script below into my guestbook.php file and now nothing loads into the flash file at all. I thought it might be because the php script used GuestBook.txt instead of guestbook.txt so i changed that and it still doesn't work.

if there is an updated flash file to go with this script can you post it here. If there isn't do you know why the previous script would work, but woth the glitches and the new script doesn't work?

many thanks

e
« Last Edit: 04/14/04, 19:47 by evie » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #91 on: 04/15/04, 00:32 »

Hi Evie,
the "new" script is only needed, when it is not running.
It fixes possible problems arising with new versions of php.
If you have an old vorsion of php, it might not run properly. And if the old script is running, it makes not much sense using the new one Wink
Logged

happy flashing
Cool
Ronald
evie
Server what's that
*
Posts: 4



View Profile WWW
« Reply #92 on: 04/15/04, 07:33 »

Thanks for the reply - i will have to check what version of PHP my ISP is running as I'm not sure [i'm very new to php].

The old script does work to the extent that the flash and php are communicating, but i do have problems with the message display in that it sometimes displays nothing - or just the original single message and nothing more, or sometimes you click the next and previous buttons to read all the messages and this causes problems in what is dsiplayed. This might be a problem with my flash file. I haven't fully debugged it yet and i am in no way a php expert - rather a complete philistine - so i'm finding that element difficult.

i will be going through the flash file thoroughly tonight and trying to get to the bottom of the problem - if at the end of this process i feel it is still buggy i will post the code and a link to an online version of my guestbook and ask you to have a look.

thanks again

e
Logged
keiichi
Server what's that
*
Posts: 3



View Profile Email
« Reply #93 on: 04/15/04, 14:05 »

Hi,

I've been using the GuestBook for a while, but recently my server upgraded PHP to 4.3.5 and since then my guestbook stopped working. I read all the previous entries for this topic, but still can't get it to work again. ???

I modified top of the GuestBook.php to

$Submit       = $HTTP_POST_VARS["Submit"];

$Name       = $HTTP_POST_VARS["Name"];

$Email       = $HTTP_POST_VARS["Email"];

$Website       = $HTTP_POST_VARS["Website"];

$Comments    = $HTTP_POST_VARS["Comments"];

$NumLow    = $HTTP_REQUEST_VARS["NumLow"];

$NumHigh    = $HTTP_REQUEST_VARS["NumHigh"];

The rest is pretty much the same as original. Am I doing this right? I have very little knowledge of PHP.
With this I can post messages and I also can view the messages by opening the GuestBook.txt directly from the browser.

When I execute the GuestBook.php in browser, it'll says
&TotalEntries=94&NumLow=&NumHigh=&GuestBook=

Do I need to change something in Flash file?

Please help.
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #94 on: 04/15/04, 15:30 »

Look over your code.
It is essetial that the variables are allways written 100% the same way.
As you describe, the php does not read the textfile.
Logged

happy flashing
Cool
Ronald
keiichi
Server what's that
*
Posts: 3



View Profile Email
« Reply #95 on: 04/15/04, 16:49 »

Hi Ronald,

I checked the var names on each Dynamic Text boxes, they are written exactly the same way that showed in my last message HTTP_POST_VARS['...']

Do I need to modify something in FLA file? or just GuestBook.php file?

Here's what I have.
Text File ( GuestBook.txt )
PHP File ( GuestBook.php extension changed for download purpose. Please change .doc to .php)
Admin Panel
Admin .fla File

I can still use this Admin Panel to write, but messages won't get loaded.
Thanks for your help.
Logged
keiichi
Server what's that
*
Posts: 3



View Profile Email
« Reply #96 on: 04/16/04, 00:38 »

Ronald,

I figured it out.

$NumLow    = $HTTP_REQUEST_VARS["NumLow"];
$NumHigh    = $HTTP_REQUEST_VARS["NumHigh"];

changed to

$NumLow    = $_REQUEST["NumLow"];
$NumHigh    = $_REQUEST["NumHigh"];

Thanks for your time and thanks for this GuestBook  ;D
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #97 on: 04/16/04, 00:58 »

Hi,
you could have used $_GET, because these two are susing the GET-Methode Wink
Logged

happy flashing
Cool
Ronald
precious dechavez
Server what's that
*
Posts: 2



View Profile Email
« Reply #98 on: 04/16/04, 05:40 »

I don't know much about PHP, but... I tried using the flash example of the guestbook and tested it online. I made no changes or corrections and it's giving me an error saying "cannot write GuestBook.txt.....

how can I fix this problem?
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #99 on: 04/16/04, 05:56 »

This is, because you did nothing to it Wink

As described in the docs, you have to make the GuestBook.txt writable on your server (chmod)
Logged

happy flashing
Cool
Ronald
evie
Server what's that
*
Posts: 4



View Profile WWW
« Reply #100 on: 04/16/04, 06:52 »

a full explanation of this process would be good for those non-techy people out here...
Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #101 on: 04/16/04, 07:22 »

Dont worry, there is one. In the docs to the tutorial Wink
Logged

happy flashing
Cool
Ronald
evie
Server what's that
*
Posts: 4



View Profile WWW
« Reply #102 on: 04/16/04, 07:24 »

cheers... Cheesy
Logged
jam
Server what's that
*
Posts: 3



View Profile Email
« Reply #103 on: 01/14/05, 09:05 »

Uh... I'm still very new to this but although I don't get all the signs and punctuations, I did managed to tweak it to my liking. Smiley But I have another issue...

My timezone is exactly 13 hours later than the host server, how do I change the time?
Logged
vesa kortelainen
Administrator
Systems Administrator
*****
Posts: 3450


View Profile
« Reply #104 on: 01/14/05, 21:54 »

jam, i found this script from www.php.net/time (User Comments) :

"Many people have asked me what's an easy way to implement time-stamp time-zone offsets. Here's a simple class I made that has a function that returns a time-stamp calculated with a time-zone offset argument."
[script]
<?php

class MyTimeZone {

  const TIMEZONE_SERVER_OFFSET = -5; // your server's offset from GMT 0
 
  public function timeOffset($offset = null)
  {
      if (is_int($offset)) {
          $local_offset = $offset - self::TIMEZONE_SERVER_OFFSET;
          return time() + 3600 * $local_offset;
      }
      return time();
  }
}

$time = new MyTimeZone();
echo date('h:i:s a', $time->timeOffset(-8)); // finds GMT -8

?>[/script]
Logged
Pages: 1 ... 5 6 [7] 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!