vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   form submission help (https://vborg.vbsupport.ru/showthread.php?t=60426)

VodkaFish 01-18-2004 11:10 PM

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.

NTLDR 01-19-2004 11:08 AM

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'));



VodkaFish 01-19-2004 02:59 PM

$url = $_SERVER['HTTP_REFERRER'];

will that work if I just want to dish them back to the page that sent them?

NTLDR 01-19-2004 03:01 PM

Yep :)

VodkaFish 01-20-2004 05:27 AM

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.


All times are GMT. The time now is 11:13 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.02414 seconds
  • Memory Usage 1,723KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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