• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space

Passing variables?

Loco

Chevereto Member
I'm trying to pass a value from a hidden (for now, testing purposes) input field on the homepage to the process function in class.upload.php. Here's my code:

index.php

<input type="hidden" name="visibility" value="public">

and in class.upload.php

$_POST['visibility'] <- returns an empty value

Is there some flow that a variable needs to follow that I'm missing?

I've even tried the following:

in upload.php

$visibility = $_POST['visibility'];

in uploader.php

$upload->visibility = $visibility;

and tried setting the variable in class.upload.php

$vis = $this->visibility;

also

$vis = $upload->visibility;

Dafuq?
 
For those who happen to come across this thread in the future and are attempting the same thing, here is my (probably ass-backwards) solution. If some of you code pros see a better way, please tell me.

I think I have way too much code, but I stopped making changes after it finally worked.

On index.php


Code:
<label class="radio">
    <input type="radio" name="public" id="public" value="true">
    Make Public
</label>
<label class="radio">
    <input type="radio" name="public" id="private" value="false">
    Make Private
</label>
<input id="vis" value="" type="hidden">
<script>
$("#public").click(function() {
  var publicVis = 'true';
  $('#vis').val(publicVis);
});
$("#private").click(function() {
  var publicVis = 'false';
  $('#vis').val(publicVis);
});
</script>

In peafowl.php, after:

Code:
    /*** upload ***/
    $(upload_button).click(function () {

I added:

Code:
$(UploadifyID).uploadifySettings('scriptData',{'public':$('#vis').val()});

So, now in class.upload.php I can grab the value with:

Code:
$_POST['public']

and that gives me either a true or false. I insert those, along with a ton of other variables, into my database.

So much work for a single variable.
 
Back
Top