Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PHP form Processor HELP Details »»
PHP form Processor HELP
Version: , by BigJohnson BigJohnson is offline
Developer Last Online: Jun 2004 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-24-2002 Last Update: Never Installs: 0
 
No support by the author.

I am creating this form processor and integrating it with my vbulletin.

PHP Code:
<html>
<head></head>
<body>
<?
/*Script developed by Nadine Gaine.
You can freely use, modify and distribute for NON-COMMERCIAL purposes only
If you decide to use it, giving me the credit would be appreciated.*/

$MailTo = "nemesis1386@new-dimensionz.com"; //recipient of the form results
$MailSubject = "TESTING THIS Out"; //text in the Subject field of the mail
$MailHeader = "From: [FSU] Clan"; //text in the From field of the mail

/* Following routines put values entered in the form fields into variables and then put the results in the global variable MailBody which will be the Body part of the message */

$Envoi = 1;   //give value 1 to the variable $Envoi

if ($champ1 == ""){ //name of field 1
     echo("<font face=verdana size=2>You forgot to complete field 1.</font><br>"); //message to be displayed if the field is left empty
     $Envoi = 0;  //if field 1 is empty, variable $Envoi takes value 0
}
else {
     $MailBody = "Question 1 : $champ1\n"; //if field 1 has been completed, value is inserted in variable MailBody
}
if ($champ2 == ""){
     echo("<font face=verdana size=2>You forgot to complete field 2.</font><br>");
     $Envoi = 1;
     $MailBody .= "Question 2 : $champ2\n";
}
if ($champ3 == ""){
     echo("<font face=verdana size=2>You forgot to complete field 3</font><br>");
     $Envoi = 0;
}
else {
     $MailBody .= "Question 3 : $champ3\n";
}
if ($champ4 == ""){
     echo("<font face=verdana size=2>You forgot to complete field 4</font><br>");
     $Envoi = 0;
}
else {
     $MailBody .= "Question 4 : $champ4\n";
}
if ($champ5 == "0"){
     echo("<font face=verdana size=2>You forgot to choose a value.</font><br>");
     $Envoi = 0;
}
else {
     $MailBody .= "Question 5 : $champ5\n";
}
if ($champ6 == ""){
     echo("<font face=verdana size=2>You forgot to complete field 6.</font><br>");
     $Envoi = 0;
}
else {
     $MailBody .= "Question 6 : $champ6\n";
}
if ($champ7 == ""){
     echo("<font face=verdana size=2>You forgot to specify your preferences to question 7.</font><br>");
     $Envoi = 0;
}
else {
     $MailBody .= "Question 7 : $champ7\n";
}

//Routine for checkboxes

     $MailBody .="Question 8 : ";

$items = 3;  //initiate possible # of items

for ($i = 1; $i <= $items; $i++) {  //loop on # of items

     $MailBody .= "$champ8[$i], ";  //put results in variable MailBody
}

//Routine to send message

if ($Envoi == 1) {  //Check that variable $Envoi has value 1
mail($MailTo, $MailSubject, $MailBody, $MailHeader);  //message send
echo("<p><font face=verdana size=2>Your message has been sent.<br>Thank you for your comments.</font>"); //Confirmation message.
}
?>
</body>
</html>
The code at the very end
PHP Code:
echo("<p><font face=verdana size=2>Your message has been sent.<br>Thank you for your comments.</font>"); //Confirmation message. 
When u fill out the form and u click send you get the message in the echo tags.

I don't want that. I want it when u press send it redirects you to another html page that i have which will then show the message that the form was sent.

I tried using

PHP Code:
header("Location: [url]http://www.php.net[/url]"); //Confirmation message. 
but does no work. All it says

Cannot add header information - headers already sent by (output started at

Please help me out thanks.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-24-2002, 10:00 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

take out these line:
Code:
<html>
<head></head>
<body>
there should not be any char before the <? tag then the header() function should work
Reply With Quote
  #3  
Old 12-27-2002, 02:07 PM
DrkFusion's Avatar
DrkFusion DrkFusion is offline
 
Join Date: Nov 2001
Posts: 1,926
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was wondering can
header() redirect, also send variables, for instance on one page, after I fill out a forum I click submit, then the page I go to after I press submit, can I have a redirect, and the I need the variables from the form to get passed, now I also do not want it to show up in the url for ex: index2.php?name=Stefan%20Kaeser&age=991

Would you know, please and thank you.
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 11:33 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.04791 seconds
  • Memory Usage 2,219KB
  • Queries Executed 16 (?)
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)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)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