Jump to content

xcislav

New Members
  • Posts

    7
  • Joined

  • Last visited

xcislav's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Because I can't imagine an array of program source. What type of "chunks" of this array could you imagine when it's just a source code...
  2. editor.php: <form action="somesense.php" ... j=new XMLHttpRequest(); j.open("POST","updatenine.php" ... j.open("GET","lb.php? IN RESULT: (editor.php contains) For example, all three files one by one have been being put into array by echoing it with strpos (from that large variable). When searching is under way and strpos comes with it's results ".php" it adds all letters/numbers (until some other leading character). For example for the first strpos finds: "lb.php? .php and adds lb, finishing with lb.php , cutting " and ? from the found line (from code). It cuts " and ? because those symbols aren't proper file names. ----- ----- First found Find pathnames matching a pattern - http://php.net/glob with it's array glob(string pattern [, int flags]) Seems to have some limits, imposed on the forms of representation. I would intend to search within large files. from php's man: "common shells" aren't the best choice for the large-scaled searches. What would you recommend?
  3. I didn't found any nice materials comparing the two ways of information unload to user. Neither have I a firm understanding of how high my learning curve should be in both cases, which of which to choose for better way. I'm a beginner asking for your professional word of advice. Help me to better formulate for search what I want, Please. I know keeping files and images in fs is better served by os/fs-drivers but i'm just learning and just trying to remember select * for "poking around". + i do hate images text analyzing it'll will be! Is it better to save files from MySQL fields via http headers, or it's even more better to perform the saving of the kept txt files (in one specific folder) and all the maintenance of tempfiles on server (archiving, indexing, cron/planning)? So: 1. Learning & get experience in file maintenance? vs 2. Finding out how to deal with protocols (download resuming) What I've found so far: header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length:'); There's a textfield full of appended edits of a specific user (for example list-ordering/or article appending). Headers should deliver it as a file, while skiping the file creation on a server. Or do I just learn how to do it with files and save just file link then accomplish the persistent file-links cleaning (because there would be lots of them)? One one side there is a certain straightforwardness in dealing with files, but then again I'd prefer the both ways while considering continuing to study MySQL-approach. I understand protocols/headers with PHP are no easy task that's why I'm hopefully leaving the last word for the professional.... Thanks in advance!
  4. <!DOCTYPE html> <html> <h1>Register</h1> <form method="POST"> <input type="text" name="user"><br /><br /> <input type="pass" name="pass"><br /><br /> <input type="submit"><br /> </form> <?php session_start(); if(isset($_POST['user'], $_POST['pass'])){ require 'connect.php'; $zr++; $query = d()->prepare("INSERT INTO u (user, pass, loc) VALUES (:user, :pass, :loc)"); $query->bindParam(':user', $_POST['user']); $query->bindParam(':pass', $_POST['pass']); $query->bindParam(':loc', $zr); if($query->execute()){ $_SESSION['user'] = $row['user']; $_SESSION['pass'] = $row['pass']; header("Location: ".$_SERVER['PHP_SELF']); } else{ echo 'ERROR'; } } ?> <h1>Login</h1> <form method="POST"> <input type="text" name="user"><br /><br /> <input type="pass" name="pass"><br /><br /> <input type="submit"><br /> </form> <?php echo $_POST['user']; if(isset($_POST['user'], $_POST['pass'])){ require 'connect.php'; $query = d()->prepare("SELECT user, pass FROM u WHERE user=:user AND pass=:pass"); $query->bindParam(':user', $_POST['user']); $query->bindParam(':pass', $_POST['pass']); $query->execute(); if($row = $query->fetch()){ $_SESSION['user'] = $row['user']; $_SESSION['pass'] = $row['pass']; header("Location: ".$_SERVER['PHP_SELF']); } } $us=$_SESSION['user']; echo 'user ',$us; ?> <?php if(isset($_SESSION['user'])){ $us=$_SESSION['user']; echo '<br /> user ',$us, ' ', '<a href="logout.php">Logout</a>'; echo '<br />', '<a href="zrs.php">zero session</a>'; } ?> </html>
  5. <input onkeyup="s?e=Date.now():s=Date.now()"onblur="c=this.value.length;this.value+=c/(e-s)"><script>s=0</script> <script>s=0</script> Once this executes - it's completely needless. But without s=0 there are no s, e variables. With = OK. How is it logically possible to reduce keeping it short?
  6. The idea is simple. A key you press (a letter) appears in updated page: keyj.php: <input id='k'></input> <script type="text/javascript"> document.getElementById('k').onkeypress=function() { <?php $db=new PDO('mysql:host=localhost;dbname=test;charset=utf8','$us','$ps'); $db->exec("UPDATE TXT SET texts=k.value"); $rl=$db->query("SELECT texts FROM TXT"); print_r($rl->fetchColumn()); ?> } </script> The intention is to have text on the screen via print_r. I successfully used it in another php to exchange information with MySQL and users screen (worked). Here - the more you type and the more k.value is the more text will be on screen (just from server). Unfortunately something went wrong.
×
×
  • Create New...

Important Information

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.