Pages: [1]   Go Down
Send this topic | Print
Author Topic: PHP Message Board Issue---Need Help Please  (Read 500 times)
soulecho
Member
*
Offline Offline

Posts: 4


WWW
« on: December 12, 2008, 11:16:08 AM »

I have just spent the last 2 hours sorting through the forums here trying to find an answer to my problem.  I am good with Flash, but new to PHP, but was able to get a PHP/XML based Message Board put together for my page (which is Flash-based).

I have tried this out several times locally on my machine and through IIS and it works GREAT!!  However, now that I have it uploaded here...there seems to be an issue with it.  It never seems to load the XML file, which I am guessing is due to a problem with the PhP.  The message board (in Flash) should pass elements/Nodes to the XML to add message entries...here on the site...it does not do that.

Here is my PhP Code...
Code:
<?php
$xmlString
= $HTTP_RAW_POST_DATA;
if (
is_null($xmlString)) {
print
"No data was sent";
}
else {
$file = fopen("guestbook.xml", "w+") or die("Can't open XML file");
if(!
fwrite($file, $xmlString)){
print
"Error writing to XML-file";
}
print
$xmlString."\n";
fclose($file);
}
?>


And here is the very simple (starter) XML file...

Code:
<?xml version="1.0" encoding="utf-8"?>
<guestbook>
</guestbook>

You can check out the message board on my page to see what it is doing...errrr...not doing.
http://soulecho.110mb.com

Thanks for any help you can give...
Logged
robleyd
Official 110mb Guru
********
Online Online

Posts: 5700

Ask before you PM


« Reply #1 on: December 12, 2008, 11:54:33 AM »

Your page is damn slow loading; perhaps you could help us help you by telling what error messages you get and what doesn't work as you expect it to.

For a wild guess, I'd say check the permissions on guestbook.xml and make sure it is world writeable.
Logged

I once had a hard drive clunk-clicking
Strange noises, weird sounds and tick-ticking
I thought I would wait
And procrastinate...
But now all my data is missing
--------------
dd, a dump, a data dump
read a line from standard in
$USER, the name I call my self
make - a long long time to run
.so a library that is shared
.ko it's not the same as .so
tee, a redirect with in and out
and brings us back to dd d d d
manicgames
Visual Basic Programmer!
Official 110mb Guru
********
Online Online

Posts: 8579


Ubuntu Is The Shizz.


WWW
« Reply #2 on: December 12, 2008, 11:56:56 AM »

Are you using an external SQL host by chance?
Logged

DOWNLOAD eoCMS NOW!

Nothing else to really say.
rvtraveller
Loyal 110MB Member
*******
Offline Offline

Posts: 2659


Please yell if you are paying attention.


WWW
« Reply #3 on: December 12, 2008, 12:04:34 PM »

Well,  I tried to find the guestbook file it is supposed to load from your site but couldn't appear to locate it.  I might have missed it but always good to double check.  I then went and tried to write something on your message board and all it did was say processing...loading new...  Based upon your PHP code it looks like when I click submit it sends the information to the code.  The code first checks to see if there is anything in the string that was passed.  If nothing is passed then it prints out "No Data was sent".  If it has a problem writing to the file then it prints out the error writing to file message.  If it doesn't error it is then supposed to print out what I submitted.  I tested twice, once with information, the second time with everything blank, and the same thing appears to happen.

I seem to remember someone saying a while ago that fwrite was disabled here at 110mb until you got fsockopen enabled.  This was for security reasons.  If someone can double check on that it would be great?

Is it possible to test the PHP with a test form outside of your flash site?  This might make narrowing down the PHP problems easier and then once you know the PHP is working everywhere then try and integrate it back into your flash design.

-rvtraveller

P.S.  In glancing around your site you mentioned 98 Rock.  Would that be the 98 Rock here in Baltimore?

People typed faster than me but I wrote this so I am posting it anyway
Logged

robleyd
Official 110mb Guru
********
Online Online

Posts: 5700

Ask before you PM


« Reply #4 on: December 12, 2008, 12:51:16 PM »

Quote
I seem to remember someone saying a while ago that fwrite was disabled here at 110mb until you got fsockopen enabled.  This was for security reasons.  If someone can double check on that it would be great?

File functions are disabled for external URL actions, but are available for local file actions, so that isn't the problem. And fsockopen is unrelated to the file functions.
Logged

I once had a hard drive clunk-clicking
Strange noises, weird sounds and tick-ticking
I thought I would wait
And procrastinate...
But now all my data is missing
--------------
dd, a dump, a data dump
read a line from standard in
$USER, the name I call my self
make - a long long time to run
.so a library that is shared
.ko it's not the same as .so
tee, a redirect with in and out
and brings us back to dd d d d
rvtraveller
Loyal 110MB Member
*******
Offline Offline

Posts: 2659


Please yell if you are paying attention.


WWW
« Reply #5 on: December 12, 2008, 01:43:23 PM »

File functions are disabled for external URL actions, but are available for local file actions, so that isn't the problem. And fsockopen is unrelated to the file functions.

Ok thanks for clarifying.  I remembered reading something about file functions but couldn't remember the specifics.

-rvtraveller
Logged

soulecho
Member
*
Offline Offline

Posts: 4


WWW
« Reply #6 on: December 12, 2008, 08:05:46 PM »

The permissions for the XML, Php and folder are all set to writable...I have tested this on my local machine through IIS and it works.

Not sure why it took so long to load...loads fine here.  But, as far as an error message goes...I do not get one...it just constantly says "Processing..." and if you try and leave a message it says "Loading New..." but never actually loads anything.

Thanks for the suggestions though...
Logged
soulecho
Member
*
Offline Offline

Posts: 4


WWW
« Reply #7 on: December 12, 2008, 08:11:59 PM »

Well,  I tried to find the guestbook file it is supposed to load from your site but couldn't appear to locate it.  I might have missed it but always good to double check.

The guestbook.xml file and the processXML.php file are both located in a subfolder "guestbook"
Logged
soulecho
Member
*
Offline Offline

Posts: 4


WWW
« Reply #8 on: December 13, 2008, 06:09:31 AM »

Okay...I feel like an idiot now.  I guess that's what I get for trying to learn PhP AND XML through Flash at the same time. 


If anyone is interested...I forgot to change the scriptAccess in the HTML file. "allowScriptAccess"...

Thanks to everyone that offered suggestions!!!
Logged
Pages: [1]   Go Up
Send this topic | Print
Jump to: