• Member Avatar for Josh Connerty
    Josh Connerty

    Began Watching How does Gutenberg render HTML with bindings?

    Hello All, I have a question regarding Gutenberg React. I'm familiar with React which is what leads me to not understanding how the process works. React can only render JSX …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How does Gutenberg render HTML with bindings?

    Thanks for the reply. I'm not actually looking to build gutenberg blocks. I'm trying to understand how from a React perspective how it actually functions. Sorry for the confusion. Josh
  • Member Avatar for Josh Connerty
    Josh Connerty

    Created How does Gutenberg render HTML with bindings?

    Hello All, I have a question regarding Gutenberg React. I'm familiar with React which is what leads me to not understanding how the process works. React can only render JSX …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Endorsed pzuurveen

  • Member Avatar for Josh Connerty
    Josh Connerty

    Endorsed Dani

  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    Glad to hear it :)
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    Form: <form id="myform" method="post" action=""> <input type="checkbox" class="ids" name="ids[]" value="1"> <input type="checkbox" class="ids" name="ids[]" value="2"> <input type="checkbox" class="ids" name="ids[]" value="3"> <input type="checkbox" class="ids" name="ids[]" value="4"> </form> <div id="response"></div> <script src="https://code.jquery.com/jquery-3.6.0.min.js" …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    I tested this while in a meeting so fingers crossed it works for you: <?php $ip_ranges = "63.119.179.0/24, 23.119.180.0/24,154.119.181.0/24,193.119.182.0/24,133.119.183.0/24"; function multiCidrToRange($cidrs) { $return_array = array(); $cidrs = explode(",",str_replace(" ","",$cidrs)); foreach($cidrs …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    Got meetings for the next couple of hours. I'll post something as soon as I get chance
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    OH I see. That won't work then. Let me look up the calculations for the range
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Searching the files in the folder and opening the related file.

    You could create a custom plugin for this. Would need to know more about where the files are hosted and where you retrieve the student number from.
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    So if you var_dump the text field and it's an empty array it implies it has nothing in the textfield. I need to see more of how it's implemented
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    What does `$pluginData` hold? if you pass a list of comma separated range values to the function it will return an array of ip addresses from all of the ranges
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    That's becuase the trigger is bound to the FORM element so when you use `$(this)` a little later on, you're refering to the form and not the checkbox. The form …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    I adapted you ajax method to this and it works: $.ajax({ url: "test.php", type: "post", data: $(this).serialize() + "&state=" + state }).done(function(data) { $('#response').html(data); });
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    `$state = (int)$_POST['state'];` Refers to a post variable that has not been passed
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    Did you put it outside of this logic? var_dump($_POST); // Here if (isset($_POST['ids'])) { $id_value = $_POST['ids']; $state = (int)$_POST['state']; foreach($id_value as $check) { $sql_check = "UPDATE toggle SET status= …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    Try var dumping the $_POST object var_dump($_POST); If this returns nothing then you know there is an issue with the reference back to the data that was sent
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    Yep so what does the response on the "Network" tab say? You should be able to click the request and it'll open another panel with headers and you want the …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    You can use console.log() within the trigger call $('#myform').click(function() { console.log("Click event triggered"); in order to see if the trigger is ran through the console. If you click the "Network" …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    Something like that <?php $ip_ranges = "32.89.178.30/24, 63.119.179.0/24, 23.119.180.0/24,154.119.181.0/24,193.119.182.0/24,133.119.183.0/24"; function multiCidrToRange($cidrs) { $return_array = array(); $cidrs = explode(",",str_replace(" ","",$cidrs)); foreach($cidrs as $cidr) { $begin_end = explode("/",$cidr); $ip_exp = explode(".",$begin_end[0]); $range[] …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    Give me an 20 mins and I'll write something for you. Just got to finish what I'm on and push to live
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    $cidrs is not defined yet. This would be for instance explode(",",$my_form_field) passing an array of ranges
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Use checkbox with jquery and ajax to update database

    What results have you had so far?
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    function cidrToRange($cidr) { $range = array(); $split = explode('/', $cidr); if(!empty($split[0]) && is_scalar($split[1]) && filter_var($split[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { $rangeStart = ip2long($split[0]) & ((-1 << (32 - (int) $split[1]))); $rangeStartIP = …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to get IP from text area that contains multiple IPs and their CIDR?

    If theres discrepencies with spaces etc. I'd consider $ips = explode(",",str_replace(" ","",$field)); // Gives IP's foreach($ips as $key => $ip) { $range = explode("/",$ip); $ips[$key] = $range; } which will …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in ReactJS Frontend with CodeIgniter backend - How to keep Authentication?

    Because React does not carry out a page refresh the cookie storage that React has access to is outdated. The best method for React & PHP authentication is to use …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Google problem with .htaccess

    What did you change?
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Help needed with Mysql_update query

    The usual way of achieving this functionality is to store a reference to the current player through a token/cookie and use that to refer to the related row in the …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in How to update database value with checkbox using jquery and ajax

    This is quite an ambiguous question. Can you elaborate on exactly what you're trying to achieve?
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Bootstrap carousel

    From what I can see, you're short a closing <div> tag.
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Database Design Help

    I don't have access to my suppliers database however each part will be populated from their website listing of that product, so when I add that product to the database …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in redirect in another tab

    Like @minitauros said, change the `header("Location: $file \r\n");` line with something like: `echo '<script type="text/javascript">window.open(' . $file . ')</script>';` See if that works.
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in isset() not working in php

    I'm a little confused as to why you want so much information to log someone in. Do you mean register? You say you get 1 extra error? So this doesn't …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Created Database Design Help

    Hello all, I'm trying to build a system to provide an easy access but very clever service select (sounds confusing, I will explain). Essentially I'm trying to create a system …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Complicated 301 redirects in wordpress

    You could always user Apache's .htaccess RewriteEngine
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in auto generated email

    Because you shouldn't usually save a users password in the raw format, but instead save it as an ecrypted version using something like md5() you can't physically retrieve the users …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Gave Reputation to diafol in send form to another page and redirect to the same page

    If you have a reusable form, I suggest that you have a php file just for the form (let's call it form.php for now). The form then has a hidden …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Image Commenting, Liking and following

    What exactly are you asking from us?
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in PHP & MySql Framework

    Thanks guys ;)
  • Member Avatar for Josh Connerty
    Josh Connerty

    Began Watching PHP & MySql Framework

    Hello All, I wonder if someone could help me, I'm about to start work on a pretty heavy system that will be massively database driven. I was wondering if there …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in PHP & MySql Framework

    Pretty much yeah...
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in PHP & MySql Framework

    I took a look at cake but it's too intrusive, I'm looking for a a non-intrusive framework that just gives me a class to communicate with the database instead of …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Edited PHP & MySql Framework

    Hello All, I wonder if someone could help me, I'm about to start work on a pretty heavy system that will be massively database driven. I was wondering if there …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Created PHP & MySql Framework

    Hello All, I wonder if someone could help me, I'm about to start work on a pretty heavy system that will be massively database driven. I was wondering if there …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in PHP specific row select?

    if ($channel_name6 = 'post') { $channel_name2 = $channel_name2; } else { $channel_name2 = "<img src='/videobox/data/uploads/images/$channel_name2' height='200px' width='100px'>"; } Correct me if I'm wrong but are you not trying to see …
  • Member Avatar for Josh Connerty
    Josh Connerty

    Replied To a Post in Collecting IP Addresses

    And to add to this. Like @jkon said, it will be the ISP's designated IP for that client. In most cases everytime your router connects to the ISP it will …

The End.