Help with getting the Alert to Submit the Form

I've added a SweetAlert into an existing upload Form, where upon selecting the Submit button it successfully displayed the pop-up alert. Like so:

$('#submit-btn').on('click',function(e){
e.preventDefault();
var form = $('.pt_upld_page_frm');
swal.fire({
title: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, submit it!",
closeOnConfirm: false
}).then((result) => {
if (result.isConfirmed) { $('.pt_upld_page_frm').submit(); }

});
});

But, my goal is to have the "Yes, submit it" to actually submit the chosen uploaded file. But it didn't upload it.
So, I added code from farther down the file, into the alert, like so:

$('#submit-btn').on('click',function(e){
e.preventDefault();
var form = $('.pt_upld_page_frm');
swal.fire({
title: "Are you sure?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, submit it!",
closeOnConfirm: false
}).then((result) => {
if (result.isConfirmed) {
$('.pt_upld_page_frm').ajaxForm({
   //$('#upload-form form').ajaxForm({
      url: '{{LINK aj/ffmpeg-submit}}?hash=' + $('.main_session').val(),
    beforeSend: function() {
       $('#submit-btn').attr('disabled', true);
       $('#submit-btn').val("{{LANG please_wait}}");
},
 success: function(data) {
         if (data.status == 200) {
window.location.href = '{{LINK home}}';
         }
         else if(data.status == 402){
            swal({
               title: '{{LANG error}}',
               text: data.message,
               type: 'error',
               confirmButtonColor: '#3085d6',
               cancelButtonColor: '#d33',
               confirmButtonText: 'OK',
               buttonsStyling: true,
               confirmButtonClass: 'btn btn-success',
            }).then(function(){
               window.location.href = '{{LINK upload-video}}';
            },
            function() {
               window.location.href = '{{LINK }}';
            });
         }
         else {
            $('#submit-btn').attr('disabled', false);
             $('#submit-btn').val('{{LANG publish}}');
            Snackbar.show({text: '<div>'+ data.message +'</div>'});
         }
      }
   });
//});
});
}
});
});

But now it submits successfully, but doesn't display the Alert first. The goal is to have the "Yes, submit it" to actually submit
Any guidance is welcomed.

Help with closing message box and submiting

