vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Quering userprofile fields in a webform (https://vborg.vbsupport.ru/showthread.php?t=117072)

silverbanana 05-29-2006 10:41 PM

Quering userprofile fields in a webform
 
Hello,

I'm wondering if someone can help me.

I would like to query and validate the username and security number (which is a profile field) in a HTML web form (Click here to see the form.

Could anyone give me any help in this? I'd really appreciate it. Thanks! :)

Kirk Y 05-30-2006 09:22 PM

I believe you'd have to CHMOD the script (unless it's in your forum dir.) and then include global.php. Assuming your form is called "info", your Username field is named "user", and your Security Code field is named "sec_code", you could try this:

PHP Code:

$username =& $vbulletin->input->clean_gpc('p''user'TYPE_STR);
$sec_code =& $vbulletin->input->clean_gpc('p''sec_code'TYPE_STR);

if(isset(
$_POST[info])){
     if (!
$user $db->query_first("SELECT username FROM dbtable WHERE username = '" $db->escape_string($username) . "'))
    {
        echo "
User Not Found!";
    }

     if (!
$sec = $db->query_first("SELECT sec_code FROM dbtable WHERE sec_code '" . $db->escape_string($sec_code) . "'))
    {
        echo 
"Incorrect Security Code";
    }




All times are GMT. The time now is 09:37 PM.

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.00992 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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