This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

$cmtx_set_name_value not working
#1

Hello,

I'm trying to pass on usernames like this:

PHP Code:
<?php
$cmtx_set_name_value
= $username;
$cmtx_identifier = $id;
$cmtx_reference = $map;
$cmtx_path = 'comments/';
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . 'includes/commentics.php'; //no need to edit this line
?>

The variable $username displays the right thing when echo'd right above $cmtx_set_name_value.

Also, I set 'Name' to 'Disabled' in Forms -> States, but the Name field is still showing up (and working). Hiding also doesn't work.
If I type in a username it's using that, instead of my variable.

Why isn't this working?

Thanks,

Tom
Reply
#2

Seems it's not supporting all usernames.

The username I'm testing with is something like "K*RoCk-Star".

How can I fix the script to allow such usernames?
Reply
#3

Fixed it myself.

I disabled the preg_matches that were scanning the usernames. Seems to be working fine.
It seems the preg_matches filtered a dash, but since I don't know regex I just disabled it completely.
Reply
#4

Hi,

The dash is a valid character. It was the * (asterisk) which was preventing the script from accepting the name as a value. If an invalid name is supplied then the script won't disable or hide the name field because the user won't have any way to fix the invalid characters so the script just ignores it. Anyway I'm glad you managed to get it fixed.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by mtnlvy
06-Jan-2019, 06:29 PM
Last Post by T04
02-Jul-2017, 09:49 PM
Last Post by Steven
25-Apr-2015, 12:01 PM
Last Post by Jim777
20-Dec-2012, 07:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)