I'm trying to add something to this JS, for a successfully working submit Form:

  $('#upload-form form').ajaxForm({
url: '{{LINK aj/ffmpeg-submit}}?hash=' + $('.main_session').val(),
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
}, success: function(data) {
if (data.status == 200) {
window.location.href = data.link;
}

to get a message to display before the Form submits, I added:

$(".loading_msg").show();

into the beforeSend: function, like so:

beforeSend: function() {
 $('#submit-btn').attr('disabled', true);
 $('#submit-btn').val("{{LANG please_wait}}");
$(".loading_msg").show();
return false;

Had to add return:false because after 'show' it was submitting too fast to read the message.
My code stops the submission, so the message can be read. How can the submission then be un-stopped upon the reader closing the message?

I have this:

<div class="loading_msg" style="display:none"> MESSAGE!! <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span> </div>

and this:

$('#submit-btn').attr('disabled', true);
 $('#submit-btn').val("{{LANG please_wait}}");
$(".loading_msg").show();
return false;

Tried these without success:

 $('#upload-form form').ajaxForm({
      url: '......,
      beforeSend: function() {
         $('#submit-btn').attr('disabled', true);
         $('#submit-btn').val("{{LANG please_wait}}");
    $('.loading_msg').show()
   $('.loading_msg').click(function () {
    return true
});

and this:

 $('#upload-form form').ajaxForm({
      url: '........,
      beforeSend: function() {
         $('#submit-btn').attr('disabled', true);
         $('#submit-btn').val("{{LANG please_wait}}");
$('#submit-btn').click(function (event) {
  event.preventDefault()
  $('.loading_msg').show()
})

$('.loading_msg').click(function () {
  $('#upload-form form').submit()
})

any help is appreciated to show the message and allow the reader of the message to close it which will cause the form to submit.

Help with modal triggered by php if statement and JS

This php statement works successfully:

 if (empty($error) && $_POST['set_p_v'] == 0 && $wallet >=1) {
  //echo '<script type="text/javascript"> $("#myModal").modal("show")</script>';
$db->rawQuery("UPDATE ".T_USERS." SET `wallet` = `wallet` - 0.50 WHERE $wallet = $user->wallet");
}

as you can see I tried to echo a modal when conditions were met, but no success. No echo, but the Form, that the modal html is within, displays and undefined form alert, upon submit (I put the JS at the bottom of the html file).

So, then I commented out the echo, as you can see. And tried sweet alert, like so, within the html form page:

$(document).ready(function(){
    $("upload-form").on('#submit-btn',function(e){
    $(".set_p_v").each(function() {

        e.preventDefault();
        var input = $(this);

        if(input.val() == "0"){
            swal(input.attr("0") + "wallet >=1");
          return false;
        }

        swal("some more info")
      })
    });
});





<script src="sweetalert2.min.js"></script>
<link rel="stylesheet" href="sweetalert2.min.css">

without success. Success would be upon 0 entered into the form field (and wallet >1), then submit is selected and upon submit selected then the alert message displays.

Any guidance is appreciated

Help with changing price after deduction…

This works successfully:

$wallet = $user->wallet;
$upwallet = ($sell_video == 0 && $wallet >= 1 ? 0.5 : 0);    
$db->rawQuery("UPDATE ".T_USERS." SET `wallet` = `wallet`- '".$upwallet."' WHERE `id` = '".$video->user_id."'");

(when the sell_video amount is 0 and the wallet amount >= 1, deduct 0.5 from the wallet). Works successfully.

I'd like guidance to add:
When the sell_video amount is 0 and the wallet amount = 0.5, change/update the sell_video to X.

I tried this, without any successful sell_video change:

if($sell_video === 0 && $wallet === 0.5) {
$sell_video = '1';
}

I'm guessing that 'sell_video' has to be updated in the db. Any example of what that might look like is appreciated.

Any assistance is welcomed.

re: Instagram, is there any point to putting hashtags…

Is there any point to putting hashtags in your Instagram profile bio? Will those be found in a search?

Can a posting's caption & info be edited after posting?

Also, I have a domain name, and I have that domain name as my IG username, but someone else has an account name with my domain name, for example, like so: #mydomainname can we both have #mydomainname or am I going to be stuck with just mydomainname (without the #)? Will it make that much difference when people are searching?

If I have the IG account just to give my web site some visibility, how would following others help with that?

How to filter YouTube search results for just USA?

How to filter YouTube search results for just USA?

Google search of that question shows:
Settings > General > Location > Select your country,

but I've done that and still searching a word or phrase on YT doesn't get me just USA results only.

Any ideas regarding how to do this?

Can you please tell me what these lines of code do?

Can you please tell me what these lines of code do?

$sub_category = 0;
            if (!empty($_POST['sub_category_id'])) {
                $is_found = $db->where('type',PT_Secure($_POST['category_id']))->where('lang_key',PT_Secure($_POST['sub_category_id']))->getValue(T_LANGS,'COUNT(*)');
                if ($is_found > 0) {
                    $sub_category = PT_Secure($_POST['sub_category_id']);
                }
            }

I look forward to any assistance

Add data to table –

I'm trying to modify a web script.
Currently, upon uploading a video, in the upload Form, among other things, the uploader chooses a sub-category and enters tags
and then submits/uploads. I'd like the sub-category that is selected, to also be searchable as a keyword.

Presently, the 'videos' table has a 'sub-category' column, but only the 'sub_category' ID is stored there (upon a video being uploaded), not the actual searchable name of the 'sub_category'. (All of the sub-category names and related sub_category ID's are stored in another table).

I'd like to modify the script code so that when the sub_category ID gets stored in the VIDEOS table, the corresponding sub_category name also populates in that table, upon a video being uploaded (so that I can add the 'sub_category' name as a searchable keyword).

I believe this code from the script's submit.php file is where the VIDEOS table gets populated (in the data_insert = array):

if (!empty($_POST['category_id'])) {
                if (in_array($_POST['category_id'], array_keys(get_object_vars($pt->categories)))) {
                    $category_id = PT_Secure($_POST['category_id']);
                }
            }
            $video_privacy = 0;
            if (!empty($_POST['privacy'])) {
                if (in_array($_POST['privacy'], array(0, 1, 2))) {
                    $video_privacy = PT_Secure($_POST['privacy']);
                }
            }
            $age_restriction = 1;
            if (!empty($_POST['age_restriction'])) {
                if (in_array($_POST['age_restriction'], array(1, 2))) {
                    $age_restriction = PT_Secure($_POST['age_restriction']);
                }
            }
            $sub_category = 0;

            if (!empty($_POST['sub_category_id'])) {
                $is_found = $db->where('type',PT_Secure($_POST['category_id']))->where('lang_key',PT_Secure($_POST['sub_category_id']))->getValue(T_LANGS,'COUNT(*)');
                if ($is_found > 0) {
                    $sub_category = PT_Secure($_POST['sub_category_id']);
                }
            }

            $publication_date = 0;
            if (!empty($_POST['date']) && !empty($_POST['hour'])) {
                $publication_date = strtotime($_POST['date']." ".$pt->config->hours[$_POST['hour']]);
                $video_privacy = 1;
            }
            $data_insert = array(
                'video_id' => $video_id,
                'user_id' => $user->id,
                'title' => PT_Secure($_POST['title']),
                'description' => PT_Secure($_POST['description']),
                'tags' => PT_Secure($_POST['tags']),
                'video_location' => '',
                'category_id' => $category_id,
                'thumbnail' => $thumbnail,
                'time' => time(),
                'registered' => date('Y') . '/' . intval(date('m')),
                'converted' => '2',
                'size' => $filesize,
                'privacy' => $video_privacy,
                'age_restriction' => $age_restriction,
                'sub_category' => $sub_category,
                'embedding' => $embedding,
                'publication_date' => $publication_date
            );

Can you provide some insight/guidance as to when the video title, description, tags and sub_category ID, etc. gets added to VIDEOS table
how I can also add sub_cat name that corresponds with the populated sub_category ID?

As stated above, all of the sub-category ID's and related sub_category names are stored in another table.

I look forward to any assistance.

How to show 2nd drop-down field after first drop-down selection is chosen?

Im trying to modify a web script where a drop-down works successfully. How can another drop-down field appear only after a selection has been made from the first drop-down list? Heres the current code:

<?php if ($pt->page == 'category' && $pt->show_sub == true) { ?>
<div class="pull-right col-md-3 no-padding-left">
<select name="type" class="form-control form-group" id="sub_categories_">
<?php echo $pt->sub_categories_array["'".$_GET['id']."'"]; ?>
</select>
<div class="pull-right col-md-2 col-sm-2 text-right"><h5>{{LANG sub_category}}</h5></div>

and this:

$(document).on('change', '#category_id', function(event) {   
event.preventDefault();   
id = $(this).val();   
$('#sub_category_id').html(sub_categories_array["'"+id+"'"]);
});
$(document).on('change','#sub_categories_', function(event) {   
window.location.href = site_url+'/videos/category/<?php echo($_GET['id']) ?>/'+$('#sub_categories_').val();
});

any guidance is appreciated

Help with referencing url in code

I am trying to display something on web pages that show this in the url: "sub" for example: ...com/videos/category/1/sub536. It was suggested I try this code:

$page = basename($_SERVER['PHP_SELF']); 
if ($page=="....") {
echo Hello World; 
} elseif ($page=="....php") {
Some Other code... 
}

but I don't know where to place the url in that code to make it purposeful.
Also, I'm not sure that I need if/else, just would like if: /videos/category/1/sub__ then show echo

Well, when I put that code on the page, as-is, I see "page isn't working.

Any guidance/suggestion is appreciated

Allow camera access – show camera view — don’t start recording video

This code below works successfully to capture/record/play video - after camera access permission is granted - when the start button is selected. I'm trying to add the functionality where (after camera access is allowed) the camera view appears, without recording starting automatically (And have the camera view displayed while recording).

Currently, the screen is black after camera access and while capture/recording. I was told that I need to "capture the stream from the video element and put it through the MediaRecorder object". I don't know how to do that. Any help is appreciated

var video = document.querySelector("video");
let params = { audio: true, video: { facingMode: { exact: "environment" } } };

let blobs = [];
let stream, mediaRecorder, blob;

async function startRecording() {
  stream = await navigator.mediaDevices.getUserMedia({
    audio: true,
    video: true,
  });

  mediaRecorder = new MediaRecorder(stream);
  mediaRecorder.ondataavailable = (event) => {
    // Let's append blobs for now, we could also upload them to the network.
    if (event.data) {
      blobs.push(event.data);

Reduce the dimensions of the full recording mobile screen/view

This html web page code, when viewed via mobile device, captures video from the mobile device. By tapping the page, the mobile video full screen appears, ready to begin recording. I'd like to find a way to reduce the dimensions of that full screen, if possible. I'm guessing it might need height and width dimnsions via some javascript code referencing "fileToUpload"?

<form action="uploadMobile.php"  method="post" enctype="multipart/form-data">
<input type="file" name="fileToUpload" id="fileToUpload" accept="video/*" capture="user" onchange="submitForm();">
<input type="submit" value="Upload" name="submit" id="go" style="display: none;"/>
</form>

Any guidance/assistance is appreciated.

Text Across The Page/Video-Camera-Screen?

Is it possible to add scrolling text across the page/video-camera-screen?

On an html page, it uses this code:

accept="video/*"

in this context:

<input type="file" name="fileToUpload" id="fileToUpload" accept="video/*" capture="user" onchange="submitForm();">

and when you view the page via mobile, and tap the page, your video camera screen appears. I'm looking to see if it's possible to add scrolling text across the page/video-camera-screen ? like some type of overlay? I would image it may be possible on an html page that displays a web cam, with something like this:

<video autoplay="true" id="videoElement"></video>

I look forward to any comments/suggestions/guidance.

Display 2nd Dropdown > 1st dropdown

I am trying to modify a existing web script's Upload Form where, currently you choose a Category...etc. and Submit. When a Category is chosen, I'd like another dropdown list of choices to display. Here is the code currently:

<div class="form-group">
<label class="col-md-12" for="category_id">{{LANG category}}</label>
<div class="col-md-12">
<select name="category_id" id="category_id" class="form-control">
<?php foreach($pt->categories as $key => $category) {?>
<option value="<?php echo $key?>"><?php echo $category?></option>
<?php } ?>
</select>
</div>
</div>

Any guidance/assistance with this appreciated.