Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. You can begin investigating the problem by starting with very first possible reason popped up into DW's window, then if the server is up and the service is running continue with the second one. As for your lacking of English knowledge, I'm afraid there are not too many options available for you - use either a dictionary (as a starting point) or find someone who speaks your language (as well as English too) to help you with the translation.
  2. Apache as mac_gyver already mentioned is not designed for this and administrating accounts on it can be a challenge. However, apache have a list of lot of projects these days you can check in their website. Anyway.....good luck
  3. I've created literally hundreds apps using PDO / MySQL / FireBird and never thought at this point that by default PDO does not use pure prepared statements rather than emulated prepared queries +1 Jacques, learn something new everyday.
  4. Get the textarea's value depending on what the method attribute for your form is set to as @cyber already mentioned and store it in your database. then fetch all proxy strings from this database into an array, as for to randomise them you could use the mysql rand() function and finally set them to CURLOPT_PROXY method, function or whatever is that. http://php.net/manual/en/faq.html.php
  5. I doubt the code you've posted to be working. There are too many occurrences could go wrong here. My advice to do this is using some php mail library, either swiftmailer or phpmailer. An example in swiftmailer using the yahoo mail server: <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/swiftmailer-master/lib/swift_required.php'; date_default_timezone_set('America/Toronto'); // Create the Transport $transport = Swift_SmtpTransport::newInstance('smtp.mail.yahoo.com',465,'ssl') ->setUsername('your_account_name@yahoo.com') ->setPassword('password') ; // Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); // Create a message $message = Swift_Message::newInstance('Some subject..') ->setFrom(array('your_account_name@yahoo.com' => 'Acknowledged74')) ->setTo(array('Acknowledged74@gmail.com' => 'Acknowledged74')) ->setBody('Body content ....') ; // Send the message $result = $mailer->send($message); A quick reference about it, click!
  6. What is the ip address of the centos server? If the server is reachable from outside you need to PREROUTING its ip to the new destination. Something like: -A PREROUTING -d 10.10.1.0/24 -p tcp -m tcp --dport 90 -j DNAT --to-destination 192.168.2.11:389 This means that every machines belong to this network (10.10.1.0/24 or ip range of 10.10.1.1-255) with a request on port 90 will be redirected to 192.168.2.11 listen on port 389 I still need to see the output of netstat!
  7. Yes, there is and it's called performance. Few years ago I made a simple benchmark parsing a large html content by php made 100 000 requests or so similar and the result of this was surprised me very much. In the first snip, the php parser should parsed all content between <?php ...?> tags spitting the data to apache, as for the second one - no. PHP developers strongly recommend to do not parsing any html/javascript or "client-side" content by php. You want to call javascript in the server side - that's not good - use AJAX as Jacques already mentioned. This is my point.
  8. @ginerjm, I've got a question to you. What is the difference in these two snips? <?php $html = <<<EOT <!DOCTYPE html> <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div>TODO write content</div> </body> </html> EOT; And simple HTML: <!DOCTYPE html> <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div>TODO write content</div> </body> </html>
  9. RaynFox, I've never seen you before and I am guessing that you are new to phpfreaks.com, GNU/Linux and to programming in general, if so I welcomed you to phpfreaks.com! You may feel a little embarrassed and you probably might have a messy with files/directories permissions on the server trying to get this working. What actually happens here? As CroNiX stated above, the web-user called apache, www-data, or somebody else needs to have some permisions to be able to read, write or execute files, commands, scripts, etc...to this particular directory and as already mentioned, php usually gets executed by this account in most cases.That's true, but it's also true that php could be executed by any account belongs to the system, for example - mysql, your-account, root, ftp, samba and so on and so forth, even from nobody Linux/UNIX like operating system offers many command line tools, so let me do this in my way I hope it will help you to get better understanding on it. In my testing I'm going to use CentOS 6.5 as a domain machine combined with "LXC" as a tesing container and dummy as a tesing user account. First when you open a window terminal and typing a "pwd" command, we'll see something like that: [dummy@centos-box ~]$ pwd /home/dummy The next step is to create a directory named http, like in your example: [dummy@centos-box ~]$ mkdir -p -v http mkdir: created directory `http' When a user creates a file or directory under Linux / Unux system, he usually creates it with a default set of permissions, what permissions are being set depends on how the default umask is being set under the entire system or just as I did to this particular account. I'm not going to go into all detail but the umask to this dummy account is being set by me to 0022, this is exactly the same as for the default root account and the entire result into this home/dummy directory is - 755. In most cases the default umask being set for all regular users is to 002 by the system, which means - 775. [dummy@centos-box ~]$ ls -ld http/ drwxr-xr-x. 2 dummy dummy 4096 Aug 19 23:03 http/ Next is to create a simple php file to http directory trying to parse it by php into a terminal. [dummy@centos-box ~]$ echo '<?php echo "Hello, World"; ?>' > ~/http/test.php [dummy@centos-box ~]$ php -f ~/http/test.php Hello, World As you can see from the log, php is called by dummy account and the file has been executed correctly by php. So, now we need to test how web-account in our case apache will work here. Everything we have to do is to login as apache using our shell terminal. To see whether apache is added to the system you could use the next command: [dummy@centos-box ~]$ cat /etc/passwd | grep apache apache:x:48:48:Apache:/var/www:/sbin/nologin I'm not gonna be stoping again explainig of what this output means, but the important things we need know at this moment are the username and home directory - apache:/var/www. Because there is no shell provided for this account (/sbin/nologin) you need to force it using the system shells as /bin/bash, /bin/sh or whatever shell is provided (installed) by the system. [dummy@centos-box ~]$ su -c "su -l apache -s /bin/bash" password: // root password required The prompt will be changed to something similar like the following: -bash-4.1$ pwd /var/www -bash-4.1$ whoami apache Then, apache could go into "/home/dummy/http/" directory trying to execute, read or write some files or commands therein: -bash-4.1$ php -f /home/dummy/http/test.php Hello, World -bash-4.1$ echo 'Test Text Content' > /home/dummy/http/foo.txt -bash: /home/dummy/http/foo.txt: Permission denied Why that happens (permission denied) in the second row is part of your home work assessment I really hope this help you.
  10. well, unfortunately it's true
  11. Can I see the outputs of: netstat -t | grep :ldap or netstat -t | grep :389 and nmap -Pn dc1.devlab.local // if you've got an namp installed on the centos-box How about to run telnet from other domain?
  12. No, it is The header and footer files are part of this CMS and they contain a lot of logic. If you create files for instance, _header.php and _footer.php in the same directory when header.php and footer.php are, you will be able to include them to az.php ( I tried ) Try!
  13. Do you get these backslashes if you try to decode the object at server side level, something like: <?php $json = json_encode( array( 'http://calendar.com/content/' => array( 'English' => array( 'One', 'January' ), 'French' => array( 'Une', 'Janvier' ) ) ) ); var_dump(json_decode($json,true));
  14. I'm at work now...but this is a content management system that I'm not familiar with...but I could try later to include the header and footer to this.
  15. Check the permissions on the files in this particular directory. Now should work - http://www.pokerhaze.com/blog/az.php The files (header and footer) should be executable also to be able to execute the content. What do you want to accomplish, a new template?
  16. Try to use PDO only - next works for me. I'm not sure whether it's possible to use two different database libraries on the same document event the drivers are connecting to the same db server....turn php errors on checkout for actual errors. <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); $user = 'SYSDBA'; $pass = 'masterdba'; $dbh = new PDO("firebird:dbname=127.0.0.1:/var/firebirddata/new.fdb;charset=utf8", $user, $pass); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $username = 'lxc'; $password = 'password'; $dbh1 = new PDO('mysql:dbname=test;host=::1;charset=utf8', $username, $password); $dbh1->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); Don't use mysql library for new development.
  17. Do you see this structure somewhere on the server - http://pokerhaze.com:8080/index.jsp (webapps/ROOT/) I am not familiar with Tomcat, but I'd try to help you.
  18. Can I see the directories/files structure from this project? Do you see .htaccess files somewhere? PS: You can PM'ed me giving me an ftp access to this server.
  19. Interesting. For which browser you are talking about? What I know that the browser parses the content from top-to-bottom-left-to-right.
  20. Agreed, but the output is very strange:
  21. Get rid of the last comma from sprintf function, I think that's your problem - mysqli_real_escape_string($con, $_POST['target']),
  22. @Jacques1, did you sleep well last night? Of course, we do care about the performance and everyone should care very well about the good coding techniques and programming practices. So, 42.2436% difference is it nothing for you?...and you call this "dubious micro-optimizations"? I wrote this little benchmark and I did run it on two different machines. You do realize that my example is not applied to OP's script at all, even more in my testing I used the PDO instead MySQLi library. Also there is a convention variable names often using in programming like - @stmt, @dbh, @sql, @row, @data, @query and so on and so forth... but wait, how about your example - $result = mysqli_fetch_all($result, MYSQLI_ASSOC); B/s of size of allocated memory. PhP allocates more memory using litteral indexes, so in some cases is good in some not depends on the hardware. Anyways.., I just followed in ginerjm's example. To OP, "@ how would I use $row = $stmt->fetchAll(); given my script?" You can't use the pdo::fetchAll method in your script you need to use mysqli_result::fetch_all one!
  23. B/s for the beginners is much more descriptive and easier to understand what's going on behind the scene, but what about performance and memory consumption. Here's my test with 500 000 records using a pdo driver and firebird for a testing database server. 1. while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $data[] = array($row[0],$row[1],$row[2]); } MemoryUsage: 414479kb CountRows: 500000 ExecutionTime: 3.088 seconds 2. $row = $stmt->fetchAll(PDO::FETCH_NUM); MemoryUsage: 414490kb CountRows: 500000 ExecutionTime: 2.011 seconds It's true that the memory usage is a little bit more but the execution time is much, much better using the internal pdo fetchAll method.
  24. Why don't you crack the admin password in case this machine is owned by you?
  25. Really? In addition what fastsol said, check the status out of this if statement - if (isset($_POST['submit'])) ...... I don't see where is the name attribute called "submit" in your html form.
×
×
  • 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.