Topic: Using Guest book with alternate data paths

I have tried your guest book and love the idea.  While trying to adapt it to my site, I am having a problem with the datapath.  I have a social site and the datapath will be unique based on the memebr's iD  so in my code I have ....   <?php  if (!isset($_GET['member']) || (!(int)$_GET['member'])){      echo 'Invalid member ID! ' . $_GET['member'] . '<-'; return; } chdir('./GuestBookFree');  $sThisDir = getcwd() . '/data/member-';  $iMemberID =  (int)$_GET['member'];  if (!is_dir($sThisDir . $iMemberID)){  mkdir ($sThisDir.$iMemberID,0777); chmod ($sThisDir.$iMemberID,0777);  }  $sDataDir = 'data/member-' . $iMemberID . '/';   echo <<<HTML  <script type=

Re: Using Guest book with alternate data paths

I think the best way for you to go about this would be to modify getdrawings.php to read from a separate directory for each user.  It's a pretty simple script that reads the data folder and outputs a list of xml files.
You could set a session cookie with the user's id, and use that to read from a specific folder.

Hope this helps. 

If you want to post code, please wrap it in a code tag or it will not show up.

Divide each difficulty into as many parts as is feasible and necessary to resolve it.
-- Rene Descartes

Re: Using Guest book with alternate data paths

Alex wrote:

I think the best way for you to go about this would be to modify getdrawings.php to read from a separate directory for each user.  It's a pretty simple script that reads the data folder and outputs a list of xml files.
You could set a session cookie with the user's id, and use that to read from a specific folder.

Hope this helps. 

If you want to post code, please wrap it in a code tag or it will not show up.

Thank you for responding!

Well, I get this error in my log, which tells me that it's seeing the proper datapath, but it's looking for support files in the datapath not the scripts root.

I'm not a flash programmer by any means, so please tell me if I am wrong.

[error] [client 24.22.17.181] script '/home/devmytikibar/public_html/GuestBookFree/data/member-24/getdrawings.php' not found or unable to stat, referer: http://dev.mytikibar.com/GuestBookFree/guestbook.swf

it's looking like guestbook.swf is looking in the datapath for getdrawings.php, which I don't think it should do that.  It should be looking in the same folder as guestbook.swf.  Shouldn't it only look at the datapath for reading and writing the XML files?

So it does appear guestbook.swf is getting the proper path via the datapath parameter.

Just to clear it up,  public_html/GuestBookFree is where the SWF and supporting files are located on my server.

/data/member-##  <- member's ID in the databsase

So I am thinking that if I pass datapath = /datatpath/member-125  I should be able to read only the XML files stored in /datatpath/member-125 and still reference the supporting files stored in public_html/GuestBookFree

Unless I am totally missing the point of the datapath parameter.

If I copy the php files they execute, but then I get a whole nother round of errors because they are in the datapath not the root.


Thank you for your time.  smile