x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

Closed Thread
 
LinkBack Thread Tools Display Modes
x10 Lieutenant

kbjradmin's Avatar

Join Date: Feb 2008
Posts: 314
Credits: 4,587
kbjradmin will become famous soon enough
Location: USA

 
09-30-2008, 01:09 PM
PHP Help

i am making a php page to make it easier to configure a contact form, but it doesn't want to work.

i've been looking at this code for a long time, and am not getting very far. please help.

http://kbjr.x10hosting.com/templates...e/info/contact

PHP Code:
<?php

$input_type 
= array();
$input_name = array();
$input_text = array();
$radio_text = array();
$radio_value = array();

#####################################################################################################################################
#####                                                 START EDITING HERE                                                        #####
#####################################################################################################################################


/*
THE FOLLOWING REFERS TO THE CONTACT INDEX PAGE.
EACH OF THESE ARE INPUT FORMS.
INPUT_NUM IS THE NUMBER OF INPUT FORMS USED.
INPUT_TYPE IS THE TYPE OF THE INPUT ( TEXT, MESSAGE, OR RADIO ).
INPUT_NAME IS THE NAME OF THE INPUT IN THE CODE, NOT THE DISPLAYED TEXT.
INPUT_TEXT IS THE TEXT DISPLAYED TO INFORM THE USER OF THE DATA REQUESTED.
FOR RADIO TYPES, YOU ALSO WILL BE REQUIRED TO ADD THE VARIABLES $radio_num[#], $radio_value[##] AND $radio_text[##] AS SHOWN BELOW AS EXAMPLE FOUR.
IN RADIO_VALUE AND RADIO_TEXT, THERE ARE TWO NUMBERS IN THE BRACKETS AS OPPOSED TO ONE.
THE FIRST IS THE NUMBER OF THAT INPUT, SAME AS THE OTHERS, AND THE OTHER IS THE NUMBER OF THE RADIO OPTION.
*/

$input_num 7;

// input one
$input_type[1] = "text";
$input_name[1] = "name";
$input_text[1] = "Name: ";

// input two
$input_type[2] = "text";
$input_name[2] = "email";
$input_text[2] = "Email: ";

// input three
$input_type[3] = "text";
$input_name[3] = "subject";
$input_text[3] = "Subject: ";

// input four
$input_type[4] = "radio";
$input_name[4] = "reason";
$input_text[4] = "Reason For Message: ";
$radio_num[4] = "3";
$radio_value[41] = "question";
$radio_text[41] = "Question";
$radio_value[42] = "comment";
$radio_text[42] = "Comment";
$radio_value[43] = "other";
$radio_text[43] = "Other";

// input five
$input_type[5] = "message";
$input_name[5] = "message";
$input_text[5] = "Message:\n";

// input six
$input_type[6] = "submit";
$input_text[6] = "Submit";

// input seven
$input_type[7] = "reset";
$input_text[7] = "Reset";


#####################################################################################################################################
#####                                                 STOP EDITING HERE                                                         #####
#####################################################################################################################################

// start contact code
$contact_code "<div id=\"contact\">\n<form action=\"send.php\" method=\"post\">\n";

// proccess contact data and append to contact code
$x 1;

while(
$x<=$input_num){

if(
$input_type[$x]="radio"){
$contact_store "<p class=\"input\">$input_text</p>";
$n 1;
while(
$n<=$radio_num[$x]){
$v $x.$n;
$contact_store $contact_store."\n<p class=\"radio\">$radio_text[$v] <input type=\"radio\" name=\"$input_name[$x]\" value=\"$radio_value[$v]\" /></p>";
$n++;
}
$contact_code $contact_code.$contact_store;
$x++;    
}

if(
$input_type[$x]="text"){
$contact_store "<p class=\"input\">$input_text[$x]<input type=\"text\" name=\"$input_name[$x]\" /></p>\n";
$contact_code $contact_code.$contact_store;
$x++;    
}

if(
$input_type[$x]="message"){
$contact_store "<p class=\"input\">$input_text[$x]<input type=\"text\" name=\"$input_name[$x]\" /></p>\n";
$contact_code $contact_code.$contact_store;
$x++;    
}

if(
$input_type[$x]="submit"){
$contact_store "<a href=\"submit();\" class=\"submit\">Submit</a>\n";
$contact_code $contact_code.$contact_store;
$x++;    
}

if(
$input_type[$x]="reset"){
$contact_store "<a href=\"reset();\" class=\"reset\">Reset</a>\n";
$contact_code $contact_code.$contact_store;
$x++;    
}

}

// end contact code
$contact_code $contact_code."</form></div>";

?>
</div>
__________________


kbjradmin is offlineReport Post
x10 Sophmore

natsuki's Avatar

Join Date: Sep 2008
Posts: 110
Credits: 1,305
natsuki will become famous soon enough
 
09-30-2008, 01:57 PM
Re: PHP Help

maybe you meant
PHP Code:
if($input_type[$x] == "radio"
instead of = which is an assignment operator... other than that can you post the error?

Last edited by natsuki; 09-30-2008 at 01:59 PM.
natsuki is offlineReport Post
x10 Lieutenant

kbjradmin's Avatar

Join Date: Feb 2008
Posts: 314
Credits: 4,587
kbjradmin will become famous soon enough
Location: USA

 
09-30-2008, 02:07 PM
Re: PHP Help

thank you, natsuki, that was the problem.
__________________


kbjradmin is offlineReport Post
x10 Sophmore

natsuki's Avatar

Join Date: Sep 2008
Posts: 110
Credits: 1,305
natsuki will become famous soon enough
 
09-30-2008, 02:18 PM
Re: PHP Help

nice to know it's solved^^
If you need some more help just feel free to ask.
__________________

Last edited by natsuki; 09-30-2008 at 02:19 PM.
natsuki is offlineReport Post
Account Manager

sunils's Avatar

Join Date: Jan 2008
Posts: 2,023
Credits: 30,523
sunils has a reputation beyond repute
Location: Chennai ,India

Send a message via AIM to sunils Send a message via Yahoo to sunils
 
10-01-2008, 07:43 AM
Re: PHP Help

Since the issue is solved, i am closing this thread.
The author can reopen the thread anytime for further help.
__________________
Sunil Sankar
-------------------------------------------------------------------------
Account Manager

sunils is offlineReport Post
Closed Thread

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
currently have an application pending php biomasti Free Hosting 1 09-03-2008 02:58 PM
php errors galore DMG Online Scripts & 3rd Party Apps 9 05-17-2008 07:23 AM
[PHP] Variables in PHP Bryon Tutorials 14 03-21-2008 03:41 AM
Ever Been Suspended For Using PHP? dragoneye_xp Off Topic 24 07-11-2006 02:05 PM


All times are GMT -5. The time now is 07:17 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Credit Card Debt Consolidation | Personal Loans | Debt Help | Remortgages | Web Advertising