vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Slashes in names (https://vborg.vbsupport.ru/showthread.php?t=46451)

Boofo 12-07-2002 03:18 AM

Slashes in names
 
Can someone please tell me how I make this line:

PHP Code:

$MessageAddon .= "\nSessions identifys them as ".addslashes($realusername[username]); 

Keep from doing this?

[disable]Sessions identifys them as Boofo\'s Babe[/disable]

Xenon 12-07-2002 11:30 AM

huh?

i think it looks perfect as it is here...

Sparkz 12-07-2002 12:00 PM

I don't see the problem either.

Boofo 12-07-2002 04:29 PM

For some reason it parsed it out. Here's how it looks with a space in it (Hopefully it won't parse it with a space). Take the space out between the o and the \ and that's how it looks.

Sessions identifys them as Boofo \'s Babe

Xenon 12-07-2002 07:30 PM

ahh, ofcourse it does, because you use addslashes function which add's slashes before ' and "

change it into that would help you:
PHP Code:

$MessageAddon .= "\nSessions identifys them as ".htmlspecialchars($realusername[username]); 


Boofo 12-07-2002 08:44 PM

Thank you, Stefan. :) I was just using the original code. Why would someone use addslashes instead of specialcharacters then? Or do you have to use addslashes for the db? I have found a few things that don't work well with ' in names on my board. Is there a global fix for that? Just curious more than anything. :)

Xenon 12-07-2002 08:54 PM

there are differences

specialcharacters changes the string and converts " ' < > and other into html code &lt; and something like that. they show up on the screen equal, but are different strings ;)

addslashes just adds / before ' and " so they could be used inside a string for inserting into db for example

hope it clarifies it :)
it's hard to explain even in my nature language, and harder in english for me ;)

hope it clarifiys

Boofo 12-07-2002 09:04 PM

So would that be why I get errors when run Counter Updates with Boofo's Babe as the last poster sometimes? I see what you are saying though. Thank you for it explaining it a little better to me. :)

Xenon 12-08-2002 01:08 PM

hmm, normally it should work, when updating counters....
i've looked into the code, and can't see something wrong..

Boofo 12-08-2002 01:32 PM

When I had Scott's last title on forumhome installed, it always snagged on that name and gave me a db error. I don't have the hack installed now. I haven't tried the counters since the new install so I may have spoken ahead of myself. Sorry about that. :)


All times are GMT. The time now is 08:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01170 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete