Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bschm78

@bschm78
About
Posts
3
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Can someone help me spot check this form code?
    B bschm78

    Thanks Hockey! Yes, I noticed after posting my php4 function that my 'valids' were missing the $s. Also, the help on the concatenation helped a lot. This was throwing me off more than anything. Thanks again! The form (up to the rest of my commented-out code) works great! :) Ben

    Linux, Apache, MySQL, PHP help php html mysql com

  • Can someone help me spot check this form code?
    B bschm78

    That probably would help, eh? :). Here ya go.... Also, just to clarify my program, this is a t-shirt order form and the $paypal and $check variables ccorrespond to checkboxes asking if the user wants to pay by check or with paypal. <html> <head> <title>Validations functions</title> </head> <body> <?php // print "included ok"; function verifyAlphaNum($testString) { if (eregi ("^([[:alnum:]]|-|\.||')+$", $testString)) { return 1; } else { return 0; } } function verifyEmail($testString) { if (eregi ("^([[:alnum:]]|-|\.||')+@([[:alnum:]]|\.|- )+(\.)([a-z]{2, 4})$", $testString)) { return 1; } else { return 0; } } function verifyText($testString) { if (eregi("^([[:alnum:]]|-|\.||\n|\r|\?|\!|\"|\' ')+$", $testString)) { return 1; } else { return 0; } } function verifyPhone($testString) { if(eregi('^([[:digit:]]||-)+$', $testString)) { return 1; } else { return 0; } } ?> </body> </html>

    Linux, Apache, MySQL, PHP help php html mysql com

  • Can someone help me spot check this form code?
    B bschm78

    I am writing a simple form for a website I am developing and I keep getting parse errors, mostly dealing with quotes around HTML tags. Here is my code - any guidance would be appreciated. The errors I am getting are creeping up between the following 2 comment tags, to make it easier to identify: /////////////////////////////////////////////////////// //check for existence of missing fields/error messages /////////////////////////////////////////////////////// and /* commented this out for testing of first part of script ///////////////////////////// // WRITE DATA TO MYSQL table ///////////////////////////// Here's my code: <HTML> <HEAD> <TITLE>SHIRT SCRIPT</TITLE> </HEAD> <BODY> <?php include ("validation_functions.php4"); function shirtsSetup() { //////////////////////////////////////// //GET VALUES FROM SHIRT PORTION OF FORM //////////////////////////////////////// $name = ($_POST['name']); $address = ($_POST['address']); $city = ($_POST['city']); $state = ($_POST['state']); $zip = ($_POST['zip']); $email = ($_POST['email']); $phone = ($_POST['phone']); $quantity = ($_POST['quantity']); $size = ($_POST['size']); $color = ($_POST['color']); $price = 15; $shirtTotalPrice = $price * $quantity; $instructions = ($_POST['instructions']); $paypal = ($_POST['paypal']); $check = ($_POST['check']); $to = "myemail@yahoo.com"; $subject = "OMN T-Shirt order"; $message= "$name\n$address\n$city\n$state\n$zip\n$phone\n$email\n$phone\nquantity\n$size\n$color\n$instructions"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; ////////////////////////////// //CHECK FOR ERRONEOUS FIELDS. ////////////////////////////// $error_msg = array(); $valid = verifyAlphaNum($name); if(!valid) { $error_msg[] = "Name must be letters, spaces, dashes and ' only"; } $valid = verifyAlphaNum($address); if(!valid) { $error_msg[] = "Address must be letters, numbers, spaces, dashes and ' only"; } $valid = verifyAlphaNum($city); if(!valid) { $error_msg[] = "City must be letters, spaces, dashes and ' only"; } $valid = verifyAlphaNum($state); if(!valid) { $error_msg[] = "State must be two letters only"; } $valid = verifyAlphaNum($zip); if(!valid) { $error_msg[] = "Zip must contain five numbers only"; } $valid = verifyEmail($email); if(!valid) { $error_msg[] = "Email must be a valid format"; } /////////////////////////////////////////////////////// //

    Linux, Apache, MySQL, PHP help php html mysql com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups