Sponsored Content
Full Discussion: help with sscanf()!
Top Forums Programming help with sscanf()! Post 302308272 by vgersh99 on Friday 17th of April 2009 02:18:28 PM
Old 04-17-2009
Code:
int main(void){
char *data, str1[50], str2[50];
 
/*... HTML stuff ...*/
 
data = getenv("QUERY_STRING");
 
if(data==NULL){
printf("<H1>Error passing data to CGI Script</H1>");
exit(1);
}
 
else
sscanf(data, "user=%s&pass=%s", str1, str2);
 
printf("Username: %s\n", str1);
printf("Password: %s\n", str2);
return(0);
}

 

7 More Discussions You Might Find Interesting

1. Programming

sscanf function is failing

Please delete this thread. (0 Replies)
Discussion started by: jxh461
0 Replies

2. Programming

sscanf !!

I have a string Form this string, I want to extract I am unable to do that with sscanf because of the space between the words. What else can I use? #include <stdio.h> char buf_2; int main() { char *buf_1 = "\\\\?\\whats going on"; sscanf(buf_1,... (4 Replies)
Discussion started by: the_learner
4 Replies

3. Programming

help with sscanf

I need to match a float inside a very long string (about 5000 chars) with sscanf. (I trimmed the string in this example.) I can't seem to match all the chars that come before and after the float. int main(void) { char A = ""; strcat(A, " hello world! WORD' name='5.3498' hello world! ... (1 Reply)
Discussion started by: limmer
1 Replies

4. Programming

Help with sscanf

sscanf does not stop at the first "&". How can I extract "doe" ? char A = "name=john&last=doe&job=vacant&"; char B = "last"; char C = ""; char *POINTER = strstr(A, B); sscanf(POINTER + strlen(B), "=%s%*", C); printf("%s\n", C); // doe&job=vacant& (2 Replies)
Discussion started by: limmer
2 Replies

5. Programming

using sscanf

How can I separetely extract the string and int after "dribble" ? (sscanf must limit TEXT to 9 chars to avoid buffer overflows.) How come this code does not work with "dribbletext08" but does with "dribbletext05" ? int main(void) { char TEXT = ""; int NUMBER = 0; ... (2 Replies)
Discussion started by: cyler
2 Replies

6. Programming

sscanf() weired behaviour

Hi with the following code int a, b; while ((n = readline (connfd, buf, sizeof(buf)-1)) > 0) { buf = '\0'; if (sscanf(buf,"%d %d",&a,&b) != 2) snprintf (buf, sizeof(buf), "data error\r\n"); else { printf("\nRecvd %d and %d",a,b); ... (1 Reply)
Discussion started by: princebadshah
1 Replies

7. Programming

Format specifier for sscanf() in C

Hello, I have formatted lines delimited by colon ":", and I need to parse the line into two parts with sscanf() with format specifiers. infile.txt: Sample Name: sample1 SNPs : 91 MNPs : 1 Insertions : 5 Deletions ... (13 Replies)
Discussion started by: yifangt
13 Replies
BB-REPLOG.CGI(1)					      General Commands Manual						  BB-REPLOG.CGI(1)

NAME
bb-replog.cgi - CGI program to report service availability log SYNOPSIS
bb-replog.cgi DESCRIPTION
bb-replog.cgi is invoked as a CGI script via the bb-replog.sh CGI wrapper. Based on the parameters it receives, it generates an availabil- ity report for a specific host-service combination for the requested time-period. The availability report includes a calculation of the availability percentage (split out on percent green, yellow, red time), and an eventlog for the period listing the status changes that have occurred to allow for drill-down to the test reports that indicate a problem. Access to the individual historical status logs go via the hobbitsvc.cgi(1) CGI script. bb-replog.cgi is passed a QUERY_STRING environment variable with the following parameters: HOSTSVC (the host and service to report on) STYLE (report style: "crit", "non-crit", "all") ST (starttime in seconds since 1-1-1970 00:00 UTC) END (endtime in seconds since 1-1-1970 00:00 UTC) The following non-standard parameters are handled by the bbgen version of bb-hist.cgi: IP (IP address of host - for display purposes only) REPORTTIME (the REPORTTIME: setting for this host) WARNPCT (the WARNPCT: setting for this host) The REPORTTIME and WARNPCT options are taken from the bb-hosts(5) definition for the host, or the defaults are used. These modify the availability calculation to handle reporting against agreed Service Level Agreements re. the time of day when the service must be avail- able, and the agreed availability level. OPTIONS
--env=FILENAME Loads environment from FILENAME before executing the CGI. SEE ALSO
bb-hosts(5), hobbitserver.cfg(5), hobbitsvc.cgi(1) Xymon Version 4.2.3: 4 Feb 2009 BB-REPLOG.CGI(1)
All times are GMT -4. The time now is 07:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy