Jump to content
xisto Community

kvkv

Members
  • Content Count

    44
  • Joined

  • Last visited

Everything posted by kvkv

  1. Here is an easy solution for your problem. {servenv++;}while((*servenv)!='.'); //increment char* till next character to '.'//use servenv here. it points to next character of the first '.'
  2. Summarizing your code,1. check for username & password (get count)2. insert into InspectionRequest3. if count is not 1, print "Did not add" else redirect to index.By the above, it is evident that you are printing wrong message. Check your InspectionRequest table in phpmyadmin and you should see your rows inserted. You need to rewrite your logic to this.1. check for username & password (get count)2. if count is not 1, print "Login failed", exit3. insert into InspectionRequest4. if insertion successful, redirect to index else print "Add to InspectionRequest failed"
  3. Ok, Here you go. You need to use reflection to get the class definition of a class whose name is in a string. Once you get the class, you can even instantiate it. import java.lang.reflect.*;import java.awt.*;......//Your class in string String s="<your class>";//Get class definition Class cls = Class.forName(s);//Instantiate Object obj=cls.newInstance(); There might be some exceptions which you need to catch (atleast provide empty catch blocks), but it works.
  4. Add your entries toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunLook into the existing entries in this key for example.
  5. Yes. If the user closes the browser, he loses his session variables. Session variables are always tied down to a browser session. By the way, what is the trouble you are facing? It is not very clear from your description.
  6. Here you go. Use this opensource code to send your mails. http://phpmailer.worxware.com/
  7. Class c = (Class)s; I don't know if the above works. But you can always use Class c = s.getClass(); That works :-)
  8. Just change listnode n1; setval(n1, 1); listnode n2; setval(n2, 2); listnode n3; setval(n3, 3); to listnode n1=malloc(sizeof(struct alistnode)); setval(n1, 1); listnode n2=malloc(sizeof(struct alistnode)); setval(n2, 2); listnode n3=malloc(sizeof(struct alistnode)); setval(n3, 3); It works. There was a memory allocation problem in this code. n1, n2, n3 were used without memory being allocated.
  9. The "headers already sent [output started]" refers to any html content which has been written to the browser. When browser requests a page, the http server sends http headers before html contents. It means that if you are using php to send any headers, it must be done before writing any html output. Html output need not be just echo statement, but can be spaces or newline before the php tag (<?) because anything outside php tags is considered to be html. It is not that php (or any serverside scripting language for that matter -- like jsp or cgi-perl or asp) doesn't like spaces or newline, but it is the correct way it is supposed to behave.Make sure that you don't output anything to the browser before header function and no spaces/newline outside php tags and your problem will be solved.
  10. That is a bit shocking because internally perl manages arrays as lists. And push() and unshift() are almost the same when it comes to performance. Are you sure you are dealing with the same set of data and haven't changed anything else? Can you post a code snippet that I can look into?
  11. These softwares are nothing but sends and receives mail with the files as attachments. I don't know whether it is legal to do so, but whenever google makes a change in their protocol, the gmail drive breaks. Also, it has the maximum file limit the same as max attachment size in gmail (10mb i believe). It is better to use internet space providers. Even if they provide ftp facility, it can be easily mapped to drive. There are freewares available to do this.
  12. What you are trying to do is run a server side code in the client. "include" is server side (php) code. Whatever is executed on "onchange" of dropdown *has* to be client side code since your browser doesn't know about server code. That doesn't work. if you want to include something, you can redirect browser to a pageinclude.php script with a parameter (depending on the selection of dropdown) and in your php, depending on parameter, you can include respective file.
  13. Since you are coding jsp, I am assuming you have java programming knowledge. To read a file, you need java io package to be imported. So, here goes the import page directive at top of your jsp. <%@page import="java.io.*"%> Now, you have to create input stream using the file. Assuming the file is in the class path, you can get the stream by java.net.URL url =config.getServletContext().getResource("yourfile.txt");BufferedReader buffreader =new BufferedReader(new InputStreamReader(url.openStream())); Rest of the things are same as reading from a BufferedReader in java. Make sure that the java code in jsp is inside <% and %> tags.
  14. Actually, you can't create a structure which contains a member of type itself. This is because this kind of structure, when initialized, will start creating a structure inside a structure inside a structure and so on till all the memory is exhausted and crashes. That is why compiler does not allow you to create a member of same type. But there is a solution. You can have a pointer to the same structure as member. It means that when an element of this struct (or class in c++) is created, only a pointer is created and no memory allocated, so it is not recursive. Here is a sample code struct listnode{ int data; struct list *nextnodelink; } You will have to create each node individually and link them in your code.
  15. I searched web a lot but couldn't find any references to solve your problem. I guess the textarea is not good enough to achive your requirements. I suggest you go for a richtexteditor instead. It will even give you a WYSIWYG feature which allows entering html contents very easily (without knowing html) and is easier to use than bbcode parser.
  16. That is what I was doing exactly. But still it was printing standard error as well as my error. I had to set error_reporting level as jlhaslip suggested. Thanks!
  17. I am testing my website on my local machine. It is still in development stage and I am using php/mysql. If there is a mysql connection error, I am checking for the connection variable and displaying a proper error message. But even before it displays my error message, it displays an error message on browser thrown by mysql (MySQL Connection Failed: Access denied for user).Can I suppress this message and display only my message?
  18. Yes. But the easier way is to use a form. Ex: <FORM ACTION="evaluate.php"><INPUT TYPE=CHECKBOX NAME="sel_1">Answer_1<INPUT TYPE=CHECKBOX NAME="sel_2">Answer_2<INPUT TYPE=CHECKBOX NAME="sel_3">Answer_3<INPUT TYPE=CHECKBOX NAME="sel_4">Answer_4<INPUT TYPE=SUBMIT></FORM> This will give you multiple check boxes (4 in this case) with a submit button. When user selects the answer and clicks submit button, it will be submitted to the action script (evaluate.php in above example). You don't have to pass any values in url explicitly, but if the checkbox is selected, the variable will be automatically available in the action script.
  19. I think in your code second->next is unassigned and is hanging. When you try to use it, it crashes. So, before your memory->next = second; you need to add second->next = memory->next; making second->next point to next memory originally pointed by "memory".
  20. It depends on weather you are using a form or not. If you are using a form, in your javascript, you will submit the form. In this case make sure your radiobutton group or checkbox (whatever you use for selecting the choice) is part of the form. If you are not using form, you will have to redirect to the php script in your url with selected choice value as parameter. In your php script, you can obtain the value from $_REQUEST variable array. For example, if you have radio_1 as one radio button group, you can get the selected value by $sel1=$_REQUEST['radio_1'];
  21. I see people suggesting to install xp pro removing the home edition which came with the comp. Even i have a XP home edition which was preinstalled. I do not want to remove it because it is licensed copy. And if I remove it, I will stop getting support from the seller. This is the reason why I have still kept it though it annoys me.The sellers sometimes tie the comp to a domain, apply some group policies on your comp and then sell it to you. Since domain policies have higher precedence over local policies, local admin cannot change it. Only way is to add your comp to workgroup. This should give your controls back.To join workgroup, right click My Computer -> Properties -> Computer Name, select workgroup, type a dummy name and click ok.
  22. One drawback of this software is that it can't create all type of archives. I was using winrar for sometime and was very impressed. But it is paid software, and it expired. If only 7-Zip could create rar files.Also 7-zip UI is not that intuitive compared to winrar. But considering it is a freeware, it is a very good software.
  23. kvkv

    Hi new here

    Hi Wowie,Welcome! Hope you enjoy your stay here.
  24. You will have to use iis-proxy. That is, configure your iis in proxy mode for the urls you like. For example, if you want to access all files under "Docs" in the second server, in your first server you need to create proxy .
  25. You have provided both the tables the same. I am assuming this is your table structure ----------------------------- User-group ----------------------------- user-id, group-id ----------------------------- group-articles ----------------------------- group-id, article-id You can use sql to check the permissions select * from user-group, group-articleswhere user-group.group-id=group-articles.group-idanduser-id=<user id>andarticle-id=<article id> replace <> with actual values. If this query returns results, then the user has permission. Otherwise, he doesn't. Note that it requires only one query.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.