cgiGetValue(3)

πŸ“¦ version 0.6, in ubuntu jammy

πŸ’– cgiGetValue β€” bestie, let's get that value πŸ’–

okay so this one lives in the cgiGetValue(3) page of the programmer's manual, and it's literally the little function that goes and grabs a CGI variable's value for you. no cap, it's a whole vibe. 🌸


✨ NAME ✨

cgiGetValue β€” return the value of a CGI variable πŸŽ€


✨ SYNOPSYS ✨

#include <cgi.h>

char *cgiGetValue (s_cgi *parms, const char *name);

(it's giving "short and iconic", we love to see it πŸ’…)


✨ DESCRIPTION ✨

so this routine hands you back a pointer to the value of a cgi variable. 🫢 and listen β€” any encoded characters (%nn) are already decoded by the time you get them, so you don't have to do a single thing about it. obsessed.

not me warning you: you must not free that pointer. don't do it. put the free() down bestie. πŸ›‘

if multiple fields are used β€” like, a variable that may contain several values β€” the value you get back contains all of those values concatenated together, with a newline character as the separator. so yeah, one string, newlines between, that's the whole deal. ✨

and the memory allocated by that returned value? it gets automatically freed by the final call to cgiFree(3). so the library's got you, you don't have to babysit it. 😌


✨ RETURN VALUE ✨

  • on success, a pointer to a string is returned πŸ‘‘
  • if the variable wasn't transmitted through CGI, or it was empty, NULL is returned πŸ’€

✨ AUTHOR ✨

this CGI library is written by Martin Schulze <joey@infodrom.org>. 🧚 and fr fr, if you have additions or improvements, please get in touch with him β€” he wants to hear from you.


✨ SEE ALSO ✨


and that's the whole page, bestie!! this one's from the CGI Library, dated 6 April 2008 β€” yeah she's a lil vintage but she still ate. go forth and get those values πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • ubuntu jammy: cgilib 0.6-1.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms