This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

Need a point in the right direction

In New to UserSpice? · Started by sandrews on 2016-11-18 6:02 pm · 52258 views · 23 replies

I can't run your code without my db being setup correctly. I actually have a /pizza install on my other computer, but I'm not there.

Javascript is normally what you would use for preventing a button from being clicked multiple times.

There are a few php hackery ways to do it though.

So, since you're storing the on_break in the users table as 0 or 1 AND refreshing the page with that redirect message after update, you should be able to go down to the button part of your form and do this.
<?php
if($user->data()->on_break != 1) {
?>
//your plain submit button in html here
<?php } ?>

That will just hide your button if on_break = 1.
Nice, that works perfectly. Clearly I need a refresher in PHP...time to go watch some PluralSight videos lol
Great! I really want to teach a class on userspice. I'm actually not a very good programmer so I've had to learn things like that to compensate for the fact that I never had time to learn javascript well :)
lol my problem was I could never pick a language to actually settle down into. I've done a little Java, a little JS, a little PHP, a little Python, a little Ruby, a little Swift, a little Perl, and a lot of BASH. So I know just enough in too many languages to really remember any of it worth a damn. Probably why I ended up going the Linux admin route instead, but now I'm getting bored again and picking up on DevOps....which requires programming knowledge.
‹ Prev12