Hi there,
Since I do not good understanding of pointers, I can not figure out why I'm missing from below code. Basically, I want to get filename from the url and if filename(media_id)is correct then return OK. But the problem is r->filename is changed. from /data/htdocs/localhost/12345_full.wmv to /data/htdocs/localhost/12345
Can anyone help me how I can fix this problem?
filename = strrchr(r->filename, (int) '/');
filename++;
media_id = atoi(strtok(filename, "_"));
Since I do not good understanding of pointers, I can not figure out why I'm missing from below code. Basically, I want to get filename from the url and if filename(media_id)is correct then return OK. But the problem is r->filename is changed. from /data/htdocs/localhost/12345_full.wmv to /data/htdocs/localhost/12345
Can anyone help me how I can fix this problem?
filename = strrchr(r->filename, (int) '/');
filename++;
media_id = atoi(strtok(filename, "_"));