Jump to content

fr@nkie

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fr@nkie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. I'm new in php encriptation and I want to know what's wrong with my code. How can I decrypt some data that I encrypt in another file? <?php        $key = "MyKey";    $data = "Secret message";    //encrypt    $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, ' ', MCRYPT_MODE_CFB, ' ');    $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), 222);    mcrypt_generic_init($td, $key, $iv);    $encrypt_data = mcrypt_generic($td, $data);    mcrypt_generic_deinit($td);    mcrypt_module_close($td);        //decrypt       $td1 = mcrypt_module_open(MCRYPT_RIJNDAEL_256, ' ', MCRYPT_MODE_CFB, ' ');    $iv1 = mcrypt_create_iv (mcrypt_enc_get_iv_size($td1), 222);    $key = substr($key, 0, mcrypt_enc_get_key_size($td1));    mcrypt_generic_init($td1, $key, $iv1);    $decrypt_data = mdecrypt_generic($td1, $encrypt_data);    mcrypt_generic_deinit($td1);    mcrypt_module_close($td1);        //print    echo "<p>Data encrypt: " . $encrypt_data . ".</p>\n";    echo "<p>Data decrypt: " . $$decrypt_data . ".</p>\n"; ?>
  2. Hi. I have a link to a file and when I click then it opens, how can I directly download the file instead I open it? Here's my command: echo "The XML file was been created!.  <a href=\"resultado.xml\">See the file.</a>"; Thanks a lot ;)
  3. Hi. I have a database MySQL in a server, and I am building a application where I can copy a part of the database from the server to my pc (for example, all clients with the name "peter"), and after this I want to add that especific information to my local database in MySQL. What the better way to do this? Save the information in a file and open it with the program? And what kind of file? Thanks a lot :)
  4. Hi. I asked before, but I still don't understand what is wrong with SQL command. I now that is not a permission issue. I try the suggestion " Add 'ENGINE = InnoDB' " and it doesn't work to :( This is the SQL command that doesn't work: CREATE TABLE Associacoes( id_patrimonio1 INTEGER, id_patrimonio2 INTEGER, observacoes VARCHAR(255), CONSTRAINT chave_primaria_associacao PRIMARY KEY (id_patrimonio1,id_patrimonio2), CONSTRAINT chave_estrangeira_id_patrimonio1 FOREIGN KEY (id_patrimonio1) REFERENCES Patrimonio (id_patrimonio) ON UPDATE CASCADE ON DELETE SET NULL, CONSTRAINT chave_estrangeira_id_patrimonio2 FOREIGN KEY (id_patrimonio2) REFERENCES Patrimonio (id_patrimonio) ON UPDATE CASCADE ON DELETE SET NULL ); It works if I take the FOREIGN KEY's CONSTRAINT's out. Like this: CREATE TABLE Associacoes( id_patrimonio1 INTEGER, id_patrimonio2 INTEGER, observacoes VARCHAR(255), CONSTRAINT chave_primaria_associacao PRIMARY KEY (id_patrimonio1,id_patrimonio2) ); Please help me! Thank you! :)
  5. Hi. I would like to now what's wrong with my SQL command. I don't understand. The error is -> "Can't create table'.\lousada\associacoes.frm' (errno: 150)  ErrorNr.1005" Thank so much :) CREATE TABLE Associacoes( id_patrimonio1 INTEGER, id_patrimonio2 INTEGER, observacoes VARCHAR(255), CONSTRAINT chave_primaria_associacao PRIMARY KEY (id_patrimonio1,id_patrimonio2), CONSTRAINT chave_estrangeira_id_patrimonio1 FOREIGN KEY (id_patrimonio1) REFERENCES Patrimonio (id_patrimonio) ON UPDATE CASCADE ON DELETE SET NULL, CONSTRAINT chave_estrangeira_id_patrimonio2 FOREIGN KEY (id_patrimonio2) REFERENCES Patrimonio (id_patrimonio) ON UPDATE CASCADE ON DELETE SET NULL );
×
×
  • 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.