• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

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