The following warnings occurred: | ||||||||||||||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
View As User - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26) +--- Thread: View As User (/showthread.php?tid=344) |
View As User - mudmin - 11-23-2016 So I'm guessing you're doing something like Code: $uid = Input::get('id'); Now you have to run a query on that. Code: $theUserQ = $db->query("SELECT * FROM users WHERE id = ?",array($uid)); Code: $theUser = $theUserQ->first(); Now you can echo out Code: $theUser->fname View As User - Brandin - 11-24-2016 And I'm having one more issue....currently, all of my pages that have direct scripts in them are using the following script for Code: $uid <pre> Code: if(isset($_GET['uid'])) However, a page has to perform a function the Code: $uid For example, on Code: functions.php Code: alerts Code: stats <pre> Code: function autoRefresh_div() { However, I run into the issue of the fact that when I am running these two URLs, I cannot push the Code: $uid Code: $uid Code: functions.php Any help would be great! View As User - mudmin - 11-24-2016 I'm terrible at JavaScript. I think you might have better luck pasting that function on stack overflow. I'll bet someone will answer it within a few hours. Tell them all how great userspice is. Free advertising while you're at it View As User - Brandin - 11-24-2016 Mudmin, Hopefully I will get someone good that won't yell at me about "situation specific" questions. Sometimes you get AMAZING people and sometimes you get really crappy people I will post it there! Thanks! View As User - Brandin - 11-24-2016 This was much easier than I thought it would be. FYI, to pass PHP variables to Javascript, just add something such as the following: Code: var uid = "<?php echo $uid ?>"; to the top of your JavaScript, and modify the links your JavaScript pushes to. View As User - mudmin - 11-24-2016 I've seen that. I think as long as you state that you know the $uid, that takes userspice out of the equation...so not knowing why the variable isn't passing seems straightforward enough. View As User - mudmin - 11-24-2016 Oh. Nice. I really need to step up my js game. View As User - Brandin - 11-24-2016 That's okay, because I know crap about JS and CSS. I really only am good with PHP and mySQL. Give me a PDO and I'm fried lol. I'm still trying to learn PDO. View As User - mudmin - 11-24-2016 Well, userspice makes the whole PDO thing a lot easier. I'm sure there are more advanced things you need to know, but you can do 99{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} of what you ever need to do by knowing the basic $db, query, insert, delete, update that US has. View As User - mudmin - 11-24-2016 Well, userspice makes the whole PDO thing a lot easier. I'm sure there are more advanced things you need to know, but you can do 99{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d} of what you ever need to do by knowing the basic $db, query, insert, delete, update that US has. |