Page 1 of 1

users cannot register

PostPosted: Sat Mar 03, 2007 7:21 pm
Author: xblade824
Your phpBB Version: 2.0.
phpBB Type: Integramod 141
MODs: No
Your knowledge: Basic Knowledge
Board URL: http://www.gamersedgecafe.com/forums

PHP Version:
MySQL Version:


What was done before the problem appeared?
I'm not sure how long this has been happening, actually


What was done to try to solve the problem?
search this forum =P



De.scription and Message

After a user registers, it displays this message (which it seems to be linked to the welcome message, but why would it give this error and how would i fix it?):

"
Could not insert private message sent info.

DEBUG MODE

INSERT INTO phpbb_privmsgs (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES (1, 'Welcome to Gamer's Edge!', 2, 20, 1172974510, '', 0, 1, 1, 1)

Line : 95
File : functions_post.php
"

Thanks

EDIT: I tried disabling the welcome message and it works perfectly. Anyone know what I can do differently to enable this without getting that error? I really want this turned on!

Re: users cannot register

PostPosted: Thu Mar 08, 2007 10:11 pm
Author: Frost
What is the chmod on includes/functions_post.php?

Make sure it's 644

If it is, have you done any edits to the file lately?

PostPosted: Fri Mar 09, 2007 2:21 am
Author: xblade824
Nothing at all - I don't even have enough knowledge about php to change anything anyways. It is 644.

Re: users cannot register

PostPosted: Fri Mar 09, 2007 3:04 am
Author: Frost
Hmm <img>

I've seen this before but it was caused by adding a mod
Try reuploading a fresh file of includes/functions_post.php from the zip

if that doesnt work show me lines 180 through 195 of functions_post.php

Re: users cannot register

PostPosted: Mon Jul 09, 2007 3:50 pm
Author: rtanner83080
I seem to be having the same problem. I have CHMOD the file to 644. I uploaded a new version of functions_post.php to the correct folder. I am still getting the same problem though.

Here is the error message:

Could not insert private message sent info.

DEBUG MODE

INSERT INTO phpbb_privmsgs (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES (1, 'Welcome to Gamer's Edge!', 2, 20, 1172974510, '', 0, 1, 1, 1)

Line : 96
File : functions_post.php


After seeing this error, here are the lines requested in previous posts.

Lines 180-195:

180 $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));
181 $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);
182 }
183
184 $message = addslashes($message);
185 if ( strpos($message, '&quot;') !== false)
186 {
187 $message = str_replace('&quot;', '&quot;', $message);
188 }
189
190 // BUG beta Michaelo #3
191 // Note this code only replaces two characters
192 // $message = str_replace('&quot;', '"', $message);
193 // $message = str_replace('&', '&', $message);
194 }
195 else


I can't seem to figure out what is causing this problem.

Any help is much appreciated so I can turn the welcome PM's on again.

PostPosted: Mon Jul 09, 2007 8:03 pm
Author: tmotley
I do believe it is the apostrophe in the site name that is causing that. Don't know how to fix it other than changing the site name to NOT have the apostrophe.

In viewing your site, some Gamer's and others Gamers...

(Not to nitpick, but you left an e out of announcements...)

Re: users cannot register

PostPosted: Tue Jul 10, 2007 1:17 am
Author: Coder
I agree with tmotley - I think he hit it squarely on the head!

Here's your 'values' line:
VALUES (1, 'Welcome to Gamer's Edge!', 2, 20, 1172974510, '', 0, 1, 1, 1)

Now here it is again as a machine would read it:
VALUES (1, 'Welcome to Gamer's Edge!', 2, 20, 1172974510, '', 0, 1, 1, 1)
As you can see, the opening quote mark ' delimits the beginning of a string to be read, and ends at the first closing quote '

The text after that confuses the machine, then it hits another quote and treats everything after that as a string, followed by yet another string. The number of values don't match the number of fields you gave, so the insert fails.

One workaround might be to use double quotes instead of single (bit rusty on MySQL, but it should work) ...
VALUES (1, "Welcome to Gamer's Edge!", 2, 20, 1172974510, '', 0, 1, 1, 1)

Bear in mind that the ' only works if the function that does the replacement comes before the string is parsed ... from your post, the error is occurring in line 95 of your file functions_post.php but the replacement of the ' with ' isn't done until line 187 of the file

Hope that helps! <img>

Re: users cannot register

PostPosted: Tue Jul 10, 2007 6:09 am
Author: rtanner83080
[quote=""Coder";p="27143""]I agree with tmotley - I think he hit it squarely on the head!

Here's your 'values' line:
VALUES (1, 'Welcome to Gamer's Edge!', 2, 20, 1172974510, '', 0, 1, 1, 1)

Now here it is again as a machine would read it:
VALUES (1, 'Welcome to Gamer's Edge!', 2, 20, 1172974510, '', 0, 1, 1, 1)
As you can see, the opening quote mark ' delimits the beginning of a string to be read, and ends at the first closing quote '

The text after that confuses the machine, then it hits another quote and treats everything after that as a string, followed by yet another string. The number of values don't match the number of fields you gave, so the insert fails.

One workaround might be to use double quotes instead of single (bit rusty on MySQL, but it should work) ...
VALUES (1, "Welcome to Gamer's Edge!", 2, 20, 1172974510, '', 0, 1, 1, 1)

Bear in mind that the ' only works if the function that does the replacement comes before the string is parsed ... from your post, the error is occurring in line 95 of your file functions_post.php but the replacement of the ' with ' isn't done until line 187 of the file

Hope that helps! <!-- s]

Tmotley and Coder....


Thanks a bunch. This is definitely the cause of the problem. I just took out the apostrophe and everything works fine now.

Thanks a bunch!

PostPosted: Tue Jul 10, 2007 6:35 am
Author: tmotley
Mark solved?