Jump to content

regdude

Members
  • Posts

    60
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

regdude's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi! I have created a script (more like a system) that uses expect. The idea is actually simple: you press a button, PHP opens an expect stream to a telnet, expect_expectl waits for specific output, PHP reads output, based on output PHP sends more data. (Im refering to this PHP module - http://php.net/manual/en/book.expect.php ) I have ran into multiple problems, one of them is that the expect extention seems to be really unstable, it crashes apache and can't really figure out why. Another problem is that sometimes it likes to simply skip an output for no reason and gets stuck in a while loop. Obviously this is happening randomly and I can't find the cause of it (its not the client's fault, the client processes command as it should). Even worse, I can't seem to compile the exepect module on any x64 machine, it seems that the code is not meant to be for 64-bit machine. I have tried a lot of things and basically I'm tired of this module (even gentoo seems to have removed it since PHP 5.3) and I don't think there is anything that can make the expect module work properly on current PHP versions. So my question is: can anyone give an alternative way to deal with these shell interactions? I'm looking at Python's "pexpect", I don't like that its bit tricky to read output from a Python script inside PHP and I don't like that I must use popen. Also found that TCL also has "exepect" which is very similar to Python's "pexepect" and also Perl has it too, haven't really dealt with either of those languages, but it is not anything "out of this world". The best way I can think of is using cgi-bin scripts, I send a request with parameters (IP, command etc.) to a Python/TCL/Perl script which then gives an output. And I can do this in 2 ways, either open a stream and fetch the output (like with popen, still don't like it) or with ajax (since the current page is based on ajax, not a big problem). Whats wrong with SSH? Its slow because of the encryption, telnet is able to proccess commands a lot faster (and on slower devices SSH creates a notable lag). Anyone has any advice?
  2. Hi! I used this script: http://javascript-array.com/scripts/simple_drop_down_menu/ to make a menu in a PHPBB2 forum. From the IE view it is all fine, but from FF/Chrome it goes wrong! As here: http://img580.imageshack.us/img580/3213/menub.jpg So the first is that the menubar background for some reasons goes 2 times bigger and messes up the background, the second thing is that the hover background of a button doesn't seem to cover up all text. Here is the style: <style type="text/css"> #topmenu { z-index: 30 } #topmenu li { list-style: none; font-size: 11px; font-weight: bold; color: #EEEEEE; float:left } #topmenu li a { display: block; font-size: 11px; font-weight: bold; padding: 4px 8px 6px 8px; width: 60px; background-image: url(images/cellpic2.gif); background-repeat: repeat-x; color: #EEEEEE; text-decoration: none } #topmenu li a:hover { background: #FE9801 } #topmenu div { position: absolute; visibility: hidden; margin: 0; padding: 0; background-image: url(images/cellpic2.gif); background-repeat: repeat-x; border: 1px solid #4F4F4F } #topmenu div a { position: relative; display: block; margin: 0; padding: 5px 10px; width: auto; white-space: nowrap; text-align: left; text-decoration: none; background: #4F4F4F; color: #FFFFFF; font-size: 11px } #topmenu div a:hover { background: #FE9801; color: #FFFFFF } </style>
  3. Is there a ready-to-use script like this?
  4. Hi! Is it easy to make a paypal script that would simply give a result like true/false (did buy, didn't buy)? For example, I have a SMS script that simply checks the SMS Code with the database and gives the answer if it is a good code, like this: $answer = @file_get_contents("http://...", FALSE, NULL, 0, 140); This code goes after I typed in the code and pressed Send in webpage. Before it does something I check if the user hasn't got the product etc. Can anyone show me a really simple example on how I can make Paypal script work similar to my SMS script?
  5. Yes. But as I said I have changed the servers. What I think here is simply the old data being exported wrong. How should be the data exported?
  6. Through the forum. Every old entry in the database shows up like "????", but a new entry (a post in the forum) shows up fine like "āāāā". Through phpmyadmin it shows up also fine.
  7. I forgot to tell you and don't know why this forum doesn't have an edit button. Ok, the thing is that everything from the DB is messed up, but a new entry in the DB shows up fine! Is this problem still related with setting UTF8 before connecting?
  8. Well I tried to set some things that are related to UTF8, but didn't seem to work, but I do recall one time when I had such a problem (also a migrating problem) and "SET names UTF8" did solve the problem, now it didn't but I think it's just the wrong place. I'm using a phpbb2 forum. Is it possible to avoid this code set so that it will allways use UTF8? I really don't want to change every single page.
  9. Hi! I'm using now mysql server 5.1.37-2 and I was using mysql server 5.0.70! So when I moved from one server to another I had problems with encoding because I get "????�" instead of "ĀĀĀĀŠ" (from UTF8). All database data seems to be in UTF8 and in phpmyadmin everything even shows up right!! But not in the web page (I did also change PHP and web server). I have tried many ways to get this working but none of them seem to be working. I have tried simply copying the DB files, I have tried mysqldump, I have tried phpmyadmin export, I have tried converting all this to latin1 then utf8, but nothing helps. Everything worked fine with my forum, it displayed all characters right, but now it only shows up right characters when I start a new forum entry, the old ones are messed up.
  10. Hi! I have a file in /var/www/localhost/stuff.php Then I use a command: "php /var/www/localhost/stuff.php?id=5" It fails because of special char "?", so if I use "php /var/www/localhost/stuff.php" - it works! With how I must replace "?" to make it work?
  11. Well, I would like to doubt that. A while go I made the whole script in a total mess, but a week ago I did a major recode. What I did was simply change from checking name to checking ID and some other things, like shortening the code (less instructions), I managed to get the query time from 1.2s to 0.2s! After you gave me the bit-type to test, I found in google an article "why I shouldn't use BIT", so I better will not. So what should be better? Can I specify and action for an out-of-range value on a single column? Or that is only possible with every column? What is the default action?
  12. The table is quite large, it has about 50 colums and over 1000 rows (will be larger), so every milisecond counts.
  13. Hi, I have been googling for this question for a while now and I found few answers for few situations. Now my IP is stored as INT, not char, and seems to be bit faster and I encountered with a new atribute - UNSIGNED. So the unsigned atribute can't store negative numbers, but what happens if an UPDATE or INSERT gives a negative number? What should be the best type and size for a number with 10 digits (positive), the best for numbers 1 or 0 and the best for a text with about 50 chars?
×
×
  • 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.