Jump to content

Captain Salad

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Captain Salad's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I changed the code to what you suggested but I get an "error missed a field" message for no matter what I type in the fields, have I missed something, see edited code below. god bless <? function checkLength($string, $min, $max) { $length = strlen(trim($string)); if ( ($length < $min) || ($length > $max) ) { return FALSE; } else { return TRUE; } } $transfer = $_REQUEST['transfer'] ; $email = $_REQUEST['email'] ; $existingnumber = $_REQUEST['existingnumber'] ; $pacnumber = $_REQUEST['pacnumber'] ; $title = $_REQUEST['title'] ; $firstname = $_REQUEST['firstname'] ; $middleinitial = $_REQUEST['middleinitial'] ; $lastname = $_REQUEST['lastname'] ; $dob = $_REQUEST['dob'] ; $currentaddress = $_REQUEST['currentaddress'] ; $town = $_REQUEST['town'] ; $postcode = $_REQUEST['postcode'] ; $residentialstatus = $_REQUEST['residentialstatus'] ; $yearsataddress = $_REQUEST['yearsataddress'] ; $monthsataddress = $_REQUEST['monthsataddress'] ; $previousaddress = $_REQUEST['previousaddress'] ; $previoustowm = $_REQUEST['previoustown'] ; $previouspostcode = $_REQUEST['previouspostcode'] ; $hometel = $_REQUEST['hometel'] ; $daytimetel = $_REQUEST['daytimetel'] ; $bankaccountyears = $_REQUEST['bankaccountyears'] ; $bankaccountmonths = $_REQUEST['bankaccountmonths'] ; $occupationalstatus = $_REQUEST['occupationalstatus'] ; $creditcard = isset($_POST['creditcard']) ? $_POST['creditcard'] : 0; $yearsinjob = $_REQUEST['yearsinjob'] ; $monthssinjob = $_REQUEST['monthsinjob'] ; $accountholder = $_REQUEST['accountholder'] ; $accountnumber = $_REQUEST['accountnumber'] ; $branchsortcode = $_REQUEST['branchsortcode'] ; $printnamebank = $_REQUEST['printnamebank'] ; $datebank = $_REQUEST['datebank'] ; $termsconditions = $_REQUEST['termsconditions'] ; $printnameterms = $_REQUEST['printnameterms'] ; $printdateterms = $_REQUEST['printdateterms'] ; if (!isset($_REQUEST['email'])) { header( "Location: [a href=\"http://www.brittalk.com/brittalk/Templates/contactUs.htm"\" target=\"_blank\"]http://www.brittalk.com/brittalk/Templates...actUs.htm"[/a] ); } elseif (checkLength($email,1,50) || checkLength($transfer,1,50) || checkLength($title,1,50) || checkLength($firstname,1,50) || checkLength($lastname,1,50) || checkLength($dob,1,50) || checkLength($currentaddress,1,50) || checkLength($town,1,50) || checkLength($postcode,1,50) || checkLength($residentialstatus,1,50) || checkLength($yearsataddress,1,50) || checkLength($monthsataddress,1,50) || checkLength($hometel,1,50) || checkLength($daytimetel,1,50) || checkLength($bankaccountyears,1,50) || checkLength($bankaccountmonths,1,50) || checkLength($occupationalstatus,1,50) || checkLength($monthssinjob,1,50) || checkLength($yearsinjob,1,50) || checkLength($accountholder,1,50) || checkLength($accountnumber,1,50) || checkLength($branchsortcode,1,50) || checkLength($printnamebank,1,50) || checkLength($datebank,1,50) || checkLength($termsconditions,1,50) || checkLength($printnameterms,1,50) || checkLength($printdateterms,1,50)) {
  2. Hi, thanks for you help, sadly I think I am way over my head as I cant get it to work still and not sure wher I should add the code (as I said I am total noob) , is there any chance you could be so kind as to amend the below code so that the $yearsataddress field proceses 0 if entered? Sorry for all these pleas for help. God bless
  3. [!--quoteo(post=358904:date=Mar 27 2006, 09:42 AM:name=footballkid4)--][div class=\'quotetop\']QUOTE(footballkid4 @ Mar 27 2006, 09:42 AM) [snapback]358904[/snapback][/div][div class=\'quotemain\'][!--quotec--] You can use: [code]if ($_REQUEST['email'] == "") {      //not supplied }[/code] Or [code]if ( strlen( trim( $_REQUEST['email'] ) ) > 0 ) {     //supplied }[/code] [/quote] Hi, Thank you for trying to help me, so would this be correct? $yearsataddress = if ($_REQUEST['yearsataddress'] == "") { //not supplied } $monthsataddress = $_REQUEST['monthsataddress'] ;
  4. [!--quoteo(post=358901:date=Mar 27 2006, 09:35 AM:name=annihilate)--][div class=\'quotetop\']QUOTE(annihilate @ Mar 27 2006, 09:35 AM) [snapback]358901[/snapback][/div][div class=\'quotemain\'][!--quotec--] [a href=\"http://uk2.php.net/empty\" target=\"_blank\"]http://uk2.php.net/empty[/a] The string '0' is considered empty, so will have to use a different method of validation if you want to allow zeros. [/quote] Thanks for your input, I was afraid of that. Any help with the code I would need to add in order to allow 0? I am a total newb to PHP and coding of any sort so any further help will be greatly appreciated. God bless
  5. Sorry to bug this forum with yet more of my woes but for some reason when I test my form, if I add a 0 (just a zero, nothing more) to a required field it doesnt pick it up and states that I missed a required field. Any help on this one? Thanks you for any time and help, God bless
  6. Have now, again works like a charm ;) thanks very much. Just so I know how would the same work for checkboxs? Put in a hidden checkbox perhaps?
  7. Wow, works like a charm, thank you sincerely for you help and patience with me, it is very appreciated! Could I pick your knowledgeable brain on one more bug? Using my current script I want to make the $transfer radio buttons a require field, when I try this with the current code, when filling out the form, if I miss the $transfer radio buttons out the browser displays an error message. Any help on this other bug? Thank you again for your time and help!! God bless
  8. Hi, thank you very much for trying to help me, I edited the code for the check box but now get this message Parse error: parse error, unexpected '?', expecting ',' or ')' in W:\Webspace\resadmin\ajsimpson\simputers.co.uk\www\brittalk\Templates\Scripts\tmobilecontract.php on line 24 here is the script:, any ideas? <? $transfer = $_REQUEST['transfer'] ; $email = $_REQUEST['email'] ; $existingnumber = $_REQUEST['existingnumber'] ; $pacnumber = $_REQUEST['pacnumber'] ; $title = $_REQUEST['title'] ; $firstname = $_REQUEST['firstname'] ; $middleinitial = $_REQUEST['middleinitial'] ; $lastname = $_REQUEST['lastname'] ; $dob = $_REQUEST['dob'] ; $currentaddress = $_REQUEST['currentaddress'] ; $town = $_REQUEST['town'] ; $postcode = $_REQUEST['postcode'] ; $residentialstatus = $_REQUEST['residentialstatus'] ; $yearsataddress = $_REQUEST['yearsataddress'] ; $monthsataddress = $_REQUEST['monthsataddress'] ; $previousaddress = $_REQUEST['previousaddress'] ; $previoustowm = $_REQUEST['previoustown'] ; $previouspostcode = $_REQUEST['previouspostcode'] ; $hometel = $_REQUEST['hometel'] ; $daytimetel = $_REQUEST['daytimetel'] ; $bankaccountyears = $_REQUEST['bankaccountyears'] ; $bankaccountmonths = $_REQUEST['bankaccountmonths'] ; $creditcard = isset($_POST['creditcard'] ? $_POST['creditcard'] : 0; if (!isset($_REQUEST['email'])) { header( "Location: [a href=\"http://www.brittalk.com/brittalk/Templates/contactUs.htm"\" target=\"_blank\"]http://www.brittalk.com/brittalk/Templates...actUs.htm"[/a] ); } elseif (empty($email) || empty($transfer) || empty($title) || empty($firstname) || empty($middleinitial) || empty($lastname) || empty($dob) || empty($currentaddress) || empty($town) || empty($postcode) || empty($residentialstatus) || empty($yearsataddress) || empty($monthsataddress) || empty($hometel) || empty($daytimetel) || empty($bankaccountyears) || empty($bankaccountmonths)) { header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" ); header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); header( "Cache-Control: no-cache, must-revalidate" ); header( "Pragma: no-cache" ); ?> <html> <head><title>Error</title></head> <body> <h1>Error</h1> <p> Oops, it appears you forgot to enter some information into the required fields. The required fields are identified by a red star preceding them. Please press the BACK button on your browser and try again. </p> </body> </html> <? } else { mail( "bukem_1@tiscali.co.uk" , "Unlock Customer Phone.", "Transfer an existing mobile number from another network: $transfer Existing Number: $existingnumber Pac Number: $pacnumber Name: $title $firstname $middleinitial $lastname Date Of Birth: $dob Current Address: $currentaddress $town $postcode Residential Status: $residentialstatus Years At Current Address: $yearsataddress Months At Current Address: $monthsataddress Previous Address: $previousaddress $previoustown $previouspostcode Home Telephone Number: $hometel Day Time Telephone Number: $daytimetel Had Bank Account for: $bankaccountyears $bankaccountmonths Own A Credit Card?: $creditcard ", "From: $email"); header("Location: [a href=\"http://www.brittalk.com/brittalk/Templates/thankyou.htm");\" target=\"_blank\"]http://www.brittalk.com/brittalk/Templates...you.htm");[/a] } ?> thank you and god bless
  9. Hi, would it be possible for one of you geniuses to give me a little hand with this script, this is my fist PHP script and am really stuck on the radio and tick box parts, if I don’t click on the tick boxes or radio buttons the script goes no where, I would like my user to have the option of NOT clicking the radio or check box if the so decide and the form to go through fine, could anyone amend the below script so I can see where I was going wrong? Thank you for your time and god bless $creditcard is the one which uses a tick box and $transfer is the one which uses radio button, the rest are just normal form fields <? $transfer = $_REQUEST['transfer'] ; $email = $_REQUEST['email'] ; $existingnumber = $_REQUEST['existingnumber'] ; $pacnumber = $_REQUEST['pacnumber'] ; $title = $_REQUEST['title'] ; $firstname = $_REQUEST['firstname'] ; $middleinitial = $_REQUEST['middleinitial'] ; $lastname = $_REQUEST['lastname'] ; $dob = $_REQUEST['dob'] ; $currentaddress = $_REQUEST['currentaddress'] ; $town = $_REQUEST['town'] ; $postcode = $_REQUEST['postcode'] ; $residentialstatus = $_REQUEST['residentialstatus'] ; $yearsataddress = $_REQUEST['yearsataddress'] ; $monthsataddress = $_REQUEST['monthsataddress'] ; $previousaddress = $_REQUEST['previousaddress'] ; $previoustowm = $_REQUEST['previoustown'] ; $previouspostcode = $_REQUEST['previouspostcode'] ; $hometel = $_REQUEST['hometel'] ; $daytimetel = $_REQUEST['daytimetel'] ; $bankaccountyears = $_REQUEST['bankaccountyears'] ; $bankaccountmonths = $_REQUEST['bankaccountmonths'] ; $creditcard = $_POST ['creditcard'] ; if (!isset($_REQUEST['email'])) { header( "Location: [a href=\"http://www.brittalk.com/brittalk/Templates/contactUs.htm"\" target=\"_blank\"]http://www.brittalk.com/brittalk/Templates...actUs.htm"[/a] ); } elseif (empty($email) || empty($transfer) || empty($title) || empty($firstname) || empty($middleinitial) || empty($lastname) || empty($dob) || empty($currentaddress) || empty($town) || empty($postcode) || empty($residentialstatus) || empty($yearsataddress) || empty($monthsataddress) || empty($hometel) || empty($daytimetel) || empty($bankaccountyears) || empty($bankaccountmonths)) { header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" ); header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" ); header( "Cache-Control: no-cache, must-revalidate" ); header( "Pragma: no-cache" ); ?> <html> <head><title>Error</title></head> <body> <h1>Error</h1> <p> Oops, it appears you forgot to enter some information into the required fields. The required fields are identified by a red star preceding them. Please press the BACK button on your browser and try again. </p> </body> </html> <? } else { mail( "bukem_1@tiscali.co.uk" , "Unlock Customer Phone.", "Transfer an existing mobile number from another network: $transfer Existing Number: $existingnumber Pac Number: $pacnumber Name: $title $firstname $middleinitial $lastname Date Of Birth: $dob Current Address: $currentaddress $town $postcode Residential Status: $residentialstatus Years At Current Address: $yearsataddress Months At Current Address: $monthsataddress Previous Address: $previousaddress $previoustown $previouspostcode Home Telephone Number: $hometel Day Time Telephone Number: $daytimetel Had Bank Account for: $bankaccountyears $bankaccountmonths Own A Credit Card?: $creditcard ", "From: $email"); header("Location: [a href=\"http://www.mysite.com");\" target=\"_blank\"]http://www.mysite.com");[/a] } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.