Jump to content


Photo

Need an Idea


  • Please log in to reply
2 replies to this topic

#1 barsa

barsa

    Newbie

  • Members
  • Pip
  • 54 posts

Posted 08 November 2005 - 05:48 PM

Hi. I am not a newbie but 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 asking 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 ?


Thank you.
Technology Department

#2 mathgirl1010

mathgirl1010

    On the road again...

  • Members
  • PipPipPip
  • 189 posts

Posted 08 November 2005 - 06:40 PM

Need idea ?? - but it can be done using some SSI or SSS to accept/process commands, I can give you only HINT, However it does no form validation etc so watch what you do with it.

you can validate yourself from w3. Here is a basic code for your idea ( Resevered for mathgirl) Dont for get to put

//begin instances from mathgirl coding

++++++++++++++++++++++++++++++++++++++++++++++

//this code is reserved on mathgirl , here it begins, DO NOT EDIT THIS LINE

<?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>


// The end , this is only face you can change it by youself or you 'l see my name all over and over :-)

// code end

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


#3 lucifer

lucifer

    born to raise hell

  • Members
  • PipPipPip
  • 231 posts

Posted 24 November 2005 - 12:38 AM

QUOTE
( Resevered for mathgirl) Dont for get to put

//begin instances from mathgirl coding

++++++++++++++++++++++++++++++++++++++++++++++

//this code is reserved on mathgirl , here it begins, DO NOT EDIT THIS LINE


HA HA HA HA HA!! is this suppose to be a joke? it cracked me for real. BTW Is your code suppose to freeze the machine up??tongue.gif k garne afu lai ta php bhanekho pani tahah nai chaina. jamana ma nukes portal hardcode ta garekho ho. khai testai hokhi? mathgirl ta kasto intelligent raicha.tongue.gif:P

Edited by lucifer, 24 November 2005 - 12:40 AM.

A full blooded Gorkhe ain't gonna care bout no spelling & grammers




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users