Jump to content

Timlab55

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Timlab55

  1. I'm sorry I started a war out there. Please forgive me. I ended up using Notepad ++. I've tried Visual Studio Code, I like it, but couldn't get it to do what I wanted. I want to write code and immediately see the results in a browsers. I also have XXAMP installed as well. But speaking of coding and this and that, I have a problem with something. What I would like is for a user to input 21 chars. ###-########-######-### However, this is what I have so far: PHP Part: if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["TicketNumber"])) { $TicketNumberErr = "21 Numbers is required "; }else{ $TicketNumber = test_input($_POST["TicketNumber"]); // check if name only contains letters and whitespace if(preg_match('/^\d{21}$/',$TicketNumber)){ echo "A match was found."; } else { $TicketNumberErr = "21 Numbers is required and do NOT include the hypen"; $TicketNumber=""; } } } HTML Part: Ticket Number: <input type="text" name="TicketNumber" size ="20" maxlength="21" value="<?php echo $TicketNumber ;?>"> <span class="error">* <?php echo $TicketNumberErr;?></span> <br><br> Test_Input Part: function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } The program does exactly what I want, however, it's rejecting the "-" or not counting them towards the 21. Can someone show me how to do this please? Thanks Dan
  2. I haven't seen this asked, but about 15 years ago when I did some PHP stuff, there was one editor I used all the time. Since then, I haven't touch the stuff and lost the editor that I truly loved. Now days, I'm sure things have changed (which I can see it has), therefore, I'm here to asked this question. I'm looking for a cheap if not free PHP editor. One that shows alot of mistakes in my coding at first. One that is easy to install and once I get something down, I would like to run it to see how it looks inside my browser. If someone has any suggestions, please leave me a reply. Thanks
  3. Hello everyone, I'm very new to this site. I'm here to learn how to code in PHP as I once did. I'm very raw at tho, and I'm looking to start back up in it again. So again, hello everyone and remember I'm new. So any dummy questions I made ask, please bear with me. I would like to start my own web site for my own purpose. Something very small and for my needs. And to top it all off, I'm going to run it on a Raspberry Pi from my home. This is should be a fun trip. Thanks Sincerely Dan
×
×
  • 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.