Closed Thread
Results 1 to 5 of 5

Thread: PHP Help

  1. #1
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    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>

  2. #2
    natsuki's Avatar
    natsuki is offline x10 Sophmore natsuki is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    112

    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 12:59 PM.

  3. #3
    kbjradmin's Avatar
    kbjradmin is offline x10 Elder kbjradmin is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    Washington State, USA
    Posts
    512

    Re: PHP Help

    thank you, natsuki, that was the problem.

  4. #4
    natsuki's Avatar
    natsuki is offline x10 Sophmore natsuki is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    112

    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 01:19 PM.

  5. #5
    sunils's Avatar
    sunils is offline x10 Spammer sunils is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,264

    Re: PHP Help

    Since the issue is solved, i am closing this thread.
    The author can reopen the thread anytime for further help.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

Closed Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. php errors galore
    By DMG Online in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 05-17-2008, 06:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers