Jump to content
xisto Community

kvkv

Members
  • Content Count

    44
  • Joined

  • Last visited

  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.
×
×
  • 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.