Jump to content
Killersites Forums

KJ

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

0 Neutral

About KJ

  • Rank
    New member
  1. I've spent a few week renewing my PHP for a form I use on my son's Web site. I'm pleased to say the form functions fine in every way, but I would prefer that the 'Accept privacy policy' checkbox (at the foot of the form), validates only after all the other validation has passed. Currently if any mistakes are made by the user when completing the form, the 'privacy' checkbox error tiles beneath any other errors, which is to be expected with the current script. I've been trying to figure out a function which will allow all the form fields to validate and only then would the 'privacy' field valida
  2. THANK YOU!!!! Andrea I'll get on to it asap. I do this purely out of interest in the Web and for fun, not financial gain, any help I receive along the way is VERY much appreciated. Kindest regards, Kev
  3. I've put a JavaScript Swap Image gallery on my Web site Here, to show pictures of my motorcycle, which I'm selling. My initial testing was successful and it appeared to work fine in all major browsers, however I noticed whilst using a different machine that it is not rendering correctly in all browsers all of the time, differing versions seem to throw it. The gallery is simple enough, one large image of 772px x 579px and 3 rows of 8 thumbnails at 93px x 70px, most browsers render the thumbs as designed with 4px borders, but some browsers or different versions of a browser seem to add to the s
  4. KJ

    Email validation

    Thank you monkeysaurus, another URL to add to my educational favourites.
  5. KJ

    Email validation

    Thanks for the response JFab, I'm going to stick with the PHP for now, but I'll certainly look into the Javascript aspect, I'm all for education and self advancement. Though it did take me a week to put together a Javascript picture gallery for a friends motorcycle website.
  6. KJ

    Email validation

    I tried Wickhams code, which would not work within my PHP file, but after some juggling I did get a successful operation together. Looks like this; if (!preg_match("/^([a-z0-9])+([a-z0-9\._%-]+)*@([a-z0-9_-])+([a-z0-9\._-]{2,6})$/i" , ($_POST['email']))) { exit ("<p>Sorry!! That is not a valid email address, please use another.</p>"); } I too was puzzled by the apparent double negative, so I dug out some old university papers, I never wrote a line of PHP at uni but we did cover it a little and I remembered I still had the papers. It appears that in this case, the forwar
  7. KJ

    Numerical validation

    In response to the question of why I added the || Eext:; to my code in the following string; if (preg_match('/[^][0-9|| Eext:;]/' , ($_POST['phone']))) {} I wanted to ensure that only numbers '0-9' OR '||' the letters ' Eext' could be input to the Telephone input box. The space was to allow breaks between numbers, the uppercase E was incase the user input Ext and I included ':;' incase the user input Ext: or ext; I probably made it too complicated and may take Falconcreative's advise and amend my error message to show a format preference. Or the advise to add another box for
  8. KJ

    Email validation

    Whilst recently amending our sites mail form PHP file, to replace the ‘ereg’ string associated to the ‘Telephone’ input box, with the ‘preg_match’ string, I noticed that our ‘Email’ input box also uses the ‘ereg’ string. Killersites member Wickham pointed out, whilst advising me on my Numerical validation topic, that the ‘ereg’ string was to be obsolete in future PHP versions so I thought I’d best have a go at replacing this string too. I’ve spent a good few hours trying to get a new string to work, sadly I have failed. Here’s the old ‘ereg’ string that has worked successfully for many y
  9. KJ

    Numerical validation

    ********************************* Following my most recent modification of the 'Telephone' code, I received complaints from our staff that they preferred to read phone numbers in the traditional format with breaks. We also received a couple of calls from potential clients that found they could not add extensions to their telephone number when using my mail form. So I modified the code as; if (preg_match('/[^][0-9|| Eext:;]/' , ($_POST['phone']))) { exit ("<p>Sorry!! Invalid telephone format, please use only numbers 0 to 9 inclusive.<br>Prefix extensions with
  10. KJ

    Numerical validation

    Thanks Wickham!!! I took on board your comments and modified my code to use the preg_match method as follows; if (preg_match('/[^][0-9]/' , ($_POST['phone']))) { exit ("<p>Sorry!! Invalid telephone format, please use only numbers 0 to 9 inclusive - no spaces.</p>"); } Worked a treat, I had to add the 'no spaces' as the code appears to require continuous numbers with no breaks. Is that how it worked when you tried it?
  11. KJ

    Numerical validation

    Thanks for the advise Wickham. I modified the suggested code to suit my structure, which works fine when only letters are input into the 'Telephone' input box, resulting in an error message. However if numbers and letters are input the mail form is passed. My code is as follows; if (!ereg("^[0-9]" , $_POST['phone'])) { exit("<p>Sorry!! Invalid telephone format, please use only numbers 0 to 9 inclusive.</p>"); }
  12. KJ

    Numerical validation

    I have a mail form up and running, but I cannot get my telephone input box to only allow numbers. It's probably an easy fix, so if anyone has ideas on how to set the input to numerical only I'd very much appreciate the help. Thanx!!!!
  13. I?m doing a project for a mate who is aiming to sell motorcycle accessories online using only PayPal payments. At + half a century I?m not a young techie whiz like many of you and I?m not in the Web development profession, I?m working simply as a favour and to further enhance my skills (and free bike maintenance). I?m not new to PHP, as I have previously designed a PHP mailform, but I have a feeling this?ll be a bigger deal than that. I?ve briefly viewed several of the PayPal shopping cart videos, just to give me an idea of what to expect, this has thrown up a few questions which I h
×
×
  • Create New...