The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$variable inside file_get_contents
#7
Yeah. Because javascript is a client side language, it does not have direct access to the database, although you can get a little sneaky.

So what you probably want to do is to write a function in javascript or php to make that happen.

I'm not a wizard but off the top of my head you would make a function like

function testVar($column){
//your test_var call with $column passed into the url
}

Then when you call the function it would be
testVar($user->data()->MyOwnColumn); in php
or something like
testVar(<?=$user->data()->MyOwnColumn?>); in js
Maybe with quotes around the php variable in javascript. I don't have my sample code with me right now.
  Reply


Messages In This Thread
$variable inside file_get_contents - by MarcE - 03-20-2017, 08:02 AM
$variable inside file_get_contents - by JUG - 03-20-2017, 09:09 AM
$variable inside file_get_contents - by mudmin - 03-20-2017, 11:21 AM
$variable inside file_get_contents - by MarcE - 03-21-2017, 05:12 PM
$variable inside file_get_contents - by JUG - 03-21-2017, 06:56 PM
$variable inside file_get_contents - by MarcE - 03-22-2017, 08:10 AM
$variable inside file_get_contents - by mudmin - 03-23-2017, 09:58 AM
$variable inside file_get_contents - by MarcE - 03-24-2017, 09:16 AM
$variable inside file_get_contents - by dan - 03-24-2017, 10:31 AM
$variable inside file_get_contents - by MarcE - 03-27-2017, 06:54 AM
$variable inside file_get_contents - by mudmin - 03-30-2017, 04:33 PM
$variable inside file_get_contents - by MarcE - 04-13-2017, 01:23 PM
$variable inside file_get_contents - by MarcE - 04-19-2017, 05:13 PM
$variable inside file_get_contents - by mudmin - 04-20-2017, 10:51 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)