So sorry :S
EDIT: I placed a warning message on the admin page now, so hopefully that will solve the problem till I work our what's wrong... What's bizzare is that it sometimes works and sometimes does not! That makes it really hard to say what's going wrong!
Last edited by sparks (2011-07-16 15:22:13)
Offline
Hmm, I was going to edit the code, but I was surprised to see that there wasn't really anything wrong!
Offline
You looked at the code? Yes, the only explaination I can come up with is that the error is caused by what you did beforehand as it's all on one page.... maybe moving the about updater to a seperate page would do the trick? I could try that, since the fact that it works some of the time indicates that the table names and MySQL connections aren't typo'd.
P.S. what's with your sig? Are you selling your username?!
Last edited by sparks (2011-07-16 15:28:30)
Offline
I found out why: You need to set/change on line 41. $_POST[about] does not work. So the way you are doing it right now won't work. It has to be $_POST['about'] .
Change:
mysql_query("UPDATE aboutme SET text = '$_POST[about]'
WHERE name = '$_SESSION[adminUsername]'");To:
$aboutTxt = $_POST['about'];
$adminUser = $_POST['adminUsername'];
mysql_query("UPDATE aboutme SET text = '$aboutTxt'
WHERE name = '$adminUser'");You keep placing they $_POST vars in the MySQL query and that will almost guarantee problems. And the quotes are needed in the $_POST vars. I suggest getting all the $_POST data in vars at the beginning of the code. And not in the middle.
Btw: You should recode it so it checks a list of users if they are admin/mod, and don't put it directly into the code where it checks if you are an Admin/Mod. It can cause problems when adding new helpers.
----
I understand how they want to discourage the FTP details so I won't try any further.
Last edited by Magnie (2011-07-16 15:54:24)
Offline
Right, great, I will make the change, thanks very much!
I think rather than going for the "MySQL members list check" thing I'll just list members in a php page and include() it in. I'm not planning to add members often either
Offline
Mmk, I'll test it.
---
Yep, it works!
---
Or maybe not... Can't really tell.
Last edited by Magnie (2011-07-16 16:57:49)
Offline
It's the same with $_SESSION vars too:
Wrong:
$result = mysql_query("SELECT * FROM aboutme
WHERE name='$_SESSION[adminUsername]'");Right:
$adminUser = $_SESSION['adminUsername'];
$result = mysql_query("SELECT * FROM aboutme
WHERE name='$adminUser'");Offline
It seems to work, I like the update as well.
Offline
The update where you login and then you have an option to change your "about me" page.
Offline
Hehe mmk.
Offline
I'm really looking forward to this front-end working. It's a shame that I have to be so secretive about the details but I can see where the scratch team are coming from
Offline
Doesn't seem to be updating for me.
Offline
sparks wrote:
P.S. what's with your sig? Are you selling your username?!
PF is running for mod.
Magnie wrote:
Doesn't seem to be updating for me.
Me either.
sparks wrote:
Sorry sci, the updater sometimes works and sometimes does not
I have no idea why and I'm trying to fix it. I can only recommend copying your changes to clipboard before posting, and then updating till the changes stick
![]()
And I wrote it in a text editor and kept it there, because I know it's glitchy. ;P
Last edited by scimonster (2011-07-17 01:26:16)
Offline
At least all these problems with updating give me time to think of something to type.
Offline
Just wondering, hows the integration with the old website stuff and the new website going?
Offline
cool
Offline