Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

RobDgital's Achievements


Member (2/5)



  1. Many thanks Kicken! Your explanation makes a ton of sense with the anser as well. I really appreciate this
  2. Hi all. After being away from coding and trying this for a while I have been asked to assist someone with something and I am not winning.....or understanding how to check the form validation coming though. The 'friend/client' needs to check that the form field filled in begins with 'DT' (either upper case or lower case) can have a space(or not) then a series of 7 numbers. For example 'DT 1234567' or 'dt1234567' I am really not understanding how to do this. I have started with some sample code /** * Validate UM DT Number field for registration dt_number2 * @param string $key * @param attay $array * @param array $args */ function um_custom_validate_dt_number2( $key, $array, $args ) { if ( isset( $args[$key] ) && !preg_match('/^[6-9]\d{9}$/', $args[$key]) ) { UM()->form()->add_error( $key, __( 'Please enter a valid DT Number.', 'ultimate-member' ) ); } } add_action( 'um_custom_field_validation_dt_number2', 'um_custom_validate_dt_number2', 30, 3 ); but for the life of me, everything I have tried on sites like http://www.santic.org/preg_match/ just dont work, I get errors all the time. The best I can do is check that there is a DT in the string! /(TD)\w*/i checked against my string TD 1234567, 1236547 TD, 123DT4567 gives me 2 results, but as soon as I try check for numbers etc /(TD)+[0-9]\d{7}\w*/i I am failing. Please someone guide me!
  3. Appreciate the pointer on prepared statements, used, and had success!
  4. Thanks Guru The dumping of the is only for when in dev stages, if i put it live, i delete this
  5. Thank you for you answer Master Coder. If I hard code the variable in it still gives me errors, so I am baffled, there is a parameter value
  6. Hi all. I am really battling with stupid things, and I can not see my errors. I am trying to display records from my db, but to no avail. Please can someone see my error... My conn code is as follows: <?php $proId = $_GET['profileId']; $postId = $_POST['postedId']; $servername = "localhost"; $username = "findo_aniuser"; $password = "111lmx333AO!"; $dbname = "findo_animals"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT * FROM codeinfo WHERE uniCode='".$proId."' OR uniCode='".$postId."'"; $result = $conn->query($sql); //echo $sql; ?> and in my page, all I am trying to do is show a record, but I am getting no results. I have checked my query on phpmysql and it is returning a recordset!? Trying to display my result on the page with the following. Again, your help is much appreciated <?php echo $row["uniCode"]; ?>
  7. Thanks a ton mac_gyver Must have pondered it for 40 minutes. Stupid mistake
  8. Please could someone PLEASE tell me why I am not getting this $_POST[] variable from this form <form style="padding-top:30px;" action="petdetails.php" method="post" name="finder"> <fieldset> <div class="form-group"> <label for="postedId">QRCode</label> <input type="text" class="form-control" id="postedId" placeholder="QR Code" /> </div> <button type="submit" class="btn btn-info">Submit Code</button> </fieldset> </form> I am trying to pick it up on the relevant page with this $bobby = $_POST['postedId']; echo "What the actual f bobby: ".$bobby; Excuse the 'f' but I am a little frustrated. lol
  9. I appreciate your help GURU! Looking into it now. Much appreciated
  10. Please can someone guide me, I can not find an answer to my dilemma. I have a client who has created QR codes in the format www.myurl.com/12345 There are 100 codes created like this. They want each to point to a profile. IF this had been done in this format www.myurl.com/profile.php?no=12345 I would have no issue, but....unfortunately...I am stumped on how to do this with php. Please any help or guidance will be appreciated
  11. Hi I have a page that the user selects a category and I have the page sending a variable to a page. However, I want the user to be able to select multiple options and therefore need the page doing the query to build an array and change the search results accordingly! Please can someonehelp me with what I have as I am jsut NOT getting my head around this! Here is the 'form' info <input name="jqdemo" value="6" type="checkbox" id="party"/> <label for="party"></label> <a class="checkbox-select" href="# id="6" onclick="showUser(this.id)""><img src="Assets/images/blank.png" alt="" width="120" height="180" /></a> <a class="checkbox-deselect" href="#" id="0" onclick="showUser(this.id)"><img src="Assets/images/blank.png" alt="" width="120" height="180" /></a> Then this is the page that is doing the query <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'root', ''); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db_pyf", $con); //$sql="SELECT * FROM tbl_product WHERE cat_id IN '".$q."'"; $sql="SELECT * FROM tbl_product WHERE cat_id IN (3,1,2)"; $result = mysql_query($sql); echo "<table border='1'> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> <th>Hometown</th> <th>Job</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['prod_name'] . "</td>"; echo "<td>" . $row['prod_desc1'] . "</td>"; echo "<td>" . $row['member_id'] . "</td>"; echo "<td>" . $row['cat_id'] . "</td>"; echo "<td>" . $row['cat_id'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> But, as I have said, I want the user to be able to select multiple options and want the search to adjust accordingly!
  • 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.