No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
18 Posted Topics
Hello, I've written down a small JS function 'checkForm()' to validate the input in a form and alerting, before actually sending data to the PHP server-side script. In my form, in addition to common input text fields I've got two buttons: the first called "ADD" to submit data and "CANCEL" … | |
Hi all, I'd like to filter an input string with a list of commas separated numeric ids to understand if it matches the pattern (only digits and commas allowed, i.e. "112,5,16,4578,ecc"). I'm trying to perform a regular expression match using preg_match. [code=PHP] $ids_list = '112,5,16,4578'; if (preg_match('/[0-9,]*/', $ids_list)) echo'OK!'; else … | |
Hi all, I would like to perform a conditional get of a file using PHP and cURL. How can I detect 304 code sent via HTTP headers and avoid to download the entire file? | |
Re: I remember to have read somewhere that it's possible to set Sessions'cookie timeout, in order to expire for example after a month instead of on browser closing... How is it possible? | |
I'd like to redirect the user to another page, i.e. after a login check. I'm used to doing this via header location directive, it's all ok, but, if I'd like to print a message and redirect the user in 2/3 seconds, like on this forum when you login? Is it … | |
I need to obtain current date formatted this way in PHP: Sun, 26 May 2005 19:32:54 GMT Is there a specific function or I've got to create it myself? | |
It's not a lot more than curiosity, which is the difference between <br> and <br /> ? I see both of them widely used and abused, are they completely interchangeable ? | |
Re: [QUOTE=Josh Connerty;881447]Basicly the logic is like this, :P You take the time stamp when they log in, store this in two fields last log in time and last movement. Every page they visit you need to runa query to update their last move to the current time stamp. (...) [/QUOTE] … | |
Hello, I've got to find on a small lan (< 200 hosts) the host (or better one of the hosts) which has in its [I]registry[/I] a specific public name bound. My first idea was to write a loop in which for each potential host of the lan I perform a … | |
I need to list the files in my current directory and have them packed into an array of chars, in Linux. I use system("ls > temp_file"); to write them one per row in a temp file, and then I copy from this file to my string. Is there a more … | |
Hello, I need to create some dirs (one for each user), taking the dir name from a given string. I managed to do this with the following code: [CODE=C] DIR *dir_ptr; char *target_dir; target_dir = malloc(32*sizeof(char)); for(all users) { /* Set username for current user */ target_dir[0] = '\0'; strcat(target_dir, … | |
Hello, I've to build a database of students in a certain school in which each student has a list of her/his passed exams along with the grade gotten. I have 3 structs and I need an advice on how to carry out memory allocation, eg. when I add a student. … | |
Re: [QUOTE=varsha0702;608031]Secondly There can be a change that the header file containing the definition of structures , has been included more than once in a file.[/QUOTE] Maybe, to avoid the problem I suggest using ifndef directive in headers containing structs. | |
I have to pass a string to a function that strcats something to it, in K&R I read to pass a pointer to it, but I don't know where to allocate buffer... Is there a difference betw passing an empty string or not? My printf starts with some strange symbols, … | |
Hi all, I've done this prog to get the last token in a string es: /dir1/dir2/file.txt must return --> file.txt I get several errors on assignments, what's wrong with it? many thanks [CODE] int main() { char *path; char *filename; path = (char*) malloc(sizeof(char) * 64); strcpy(path, "/dir1/dir2/file.txt"); filename = … | |
Hi guys, I've to read a txt file and produce a statistic of each alphabetic char occurrence. I'm approaching this task reading char by char until EOF and using an int array to hold the number of occurrences of each character read so far! So that's my solution: [code] int … | |
Hi guys, I've got troubles with a conversion. My function: void stringFormat (char *input, int nums) receives a string like this: "name;3,45,5,6,77;" and a number indicating how many numbers in the String (in this case 5) I've got to tokenize the string in order to obtain: 1) a string named … | |
Hi guys, congrats for this wonderful site, I've found it very helpful for my programmation skills, in more than one case.. Keep going this way :) |
The End.