Results 1 to 2 of 2

Thread: script help

  1. #1

    Thread Starter
    Hyperactive Member GingerNut's Avatar
    Join Date
    May 2002
    Location
    Are those my feet?
    Posts
    372

    script help

    Hi,

    I have this as part of a php script:

    PHP Code:
    function make_reservation_validation() // the function makes validation for the reservation.php file
    {
        global 
    $name_title$name$address$city$country$zip$home_phone$work_phone$email$contact_method$contact_method2$contact_method3$movies$number_of_tickets$seating_type$main_message$tickets$credit_card_payment;
        global 
    $name_problem$address_problem$city_problem$country_problem$home_phone_problem$work_phone_problem$email_problem$tickets_problem;
        
        
    $error=0//init
        
    if (input_verification($name_title,"^[[:alpha:][:punct:]]+$")) {$error=1;}
        if (
    input_verification($name,"^[[:alnum:][:space:][:punct:]]+$")) {$error=1$name_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($address,"^[[:alnum:][:space:][:punct:]]+$")) {$error=1$address_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($city,"^[[:alnum:][:space:][:punct:]]+$")) {$error=1$city_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($country,"^[[:alnum:][:space:][:punct:]]+$")) {$error=1$country_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($zip,"^[[:digit:][:alnum:][:space:][:punct:]]+$")) {$error=1$zip_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($home_phone,"^[[:digit:][:space:][:punct:]]+$")) {$error=1$home_phone_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($work_phone,"^[[:digit:][:space:][:punct:]]+$")) {$error=1$work_phone_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($email,"^.+@.+\\..+$")) {$error=1$email_problem="<font color=\"red\"><B> * </B></font>";}
        if (isset(
    $contact_method)==and $contact_method<>"") {if ($contact_method<>"Home") {$error=1; }}
        if (isset(
    $contact_method2)==and $contact_method2<>"") {if ($contact_method2<>"Work") {$error=1;}}
        if (isset(
    $contact_method3)==and $contact_method3<>"") {if ($contact_method3<>"Email") {$error=1;}}
        if (
    input_verification($movies,"^[[:alnum:][:space:][:punct:]]+$")) {$error=1;}
        if (
    input_verification($number_of_tickets,"^[[:digit:]]+$")) {$error=1;  $tickets_problem="<font color=\"red\"><B> * </B></font>";}
        if (
    input_verification($seating_type,"^[[:alnum:][:space:][:punct:]]+$")) {$error=1;  $tickets_problem="<font color=\"red\"><B> * </B></font>";}
        if (isset(
    $tickets)==and $tickets<>"") {if ($tickets<>"Yes") {$error=1;}}
        if (isset(
    $credit_card_payment)==and $credit_card_payment<>"") {if ($credit_card_payment<>"Yes") {$error=1;}}

    return 
    $error;

    At the moment the postcode $zip is a required field, but I don't want it as required anymore. Can I just remove the whole line or will that mess things up?
    How is it one careless match can start a forest fire, but it takes a whole box to start a campfire?

    Global Freelancers | Web Traffic Analyser

  2. #2

    Thread Starter
    Hyperactive Member GingerNut's Avatar
    Join Date
    May 2002
    Location
    Are those my feet?
    Posts
    372
    Nevermind, got it.
    How is it one careless match can start a forest fire, but it takes a whole box to start a campfire?

    Global Freelancers | Web Traffic Analyser

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width