Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-25-2002, 08:28 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default What the hell is wrong with this?

Code:
		if ($submit=="true") {
			if (!title) {
				show_nopermission();
			}
			if (!code) {
				show_nopermission();
			}
			$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,ipaddress,site,siteid) VALUES (NULL,'$gid','".addslashes(htmlspecialchars($title))."','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','".addslashes($code)."','$ipaddress','2','$siteid')");
			header ("Location: content.php?action=code&do=display&gid=$gid");
			exit;
		}
It stops before it even hits the redirect. No errors, nothing. Just a blank page. What is wrong with it?
Reply With Quote
  #2  
Old 11-25-2002, 08:32 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'd say your variable $submit would be not "true"

where do you get this var?

also title and code should be introduced with an $
Reply With Quote
  #3  
Old 11-25-2002, 08:38 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
$siteheader
$sitemiddle1
Add Codes ($gamename)
$sitemiddle2

<form $enctype action="addcontent.php?action=code&subaction=main" name="vbform" method="post">
<input type="hidden" name="submit" value="true">
<input type="hidden" name="gid" value="$gid">

<center>Code Title:</center><br>
<input type="text" class="bginput" name="title" value="$title" size="40" maxlength="85" tabindex="1"><br><br>
<center>Code Content:</center><br>
<textarea name="code" rows="7" cols="$textareacols" wrap="virtual" tabindex="2">$message</textarea>
<br><br>	<input type="submit" class="bginput" name="submit" value="Submit Code" accesskey="s" tabindex="3">
</form>
$sitefooter
I am using that template to submit the variables in a form. Everything appears correctly.

And I missed the $ and didn't notice it due to lack of parse error.

EDIT:
Code:
		if (!$submit) {
			eval("dooutput(\"".gettemplate("site_v$v" . "_addcodes_main")."\");");
		}
That is when submit s not true.
Reply With Quote
  #4  
Old 11-25-2002, 08:40 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah i see your fault:

Code:
$siteheader
$sitemiddle1
Add Codes ($gamename)
$sitemiddle2

<form $enctype action="addcontent.php?action=code&subaction=main" name="vbform" method="post">
<input type="hidden" name="submit" value="true">
<input type="hidden" name="gid" value="$gid">

<center>Code Title:</center><br>
<input type="text" class="bginput" name="title" value="$title" size="40" maxlength="85" tabindex="1"><br><br>
<center>Code Content:</center><br>
<textarea name="code" rows="7" cols="$textareacols" wrap="virtual" tabindex="2">$message</textarea>
<br><br><input type="submit" class="bginput" name="submit" value="Submit Code" accesskey="s" tabindex="3">
</form>
$sitefooter
as you can see you have two variablenames called submit, and the last one counts i think, so your true will always be overwritten
Reply With Quote
  #5  
Old 11-25-2002, 08:42 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And this is exactly why I hate HTML
Reply With Quote
  #6  
Old 11-25-2002, 08:43 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Changed that variable to send, modified the file, BAM! It works. Thank you, Xenon!
Reply With Quote
  #7  
Old 11-25-2002, 08:44 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


you're welcome
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:34 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04070 seconds
  • Memory Usage 2,225KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete