Forum: PHP Aug 9th, 2009 |
| Replies: 1 Views: 351 |
Forum: PHP Jul 26th, 2009 |
| Replies: 1 Views: 351 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? |
Forum: PHP Jun 28th, 2009 |
| Replies: 13 Views: 1,232 I've changed life value to 3 days, from my browser I can see the cookie has been updated with the new expire date but if I close the browser and reopen it I've got to login again, even if the cookie... |
Forum: PHP Jun 26th, 2009 |
| Replies: 5 Views: 1,623 Perfect, many thanks for these details! |
Forum: PHP Jun 25th, 2009 |
| Replies: 1 Views: 509 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? |
Forum: PHP Jun 24th, 2009 |
| Replies: 5 Views: 1,623 Which is the difference between the two solutions? I'm using the syntax from Atli's post right now and it fullfills its aim, but I'd like to know the differences, just to learn something and use it... |
Forum: PHP Jun 18th, 2009 |
| Replies: 5 Views: 1,623 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... |
Forum: PHP Jun 18th, 2009 |
| Replies: 13 Views: 1,232 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? |
Forum: HTML and CSS Jun 12th, 2009 |
| Replies: 9 Views: 942 Ok, so it's definitely better to use <br /> in any case from my pov... |
Forum: HTML and CSS Jun 6th, 2009 |
| Replies: 9 Views: 942 I don't get it, can you please show me with an example the relation to the doctype? |
Forum: HTML and CSS Jun 6th, 2009 |
| Replies: 9 Views: 942 So in any case there are no cons using <br/> instead of <br> even in "simple" HTML ?
<br/> is the same withot space btw 'r' and '/' ? |
Forum: HTML and CSS Jun 6th, 2009 |
| Replies: 9 Views: 942 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 ? |
Forum: PHP Jun 6th, 2009 |
| Replies: 12 Views: 1,683 I quote this reply to put forward some questions:
1) an approach like that (with an update query) is not slowing down the website? It's not better to save last move in sessions?
2) is there a way... |
Forum: Java Apr 14th, 2009 |
| Replies: 0 Views: 240 Hello,
I've got to find on a small lan (< 200 hosts) the host (or better one of the hosts) which has in its registry a specific public name bound.
My first idea was to write a loop in which for... |
Forum: C Dec 14th, 2008 |
| Replies: 1 Views: 341 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... |
Forum: C Nov 25th, 2008 |
| Replies: 1 Views: 285 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:
DIR *dir_ptr;
char *target_dir;
target_dir =... |
Forum: C Nov 18th, 2008 |
| Replies: 12 Views: 1,809 Yes, if I've understood properly, for my purpose it's enough an "array of students", I only want to list the students in the school with their exams.
Now, I'm asking myself, why in the spec, that... |
Forum: C Nov 17th, 2008 |
| Replies: 12 Views: 1,809 Pardon me for having cut your reply to the bone, you write "p is a dynamically sized array of pointers to T", I used to think p was *only* a pointer to a dynamically sizeable array of pointers to T..... |
Forum: C Nov 17th, 2008 |
| Replies: 12 Views: 1,809 Yes, obviously, it was an oversight when copying into the post form..
The problem is I don't know how much space to allocate: students is declared as struct student **students;
What does it mean?... |
Forum: C Nov 17th, 2008 |
| Replies: 12 Views: 1,809 You can find it in the struct school:
struct school {
int total_students;
struct student **students;
};
I mean school is made of students, plus a counter to check how many students... |
Forum: C Nov 16th, 2008 |
| Replies: 12 Views: 1,809 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... |
Forum: C May 16th, 2008 |
| Replies: 8 Views: 1,222 Maybe, to avoid the problem I suggest using ifndef directive in headers containing structs. |
Forum: C May 15th, 2008 |
| Replies: 4 Views: 3,587 Ok, I think I've understood the mistery.
Infact I decided to pass a pointer to a pointer because in the interface I'm implementing the function is declared this way, what pros in such a solution... |
Forum: C May 8th, 2008 |
| Replies: 4 Views: 3,587 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... |
Forum: C May 3rd, 2008 |
| Replies: 5 Views: 1,180 Ok, with strrchr() and strcpy() it finally worked! :icon_wink:
Anway, in case I need to modify the original string, in K&R I read to pass a pointer to it, where am I wrong? I don't know where to... |
Forum: C Apr 29th, 2008 |
| Replies: 5 Views: 1,180 Hi Luckychap, first of all thanks for your reply.
My problem is not in the function working on the string, that works well, but in main(): I cannot do assignment
filename = get_filename(path); ... |
Forum: C Apr 29th, 2008 |
| Replies: 5 Views: 1,180 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
int... |
Forum: C Sep 26th, 2007 |
| Replies: 10 Views: 1,377 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... |
Forum: C Sep 15th, 2007 |
| Replies: 22 Views: 4,747 Good idea, Narue...
Here's the updated version, with the pointer issue fixed!
void stringFormat(char *input, int nums){
char *data;
int numbers[nums];
int i=0;
char *p;
p =... |
Forum: C Sep 15th, 2007 |
| Replies: 22 Views: 4,747 Yes, here's the problem, I'm sorry for that.
Anyway the code is very well working, the only thing I changed after all it's the pointer to the array because further operations that I had to do in the... |
Forum: C Sep 15th, 2007 |
| Replies: 22 Views: 4,747 Yes, gcc says that, better if I fix it using a constant inside the function? I don't know other ways to solve this issue...
I've not checked the result returned by sscanf() 'cause the string... |
Forum: C Sep 14th, 2007 |
| Replies: 22 Views: 4,747 Many thanks for your indeepth replies, I think I've clearly understood this point, very interesting the example and the link to the faq, it seems it was there just for me!
As requested, I post my... |
Forum: C Sep 9th, 2007 |
| Replies: 22 Views: 4,747 Many thanks! I decided to use strtok() for data and sscanf for numbers, and with some arrangments from the two codes you posted I managed to fix the problem: it seems to work properly.
... |
Forum: C Sep 8th, 2007 |
| Replies: 22 Views: 4,747 Yes I read something and put the rest in bookmarks, but I've not found my answer.
I'd like to know why my code doesn't work with strtok() and atoi(), before changing everything and using sscanf()... |
Forum: C Sep 8th, 2007 |
| Replies: 22 Views: 4,747 You guessed the core of the problem.
I've seen some sscanf() tutorials but I've not understood the difference with strtok().
In my case, there's no way to perform a "on the fly" conversion using... |
Forum: C Sep 8th, 2007 |
| Replies: 22 Views: 4,747 Your code works correctly on my PC, maybe assigning a variable instead of a static value it's only bad style since I get "only" a gcc warning.
Anyway, even if I iniitialise it with a big value the... |
Forum: Community Introductions Sep 7th, 2007 |
| Replies: 4 Views: 638 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 :) |
Forum: C Sep 7th, 2007 |
| Replies: 22 Views: 4,747 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... |