Jump to content
xisto Community

apacheNewbie

Members
  • Content Count

    30
  • Joined

  • Last visited

Posts posted by apacheNewbie


  1. I would use file name as check box identifier. So first, we will add checkbox in your code

    <?php$path = "./";$dir_handle = @opendir($path) or die("Unable to open folder");while (false !== ($file = readdir($dir_handle))) {if($file == "index.php")continue;if($file == ".")continue;if($file == "..")continue;echo "<input type=CHECKBOX name=$file>";echo "<img src='$file' alt='$file'><br />";}closedir($dir_handle);?>

    That is, now you have images with check box beside them. In order to delete the chosen images, you need to capture which checkbox is selected.
    This is the example of how to know which check box is checked (assuming, you are using POST method to submit the form using delete button):

    <?php$path = "./";$dir_handle = @opendir($path) or die("Unable to open folder");//We list the name of the files again, since the name of the checkbox is the same with the name of the filewhile (false !== ($file = readdir($dir_handle))) {if($file == "index.php")continue;if($file == ".")continue;if($file == "..")continue;if(isset($_POST[$file])){   $checkbox = $_POST[$file];   if($checkbox == on) { //checkbox is selected	  //Delete the file	  if(!unlink($file)) die("Failed to delete file");   }}?>

    Hopefully it helps :P

  2. You all must have been struck by the blue screen of death...specially the windows users....these may arise due to hardware as well as software problems....so...what could be the possible reasons of PC crashing...


    Not enough memory
    Overheating
    Incompatible Driver

    and .... Windows

    Yes, windows can crash anytime without any reason :P

  3. How to run a java file from another java file?

     

    Java Helpdesk

    Hi! I want to run a java file from another java file. I heard exec() method from Rumtime class. I wrote two files(Caller and Hello) for testing. Following codes:

     

    Caller.Java

    Import java.Io.*;

    Public class Caller{

    Public static void main(String args[]) throws Exception{

    Runtime rt = Runtime.GetRuntime();

    Process prcs = rt.Exec("java Hello");

     

    Hello.Java

    Import java.Lang.System;

    Public class Hello{

    Public static void main(String args[]){

    System.Out.Println("Hello World.");

    }

    }

     

    Although I compile and run successfully but I didn't get result I neeed (printing Hello World). Please help me! Thanks so much!

     

    -question by thungphan


    The Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it.

    So if you want to get the output ("Hello World"), you need to use Process.getInputStream() method.

     

    The method will return an InputStream, which you can use to generate output in your monitor.

     

    This is the example of how to print the InputStream:

    InputStream is = process.getInputStream();BufferedReader is = new BufferedReader(new InputStreamReader(is));	String line;	while ((line = is.readLine()) != null)	  System.out.println(line);


  4. At last, a free SDK for mobile phone.The programming language is java, so it is object oriented and run on a virtual machine.It has nice integration with Eclipse IDE.I hope android can compete with other mobile SDK like symbian, and windows mobile.Anybody download the SDK and trying to make an mobile application with it?What do you think about android?


  5. Home server ? i guess we can install the IIS server in our home PC and make the computer a server then we have the INETPUB directory in it in which we can upload what we want .
    In that moreover we have the WWW root folder.


    I think home server is more than just a web server.
    It can be use for file sharing, email monitoring, or web proxy.

    It is very nice to use in dormitory :P

  6. If you don't want to use id, you need to know the sequence number of the form in the display.First, you need to access the form object.With id, you can access the form object by using: document.getElementById('$rs['id'])otherwise, you can access it using: document.forms[<form number>]

    
    
    Because I don't know the sequence number of your form, I will use form id instead. I will use id 'form1' for simplicity.
    <script type="text/javascript">function news_modify(type){	if(type=='edit'){		document.getElementById('form1').do.value='edit'	}	else if(type=='delete'){		document.getElementById('form1').do.value='delete2'	}		document.getElementById('form1').submit();}<form method='post' action='manage.php?manage=news&id='form1'><input type='hidden' name='do' value='' /><button type='submit' onclick="news_modify('edit');">Edit</button> <button type='submit' onclick="news_modify('delete');">Delete</button></form></script>

    Hope it helps


  7. Hmm well trap176 is brilliant and its what I use. Until I need or can afford payed hosting but that'll be a while yet. I also fnd because you are required to post on the forums any problems you have a quickly sorted out!

    My first of impression of Byet Host is good. It offers big storage and bandwidth capacity.
    Its cPanel is nice.

    Byet Host does not install complete add on for PHP though. That's mean many classes in certain framework (e.g. Zend Framework) will not work.
    That's why I move to Xisto :P

    However, I do not know about its speed. I only use it to test my PHP application.

  8. Anyone knows when can I get a book or some tutorial money about making own Content Management System. I appreciate if someone will know the tutorial how I can make Library CMS (Content Management System).
    Thanks!


    If you are good at reading source code, try to download Drupal Content Management System, and read their code
    Drupal is module based, so you can read only the module that interests you.

    In my opinion, it is better if you develop your CMS library from existing one, instead of creating from scratch. It is too time consuming. :P

  9. i do wired.. i can connect to live fine, its just hard to connect to other players..
    It just recently got stricter then it was before, it is frustrating.


    If you can connect to live, then it is possible that your friends who have problem in their connection.
    May be they forget to open port and do the portforwarding

  10. while (str != null) {
    System.Out.Println(str);
    str = inputFile.ReadLine();
    }

    // str == null


    After this while loop, your str is null

    Therefore the next line " for(int I = 0; I <str.Length(); I++)" throws exception.

    May be you need to add another variable as buffer before adding the line to str variable.

    example
    String buffer;		str = "";		buffer = inputFile.readLine();		while (buffer != null)		{			str += buffer;				buffer = inputFile.readLine();		}		System.out.println(str);


  11. does anyone know of any good websites with free java tutorials for people without a lot of prior coding experience?i've read some tutorials, but every one i read starts making references to C and C++... well i don't know either of those so it gets really really confusing really really fast.
    ive downloaded the sdk but that is it....
    i know a pretty good amount of php and a tiny bit of perl but those are procedural languages so i dont know if they even helpe me at all with an OOP language like java.


    I find that this book "Essentials of the Java Programming Language" is good for learning java.

    You can read it online or download the book from this site:
    http://www.oracle.com/technetwork/java/index.html

    Have fun!

  12. In my opinions, game companies are using another way to gather ideas.They, of course, have their own team that taking care about this idea matter, but when they need ideas from outside, they will put something like contest. Gather all ideas from the contestant and the best one will get the prize.


  13. less likely yes, but not impossible. There is a way to get php to execute within an image as some signatures you see do, the ones which display your IP, OS etc... the only way i know of doing this is to write the php code yourself and specify an image document type but im sure there is an exploit somewhere which will allow such images to be uploaded.

    how could you embed php script in image document type? :)

     

    Anyway, There is no problem by using image hosting service like image shack.

    The problems come only when you make a web site which allow the visitors to upload their data to the server.

     

    So this means you need to be careful when you make a image hosting service like image shack, but you don't need to worry when you use it. There is no security problem there.


  14. Actually, what is the "copyright" means? Is it only about the use and distribution of the operating system, or it includes the design and architecture of the operating system itself.If apple cannot sue microsoft over this thing, that means everyone can make the similar operating system without being sued. Or there is some point that I have missed?


  15. Could you explain more about realbasic? for example, what is the main advantage of realBasic compared to another programming language (it is new programming language, right?)It is really my first time to hear this name.


  16. You can try this one:

    var beginText = textarea.value.substr(0, textarea.selectionStart);var endText = textarea.value.substr(textarea.selectionEnd);var cursorPos = textarea.selectionStart;textarea.value = beginText + beginCode + endCode + endText;//Change beginCode and endCode with the symbol that you want//Example beginText + [X] + [/X] + endText//to put the cursor in the middleif (textarea.setSelectionRange){	textarea.setSelectionRange(cursorPos + beginCode.length, cursorPos + beginCode.length);	textarea.focus();}

    Does not work on all browser. But I think it works on mozilla and IE

  17. You can seach it by using your favourite search engine.It is also good if you buy/borrow some books as I find it more understandable.I recommend reading "Learning C++ in 21 days". In a month or so, you will understand the concept behind C++.


  18. I do not think that software developer will die only because of piracy.First, the software that a software developer made is not necessarily general product like microsoft windows or adobe photoshop. They can make specialized software for a company and there, they will get money.Second, for general product, It is true that we find the piracy product all over internet. Those who is only depend on their product would die soon. But I find that software developer usually makes advantage by offering customer service. The pirate software would not get this one.Third, Big company usually does not want to involve in piracy problem. So if your software is good enough that they want to use it, they will pay for it.Fourth, Open software company has shown you how to survive without getting money from your software. As your software developer you can get money from training, service, seminar, advertising, etc.

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