Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Encrypted data is always longer than the non-encrypted version. There's a maximum length for URL's (different for different browsers) and there are also limits that web servers will accept. You would generally need to use POST to pass a large amount of data from the browser to a web server.
  2. Again, in case the OP revisits the thread, the syntax that should work for this - is this - $xml->Header->Record->$curblk->{$row}[$multi] = $value;
  3. In case the OP revisits this thread, you haven't provided really enough information (and reading through the write.php code to figure out the structure of your xml document and what you form fields are is not going to go very far - in fact there were zero downloads of that file before I looked into it.) You need to post enough code and sample data for someone to be able to produce/reproduce what you are doing. However, in just looking through the write.php code, you should make the form field names or even better the form field array index be the full node path/name so that you don't need to use a bunch of code to convert what ever form field name you are currently using back to the actual node path/name. I suspect, but don't know, that the random junk you are getting is because you are mixing simplexml and DOMDocument statements. There are appendChild, replaceChild, and removeChild methods that you should be using.
  4. In another recent thread I used mysql_affected_rows() after a multi-value insert query, with the IGNORE keyword, and it does correctly indicate how many new rows were inserted. The number of duplicates would be the total count of data values being put into the query, less the number of affected rows.
  5. Also, blindly converting external variables into program variables is exactly what register_globals did and a lot of web sites were taken over because not only does that set the variables you are expecting but allows a hacker to set any of your other program variables to values he wants. You should just put the result back into the $_POST array and use the $_POST variables in your code or use some other name of your choice, such as $mypost - $_POST = array_map('mysql_real_escape_string',$_POST); // escape the $_POST array and put the results back into the $_POST array or $mypost = array_map('mysql_real_escape_string',$_POST); // escape the $_POST array and put the results back into an array name of your choice If you are passing a form array element in the $_POST array, you would need to write your own recursive function to use in the array_map() statement so that any sub/nested arrays are also escaped.
  6. In doing a little basic research on this (search for mysql dns lookup) - http://dev.mysql.com/doc/refman/5.0/en/dns.html you either need to disable DNS host name lookups on the old mysql server or you need to enter the mattress-sales.co.uk domain name instead of the IP address of new server (client) that you want the old mysql server to accept a connection from.
  7. The code you posted does not contain a mysql_query() function call and if you just forgot to show that in your post, you can find out why the query is failing by echoing mysql_error() on the next line after the line with your mysql_query() statement.
  8. I don't see anywhere in this thread where you have configured the old database server to accept a remote connection from the IP address of the new web server? That would be your first step. And you do realize that connecting to the old database server remotely over the Internet will be several times slower than when the database server and web server were on the same hardware, in the same rack, or even in the same data center.
  9. Yes, it's not a good idea because it would show insecure settings like register_globals, allow_url_fopen, and allow_url_include along with the php version and what language extensions are installed so that attacks could be used to try and exploit specific security holes that those settings open or bugs that are present in the specific version/language extensions.
  10. It's likely that your db_query() function was written poorly and it expects the main program variable $passwd to hold your database connection password. Posting the code for the db_query() function would be the quickest way of getting help. Edit to your edit (and Dan's post): Please, please don't ever use the global keyword, ever. It causes the kind of problem you were having and surprisingly WASTES TIME both in debugging problems and in writing code because suddenly you must remember what variables you are using inside of functions. Functions are supposed to make writing code EASIER and FASTER, not take more time trying to remember what you used where. After you write a function and test it, you should not need to remember what it is doing, just what parameters it takes, what function it performs, and what result it returns.
  11. $update = "UPDATE mona SET STKFF='{$_POST[$counter."NAME"]}' WHERE id='$userid'";
  12. Dual Layer means there are two layers on one side. This link explains - http://en.wikipedia.org/wiki/DVD%2BR_DL
  13. If you look directly in your database table, you will find that each test run of your script is inserting a new row. This is the reason why your The encrypted string: and The encrypted string from db: values don't match. When you are retrieving the value, you are getting the first row from your table and since that encrypted value was generated using a different $iv than the current $iv being used in your script, it decrypts to a nonsense string. You would need to insure that your email column value is unique and replace any existing name value on each test run and if you are doing this for a real application, you will need to store the random $iv that was generated in the row so that you can decrypt the value (or you will need to generate a fixed $iv value and use that everywhere.) You can directly insert the $encrypted_string value into a BLOB field and you would need to use mysqli_real_escape_string on it so that the special SQL characters that will eventually get generated in the value won't break the sql syntax and produce a sql error.
  14. The following is the syntax definition for an UPDATE query, with the commonly used parts in bold - Typical usage would be - UPDATE your_table SET your_column1 = 'some value', your_column2 = 'some value' WHERE your_where_condition_goes_here
  15. I can give you a hint. Because someone removed most of the white space from that HTML/Javascript, the parts of it that look like {$...} are being parsed by php as a php variable within a string. However, the leading {'s are actually part of some Javascript if(){}else{} statements and are not part of php's {$...} syntax. Format that HTML/Javscript with some white-space/new-lines so that the Javascript does not look like php syntax and the php parser errors will be fixed.
  16. Actually, the error message occurs in the line that starts echo " </select></td>\r\n ..., not in the $query = "SELECT * \r\n FROM `ad` "; line. You must have miss counted. Oh, and no one is really going to help you troubleshoot that mess the way it is written, there's no reason for any code to be written that way. Where did you get that code?
  17. That's an entirely different section of code, so of course the replies don't apply to it. The replies were specific to the query and the code you posted at the start of this thread. If you look at the line of code where the error is being reported at, you will see that your code has two $$ in front of the variable name. There should only be one $ on a variable.
  18. You have an extra comma in your query, at the point right before where the error message is calling your attention to something that was invalid due to that extra comma being there - the right syntax to use near 'FROM ...
  19. IF (a big if) the error indicated that the session_start() in your posted code was on line 2, I would agree that you don't have any new-line in your file before the <?php tag. However, the error message does not lie. I recommend that you open your file and back-space to the start of the file and the hit the delete key until the < character on the <?php tag is removed to make sure you don't have any characters before the <?php tag.
  20. The XML Parser - http://us2.php.net/manual/en/book.xml.php allows you to parse an XML document line by line. I do however recommend that you wrap the call-back functions in a OOP/Class so that you can share class variables as necessary between the call-back functions to 'remember' the present state/current tag name...
  21. Since the session_start() statement is on line two of what you can see, but the error message indicates it is on line three in the file, you likely have a blank-line/new-line character on line one of your file.
  22. [ot]@dan, the forum has a custom bbcode tag - [m][/m] that you can put around the name of php functions and it creates a link to the corresponding php.net/{functionname} page, i.e. [m]nl2br[/m] would give nl2br[/ot]
  23. Your code works for me in the latest FF browser. All I changed was the path to the tiny_mce to match where it is on my system (document root/htdocs folder) and changed the form's action="" URL to point to my test-form-processing code.
  24. $string = implode('<br />',$errors); echo $string;
  25. 'first day' means '1 day' and is adding one day to the current date.
×
×
  • 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.