Jump to content
xisto Community
Chesso

Need Help With Php/mysql And Web Servers Such As Asta's.

Recommended Posts

Within my site I have built my own basic forum using PHP/Mysql, I always test locally now both using EasyPHP and WAMP5 which both give me no problems what so ever.But when I tryed to run the exact same code on Asta's hosting services (and possible another I used to use) when creating a new thread or adding a reply to an existing one it *sometimes* adds an additional thread/reply as a Guest (someone not signed in) with an empty message.This would lead me to believe that somehow the page is being refreshed and the variables sent to the database update php file are obviously not filled in unless sent from the proper page.But why does this behaviour happen only on using web services from others and works perfect for me using a completely different version of mysql/php and the same version on my machine?

Edited by Chesso (see edit history)

Share this post


Link to post
Share on other sites

Sounds quite strange... It must have something to do with the refresh... But what sounds so weird is that the new post is not with same username. How do you fetch the username/ID? Do you use sessions or cookies or what?And is the entire thread/reply created with one execution of a PHP file or do you create a say a thread entry to the table first and then add the contents to another table?

Share this post


Link to post
Share on other sites

I use sessions. The code should only ever execute once except if a user by mistake refreshed the page one or more times.I have a temporary or permanent fix now that should have been obvious to me long ago but well it's fixed. I send a few values such as message content and username, I basically just check to see if the message content is null.Users shouldn't be trying to post blank messages and such and it should mean that the data for that particular instance was not sent from the right page properly.I also managed to fix alot of other small bugs that I have been meaning to get out of the way, I just needed some time to focus on the affected code and it didn't take too long at all after that to figure out something to fix it up.

Edited by Chesso (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.