vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Ran into a bit of a problem (https://vborg.vbsupport.ru/showthread.php?t=105293)

Reeve of shinra 01-14-2006 01:20 PM

Ran into a bit of a problem
 
I'm updating a small custom hack from 3.0 to 3.5 and I seem to be having some problems with a form I'm inserting into the postbit template.

When I hit submit, the value entered into the text box should be updating two fields in the db -- the problem is its not.

HTML Code:

<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
<div>
<form action="./modcp/gilupdate.php" method="post">
<input type="hidden" name="action" value="private204">
<input type="hidden" name="postid" value="$post[postid]">
<input type="hidden" name="userid" value="$post[userid]">
<input type="text" name="amount" size="3">&nbsp;
<input type="image" src="images/coin.gif" border="0" name="submit" alt="Give Gil" onClick="javascript:alert('Gil Paid!');">
</form>
<br />
<br />
               
</if>

I tried using the following script to see it that was the problem but it seems to work fine when I call it directly. Its only when I try to call it from the postbit that there seems to be an issue

PHP Code:


// ##### Set us up an enviroment #####
error_reporting(E_ALL & ~E_NOTICE);
require_once(
'./global.php');


// ##### Lets set up some user defined variables #####
$fieldx="field5";
$postx="gilpaid"

//### Hard Constants for Testing #####
$userid="7";
$postid="88";
$gilstr="93";

//##### Start Doing Stuff ##### 
//if ($_POST['action']=="private204") {

$vbulletin->db->query_write("UPDATE userfield SET $fieldx  = '$gilstr' WHERE userid = '$userid'");
$vbulletin->db->query_write("UPDATE post      SET $postx = '$gilstr' WHERE postid = '$postid'");

//}

?> 

Any thoughts about where I'm going wrong? I'm sure it must be something simple.

Bumping this with a pretty please!

Reeve of shinra 01-16-2006 07:39 PM

/me pleads for help lol

Ranma2k 01-16-2006 09:55 PM

Quote:

Originally Posted by Reeve of shinra
I'm updating a small custom hack from 3.0 to 3.5 and I seem to be having some problems with a form I'm inserting into the postbit template.

When I hit submit, the value entered into the text box should be updating two fields in the db -- the problem is its not.

HTML Code:

<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
<div>
<form action="./modcp/gilupdate.php" method="post">
<input type="hidden" name="action" value="private204">
<input type="hidden" name="postid" value="$post[postid]">
<input type="hidden" name="userid" value="$post[userid]">
<input type="text" name="amount" size="3">&nbsp;
<input type="image" src="images/coin.gif" border="0" name="submit" alt="Give Gil" onClick="javascript:alert('Gil Paid!');">
</form>
<br />
<br />
               
</if>

I tried using the following script to see it that was the problem but it seems to work fine when I call it directly. Its only when I try to call it from the postbit that there seems to be an issue

PHP Code:


// ##### Set us up an enviroment #####
error_reporting(E_ALL & ~E_NOTICE);
require_once(
'./global.php');


// ##### Lets set up some user defined variables #####
$fieldx="field5";
$postx="gilpaid"

//### Hard Constants for Testing #####
$userid="7";
$postid="88";
$gilstr="93";

//##### Start Doing Stuff ##### 
//if ($_POST['action']=="private204") {

$vbulletin->db->query_write("UPDATE userfield SET $fieldx  = '$gilstr' WHERE userid = '$userid'");
$vbulletin->db->query_write("UPDATE post      SET $postx = '$gilstr' WHERE postid = '$postid'");

//}

?> 

Any thoughts about where I'm going wrong? I'm sure it must be something simple.

Bumping this with a pretty please!

well i don't understand what is your problem
but passing vraiables in to a script from a form you have to use the clean class

Please read about here :
https://vborg.vbsupport.ru/showthread.php?t=98047

Hope it helps you


All times are GMT. The time now is 07:05 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.01056 seconds
  • Memory Usage 1,742KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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