![]() |
Image displaying from database
I came up with my own way to pull images but the thing about is that it won't pull the image on vB4.0, here is the template and file.
Template: HTML Code:
<img src="download.php?catimg={vb:var cid}" height="50"> HTML Code:
<img src="cat.php?img={vb:var cid}" height="50"> File: PHP Code:
PHP Code:
Thanks Steve M |
Where do you register $cid for use in the template in the second chunk of code?
|
PHP Code:
|
You need to register variables to make them available in templates:
https://vborg.vbsupport.ru/showthread.php?t=228078 I thought you knew all that, since you're already doing it: PHP Code:
|
$cid is not a template or do all variables you use no matter if they are a template or not need to be registered?
I knew about templates but was unaware of having to do it for data variables such as $cid. |
bfc_download_cat_bit is the template. You create it by calling the vB_Template:create method, and then you need to register every variable you want to use inside that template, no matter what's saved inside that variable. It can contain a rendered template, or it can contain just a simple boolean false or true. That does not matter, you need to register it to be able to use it. Then, in the next step, you render the template.
|
Ok I can't figure out why this:
HTML Code:
</td> </td></tr><tr> |
Just a quick note on security :)
PHP Code:
PHP Code:
|
Thanks for pointing that out, I was actually starting to think I needed to clean it.
|
All times are GMT. The time now is 06:07 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|