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 01-18-2004, 11:10 PM
VodkaFish VodkaFish is offline
 
Join Date: Oct 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default form submission help

I've got a page outside of vb that works with some of the vb elements (mainly, it's a members-only page).

I've got a lot of it working; the login, the correct info displayed, and correct form stuff setup.

I've got the submit that I want to do with the form, but I'm not sure how to go about it. Here's what I mean: I've got the insert statement I want, and an if/else statement for a couple of the fields of the form - but I'm not quite sure how to do it within the same page and the display a simple "thank you" (like after submitting a post) and then kick you back out to the page that originally led you to the form in the first place.

Does that make sense? Hope so Let me know if I can clear anything up, and I hope someone can point me in the right direction. My php is iffy, but I'm getting by so far.
Reply With Quote
  #2  
Old 01-19-2004, 11:08 AM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the basic code to go on: In the form HTML make the file the form submits to the same as the file thats displaying the form and make sure this hidden input field is added:

HTML Code:
<input type="hidden" name="action" value="update">
Then in your PHP, near the top before you do the stuff to display the form:

PHP Code:
if ($_POST['action'] == 'update') {
    
// your code here to process the form data, which is in the $_POST array
    // your query

    // lets redirect the user -- make sure your change the url
    
$url "URL_TO_REDIRECT_TO";
    
// replace PHRASE_NAME with a title for the phrase you want to show, ie the thanks message and add it to the Front-End Redircet Message group
    
eval(print_standard_redirect('redirect_PHRASE_NAME'));

Reply With Quote
  #3  
Old 01-19-2004, 02:59 PM
VodkaFish VodkaFish is offline
 
Join Date: Oct 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$url = $_SERVER['HTTP_REFERRER'];

will that work if I just want to dish them back to the page that sent them?
Reply With Quote
  #4  
Old 01-19-2004, 03:01 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep
Reply With Quote
  #5  
Old 01-20-2004, 05:27 AM
VodkaFish VodkaFish is offline
 
Join Date: Oct 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by VodkaFish
$url = $_SERVER['HTTP_REFERRER'];

will that work if I just want to dish them back to the page that sent them?
I wound up having to use:
$_SERVER['HTTP_REFERER']
as: $_SERVER['HTTP_REFERRER'] wouldn't work

Is it spelt differently in UK-English or something? Any spell check/dictionary I know of spells it referrer (as I was taught and even as programs like DW output it). Luckily, I found out the quirk through Google.
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 07:21 PM.


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.04186 seconds
  • Memory Usage 2,200KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_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