Need a ideea....
Results 1 to 6 of 6

Thread: Need a ideea....

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    3

    Need a ideea....

    Hi. I want to make a personal webpage, but here is the trick part:
    inside the page i want to put a frame, (something like a iframe) where i like to put something like a command line. For example: if i type "goto home.php" the browser will go to that page.
    If i type "retrieve fis.ext" --> start download of fis.ext
    and so on....
    My question is:
    -how do i make the browser to know what i type in? Or better, i need a program that runs on background and capture the text that i type there , interpret the text and make a decision ?


    Soryy if I don't explin myself very well.

  2. #2
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,403
    On what OS (windows, linux, *bsd?), what webserver (IIS, apache, Lotus Domino?) and what language (php, visualbasic, java?)
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    3
    OS Linux Slackware, server Apache, Database server MySql. Language PHP .

  4. #4
    Banned
    Join Date
    Aug 2004
    Posts
    534
    short of learning a programing language suited for this (perl, python, ruby, java, php) and writting it yourself you can only hope that you find a similar script in one of the archives..

  5. #5
    Flash M0nkey
    Join Date
    Sep 2001
    Posts
    3,447
    Code:
    <?php
    
    //get the information from POST
    $post_cmd = $_POST['cmd'];
    
    //if it exsists then do stuff
    if($post_cmd)
    	{
    	//break it apart at the space
    	$cmds = explode(" ", $post_cmd);
    	
    		//info is stored in an array called $cmds with cmds[0] being like 'goto'
    		//just add more elseif's for more commands and change what each command does if needed
    		//these are simply using a bit of JScript to redirect page but you could also use header();
    		if($cmds[0] == "goto") { ?>
    		<SCRIPT LANGUAGE="JavaScript">
    		<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
    		window.location="<?php echo $cmds[1]; ?>";
    		// -->
    		</script>
    		<?php }
    		
    		elseif($cmds[0] == "retreive") { ?>
    		<SCRIPT LANGUAGE="JavaScript">
    		<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
    		window.location="<?php echo $cmds[1]; ?>";
    		// -->
    		</script>
    		<?php }
    		
    		else { ?>
    		<SCRIPT LANGUAGE="JavaScript">
    		<!-- Script courtesy of http://www.web-source.net - Your Guide to Professional Web Site Design and Development
    		window.location="error.php";
    		// -->
    		</script>
    		<?php }
    	}
    
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Cmd Line Type Thingy - by v_Ln</title>
    
    <!-- Some CSS to make the boxes look right -->
    <style type="text/css">
    <!--
    textarea {
    	font-family: "Courier New", Courier, mono;
    	font-size: 12px;
    	color: #00FF00;
    	background-color: #000000;
    	border: thin inset #CCCCCC;
    }
    input {
    	font-family: "Courier New", Courier, mono;
    	font-size: 12px;
    	color: #00FF00;
    	background-color: #000000;
    	border: thin inset #CCCCCC;
    }
    -->
    </style>
    </head>
    
    <body bgcolor="#000000">
    
    <!-- The main form, fairly simple -->
    <form name="form1" id="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
      <p>
        <input name="cmd" type="text" id="cmd" value="Enter your commands" size="70">
    </p>
      <p>
        <input type="submit" name="Submit" value="Send Command" />
    </p>
    </form>
    
    
    
    
    </body>
    </html>
    basic idea - but it can be done using some server side scripting to accept/process commands
    btw not tested to work, just typed it out of top of head - but should be fine. However it does no form validation etc so watch what you do with it

    v_Ln

  6. #6
    Junior Member
    Join Date
    Oct 2005
    Posts
    3

    Cool

    thx --valhallen --- .I will get to work these days.
    I was thinching something like a interpretator that runs in backgroung and gets the keys presed, then make a decision. However, thx once again. If i have more question i wiil post it here . For now I will try to make the best of it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •